annotate libinterp/corefcn/oct-procbuf.h @ 20614:10ec79b47808

use new string_value method to handle value extraction errors * __voronoi__.cc, chol.cc, colamd.cc, fftw.cc: Use new string_value method.
author John W. Eaton <jwe@octave.org>
date Thu, 08 Oct 2015 18:15:56 -0400
parents 4197fc428c7d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2094
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
1 /*
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
2
19731
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
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
4
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
6
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6316
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6316
diff changeset
10 option) any later version.
2094
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
11
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
15 for more details.
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
16
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6316
diff changeset
18 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6316
diff changeset
19 <http://www.gnu.org/licenses/>.
2094
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
20
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
21 */
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
22
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
23 // This class is based on the procbuf class from libg++, written by
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
24 // Per Bothner, Copyright (C) 1993 Free Software Foundation.
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
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
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
28
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
29 #include <sys/types.h>
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
30
3631
0b6b55fd0a5c [project @ 2000-03-23 09:16:36 by jwe]
jwe
parents: 3560
diff changeset
31 #include "c-file-ptr-stream.h"
0b6b55fd0a5c [project @ 2000-03-23 09:16:36 by jwe]
jwe
parents: 3560
diff changeset
32
2094
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
33 class
3631
0b6b55fd0a5c [project @ 2000-03-23 09:16:36 by jwe]
jwe
parents: 3560
diff changeset
34 octave_procbuf : public c_file_ptr_buf
2094
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
35 {
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
36 public:
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
37
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
38 octave_procbuf (void)
3631
0b6b55fd0a5c [project @ 2000-03-23 09:16:36 by jwe]
jwe
parents: 3560
diff changeset
39 : c_file_ptr_buf (0), wstatus (-1), open_p (false), proc_pid (-1),
0b6b55fd0a5c [project @ 2000-03-23 09:16:36 by jwe]
jwe
parents: 3560
diff changeset
40 next (0) { }
2094
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
41
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
42 octave_procbuf (const char *command, int mode)
3631
0b6b55fd0a5c [project @ 2000-03-23 09:16:36 by jwe]
jwe
parents: 3560
diff changeset
43 : c_file_ptr_buf (0), wstatus (-1), open_p (false), proc_pid (-1),
0b6b55fd0a5c [project @ 2000-03-23 09:16:36 by jwe]
jwe
parents: 3560
diff changeset
44 next (0) { open (command, mode); }
2094
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
45
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
46 ~octave_procbuf (void) { close (); }
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
47
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
48 octave_procbuf *open (const char *command, int mode);
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
49
3631
0b6b55fd0a5c [project @ 2000-03-23 09:16:36 by jwe]
jwe
parents: 3560
diff changeset
50 octave_procbuf *close (void);
2094
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
51
3189
bef7b73c0724 [project @ 1998-10-16 18:05:26 by jwe]
jwe
parents: 3174
diff changeset
52 int wait_status (void) const { return wstatus; }
bef7b73c0724 [project @ 1998-10-16 18:05:26 by jwe]
jwe
parents: 3174
diff changeset
53
3631
0b6b55fd0a5c [project @ 2000-03-23 09:16:36 by jwe]
jwe
parents: 3560
diff changeset
54 bool is_open (void) const { return open_p; }
0b6b55fd0a5c [project @ 2000-03-23 09:16:36 by jwe]
jwe
parents: 3560
diff changeset
55
6316
a3a2580435c2 [project @ 2007-02-16 07:23:49 by jwe]
jwe
parents: 5307
diff changeset
56 pid_t pid (void) const { return proc_pid; }
2094
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
57
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
58 protected:
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
59
3189
bef7b73c0724 [project @ 1998-10-16 18:05:26 by jwe]
jwe
parents: 3174
diff changeset
60 int wstatus;
bef7b73c0724 [project @ 1998-10-16 18:05:26 by jwe]
jwe
parents: 3174
diff changeset
61
3631
0b6b55fd0a5c [project @ 2000-03-23 09:16:36 by jwe]
jwe
parents: 3560
diff changeset
62 bool open_p;
0b6b55fd0a5c [project @ 2000-03-23 09:16:36 by jwe]
jwe
parents: 3560
diff changeset
63
2094
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
64 pid_t proc_pid;
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
65
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
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
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
75 };
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
76
3174
390d5e396682 [project @ 1998-05-04 16:36:17 by jwe]
jwe
parents: 2847
diff changeset
77 extern void symbols_of_oct_procbuf (void);
390d5e396682 [project @ 1998-05-04 16:36:17 by jwe]
jwe
parents: 2847
diff changeset
78
2094
a23645b0364e [project @ 1996-04-28 09:00:07 by jwe]
jwe
parents:
diff changeset
79 #endif