X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=ztest%2Fztest.c;h=6b21057cb250fcce5cb147adab235103ccd28086;hb=4090fc5c7b77769020633d09cf63b325aceaf49a;hp=d8b155541edca72c53e8c18c590ffafdb53c31f8;hpb=6517fa53d35512887780fd07de5667940da18a9e;p=yaz-moved-to-github.git diff --git a/ztest/ztest.c b/ztest/ztest.c index d8b1555..6b21057 100644 --- a/ztest/ztest.c +++ b/ztest/ztest.c @@ -7,7 +7,11 @@ * Chas Woodfield, Fretwell Downing Datasystems. * * $Log: ztest.c,v $ - * Revision 1.4 1997-09-17 12:10:43 adam + * Revision 1.5 1997-11-07 13:31:58 adam + * Added NT Service name part of statserv_options_block. Moved NT + * service utility to server library. + * + * Revision 1.4 1997/09/17 12:10:43 adam * YAZ version 1.4. * * Revision 1.3 1997/09/09 10:10:20 adam @@ -33,9 +37,6 @@ #include #include -/* Specifically for NT Services - Shouldn't cause problems on UNIX */ -#include "service.h" - Z_GenericRecord *read_grs1(FILE *f, ODR o); bend_initresult *bend_init(bend_initrequest *q) @@ -301,65 +302,7 @@ void bend_close(void *handle) return; } -#ifndef WINDOWS -/* UNIX version */ -int main(int argc, char **argv) -{ - statserv_main(argc, argv); - statserv_closedown(); - exit (0); -} -#else -/* Windows version with Service support */ - -typedef struct _Args -{ - char **argv; - int argc; -} Args; - -static Args ArgDetails; - -/* name of the executable */ -#define SZAPPNAME "server" - -/* internal name of the service */ -#define SZSERVICENAME "Z3950 Test Server" - -/* displayed name of the service */ -#define SZSERVICEDISPLAYNAME "Z3950 Test Server" - -/* list of service dependencies - "dep1\0dep2\0\0" */ -#define SZDEPENDENCIES "" - int main(int argc, char **argv) { - /* Lets setup the Arg structure */ - ArgDetails.argc = argc; - ArgDetails.argv = argv; - - /* Now setup the service with the service controller */ - SetupService(argc, argv, &ArgDetails, SZAPPNAME, SZSERVICENAME, SZSERVICEDISPLAYNAME, SZDEPENDENCIES); - return(0); + return statserv_main(argc, argv); } - -int StartAppService(void *pHandle, int argc, char **argv) -{ - /* Initializes the App */ - return 1; -} - -void RunAppService(void *pHandle) -{ - Args *pArgs = (Args *)pHandle; - - /* Starts the app running */ - statserv_main(pArgs->argc, pArgs->argv); -} - -void StopAppService(void *pHandle) -{ - /* Stops the app */ - statserv_closedown(); -} -#endif