1 /************************************************************************ 2 * This program is Copyright (C) 1986-1996 by Jonathan Payne. JOVE is * 3 * provided to you without charge, and with no warranty. You may give * 4 * away copies of JOVE, including sources, provided that this notice is * 5 * included in all the files. * 6 ************************************************************************/ 7 8 #ifdef IPROCS /* the body is the rest of this file */ 9 10 typedef struct process *Process; /* process reference (opaque type) */ 11 12 # ifdef PIPEPROCS 13 14 extern char Portsrv[FILESIZE]; /* path to portsrv program (in LibDir) */ 15 16 extern int NumProcs; 17 18 # define KBDSIG SIGUSR1 /* used for shoulder tapping */ 19 20 /* Messages from kbd and portsrv to jove. 21 * We depend on writes to a pipe being atomic. 22 * This seems to be the case if the write is short enough (<4k?) 23 * but not documented in the UNIX manuals. 24 */ 25 26 struct header { 27 pid_t pid; /* sender */ 28 int nbytes; /* data length */ 29 }; 30 31 struct lump { 32 struct header header; 33 char data[128]; /* data being sent */ 34 }; 35 36 extern File *ProcInput; 37 extern pid_t kbd_pid; 38 39 extern void kbd_strt proto((void)); 40 extern bool kbd_stop proto((void)); 41 extern void read_pipe_proc proto((pid_t, int)); 42 extern void kbd_kill proto((void)); 43 44 # else /* !PIPEPROCS */ 45 46 extern void read_pty_proc proto((int)); 47 48 extern SIGRESTYPE sigchld_handler proto((int)); 49 extern volatile bool procs_to_reap; 50 extern void reap_procs proto((void)); 51 52 # endif /* !PIPEPROCS */ 53 54 extern void 55 closeiprocs proto((void)), 56 untieDeadProcess proto((Buffer *)); 57 58 extern bool 59 KillProcs proto((void)); 60 61 extern const char 62 *dbxness proto((Process)), 63 *pstate proto((Process)); 64 65 extern pid_t DeadPid; /* info about ChildPid, if reaped by kill_off */ 66 extern wait_status_t DeadStatus; 67 68 extern void 69 kill_off proto((pid_t, wait_status_t)); 70 71 /* Commands: */ 72 extern void 73 ProcInt proto((void)), 74 DBXpoutput proto((void)), 75 Iprocess proto((void)), 76 ShellProc proto((void)), 77 ProcQuit proto((void)), 78 ProcKill proto((void)), 79 # ifdef PTYPROCS 80 ProcCont proto((void)), 81 ProcDStop proto((void)), 82 ProcEof proto((void)), 83 ProcStop proto((void)), 84 # endif 85 ProcSendData proto((void)), 86 ProcNewline proto((void)), 87 ProcList proto((void)); 88 89 /* Variables: */ 90 91 extern char 92 proc_prompt[128], /* VAR: process prompt */ 93 dbx_parse_fmt[128]; /* VAR: dbx-mode parse string */ 94 95 #endif /* IPROCS */ 96