/* Here's how to use these calls */

/*
Add your program as a service using this command:
	\dnews\addsvc -add testsvc d:\path\prog.exe "description"
Start the service with:
	net start testsvc
	net stop testsvc
And follow the steps below to make this work :-)


In your main program, modify your main() function like this AND
add a main_setexit() function.


static int exiting;
int main_setexit(void)
{
	exiting = TRUE;
	return TRUE;
}

#ifdef WIN32
int svc_main(int argc, char *argv[])
#else
int main(int argc, char *argv[])
#endif
{
        svc_init(argv[0]);
	...BODY OF MAIN FUNCTION GOES HERE:...
	for (;!exiting;) {
		...MAIN PROGRAM LOOP...
	}
        svc_exiting();
        svc_exit();
	return 0;
}



*/

#ifdef WIN32
#include <windows.h>
void svc_report(int status);
VOID svc_handler(DWORD msg);
VOID svc_exiting(void);
VOID svc_exit(void);
VOID ServiceMain(DWORD  dwArgc, LPTSTR  *lpszArgv);

/* call this if you want to delay the RUNNING message sent to the system to indicate your 
process is officially running. MUST be called before svc_init() */
void svc_delay_running(int state);

void svc_init(char *sname);

/* call this to indicate that you are RUNNING, MUST be called after svc_init(); and MUST be 
called if svc_delay_running(TRUE) has been called */
void svc_running(void);

char *svc_getargs(char *svcname);
int main_setexit(void);
int svc_main(int argc, char *argv[]);
#else
void svc_delay_running(int state);
void svc_running(void);
void svc_exiting(void);
void svc_exit(void);
void svc_init(char *sname);
#endif

char *svc_getpath(char *svcname);
