OSDN Git Service

code cleanups
[pf3gnuchains/gcc-fork.git] / gcc / fixinc / server.h
1
2 /*
3  *  server.c  Set up and handle communications with a server process.
4  *
5  *  Server Handling copyright 1992-1999 The Free Software Foundation
6  *
7  *  Server Handling is free software.
8  *  You may redistribute it and/or modify it under the terms of the
9  *  GNU General Public License, as published by the Free Software
10  *  Foundation; either version 2, or (at your option) any later version.
11  *
12  *  Server Handling is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *  GNU General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with Server Handling.  See the file "COPYING".  If not,
19  *  write to:  The Free Software Foundation, Inc.,
20  *             59 Temple Place - Suite 330,
21  *             Boston,  MA  02111-1307, USA.
22  *
23  * As a special exception, The Free Software Foundation gives
24  * permission for additional uses of the text contained in his release
25  * of ServerHandler.
26  *
27  * The exception is that, if you link the ServerHandler library with other
28  * files to produce an executable, this does not by itself cause the
29  * resulting executable to be covered by the GNU General Public License.
30  * Your use of that executable is in no way restricted on account of
31  * linking the ServerHandler library code into it.
32  *
33  * This exception does not however invalidate any other reasons why
34  * the executable file might be covered by the GNU General Public License.
35  *
36  * This exception applies only to the code released by The Free
37  * Software Foundation under the name ServerHandler.  If you copy code
38  * from other sources under the General Public License into a copy of
39  * ServerHandler, as the General Public License permits, the exception
40  * does not apply to the code that you add in this way.  To avoid
41  * misleading anyone as to the status of such modified files, you must
42  * delete this exception notice from them.
43  *
44  * If you write modifications of your own for ServerHandler, it is your
45  * choice whether to permit this exception to apply to your modifications.
46  * If you do not wish that, delete this exception notice.
47  */
48
49 #ifndef FIXINC_SERVER_H
50 #define FIXINC_SERVER_H
51
52 #include <stdio.h>
53 #ifdef HAVE_UNISTD_H
54 #include <unistd.h>
55 #endif
56
57 /*
58  *  Dual pipe opening of a child process
59  */
60
61 typedef struct
62 {
63   int read_fd;
64   int write_fd;
65 } t_fd_pair;
66
67 typedef struct
68 {
69   FILE *pf_read;                /* parent read fp  */
70   FILE *pf_write;               /* parent write fp */
71 } t_pf_pair;
72
73 typedef char *t_pchar;
74
75 #ifndef NOPROCESS
76 #define NOPROCESS       ((pid_t) -1)
77 #define NULLPROCESS     ((pid_t)0)
78
79 #define EXIT_PANIC      99
80 #endif /* NOPROCESS */
81
82 #ifndef HAVE_T_BOOL_ENUM
83 #define HAVE_T_BOOL_ENUM
84 typedef enum
85 {
86   BOOL_FALSE, BOOL_TRUE
87 } t_bool;
88 #endif
89
90 char *run_shell   PARAMS (( const char *pzCmd));
91 pid_t proc2_fopen PARAMS (( t_pf_pair * p_pair, t_pchar * pp_args));
92 pid_t proc2_open  PARAMS (( t_fd_pair * p_pair, t_pchar * pp_args));
93 int   chain_open  PARAMS (( int in_fd, t_pchar * pp_args,
94                             pid_t * p_child));
95 void close_server PARAMS (( void ));
96 #endif /* FIXINC_SERVER_H */