]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_utilities/lib/mach_notify.h
Security-58286.200.222.tar.gz
[apple/security.git] / OSX / libsecurity_utilities / lib / mach_notify.h
1 /*
2 * Copyright (c) 2000-2001,2004,2011,2014 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
25 #ifndef _notify_user_
26 #define _notify_user_
27
28 /* Module notify */
29
30 #include <string.h>
31 #include <mach/ndr.h>
32 #include <mach/boolean.h>
33 #include <mach/kern_return.h>
34 #include <mach/notify.h>
35 #include <mach/mach_types.h>
36 #include <mach/message.h>
37 #include <mach/mig_errors.h>
38 #include <mach/port.h>
39
40 #ifdef AUTOTEST
41 #ifndef FUNCTION_PTR_T
42 #define FUNCTION_PTR_T
43 typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
44 typedef struct {
45 char *name;
46 function_ptr_t function;
47 } function_table_entry;
48 typedef function_table_entry *function_table_t;
49 #endif /* FUNCTION_PTR_T */
50 #endif /* AUTOTEST */
51
52 #ifndef notify_MSG_COUNT
53 #define notify_MSG_COUNT 9
54 #endif /* notify_MSG_COUNT */
55
56 #include <mach/std_types.h>
57 #include <mach/mig.h>
58
59 #ifdef __BeforeMigUserHeader
60 __BeforeMigUserHeader
61 #endif /* __BeforeMigUserHeader */
62
63 #include <sys/cdefs.h>
64 __BEGIN_DECLS
65
66
67 /* SimpleRoutine mach_notify_port_deleted */
68 #ifdef mig_external
69 mig_external
70 #else
71 extern
72 #endif /* mig_external */
73 kern_return_t cdsa_mach_notify_port_deleted
74 (
75 mach_port_t notify,
76 mach_port_name_t name
77 );
78
79 /* SimpleRoutine mach_notify_port_destroyed */
80 #ifdef mig_external
81 mig_external
82 #else
83 extern
84 #endif /* mig_external */
85 kern_return_t cdsa_mach_notify_port_destroyed
86 (
87 mach_port_t notify,
88 mach_port_t rights
89 );
90
91 /* SimpleRoutine mach_notify_no_senders */
92 #ifdef mig_external
93 mig_external
94 #else
95 extern
96 #endif /* mig_external */
97 kern_return_t cdsa_mach_notify_no_senders
98 (
99 mach_port_t notify,
100 mach_port_mscount_t mscount
101 );
102
103 /* SimpleRoutine mach_notify_send_once */
104 #ifdef mig_external
105 mig_external
106 #else
107 extern
108 #endif /* mig_external */
109 kern_return_t cdsa_mach_notify_send_once
110 (
111 mach_port_t notify
112 );
113
114 /* SimpleRoutine mach_notify_dead_name */
115 #ifdef mig_external
116 mig_external
117 #else
118 extern
119 #endif /* mig_external */
120 kern_return_t cdsa_mach_notify_dead_name
121 (
122 mach_port_t notify,
123 mach_port_name_t name
124 );
125
126 __END_DECLS
127
128 #ifndef subsystem_to_name_map_notify
129 #define subsystem_to_name_map_notify \
130 { "mach_notify_port_deleted", 65 },\
131 { "mach_notify_port_destroyed", 69 },\
132 { "mach_notify_no_senders", 70 },\
133 { "mach_notify_send_once", 71 },\
134 { "mach_notify_dead_name", 72 }
135 #endif
136
137 #ifdef __AfterMigUserHeader
138 __AfterMigUserHeader
139 #endif /* __AfterMigUserHeader */
140
141 #endif /* _notify_user_ */