2 * winservice.h : Public definitions for Windows Service support
4 * ====================================================================
5 * Licensed to the Apache Software Foundation (ASF) under one
6 * or more contributor license agreements. See the NOTICE file
7 * distributed with this work for additional information
8 * regarding copyright ownership. The ASF licenses this file
9 * to you under the Apache License, Version 2.0 (the
10 * "License"); you may not use this file except in compliance
11 * with the License. You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing,
16 * software distributed under the License is distributed on an
17 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18 * KIND, either express or implied. See the License for the
19 * specific language governing permissions and limitations
21 * ====================================================================
29 #endif /* __cplusplus */
34 /* Connects to the Windows Service Control Manager and allows this
35 process to run as a service. This function can only succeed if the
36 process was started by the SCM, not directly by a user. After this
37 call succeeds, the service should perform whatever work it needs to
38 start the service, and then the service should call
39 winservice_running() (if no errors occurred) or winservice_stop()
40 (if something failed during startup). */
41 svn_error_t *winservice_start(void);
43 /* Notifies the SCM that the service is now running. The caller must
44 already have called winservice_start successfully. */
45 void winservice_running(void);
47 /* This function is called by the SCM in an arbitrary thread when the
48 SCM wants the service to stop. The implementation of this function
49 can return immediately; all that is necessary is that the service
50 eventually stop in response. */
51 void winservice_notify_stop(void);
53 /* Evaluates to TRUE if the SCM has requested that the service stop.
54 This allows for the service to poll, in addition to being notified
55 in the winservice_notify_stop callback. */
56 svn_boolean_t winservice_is_stopping(void);
62 #endif /* __cplusplus */
64 #endif /* WINSERVICE_H */