67fed2acad9f53e995c6c6701f1ff2bbf02e8005
[yaz-moved-to-github.git] / src / 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  2003-10-27 12:21:35  adam
7  * Source restructure. yaz-marcdump part of installation
8  *
9  * Revision 1.1  1997/11/07 13:31:52  adam
10  * Added NT Service name part of statserv_options_block. Moved NT
11  * service utility to server library.
12  *
13  * Revision 1.2  1997/09/04 13:50:30  adam
14  * Bug fix in ztest.
15  *
16  */
17
18 #ifndef SERVICE_INCLUDED
19 #define SERVICE_INCLUDED
20
21 #ifdef WIN32
22
23 #include <windows.h>
24
25 typedef struct _Service
26 {
27     LPTSTR pAppName;
28     LPTSTR pServiceName;
29     LPTSTR pServiceDisplayName;
30     LPTSTR pDependancies;
31     TCHAR szErr[256];
32     SERVICE_STATUS_HANDLE hService;
33     SERVICE_STATUS ServiceStatus;
34     SERVICE_TABLE_ENTRY ServiceTable[2];
35     int argc;
36     char **argv;
37 } AppService;
38
39 /* Called by the app to initialize the service */
40 BOOL SetupService(int argc, char *argv[], void *pHandle, LPTSTR pAppName, LPTSTR pServiceName, LPTSTR pServiceDisplayName, LPTSTR pDependancies);
41
42 #endif /* WIN32 */
43
44 /* Functions that must be in the main application */
45 /* Initializes the app */
46 int StartAppService(void *pHandle, int argc, char **argv);
47
48 /* Now we wait for any connections */
49 void RunAppService(void *pHandle);
50
51 /* Time to tidyup and stop the service */
52 void StopAppService(void *pHandle);
53
54 #endif