Fixed bug in inetd code. The server listened on tcp:@:9999 even
[yaz-moved-to-github.git] / server / service.h
1 /*
2  * NT Service interface Utility.
3  *  Based on code written by
4  *     Chas Woodfield, Fretwell Downing Datasystems.
5  * $Log: service.h,v $
6  * Revision 1.1  1997-11-07 13:31:52  adam
7  * Added NT Service name part of statserv_options_block. Moved NT
8  * service utility to server library.
9  *
10  * Revision 1.2  1997/09/04 13:50:30  adam
11  * Bug fix in ztest.
12  *
13  */
14
15 #ifndef SERVICE_INCLUDED
16 #define SERVICE_INCLUDED
17
18 #ifdef WIN32
19
20 #include <windows.h>
21
22 typedef struct _Service
23 {
24     LPTSTR pAppName;
25     LPTSTR pServiceName;
26     LPTSTR pServiceDisplayName;
27     LPTSTR pDependancies;
28     TCHAR szErr[256];
29     SERVICE_STATUS_HANDLE hService;
30     SERVICE_STATUS ServiceStatus;
31     SERVICE_TABLE_ENTRY ServiceTable[2];
32     int argc;
33     char **argv;
34 } AppService;
35
36 /* Called by the app to initialize the service */
37 BOOL SetupService(int argc, char *argv[], void *pHandle, LPTSTR pAppName, LPTSTR pServiceName, LPTSTR pServiceDisplayName, LPTSTR pDependancies);
38
39 #endif /* WIN32 */
40
41 /* Functions that must be in the main application */
42 /* Initializes the app */
43 int StartAppService(void *pHandle, int argc, char **argv);
44
45 /* Now we wait for any connections */
46 void RunAppService(void *pHandle);
47
48 /* Time to tidyup and stop the service */
49 void StopAppService(void *pHandle);
50
51 #endif