1
/* @(#)subproc.h 19.1 (ESO-IPG) 02/25/03 13:41:47 */
2
/*---------------------------------------------------------------------
3
* $Date: 2003-06-04 14:49:18 $ $Revision: 1.1.1.1 $
4
*---------------------------------------------------------------------
5
* Copyright (c) 1992, Visual Edge Software Ltd.
7
* ALL RIGHTS RESERVED. Permission to use, copy, modify, and
8
* distribute this software and its documentation for any purpose
9
* and without fee is hereby granted, provided that the above
10
* copyright notice appear in all copies and that both that
11
* copyright notice and this permission notice appear in supporting
12
* documentation, and that the name of Visual Edge Software not be
13
* used in advertising or publicity pertaining to distribution of
14
* the software without specific, written prior permission. The year
15
* included in the notice is the year of the creation of the work.
16
*---------------------------------------------------------------------
17
* File_Description_Section
18
*--------------------------------------------------------------------*/
23
/*--- include files ---*/
33
#include <X11/Intrinsic.h>
36
#include "UxSubproc.h"
42
extern "C" { /* C++ compatability */
43
#endif /* __cplusplus */
45
/*--- macro symbolic constants ---*/
48
#define UxError(msg) UxStandardError((msg))
51
/* Provide 32 entries which is the maximum number of
52
* of tty/pty pairs for one process on most extended
53
* architectures. Pseudo terminals are only in use if
54
* a subprocess is between a Run - Exit cycle. Double
55
* the number of subprocess structures should suffice.
56
* Refered to in the functions UxDeleteSubproc and GetSp.
58
#define MAX_SUBPROC 64
60
/* These are the possible values for the field subprocStatus
61
* in the structure SubprocInfo_t.
63
#define UNDEFINED -1 /* the process state is unknown */
64
#define RUNNING 0 /* the process is running */
65
#define EXITING 1 /* the process is exiting */
66
#define DEAD 2 /* the process is dead */
67
#define DELAYED_EXIT 3 /* the process is in a delayed exit state */
70
# define USE_SYSV_TERMIO
71
# define USE_SYSV_PGRP
74
/*--- macro functions ---*/
75
/* X/OPEN message catalog macros. These will make the code more compact. */
76
#define CGETS(ms,ds_ms) UxCatGets(MC_MISC1,ms,ds_ms)
77
#define error_msg(x) UxStandardError("%s", x);
95
typedef void (*void_func_ptr)();
96
typedef int (*int_func_ptr)();
97
typedef char ** (*char_func_ptr)();
100
char_func_ptr prepare_command_m;
101
int_func_ptr set_parent_side_m;
102
int_func_ptr setup_parent_communication_m;
103
int_func_ptr start_child_m;
104
int_func_ptr set_child_side_m;
105
void_func_ptr setup_child_communication_m;
106
int_func_ptr exec_subprocess_m;
107
void_func_ptr close_communication_m;
110
/*--- external functions ---*/
111
extern int UxGetSp UXPROTO((void));
112
extern int UxCheckIndex UXPROTO((handle index));
113
extern void UxSyserr UXPROTO((char *msg1, char *msg2));
114
extern int UxPrintArgs UXPROTO((char **tmp));
115
extern void UxSpCheck UXPROTO((SubprocInfo_t *sp));
116
extern void UxOutputHandler UXPROTO((SubprocInfo_t *sp));
117
extern void UxSpExit UXPROTO((SubprocInfo_t *sp));
118
extern void UxOnExitRunExitCb UXPROTO((int pid, int status));
119
extern char **UxBuildArgs UXPROTO((char *process, char *command_line));
120
extern void UxKillAllSubprocs UXPROTO((void));
122
/*--- external variables ---*/
123
extern SubprocInfo_t *UxSpArray[MAX_SUBPROC];
124
extern SubprocMgr_t UxSubprocMgr;
128
} /* Close scope of 'extern "C"' declaration which encloses file. */
129
#endif /* __cplusplus */