]>
git.saurik.com Git - apple/libc.git/blob - gen/asl_msg.h
dc9a9dc95f0f243002db436e01a4584498cdd4dc
2 * Copyright (c) 2009-2011 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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
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.
21 * @APPLE_LICENSE_HEADER_END@
28 #include <asl_private.h>
30 #define IndexNull ((uint32_t)-1)
32 #define ASL_MSG_PAGE_DATA_SIZE 800
33 #define ASL_MSG_PAGE_SLOTS 24
35 #define ASL_MSG_OFFSET_MASK 0x3fff
36 #define ASL_MSG_KV_MASK 0xc000
37 #define ASL_MSG_KV_INLINE 0x0000
38 #define ASL_MSG_KV_DICT 0x8000
39 #define ASL_MSG_KV_EXTERN 0x4000
41 #define ASL_MSG_SLOT_FREE 0xffff
43 #define ASL_STD_KEY_BASE 0x8000
44 #define ASL_STD_KEY_TIME 0x8001
45 #define ASL_STD_KEY_NANO 0x8002
46 #define ASL_STD_KEY_HOST 0x8003
47 #define ASL_STD_KEY_SENDER 0x8004
48 #define ASL_STD_KEY_FACILITY 0x8005
49 #define ASL_STD_KEY_PID 0x8006
50 #define ASL_STD_KEY_UID 0x8007
51 #define ASL_STD_KEY_GID 0x8008
52 #define ASL_STD_KEY_LEVEL 0x8009
53 #define ASL_STD_KEY_MESSAGE 0x800a
54 #define ASL_STD_KEY_READ_UID 0x800b
55 #define ASL_STD_KEY_READ_GID 0x800c
56 #define ASL_STD_KEY_SESSION 0x800d
57 #define ASL_STD_KEY_REF_PID 0x800e
58 #define ASL_STD_KEY_REF_PROC 0x800f
59 #define ASL_STD_KEY_MSG_ID 0x8010
60 #define ASL_STD_KEY_EXPIRE 0x8011
61 #define ASL_STD_KEY_OPTION 0x8012
62 #define ASL_STD_KEY_LAST ASL_STD_KEY_OPTION
64 #define ASL_MT_KEY_BASE 0x8100
65 #define ASL_MT_KEY_DOMAIN 0x8101
66 #define ASL_MT_KEY_SCOPE 0x8102
67 #define ASL_MT_KEY_RESULT 0x8103
68 #define ASL_MT_KEY_SIG 0x8104
69 #define ASL_MT_KEY_SIG2 0x8105
70 #define ASL_MT_KEY_SIG3 0x8106
71 #define ASL_MT_KEY_SUCCESS 0x8107
72 #define ASL_MT_KEY_UUID 0x8108
73 #define ASL_MT_KEY_VAL 0x8109
74 #define ASL_MT_KEY_VAL2 0x810a
75 #define ASL_MT_KEY_VAL3 0x810b
76 #define ASL_MT_KEY_VAL4 0x810c
77 #define ASL_MT_KEY_VAL5 0x810d
78 #define ASL_MT_KEY_LAST ASL_MT_KEY_VAL5
80 #define ASL_PRIVATE_KEY_BASE 0x8200
82 typedef struct asl_msg_s
88 struct asl_msg_s
*next
;
89 uint16_t key
[ASL_MSG_PAGE_SLOTS
];
90 uint16_t val
[ASL_MSG_PAGE_SLOTS
];
91 uint32_t op
[ASL_MSG_PAGE_SLOTS
];
92 char data
[ASL_MSG_PAGE_DATA_SIZE
];
95 typedef struct __aslresponse
102 #define asl_search_result_t asl_msg_list_t
104 asl_msg_t
*asl_msg_new(uint32_t type
) __OSX_AVAILABLE_STARTING(__MAC_10_7
, __IPHONE_4_3
);
105 asl_msg_t
*asl_msg_retain(asl_msg_t
*msg
) __OSX_AVAILABLE_STARTING(__MAC_10_7
, __IPHONE_4_3
);
106 void asl_msg_release(asl_msg_t
*msg
) __OSX_AVAILABLE_STARTING(__MAC_10_7
, __IPHONE_4_3
);
108 int asl_msg_set_key_val(asl_msg_t
*msg
, const char *key
, const char *val
) __OSX_AVAILABLE_STARTING(__MAC_10_7
, __IPHONE_4_3
);
109 int asl_msg_set_key_val_op(asl_msg_t
*msg
, const char *key
, const char *val
, uint32_t op
) __OSX_AVAILABLE_STARTING(__MAC_10_7
, __IPHONE_4_3
);
110 void asl_msg_unset(asl_msg_t
*msg
, const char *key
) __OSX_AVAILABLE_STARTING(__MAC_10_7
, __IPHONE_4_3
);
112 asl_msg_t
*asl_msg_copy(asl_msg_t
*msg
) __OSX_AVAILABLE_STARTING(__MAC_10_8
, __IPHONE_5_1
);
113 asl_msg_t
*asl_msg_merge(asl_msg_t
*target
, asl_msg_t
*msg
) __OSX_AVAILABLE_STARTING(__MAC_10_8
, __IPHONE_5_1
);
115 int asl_msg_lookup(asl_msg_t
*msg
, const char *key
, const char **valout
, uint32_t *opout
) __OSX_AVAILABLE_STARTING(__MAC_10_7
, __IPHONE_4_3
);
116 uint32_t asl_msg_fetch(asl_msg_t
*msg
, uint32_t n
, const char **keyout
, const char **valout
, uint32_t *opout
) __OSX_AVAILABLE_STARTING(__MAC_10_7
, __IPHONE_4_3
);
118 uint32_t asl_msg_type(asl_msg_t
*msg
) __OSX_AVAILABLE_STARTING(__MAC_10_7
, __IPHONE_4_3
);
119 uint32_t asl_msg_count(asl_msg_t
*msg
) __OSX_AVAILABLE_STARTING(__MAC_10_7
, __IPHONE_4_3
);
121 char *asl_msg_to_string(asl_msg_t
*in
, uint32_t *len
) __OSX_AVAILABLE_STARTING(__MAC_10_4
, __IPHONE_2_0
);
122 char *asl_list_to_string(asl_search_result_t
*, uint32_t *) __OSX_AVAILABLE_STARTING(__MAC_10_5
, __IPHONE_2_0
);
123 asl_search_result_t
*asl_list_from_string(const char *buf
) __OSX_AVAILABLE_STARTING(__MAC_10_5
, __IPHONE_2_0
);
125 char *asl_format_message(asl_msg_t
*msg
, const char *msg_fmt
, const char *time_fmt
, uint32_t text_encoding
, uint32_t *outlen
) __OSX_AVAILABLE_STARTING(__MAC_10_5
, __IPHONE_2_0
);
127 #endif /* __ASL_MSG_H__ */