xref: /NextBSD/usr.sbin/notifyd/service.h (revision 33da5adc555b3bc29986eeadca03829e4ad06b1e)
1 /*
2  * Copyright (c) 2003-2010 Apple Inc. All rights reserved.
3  *
4  * @APPLE_LICENSE_HEADER_START@
5  *
6  * This file contains Original Code and/or Modifications of Original Code
7  * as defined in and that are subject to the Apple Public Source License
8  * Version 2.0 (the 'License'). You may not use this file except in
9  * compliance with the License. Please obtain a copy of the License at
10  * http://www.opensource.apple.com/apsl/ and read it before using this
11  * file.
12  *
13  * The Original Code and all software distributed under the License are
14  * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18  * Please see the License for the specific language governing rights and
19  * limitations under the License.
20  *
21  * @APPLE_LICENSE_HEADER_END@
22  */
23 
24 #ifndef _NOTIFY_SERVICE_H_
25 #define _NOTIFY_SERVICE_H_
26 
27 #define SERVICE_TYPE_NONE 0
28 #define SERVICE_TYPE_PATH_PUBLIC 1
29 #define SERVICE_TYPE_PATH_PRIVATE 2
30 #define SERVICE_TYPE_TIMER_PUBLIC 3
31 #define SERVICE_TYPE_TIMER_PRIVATE 4
32 
33 #define SERVICE_PREFIX "com.apple.system.notify.service."
34 #define SERVICE_PREFIX_LEN 32
35 
36 typedef struct
37 {
38 	uint32_t type;
39 	void *private;
40 } svc_info_t;
41 
42 int service_open(const char *name, client_t *client, uint32_t uid, uint32_t gid);
43 int service_open_path(const char *name, const char *path, uid_t uid, gid_t gid);
44 int service_open_path_private(const char *name, client_t *client, const char *path, uid_t uid, gid_t gid, uint32_t flags);
45 int service_open_timer(const char *name, const char *args);
46 int service_open_timer_private(const char *name, client_t *client, const char *args);
47 void service_close(svc_info_t *info);
48 
49 #endif /* _NOTIFY_SERVICE_H_ */
50