-YAZ_EXPORT bend_initresult *bend_init(bend_initrequest *r);
-
-YAZ_EXPORT void bend_request_send (bend_association a, bend_request req,
- Z_APDU *res);
-
-YAZ_EXPORT bend_request bend_request_mk (bend_association a);
-
-YAZ_EXPORT void bend_request_destroy (bend_request *req);
-
-YAZ_EXPORT Z_ReferenceId *bend_request_getid (ODR odr, bend_request req);
-YAZ_EXPORT int bend_backend_respond (bend_association a, bend_request req);
-YAZ_EXPORT void bend_request_setdata(bend_request r, void *p);
-YAZ_EXPORT void *bend_request_getdata(bend_request r);
+/** \brief control block for server */
+typedef struct statserv_options_block
+{
+ int dynamic; /**< fork on incoming requests */
+ int threads; /**< use threads */
+ int one_shot; /**< one session then exit(1) */
+ char apdufile[ODR_MAXNAME+1]; /**< file for pretty-printed PDUs */
+ char logfile[ODR_MAXNAME+1]; /**< file for diagnostic output */
+ char default_listen[1024]; /**< 0 == no default listen */
+ enum oid_proto default_proto; /**< PROTO_SR or PROTO_Z3950 */
+ int idle_timeout; /**< how many minutes to wait before closing */
+ int maxrecordsize; /**< maximum value for negotiation */
+ char configname[ODR_MAXNAME+1]; /**< given to the backend in bend_init */
+ char setuid[ODR_MAXNAME+1]; /**< setuid to this user after binding */
+ void (*bend_start)(struct statserv_options_block *p);
+ void (*bend_stop)(struct statserv_options_block *p);
+ int (*options_func)(int argc, char **argv);
+ int (*check_ip)(void *cd, const char *addr, int len, int type);
+ char daemon_name[128];
+ int inetd; /**< Do we use the inet deamon or not */
+
+ void *handle; /**< Handle */
+ bend_initresult *(*bend_init)(bend_initrequest *r);
+ void (*bend_close)(void *handle);
+#ifdef WIN32
+ /* We only have these members for the windows version */
+ /* They seemed a bit large to have them there in general */
+ char service_name[128]; /**< NT Service Name */
+ char app_name[128]; /**< Application Name */
+ char service_dependencies[128]; /**< The services we are dependent on */
+ char service_display_name[128]; /**< The service display name */
+#endif /* WIN32 */
+ struct bend_soap_handler *soap_handlers;
+ char pid_fname[128]; /**< pid fname */
+ int background; /**< auto daemon */
+ char cert_fname[128]; /**< SSL certificate fname */
+ char xml_config[128]; /**< XML config filename */
+ int keepalive; /**< keep alive if HTTP 1.1 (default: 1) */
+} statserv_options_block;
+
+YAZ_EXPORT int statserv_main(
+ int argc, char **argv,
+ bend_initresult *(*bend_init)(bend_initrequest *r),
+ void (*bend_close)(void *handle));
+
+YAZ_EXPORT statserv_options_block *statserv_getcontrol(void);
+YAZ_EXPORT void statserv_setcontrol(statserv_options_block *block);
+YAZ_EXPORT int check_ip_tcpd(void *cd, const char *addr, int len, int type);
+
+YAZ_EXPORT int bend_assoc_is_alive(bend_association assoc);
+
+YAZ_END_CDECL