--- ray/src/util/netproc.h 2003/06/27 06:53:23 2.5 +++ ray/src/util/netproc.h 2004/03/26 21:36:19 2.8 @@ -1,8 +1,14 @@ -/* RCSid $Id: netproc.h,v 2.5 2003/06/27 06:53:23 greg Exp $ */ +/* RCSid $Id: netproc.h,v 2.8 2004/03/26 21:36:19 schorsch Exp $ */ /* * Header file for network processing routines */ +#ifndef _RAD_NETPROC_H_ +#define _RAD_NETPROC_H_ +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { char *com; /* command (stored on client side) */ int pid; /* process ID */ @@ -10,7 +16,7 @@ typedef struct { char *errs; /* error output */ int elen; /* error output length */ int (*cf)(); /* completion callback function */ -} PROC; /* process slot */ +} NETPROC; /* process slot (name PROC conflicts with Windows) */ /* Callback function cf above passed process server, slot number and status */ @@ -20,15 +26,26 @@ typedef struct pserver { char directory[128]; /* remote execution directory */ char username[32]; /* remote user ID */ short nprocs; /* number of allocated process slots */ - PROC proc[1]; /* process slot(s) (must be last in struct) */ + NETPROC proc[1]; /* process slot(s) (must be last in struct) */ } PSERVER; /* process server */ extern PSERVER *pslist; /* global process server list */ -extern PSERVER *addpserver(), *findjob(); +extern PSERVER *addpserver(char *host, char *dir, char *usr, int np); +extern void delpserver(PSERVER *ps); +extern PSERVER *findjob(int *pnp); +typedef int pscompfunc(PSERVER *ps, int pn, int status); +extern int startjob(PSERVER *ps, char *command, pscompfunc *compf); +extern int wait4job(PSERVER *ps, int pid); -extern char *myhostname(); #define LHOSTNAME "localhost" /* accepted name for local host */ #define pserverOK(ps) (wait4job(ps, startjob(ps, "true", NULL)) == 0) + + +#ifdef __cplusplus +} +#endif +#endif /* _RAD_NETPROC_H_ */ +