Mercurial > hg > octave-nkf
annotate libinterp/corefcn/oct-procbuf.h @ 20830:b65888ec820e draft default tip gccjit
dmalcom gcc jit import
author | Stefan Mahr <dac922@gmx.de> |
---|---|
date | Fri, 27 Feb 2015 16:59:36 +0100 |
parents | 4197fc428c7d |
children |
rev | line source |
---|---|
2094 | 1 /* |
2 | |
19898
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
17822
diff
changeset
|
3 Copyright (C) 1996-2015 John W. Eaton |
2094 | 4 |
5 This file is part of Octave. | |
6 | |
7 Octave is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published by the | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
2094 | 11 |
12 Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
2094 | 20 |
21 */ | |
22 | |
23 // This class is based on the procbuf class from libg++, written by | |
24 // Per Bothner, Copyright (C) 1993 Free Software Foundation. | |
25 | |
17822
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
26 #if !defined (octave_oct_procbuf_h) |
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
27 #define octave_oct_procbuf_h 1 |
2094 | 28 |
29 #include <sys/types.h> | |
30 | |
3631 | 31 #include "c-file-ptr-stream.h" |
32 | |
2094 | 33 class |
3631 | 34 octave_procbuf : public c_file_ptr_buf |
2094 | 35 { |
36 public: | |
37 | |
38 octave_procbuf (void) | |
3631 | 39 : c_file_ptr_buf (0), wstatus (-1), open_p (false), proc_pid (-1), |
40 next (0) { } | |
2094 | 41 |
42 octave_procbuf (const char *command, int mode) | |
3631 | 43 : c_file_ptr_buf (0), wstatus (-1), open_p (false), proc_pid (-1), |
44 next (0) { open (command, mode); } | |
2094 | 45 |
46 ~octave_procbuf (void) { close (); } | |
47 | |
48 octave_procbuf *open (const char *command, int mode); | |
49 | |
3631 | 50 octave_procbuf *close (void); |
2094 | 51 |
3189 | 52 int wait_status (void) const { return wstatus; } |
53 | |
3631 | 54 bool is_open (void) const { return open_p; } |
55 | |
6316 | 56 pid_t pid (void) const { return proc_pid; } |
2094 | 57 |
58 protected: | |
59 | |
3189 | 60 int wstatus; |
61 | |
3631 | 62 bool open_p; |
63 | |
2094 | 64 pid_t proc_pid; |
65 | |
66 octave_procbuf *next; | |
12122
f4689107dd8c
Explicitly disallow copying in some classes.
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
11523
diff
changeset
|
67 |
f4689107dd8c
Explicitly disallow copying in some classes.
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
11523
diff
changeset
|
68 private: |
f4689107dd8c
Explicitly disallow copying in some classes.
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
11523
diff
changeset
|
69 |
f4689107dd8c
Explicitly disallow copying in some classes.
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
11523
diff
changeset
|
70 // No copying! |
f4689107dd8c
Explicitly disallow copying in some classes.
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
11523
diff
changeset
|
71 |
f4689107dd8c
Explicitly disallow copying in some classes.
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
11523
diff
changeset
|
72 octave_procbuf (const octave_procbuf&); |
f4689107dd8c
Explicitly disallow copying in some classes.
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
11523
diff
changeset
|
73 |
f4689107dd8c
Explicitly disallow copying in some classes.
Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
parents:
11523
diff
changeset
|
74 octave_procbuf& operator = (const octave_procbuf&); |
2094 | 75 }; |
76 | |
3174 | 77 extern void symbols_of_oct_procbuf (void); |
78 | |
2094 | 79 #endif |