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