Followup to r29625: fix getopt tests.
[svn.git] / subversion / svnserve / winservice.h
blob89bec92e5e014d19688cde600f6f8453e54daa68
1 /*
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 * ====================================================================
19 #ifndef WINSERVICE_H
20 #define WINSERVICE_H
22 #ifdef __cplusplus
23 extern "C" {
24 #endif /* __cplusplus */
27 #ifdef WIN32
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);
53 #endif /* WIN32 */
55 #ifdef __cplusplus
57 #endif /* __cplusplus */
59 #endif /* WINSERVICE_H */