zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

clock.h (6299B) - Raw


      1 #ifndef	_clock_user_
      2 #define	_clock_user_
      3 
      4 /* Module clock */
      5 
      6 #include <string.h>
      7 #include <mach/ndr.h>
      8 #include <mach/boolean.h>
      9 #include <mach/kern_return.h>
     10 #include <mach/notify.h>
     11 #include <mach/mach_types.h>
     12 #include <mach/message.h>
     13 #include <mach/mig_errors.h>
     14 #include <mach/port.h>
     15 	
     16 /* BEGIN MIG_STRNCPY_ZEROFILL CODE */
     17 
     18 #if defined(__has_include)
     19 #if __has_include(<mach/mig_strncpy_zerofill_support.h>)
     20 #ifndef USING_MIG_STRNCPY_ZEROFILL
     21 #define USING_MIG_STRNCPY_ZEROFILL
     22 #endif
     23 #ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
     24 #define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__
     25 #ifdef __cplusplus
     26 extern "C" {
     27 #endif
     28 #ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS_CSTRING_ATTR
     29 #define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS_CSTRING_COUNTEDBY_ATTR(C) __unsafe_indexable
     30 #endif
     31 	extern int mig_strncpy_zerofill(char * dest, const char * src, int len) __attribute__((weak_import));
     32 #ifdef __cplusplus
     33 }
     34 #endif
     35 #endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */
     36 #endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */
     37 #endif /* __has_include */
     38 	
     39 /* END MIG_STRNCPY_ZEROFILL CODE */
     40 
     41 
     42 #ifdef AUTOTEST
     43 #ifndef FUNCTION_PTR_T
     44 #define FUNCTION_PTR_T
     45 typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
     46 typedef struct {
     47         char            * name;
     48         function_ptr_t  function;
     49 } function_table_entry;
     50 typedef function_table_entry   *function_table_t;
     51 #endif /* FUNCTION_PTR_T */
     52 #endif /* AUTOTEST */
     53 
     54 #ifndef	clock_MSG_COUNT
     55 #define	clock_MSG_COUNT	3
     56 #endif	/* clock_MSG_COUNT */
     57 
     58 #include <Availability.h>
     59 #include <mach/std_types.h>
     60 #include <mach/mig.h>
     61 #include <mach/mig.h>
     62 #include <mach/mach_types.h>
     63 #include <mach/mach_types.h>
     64 
     65 #ifdef __BeforeMigUserHeader
     66 __BeforeMigUserHeader
     67 #endif /* __BeforeMigUserHeader */
     68 
     69 #include <sys/cdefs.h>
     70 __BEGIN_DECLS
     71 
     72 
     73 /* Routine clock_get_time */
     74 #ifdef	mig_external
     75 mig_external
     76 #else
     77 extern
     78 #endif	/* mig_external */
     79 kern_return_t clock_get_time
     80 (
     81 	clock_serv_t clock_serv,
     82 	mach_timespec_t *cur_time
     83 );
     84 
     85 /* Routine clock_get_attributes */
     86 #ifdef	mig_external
     87 mig_external
     88 #else
     89 extern
     90 #endif	/* mig_external */
     91 kern_return_t clock_get_attributes
     92 (
     93 	clock_serv_t clock_serv,
     94 	clock_flavor_t flavor,
     95 	clock_attr_t clock_attr,
     96 	mach_msg_type_number_t *clock_attrCnt
     97 );
     98 
     99 /* Routine clock_alarm */
    100 #ifdef	mig_external
    101 mig_external
    102 #else
    103 extern
    104 #endif	/* mig_external */
    105 kern_return_t clock_alarm
    106 (
    107 	clock_serv_t clock_serv,
    108 	alarm_type_t alarm_type,
    109 	mach_timespec_t alarm_time,
    110 	clock_reply_t alarm_port
    111 );
    112 
    113 __END_DECLS
    114 
    115 /********************** Caution **************************/
    116 /* The following data types should be used to calculate  */
    117 /* maximum message sizes only. The actual message may be */
    118 /* smaller, and the position of the arguments within the */
    119 /* message layout may vary from what is presented here.  */
    120 /* For example, if any of the arguments are variable-    */
    121 /* sized, and less than the maximum is sent, the data    */
    122 /* will be packed tight in the actual message to reduce  */
    123 /* the presence of holes.                                */
    124 /********************** Caution **************************/
    125 
    126 /* typedefs for all requests */
    127 
    128 #ifndef __Request__clock_subsystem__defined
    129 #define __Request__clock_subsystem__defined
    130 
    131 #ifdef  __MigPackStructs
    132 #pragma pack(push, 4)
    133 #endif
    134 	typedef struct {
    135 		mach_msg_header_t Head;
    136 	} __Request__clock_get_time_t __attribute__((unused));
    137 #ifdef  __MigPackStructs
    138 #pragma pack(pop)
    139 #endif
    140 
    141 #ifdef  __MigPackStructs
    142 #pragma pack(push, 4)
    143 #endif
    144 	typedef struct {
    145 		mach_msg_header_t Head;
    146 		NDR_record_t NDR;
    147 		clock_flavor_t flavor;
    148 		mach_msg_type_number_t clock_attrCnt;
    149 	} __Request__clock_get_attributes_t __attribute__((unused));
    150 #ifdef  __MigPackStructs
    151 #pragma pack(pop)
    152 #endif
    153 
    154 #ifdef  __MigPackStructs
    155 #pragma pack(push, 4)
    156 #endif
    157 	typedef struct {
    158 		mach_msg_header_t Head;
    159 		/* start of the kernel processed data */
    160 		mach_msg_body_t msgh_body;
    161 		mach_msg_port_descriptor_t alarm_port;
    162 		/* end of the kernel processed data */
    163 		NDR_record_t NDR;
    164 		alarm_type_t alarm_type;
    165 		mach_timespec_t alarm_time;
    166 	} __Request__clock_alarm_t __attribute__((unused));
    167 #ifdef  __MigPackStructs
    168 #pragma pack(pop)
    169 #endif
    170 #endif /* !__Request__clock_subsystem__defined */
    171 
    172 /* union of all requests */
    173 
    174 #ifndef __RequestUnion__clock_subsystem__defined
    175 #define __RequestUnion__clock_subsystem__defined
    176 union __RequestUnion__clock_subsystem {
    177 	__Request__clock_get_time_t Request_clock_get_time;
    178 	__Request__clock_get_attributes_t Request_clock_get_attributes;
    179 	__Request__clock_alarm_t Request_clock_alarm;
    180 };
    181 #endif /* !__RequestUnion__clock_subsystem__defined */
    182 /* typedefs for all replies */
    183 
    184 #ifndef __Reply__clock_subsystem__defined
    185 #define __Reply__clock_subsystem__defined
    186 
    187 #ifdef  __MigPackStructs
    188 #pragma pack(push, 4)
    189 #endif
    190 	typedef struct {
    191 		mach_msg_header_t Head;
    192 		NDR_record_t NDR;
    193 		kern_return_t RetCode;
    194 		mach_timespec_t cur_time;
    195 	} __Reply__clock_get_time_t __attribute__((unused));
    196 #ifdef  __MigPackStructs
    197 #pragma pack(pop)
    198 #endif
    199 
    200 #ifdef  __MigPackStructs
    201 #pragma pack(push, 4)
    202 #endif
    203 	typedef struct {
    204 		mach_msg_header_t Head;
    205 		NDR_record_t NDR;
    206 		kern_return_t RetCode;
    207 		mach_msg_type_number_t clock_attrCnt;
    208 		int clock_attr[1];
    209 	} __Reply__clock_get_attributes_t __attribute__((unused));
    210 #ifdef  __MigPackStructs
    211 #pragma pack(pop)
    212 #endif
    213 
    214 #ifdef  __MigPackStructs
    215 #pragma pack(push, 4)
    216 #endif
    217 	typedef struct {
    218 		mach_msg_header_t Head;
    219 		NDR_record_t NDR;
    220 		kern_return_t RetCode;
    221 	} __Reply__clock_alarm_t __attribute__((unused));
    222 #ifdef  __MigPackStructs
    223 #pragma pack(pop)
    224 #endif
    225 #endif /* !__Reply__clock_subsystem__defined */
    226 
    227 /* union of all replies */
    228 
    229 #ifndef __ReplyUnion__clock_subsystem__defined
    230 #define __ReplyUnion__clock_subsystem__defined
    231 union __ReplyUnion__clock_subsystem {
    232 	__Reply__clock_get_time_t Reply_clock_get_time;
    233 	__Reply__clock_get_attributes_t Reply_clock_get_attributes;
    234 	__Reply__clock_alarm_t Reply_clock_alarm;
    235 };
    236 #endif /* !__RequestUnion__clock_subsystem__defined */
    237 
    238 #ifndef subsystem_to_name_map_clock
    239 #define subsystem_to_name_map_clock \
    240     { "clock_get_time", 1000 },\
    241     { "clock_get_attributes", 1001 },\
    242     { "clock_alarm", 1002 }
    243 #endif
    244 
    245 #ifdef __AfterMigUserHeader
    246 __AfterMigUserHeader
    247 #endif /* __AfterMigUserHeader */
    248 
    249 #endif	 /* _clock_user_ */