GNU Octave
10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
Loading...
Searching...
No Matches
oct-procbuf.h
Go to the documentation of this file.
1
////////////////////////////////////////////////////////////////////////
2
//
3
// Copyright (C) 1996-2025 The Octave Project Developers
4
//
5
// See the file COPYRIGHT.md in the top-level directory of this
6
// distribution or <https://octave.org/copyright/>.
7
//
8
// This file is part of Octave.
9
//
10
// Octave is free software: you can redistribute it and/or modify it
11
// under the terms of the GNU General Public License as published by
12
// the Free Software Foundation, either version 3 of the License, or
13
// (at your option) any later version.
14
//
15
// Octave is distributed in the hope that it will be useful, but
16
// WITHOUT ANY WARRANTY; without even the implied warranty of
17
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
// GNU General Public License for more details.
19
//
20
// You should have received a copy of the GNU General Public License
21
// along with Octave; see the file COPYING. If not, see
22
// <https://www.gnu.org/licenses/>.
23
//
24
////////////////////////////////////////////////////////////////////////
25
26
// This class is based on the procbuf class from libg++, written by
27
// Per Bothner, Copyright (C) 1993 Free Software Foundation.
28
29
#if ! defined (octave_oct_procbuf_h)
30
#define octave_oct_procbuf_h 1
31
32
#include "octave-config.h"
33
34
#include <sys/types.h>
35
36
#include "
c-file-ptr-stream.h
"
37
38
OCTAVE_BEGIN_NAMESPACE
(octave)
39
40
class
procbuf
: public
c_file_ptr_buf
41
{
42
public
:
43
44
procbuf
()
45
:
c_file_ptr_buf
(nullptr), m_wstatus (-1), m_open_p (false),
46
m_proc_pid (-1), m_next (nullptr)
47
{ }
48
49
procbuf
(
const
char
*command,
int
mode)
50
:
c_file_ptr_buf
(nullptr), m_wstatus (-1), m_open_p (false),
51
m_proc_pid (-1), m_next (nullptr)
52
{ open (command, mode); }
53
54
OCTAVE_DISABLE_COPY_MOVE (
procbuf
)
55
56
~procbuf
() { close (); }
57
58
procbuf
* open (
const
char
*command,
int
mode);
59
60
procbuf
* close ();
61
62
int
wait_status
()
const
{
return
m_wstatus; }
63
64
bool
is_open
()
const
{
return
m_open_p; }
65
66
pid_t
pid
()
const
{
return
m_proc_pid; }
67
68
protected
:
69
70
int
m_wstatus
;
71
72
bool
m_open_p
;
73
74
pid_t
m_proc_pid
;
75
76
procbuf
*
m_next
;
77
};
78
79
OCTAVE_END_NAMESPACE(octave)
80
81
#endif
c-file-ptr-stream.h
c_file_ptr_buf
Definition
c-file-ptr-stream.h:41
procbuf
Definition
oct-procbuf.h:41
procbuf::~procbuf
~procbuf()
Definition
oct-procbuf.h:56
procbuf::m_proc_pid
pid_t m_proc_pid
Definition
oct-procbuf.h:74
procbuf::pid
pid_t pid() const
Definition
oct-procbuf.h:66
procbuf::procbuf
procbuf()
Definition
oct-procbuf.h:44
procbuf::is_open
bool is_open() const
Definition
oct-procbuf.h:64
procbuf::m_wstatus
int m_wstatus
Definition
oct-procbuf.h:70
procbuf::m_next
procbuf * m_next
Definition
oct-procbuf.h:76
procbuf::procbuf
procbuf(const char *command, int mode)
Definition
oct-procbuf.h:49
procbuf::m_open_p
bool m_open_p
Definition
oct-procbuf.h:72
procbuf::wait_status
int wait_status() const
Definition
oct-procbuf.h:62
OCTAVE_BEGIN_NAMESPACE
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
libinterp
corefcn
oct-procbuf.h
Generated on Sat Aug 2 2025 06:52:10 for GNU Octave by
1.9.8