]>
git.saurik.com Git - apple/syslog.git/blob - libsystem_asl.tproj/include/asl_msg.h
2 * Copyright (c) 2009-2012 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@
30 #include <asl_string.h>
32 #include <asl_object.h>
34 #define IndexNull ((uint32_t)-1)
36 #define ASL_MSG_PAGE_DATA_SIZE 220
38 #define ASL_MSG_KVO_COUNT 30
39 // ASL_MSG_KVO_QUERY_SLOTS = ASL_MSG_KVO_COUNT / 3;
40 #define ASL_MSG_KVO_QUERY_SLOTS 10
41 // ASL_MSG_KVO_MSG_SLOTS = ASL_MSG_KVO_COUNT / 2;
42 #define ASL_MSG_KVO_MSG_SLOTS 15
44 #define ASL_MSG_OFFSET_MASK 0x3fff
45 #define ASL_MSG_KV_MASK 0xc000
46 #define ASL_MSG_KV_INLINE 0x0000
47 #define ASL_MSG_KV_DICT 0x8000
48 #define ASL_MSG_KV_EXTERN 0x4000
50 #define ASL_MSG_SLOT_FREE 0xffff
52 #define ASL_STD_KEY_BASE 0x8000
53 #define ASL_STD_KEY_TIME 0x8001
54 #define ASL_STD_KEY_NANO 0x8002
55 #define ASL_STD_KEY_HOST 0x8003
56 #define ASL_STD_KEY_SENDER 0x8004
57 #define ASL_STD_KEY_FACILITY 0x8005
58 #define ASL_STD_KEY_PID 0x8006
59 #define ASL_STD_KEY_UID 0x8007
60 #define ASL_STD_KEY_GID 0x8008
61 #define ASL_STD_KEY_LEVEL 0x8009
62 #define ASL_STD_KEY_MESSAGE 0x800a
63 #define ASL_STD_KEY_READ_UID 0x800b
64 #define ASL_STD_KEY_READ_GID 0x800c
65 #define ASL_STD_KEY_SESSION 0x800d
66 #define ASL_STD_KEY_REF_PID 0x800e
67 #define ASL_STD_KEY_REF_PROC 0x800f
68 #define ASL_STD_KEY_MSG_ID 0x8010
69 #define ASL_STD_KEY_EXPIRE 0x8011
70 #define ASL_STD_KEY_OPTION 0x8012
71 #define ASL_STD_KEY_FREE_NOTE 0x8013
72 #define ASL_STD_KEY_LAST ASL_STD_KEY_FREE_NOTE
74 #define ASL_MT_KEY_BASE 0x8100
75 #define ASL_MT_KEY_DOMAIN 0x8101
76 #define ASL_MT_KEY_SCOPE 0x8102
77 #define ASL_MT_KEY_RESULT 0x8103
78 #define ASL_MT_KEY_SIG 0x8104
79 #define ASL_MT_KEY_SIG2 0x8105
80 #define ASL_MT_KEY_SIG3 0x8106
81 #define ASL_MT_KEY_SUCCESS 0x8107
82 #define ASL_MT_KEY_UUID 0x8108
83 #define ASL_MT_KEY_VAL 0x8109
84 #define ASL_MT_KEY_VAL2 0x810a
85 #define ASL_MT_KEY_VAL3 0x810b
86 #define ASL_MT_KEY_VAL4 0x810c
87 #define ASL_MT_KEY_VAL5 0x810d
88 #define ASL_MT_KEY_LAST ASL_MT_KEY_VAL5
90 #define ASL_PRIVATE_KEY_BASE 0x8200
92 typedef struct asl_msg_s
94 uint32_t asl_type
; //ASL OBJECT HEADER
95 int32_t refcount
; //ASL OBJECT HEADER
99 struct asl_msg_s
* next
;
103 uint16_t kvo
[ ASL_MSG_KVO_COUNT
];
104 char data
[ ASL_MSG_PAGE_DATA_SIZE
];
109 const asl_jump_table_t
* asl_msg_jump_table ( void );
111 /* new/retain/release */
112 asl_msg_t
* asl_msg_new ( uint32_t type
) __API_DEPRECATED ( "os_log(3) has replaced asl(3)" , macosx ( 10.7 , 10.12 ), ios ( 4.3 , 10.0 ), watchos ( 2.0 , 3.0 ), tvos ( 9.0 , 10.0 ));
113 asl_msg_t
* asl_msg_retain ( asl_msg_t
* msg
) __API_DEPRECATED ( "os_log(3) has replaced asl(3)" , macosx ( 10.7 , 10.12 ), ios ( 4.3 , 10.0 ), watchos ( 2.0 , 3.0 ), tvos ( 9.0 , 10.0 ));
114 void asl_msg_release ( asl_msg_t
* msg
) __API_DEPRECATED ( "os_log(3) has replaced asl(3)" , macosx ( 10.7 , 10.12 ), ios ( 4.3 , 10.0 ), watchos ( 2.0 , 3.0 ), tvos ( 9.0 , 10.0 ));
116 int asl_msg_set_key_val ( asl_msg_t
* msg
, const char * key
, const char * val
) __API_DEPRECATED ( "os_log(3) has replaced asl(3)" , macosx ( 10.7 , 10.12 ), ios ( 4.3 , 10.0 ), watchos ( 2.0 , 3.0 ), tvos ( 9.0 , 10.0 ));
117 int asl_msg_set_key_val_op ( asl_msg_t
* msg
, const char * key
, const char * val
, uint32_t op
) __API_DEPRECATED ( "os_log(3) has replaced asl(3)" , macosx ( 10.7 , 10.12 ), ios ( 4.3 , 10.0 ), watchos ( 2.0 , 3.0 ), tvos ( 9.0 , 10.0 ));
118 void asl_msg_unset ( asl_msg_t
* msg
, const char * key
) __API_DEPRECATED ( "os_log(3) has replaced asl(3)" , macosx ( 10.7 , 10.12 ), ios ( 4.3 , 10.0 ), watchos ( 2.0 , 3.0 ), tvos ( 9.0 , 10.0 ));
119 void asl_msg_unset_index ( asl_msg_t
* msg
, uint32_t n
) __API_DEPRECATED ( "os_log(3) has replaced asl(3)" , macosx ( 10.10 , 10.12 ), ios ( 7.0 , 10.0 ), watchos ( 2.0 , 3.0 ), tvos ( 9.0 , 10.0 ));
121 asl_msg_t
* asl_msg_copy ( asl_msg_t
* msg
) __API_DEPRECATED ( "os_log(3) has replaced asl(3)" , macosx ( 10.8 , 10.12 ), ios ( 5.1 , 10.0 ), watchos ( 2.0 , 3.0 ), tvos ( 9.0 , 10.0 ));
122 asl_msg_t
* asl_msg_merge ( asl_msg_t
* target
, asl_msg_t
* msg
) __API_DEPRECATED ( "os_log(3) has replaced asl(3)" , macosx ( 10.8 , 10.12 ), ios ( 5.1 , 10.0 ), watchos ( 2.0 , 3.0 ), tvos ( 9.0 , 10.0 ));
124 int asl_msg_lookup ( asl_msg_t
* msg
, const char * key
, const char ** valout
, uint16_t * opout
) __API_DEPRECATED ( "os_log(3) has replaced asl(3)" , macosx ( 10.7 , 10.12 ), ios ( 4.3 , 10.0 ), watchos ( 2.0 , 3.0 ), tvos ( 9.0 , 10.0 ));
125 uint32_t asl_msg_fetch ( asl_msg_t
* msg
, uint32_t n
, const char ** keyout
, const char ** valout
, uint16_t * opout
) __API_DEPRECATED ( "os_log(3) has replaced asl(3)" , macosx ( 10.7 , 10.12 ), ios ( 4.3 , 10.0 ), watchos ( 2.0 , 3.0 ), tvos ( 9.0 , 10.0 ));
126 const char * asl_msg_get_val_for_key ( asl_msg_t
* msg
, const char * key
) __API_DEPRECATED ( "os_log(3) has replaced asl(3)" , macosx ( 10.10 , 10.12 ), ios ( 7.0 , 10.0 ), watchos ( 2.0 , 3.0 ), tvos ( 9.0 , 10.0 ));
128 uint32_t asl_msg_type ( asl_msg_t
* msg
) __API_DEPRECATED ( "os_log(3) has replaced asl(3)" , macosx ( 10.7 , 10.12 ), ios ( 4.3 , 10.0 ), watchos ( 2.0 , 3.0 ), tvos ( 9.0 , 10.0 ));
129 uint32_t asl_msg_count ( asl_msg_t
* msg
) __API_DEPRECATED ( "os_log(3) has replaced asl(3)" , macosx ( 10.7 , 10.12 ), ios ( 4.3 , 10.0 ), watchos ( 2.0 , 3.0 ), tvos ( 9.0 , 10.0 ));
131 char * asl_msg_to_string ( asl_msg_t
* in
, uint32_t * len
) __API_DEPRECATED ( "os_log(3) has replaced asl(3)" , macosx ( 10.4 , 10.12 ), ios ( 2.0 , 10.0 ), watchos ( 2.0 , 3.0 ), tvos ( 9.0 , 10.0 ));
132 asl_msg_t
* asl_msg_from_string ( const char * buf
) __API_DEPRECATED ( "os_log(3) has replaced asl(3)" , macosx ( 10.8 , 10.12 ), ios ( 7.0 , 10.0 ), watchos ( 2.0 , 3.0 ), tvos ( 9.0 , 10.0 ));
134 char * asl_format_message ( asl_msg_t
* msg
, const char * msg_fmt
, const char * time_fmt
, uint32_t text_encoding
, uint32_t * outlen
) __API_DEPRECATED ( "os_log(3) has replaced asl(3)" , macosx ( 10.5 , 10.12 ), ios ( 2.0 , 10.0 ), watchos ( 2.0 , 3.0 ), tvos ( 9.0 , 10.0 ));
136 asl_string_t
* asl_msg_to_string_raw ( uint32_t encoding
, asl_msg_t
* msg
, const char * tfmt
) __API_DEPRECATED ( "os_log(3) has replaced asl(3)" , macosx ( 10.8 , 10.12 ), ios ( 5.1 , 10.0 ), watchos ( 2.0 , 3.0 ), tvos ( 9.0 , 10.0 ));
137 asl_string_t
* asl_string_append_asl_msg ( asl_string_t
* str
, asl_msg_t
* msg
) __API_DEPRECATED ( "os_log(3) has replaced asl(3)" , macosx ( 10.10 , 10.12 ), ios ( 7.0 , 10.0 ), watchos ( 2.0 , 3.0 ), tvos ( 9.0 , 10.0 ));
139 int asl_msg_cmp ( asl_msg_t
* a
, asl_msg_t
* b
) __API_DEPRECATED ( "os_log(3) has replaced asl(3)" , macosx ( 10.10 , 10.12 ), ios ( 7.0 , 10.0 ), watchos ( 2.0 , 3.0 ), tvos ( 9.0 , 10.0 ));
141 void _asl_log_args_to_xpc ( asl_object_t client
, asl_object_t msg
, xpc_object_t dict
); //TODO: ADD AVAILABLITY INFO
145 #endif /* __ASL_MSG_H__ */