2 * winservice.h : Public definitions for Windows Service support
4 * ====================================================================
5 * Copyright (c) 2000-2006 CollabNet. All rights reserved.
7 * This software is licensed as described in the file COPYING, which
8 * you should have received as part of this distribution. The terms
9 * are also available at http://subversion.tigris.org/license-1.html.
10 * If newer versions of this license are posted there, you may use a
11 * newer version instead, at your option.
13 * This software consists of voluntary contributions made by many
14 * individuals. For exact contribution history, see the revision
15 * history and logs, available at http://subversion.tigris.org/.
16 * ====================================================================
24 #endif /* __cplusplus */
29 /* Connects to the Windows Service Control Manager and allows this
30 process to run as a service. This function can only succeed if the
31 process was started by the SCM, not directly by a user. After this
32 call succeeds, the service should perform whatever work it needs to
33 start the service, and then the service should call
34 winservice_running() (if no errors occurred) or winservice_stop()
35 (if something failed during startup). */
36 svn_error_t
*winservice_start(void);
38 /* Notifies the SCM that the service is now running. The caller must
39 already have called winservice_start successfully. */
40 void winservice_running(void);
42 /* This function is called by the SCM in an arbitrary thread when the
43 SCM wants the service to stop. The implementation of this function
44 can return immediately; all that is necessary is that the service
45 eventually stop in response. */
46 void winservice_notify_stop(void);
48 /* Evaluates to TRUE if the SCM has requested that the service stop.
49 This allows for the service to poll, in addition to being notified
50 in the winservice_notify_stop callback. */
51 svn_boolean_t
winservice_is_stopping(void);
57 #endif /* __cplusplus */
59 #endif /* WINSERVICE_H */