1 /* 2 * Copyright 2001-2004 Brandon Long 3 * All Rights Reserved. 4 * 5 * ClearSilver Templating System 6 * 7 * This code is made available under the terms of the ClearSilver License. 8 * http://www.clearsilver.net/license.hdf 9 * 10 */ 11 12 #ifndef __NEO_SERVER_H_ 13 #define __NEO_SERVER_H_ 1 14 15 __BEGIN_DECLS 16 17 /* hmm, this callback might need a mechanism for telling the child to 18 * end... */ 19 typedef NEOERR *(*NSERVER_REQ_CB)(void *rock, int num, NSOCK *sock); 20 typedef NEOERR *(*NSERVER_CB)(void *rock, int num); 21 22 typedef struct _nserver { 23 /* callbacks */ 24 NSERVER_CB init_cb; 25 NSERVER_REQ_CB req_cb; 26 NSERVER_CB clean_cb; 27 28 void *data; 29 30 int num_children; 31 int num_requests; 32 33 int port; 34 int conn_timeout; 35 int data_timeout; 36 37 char lockfile[_POSIX_PATH_MAX]; 38 39 /* Internal data */ 40 int accept_lock; 41 int server_fd; 42 } NSERVER; 43 44 NEOERR *nserver_proc_start(NSERVER *server, BOOL debug); 45 46 __END_DECLS 47 48 #endif /* __NEO_SERVER_H_ */ 49