annotate src/sighandlers.h @ 11523:fd0a3ac60b0e

update copyright notices
author John W. Eaton <jwe@octave.org>
date Fri, 14 Jan 2011 05:47:45 -0500
parents 479cc8a0a846
children ab231f944252
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
1 /*
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
2
11523
fd0a3ac60b0e update copyright notices
John W. Eaton <jwe@octave.org>
parents: 10411
diff changeset
3 Copyright (C) 1993-2011 John W. Eaton
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
4
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
6
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
78fd87e624cb [project @ 1993-08-08 01:13:40 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: 6972
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: 6972
diff changeset
10 option) any later version.
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
11
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
15 for more details.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
16
78fd87e624cb [project @ 1993-08-08 01:13:40 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: 6972
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: 6972
diff changeset
19 <http://www.gnu.org/licenses/>.
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
20
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
21 */
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
22
2939
f2feebf0eb7d [project @ 1997-05-06 16:36:34 by jwe]
jwe
parents: 2926
diff changeset
23 /*
f2feebf0eb7d [project @ 1997-05-06 16:36:34 by jwe]
jwe
parents: 2926
diff changeset
24
f2feebf0eb7d [project @ 1997-05-06 16:36:34 by jwe]
jwe
parents: 2926
diff changeset
25 The signal blocking macros defined below were adapted from similar
f2feebf0eb7d [project @ 1997-05-06 16:36:34 by jwe]
jwe
parents: 2926
diff changeset
26 functions from GNU Bash, the Bourne Again SHell, copyright (C) 1994
f2feebf0eb7d [project @ 1997-05-06 16:36:34 by jwe]
jwe
parents: 2926
diff changeset
27 Free Software Foundation, Inc.
f2feebf0eb7d [project @ 1997-05-06 16:36:34 by jwe]
jwe
parents: 2926
diff changeset
28
f2feebf0eb7d [project @ 1997-05-06 16:36:34 by jwe]
jwe
parents: 2926
diff changeset
29 */
f2feebf0eb7d [project @ 1997-05-06 16:36:34 by jwe]
jwe
parents: 2926
diff changeset
30
834
44ce29d8cb7b [project @ 1994-10-19 18:17:44 by jwe]
jwe
parents: 383
diff changeset
31 // This file should always be included after config.h!
44ce29d8cb7b [project @ 1994-10-19 18:17:44 by jwe]
jwe
parents: 383
diff changeset
32
383
0b52c68ec81f [project @ 1994-03-09 21:19:44 by jwe]
jwe
parents: 296
diff changeset
33 #if !defined (octave_sighandlers_h)
0b52c68ec81f [project @ 1994-03-09 21:19:44 by jwe]
jwe
parents: 296
diff changeset
34 #define octave_sighandlers_h 1
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
35
3566
4b1a93f83264 [project @ 2000-02-03 09:19:49 by jwe]
jwe
parents: 3546
diff changeset
36 // Include signal.h, not csignal since the latter might only define
4b1a93f83264 [project @ 2000-02-03 09:19:49 by jwe]
jwe
parents: 3546
diff changeset
37 // the ANSI standard C signal interface.
4b1a93f83264 [project @ 2000-02-03 09:19:49 by jwe]
jwe
parents: 3546
diff changeset
38
4b1a93f83264 [project @ 2000-02-03 09:19:49 by jwe]
jwe
parents: 3546
diff changeset
39 #include <signal.h>
2209
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
40
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
41 #include "syswait.h"
3546
6dfdded73a7e [project @ 2000-02-02 22:45:39 by jwe]
jwe
parents: 3018
diff changeset
42 #include "siglist.h"
2209
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
43
5142
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
44 #include "base-list.h"
3566
4b1a93f83264 [project @ 2000-02-03 09:19:49 by jwe]
jwe
parents: 3546
diff changeset
45
290
5325afdb0ef5 [project @ 1994-01-13 19:21:40 by jwe]
jwe
parents: 240
diff changeset
46 // Signal handler return type.
5325afdb0ef5 [project @ 1994-01-13 19:21:40 by jwe]
jwe
parents: 240
diff changeset
47 #ifndef BADSIG
10246
f751dae7aab8 use gnulib signal modules
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
48 #define BADSIG (void (*)(int))-1
290
5325afdb0ef5 [project @ 1994-01-13 19:21:40 by jwe]
jwe
parents: 240
diff changeset
49 #endif
5325afdb0ef5 [project @ 1994-01-13 19:21:40 by jwe]
jwe
parents: 240
diff changeset
50
2693
f4d0604cbcc4 [project @ 1997-02-18 15:25:21 by jwe]
jwe
parents: 2554
diff changeset
51 #define BLOCK_SIGNAL(sig, nvar, ovar) \
f4d0604cbcc4 [project @ 1997-02-18 15:25:21 by jwe]
jwe
parents: 2554
diff changeset
52 do \
f4d0604cbcc4 [project @ 1997-02-18 15:25:21 by jwe]
jwe
parents: 2554
diff changeset
53 { \
10411
479cc8a0a846 use gnulib namespace
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
54 gnulib::sigemptyset (&nvar); \
479cc8a0a846 use gnulib namespace
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
55 gnulib::sigaddset (&nvar, sig); \
479cc8a0a846 use gnulib namespace
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
56 gnulib::sigemptyset (&ovar); \
479cc8a0a846 use gnulib namespace
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
57 gnulib::sigprocmask (SIG_BLOCK, &nvar, &ovar); \
2693
f4d0604cbcc4 [project @ 1997-02-18 15:25:21 by jwe]
jwe
parents: 2554
diff changeset
58 } \
f4d0604cbcc4 [project @ 1997-02-18 15:25:21 by jwe]
jwe
parents: 2554
diff changeset
59 while (0)
f4d0604cbcc4 [project @ 1997-02-18 15:25:21 by jwe]
jwe
parents: 2554
diff changeset
60
5144
25b090e1be9f [project @ 2005-02-15 12:06:05 by jwe]
jwe
parents: 5142
diff changeset
61 #if !defined (SIGCHLD) && defined (SIGCLD)
25b090e1be9f [project @ 2005-02-15 12:06:05 by jwe]
jwe
parents: 5142
diff changeset
62 #define SIGCHLD SIGCLD
25b090e1be9f [project @ 2005-02-15 12:06:05 by jwe]
jwe
parents: 5142
diff changeset
63 #endif
25b090e1be9f [project @ 2005-02-15 12:06:05 by jwe]
jwe
parents: 5142
diff changeset
64
2693
f4d0604cbcc4 [project @ 1997-02-18 15:25:21 by jwe]
jwe
parents: 2554
diff changeset
65 #define BLOCK_CHILD(nvar, ovar) BLOCK_SIGNAL (SIGCHLD, nvar, ovar)
10411
479cc8a0a846 use gnulib namespace
John W. Eaton <jwe@octave.org>
parents: 10313
diff changeset
66 #define UNBLOCK_CHILD(ovar) gnulib::sigprocmask (SIG_SETMASK, &ovar, 0)
2693
f4d0604cbcc4 [project @ 1997-02-18 15:25:21 by jwe]
jwe
parents: 2554
diff changeset
67
10246
f751dae7aab8 use gnulib signal modules
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
68 typedef void sig_handler (int);
290
5325afdb0ef5 [project @ 1994-01-13 19:21:40 by jwe]
jwe
parents: 240
diff changeset
69
5775
ace8d8d26933 [project @ 2006-04-24 19:13:06 by jwe]
jwe
parents: 5770
diff changeset
70 // FIXME -- the data should probably be private...
2554
f7e3d23f0a8f [project @ 1996-11-21 01:41:57 by jwe]
jwe
parents: 2469
diff changeset
71
2705
18395aaeafb7 [project @ 1997-02-20 04:56:43 by jwe]
jwe
parents: 2693
diff changeset
72 struct
18395aaeafb7 [project @ 1997-02-20 04:56:43 by jwe]
jwe
parents: 2693
diff changeset
73 octave_interrupt_handler
18395aaeafb7 [project @ 1997-02-20 04:56:43 by jwe]
jwe
parents: 2693
diff changeset
74 {
18395aaeafb7 [project @ 1997-02-20 04:56:43 by jwe]
jwe
parents: 2693
diff changeset
75 #ifdef SIGINT
18395aaeafb7 [project @ 1997-02-20 04:56:43 by jwe]
jwe
parents: 2693
diff changeset
76 sig_handler *int_handler;
18395aaeafb7 [project @ 1997-02-20 04:56:43 by jwe]
jwe
parents: 2693
diff changeset
77 #endif
18395aaeafb7 [project @ 1997-02-20 04:56:43 by jwe]
jwe
parents: 2693
diff changeset
78
18395aaeafb7 [project @ 1997-02-20 04:56:43 by jwe]
jwe
parents: 2693
diff changeset
79 #ifdef SIGBREAK
18395aaeafb7 [project @ 1997-02-20 04:56:43 by jwe]
jwe
parents: 2693
diff changeset
80 sig_handler *brk_handler;
18395aaeafb7 [project @ 1997-02-20 04:56:43 by jwe]
jwe
parents: 2693
diff changeset
81 #endif
18395aaeafb7 [project @ 1997-02-20 04:56:43 by jwe]
jwe
parents: 2693
diff changeset
82 };
2554
f7e3d23f0a8f [project @ 1996-11-21 01:41:57 by jwe]
jwe
parents: 2469
diff changeset
83
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
84 // Nonzero means we have already printed a message for this series of
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
85 // SIGPIPES. We assume that the writer will eventually give up.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
86 extern int pipe_handler_error_count;
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
87
3018
5708b8bb4f06 [project @ 1997-06-03 21:48:05 by jwe]
jwe
parents: 2939
diff changeset
88 // TRUE means we can be interrupted.
6972
b5a6f5c71451 [project @ 2007-10-08 09:36:57 by jwe]
jwe
parents: 6109
diff changeset
89 extern OCTINTERP_API bool can_interrupt;
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
90
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 5775
diff changeset
91 extern OCTINTERP_API sig_handler *octave_set_signal_handler (int, sig_handler *,
10313
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10246
diff changeset
92 bool restart_syscalls = true);
1443
cd6c9be7337c [project @ 1995-09-19 21:54:56 by jwe]
jwe
parents: 1315
diff changeset
93
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 5775
diff changeset
94 extern OCTINTERP_API void install_signal_handlers (void);
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
95
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 5775
diff changeset
96 extern OCTINTERP_API void octave_signal_handler (void);
5142
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
97
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 5775
diff changeset
98 extern OCTINTERP_API octave_interrupt_handler octave_catch_interrupts (void);
2554
f7e3d23f0a8f [project @ 1996-11-21 01:41:57 by jwe]
jwe
parents: 2469
diff changeset
99
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 5775
diff changeset
100 extern OCTINTERP_API octave_interrupt_handler octave_ignore_interrupts (void);
2554
f7e3d23f0a8f [project @ 1996-11-21 01:41:57 by jwe]
jwe
parents: 2469
diff changeset
101
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 5775
diff changeset
102 extern OCTINTERP_API octave_interrupt_handler
5770
6a9244f89a2a [project @ 2006-04-18 17:44:33 by jwe]
jwe
parents: 5307
diff changeset
103 octave_set_interrupt_handler (const volatile octave_interrupt_handler&,
10313
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10246
diff changeset
104 bool restart_syscalls = true);
1651
e846e361a265 [project @ 1995-12-20 06:59:12 by jwe]
jwe
parents: 1445
diff changeset
105
2214
b5c7309168f3 [project @ 1996-05-16 15:48:22 by jwe]
jwe
parents: 2209
diff changeset
106 // extern void ignore_sigchld (void);
b5c7309168f3 [project @ 1996-05-16 15:48:22 by jwe]
jwe
parents: 2209
diff changeset
107
2209
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
108 // Maybe this should be in a separate file?
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
109
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
110 class
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 5775
diff changeset
111 OCTINTERP_API
2209
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
112 octave_child
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
113 {
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
114 public:
5142
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
115
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
116 // Do whatever to handle event for child with PID (might not
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
117 // actually be dead, could just be stopped). Return true if
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
118 // the list element corresponding to PID should be removed from
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
119 // list. This function should not call any functions that modify
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
120 // the octave_child_list.
2209
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
121
5142
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
122 typedef bool (*child_event_handler) (pid_t, int);
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
123
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
124 octave_child (pid_t id = -1, child_event_handler f = 0)
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
125 : pid (id), handler (f), have_status (0), status (0) { }
2209
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
126
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
127 octave_child (const octave_child& oc)
5142
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
128 : pid (oc.pid), handler (oc.handler),
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
129 have_status (oc.have_status), status (oc.status) { }
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
130
2209
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
131 octave_child& operator = (const octave_child& oc)
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
132 {
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
133 if (&oc != this)
10313
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10246
diff changeset
134 {
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10246
diff changeset
135 pid = oc.pid;
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10246
diff changeset
136 handler = oc.handler;
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10246
diff changeset
137 have_status = oc.have_status;
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10246
diff changeset
138 status = oc.status;
f3b65e1ae355 untabify src header files
John W. Eaton <jwe@octave.org>
parents: 10246
diff changeset
139 }
2209
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
140 return *this;
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
141 }
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
142
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
143 ~octave_child (void) { }
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
144
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
145 // The process id of this child.
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
146 pid_t pid;
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
147
5142
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
148 // The function we call if an event happens for this child.
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
149 child_event_handler handler;
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
150
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
151 // Nonzero if this child has stopped or terminated.
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
152 sig_atomic_t have_status;
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
153
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
154 // The status of this child; 0 if running, otherwise a status value
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
155 // from waitpid.
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
156 int status;
2209
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
157 };
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
158
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
159 class
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 5775
diff changeset
160 OCTINTERP_API
2209
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
161 octave_child_list
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
162 {
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
163 protected:
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
164
5142
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
165 octave_child_list (void) { }
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
166
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
167 class octave_child_list_rep : public octave_base_list<octave_child>
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
168 {
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
169 public:
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
170
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
171 void insert (pid_t pid, octave_child::child_event_handler f);
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
172
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
173 void reap (void);
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
174
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
175 bool wait (void);
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
176 };
2209
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
177
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
178 public:
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
179
5142
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
180 ~octave_child_list (void) { }
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
181
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
182 static void insert (pid_t pid, octave_child::child_event_handler f);
2209
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
183
5142
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
184 static void reap (void);
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
185
5142
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
186 static bool wait (void);
2209
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
187
2214
b5c7309168f3 [project @ 1996-05-16 15:48:22 by jwe]
jwe
parents: 2209
diff changeset
188 static void remove (pid_t pid);
b5c7309168f3 [project @ 1996-05-16 15:48:22 by jwe]
jwe
parents: 2209
diff changeset
189
2209
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
190 private:
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
191
5142
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
192 static bool instance_ok (void);
2209
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
193
5142
0f9108f298ab [project @ 2005-02-12 02:29:34 by jwe]
jwe
parents: 5128
diff changeset
194 static octave_child_list_rep *instance;
2209
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
195 };
859030f15706 [project @ 1996-05-15 11:46:43 by jwe]
jwe
parents: 2016
diff changeset
196
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
197 #endif