Debian Codegraph @

xpa/xlaunch.h

raw symbols SCIP
1 /*
2 * Copyright (c) 1999-2003 Smithsonian Astrophysical Observatory
3 */
4
5 /*
6 *
7 * xlaunch.h -- declarations for launching a program
8 *
9 */
10
11 #ifndef __xlaunch_h
12 #define __xlaunch_h
13
14 #if HAVE_CONFIG_H
15 #include <conf.h>
16 #endif
17
18 #include <stdio.h>
19 #include <errno.h>
20 #include <signal.h>
21 #include <fcntl.h>
22 #include <sys/time.h>
23 #include <sys/stat.h>
24 #if HAVE_STRING_H
25 #include <string.h>
26 #endif
27 #if HAVE_MALLOC_H
28 #include <malloc.h>
29 #endif
30 #if HAVE_UNISTD_H
31 #include <unistd.h>
32 #endif
33 #if HAVE_POSIX_SPAWN
34 #include <spawn.h>
35 #endif
36 #include <xport.h>
37 #include <word.h>
38 #include <xalloc.h>
39 #include <prsetup.h>
40
41 #define LAUNCH_ARGS 1024
42
43 #define LAUNCH_SPACE '\001'
44
45 /* for fork/exec, one of these is required to specify the technique to be used
46 by the parent when determining if the child started successfully */
47 #if !defined(LAUNCH_USE_PIPE) && !defined(LAUNCH_USE_WAITPID)
48 #define LAUNCH_USE_PIPE 1
49 #endif
50 /* ... but not both */
51 #if defined(LAUNCH_USE_PIPE) && defined(LAUNCH_USE_WAITPID)
52 #error "LAUNCH_USE_PIPE and LAUNCH_USE_WAITPID are mutually exclusive"
53 #endif
54
55 #ifndef LAUNCH_WAIT_TRIES
56 #define LAUNCH_WAIT_TRIES 100
57 #endif
58 #ifndef LAUNCH_WAIT_MSEC
59 #define LAUNCH_WAIT_MSEC 5000
60 #endif
61
62 #if HAVE_MINGW32|HAVE_CYGWIN
63 #define HAVE_SPAWNVP 1
64 #endif
65
66 #if HAVE_MINGW32
67 /* for now, ensure that MinGW utilizes spawnvp() */
68 #define LAUNCH_DEFAULT_WHICH 3
69 #elif HAVE_POSIX_SPAWN
70 /* use posix_spawn if possible (required for OS X 10.5) */
71 #define LAUNCH_DEFAULT_WHICH 2
72 #else
73 /* use our home-grown version */
74 #define LAUNCH_DEFAULT_WHICH 1
75 #endif
76
77 _PRbeg
78
79 int Launch _PRx((char *cmdstring, int wait, char **stdfiles, int *pipes));
80 pid_t LaunchPid _PRx((void));
81
82 _PRend
83
84 #endif