]> git.saurik.com Git - apple/libc.git/blob - gen/asl_core.h
10292fb7ed6168688588487695c6799607aba62e
[apple/libc.git] / gen / asl_core.h
1 #ifndef __ASL_CORE_H__
2 #define __ASL_CORE_H__
3
4 /*
5 * Copyright (c) 2007 Apple Inc. All rights reserved.
6 *
7 * @APPLE_LICENSE_HEADER_START@
8 *
9 * "Portions Copyright (c) 2007 Apple Inc. All Rights
10 * Reserved. This file contains Original Code and/or Modifications of
11 * Original Code as defined in and that are subject to the Apple Public
12 * Source License Version 1.0 (the 'License'). You may not use this file
13 * except in compliance with the License. Please obtain a copy of the
14 * License at http://www.apple.com/publicsource and read it before using
15 * this file.
16 *
17 * The Original Code and all software distributed under the License are
18 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
19 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
20 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
22 * License for the specific language governing rights and limitations
23 * under the License."
24 *
25 * @APPLE_LICENSE_HEADER_END@
26 */
27
28 #include <stdint.h>
29 #include <Availability.h>
30
31 #define asl_msg_list_t asl_search_result_t
32
33 #define ASL_STATUS_OK 0
34 #define ASL_STATUS_INVALID_ARG 1
35 #define ASL_STATUS_INVALID_STORE 2
36 #define ASL_STATUS_INVALID_STRING 3
37 #define ASL_STATUS_INVALID_ID 4
38 #define ASL_STATUS_INVALID_MESSAGE 5
39 #define ASL_STATUS_NOT_FOUND 6
40 #define ASL_STATUS_READ_FAILED 7
41 #define ASL_STATUS_WRITE_FAILED 8
42 #define ASL_STATUS_NO_MEMORY 9
43 #define ASL_STATUS_ACCESS_DENIED 10
44 #define ASL_STATUS_READ_ONLY 11
45 #define ASL_STATUS_WRITE_ONLY 12
46 #define ASL_STATUS_MATCH_FAILED 13
47 #define ASL_STATUS_NO_RECORDS 14
48 #define ASL_STATUS_FAILED 9999
49
50 #define ASL_REF_NULL 0xffffffffffffffffLL
51
52 #define ASL_MSG_FLAG_READ_UID_SET 0x0001
53 #define ASL_MSG_FLAG_READ_GID_SET 0x0002
54 #define ASL_MSG_FLAG_SEARCH_MATCH 0x8000
55 #define ASL_MSG_FLAG_SEARCH_CLEAR 0x7fff
56
57 #define ASL_QUERY_MATCH_SLOW 0x00000000
58 #define ASL_QUERY_MATCH_MSG_ID 0x00000001
59 #define ASL_QUERY_MATCH_TIME 0x00000002
60 #define ASL_QUERY_MATCH_NANO 0x00000004
61 #define ASL_QUERY_MATCH_LEVEL 0x00000008
62 #define ASL_QUERY_MATCH_PID 0x00000010
63 #define ASL_QUERY_MATCH_UID 0x00000020
64 #define ASL_QUERY_MATCH_GID 0x00000040
65 #define ASL_QUERY_MATCH_RUID 0x00000080
66 #define ASL_QUERY_MATCH_RGID 0x00000100
67 #define ASL_QUERY_MATCH_REF_PID 0x00000200
68 #define ASL_QUERY_MATCH_HOST 0x00000400
69 #define ASL_QUERY_MATCH_SENDER 0x00000800
70 #define ASL_QUERY_MATCH_FACILITY 0x00001000
71 #define ASL_QUERY_MATCH_MESSAGE 0x00002000
72 #define ASL_QUERY_MATCH_REF_PROC 0x00004000
73 #define ASL_QUERY_MATCH_SESSION 0x00008000
74 #define ASL_QUERY_MATCH_TRUE 0x80000000
75 #define ASL_QUERY_MATCH_FALSE 0x40000000
76 #define ASL_QUERY_MATCH_ERROR 0x20000000
77
78 uint32_t asl_core_string_hash(const char *str, uint32_t len) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
79 const char *asl_core_error(uint32_t code) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
80 uint32_t asl_core_check_access(int32_t msgu, int32_t msgg, int32_t readu, int32_t readg, uint16_t flags) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
81 uint64_t asl_core_htonq(uint64_t n) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
82 uint64_t asl_core_ntohq(uint64_t n)__OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
83 uint64_t asl_core_new_msg_id(uint64_t start) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
84 char *asl_core_encode_buffer(const char *in, uint32_t len) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0);
85 int32_t asl_core_decode_buffer(const char *in, char **buf, uint32_t *len) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0);
86
87 #endif __ASL_CORE_H__