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