00001 00002 /* 00003 * server.c Set up and handle communications with a server process. 00004 * 00005 * Server Handling copyright 1992-1999 The Free Software Foundation 00006 * 00007 * Server Handling is free software. 00008 * You may redistribute it and/or modify it under the terms of the 00009 * GNU General Public License, as published by the Free Software 00010 * Foundation; either version 2, or (at your option) any later version. 00011 * 00012 * Server Handling is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with Server Handling. See the file "COPYING". If not, 00019 * write to: The Free Software Foundation, Inc., 00020 * 51 Franklin Street, Fifth Floor, 00021 * Boston, MA 02110-1301, USA. 00022 * 00023 * As a special exception, The Free Software Foundation gives 00024 * permission for additional uses of the text contained in his release 00025 * of ServerHandler. 00026 * 00027 * The exception is that, if you link the ServerHandler library with other 00028 * files to produce an executable, this does not by itself cause the 00029 * resulting executable to be covered by the GNU General Public License. 00030 * Your use of that executable is in no way restricted on account of 00031 * linking the ServerHandler library code into it. 00032 * 00033 * This exception does not however invalidate any other reasons why 00034 * the executable file might be covered by the GNU General Public License. 00035 * 00036 * This exception applies only to the code released by The Free 00037 * Software Foundation under the name ServerHandler. If you copy code 00038 * from other sources under the General Public License into a copy of 00039 * ServerHandler, as the General Public License permits, the exception 00040 * does not apply to the code that you add in this way. To avoid 00041 * misleading anyone as to the status of such modified files, you must 00042 * delete this exception notice from them. 00043 * 00044 * If you write modifications of your own for ServerHandler, it is your 00045 * choice whether to permit this exception to apply to your modifications. 00046 * If you do not wish that, delete this exception notice. 00047 */ 00048 00049 #ifndef GCC_SERVER_H 00050 #define GCC_SERVER_H 00051 00052 /* 00053 * Dual pipe opening of a child process 00054 */ 00055 00056 typedef struct 00057 { 00058 int read_fd; 00059 int write_fd; 00060 } t_fd_pair; 00061 00062 typedef struct 00063 { 00064 FILE *pf_read; /* parent read fp */ 00065 FILE *pf_write; /* parent write fp */ 00066 } t_pf_pair; 00067 00068 char* run_shell( const char* pzCmd ); 00069 pid_t proc2_fopen( t_pf_pair* p_pair, tCC** pp_args ); 00070 pid_t proc2_open( t_fd_pair* p_pair, tCC** pp_args ); 00071 int chain_open( int in_fd, tCC** pp_args, pid_t* p_child ); 00072 void close_server( void ); 00073 00074 #endif /* ! GCC_SERVER_H */
1.5.6