]>
git.saurik.com Git - apple/syslog.git/blob - libsystem_asl.tproj/include/asl_client.h
e0383aa3d0c304b83c975ab8365f34bd5ab64c29
2 * Copyright (c) 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@
24 #ifndef __ASL_CLIENT_H__
25 #define __ASL_CLIENT_H__
30 #include <asl_store.h>
32 #include <asl_msg_list.h>
33 #include <Availability.h>
34 #include <asl_object.h>
36 #define CLIENT_FLAG_WRITE_SYS 0x00000001
37 #define CLIENT_FLAG_WRITE_STORE 0x00000002
38 #define CLIENT_FLAG_WRITE_FILE 0x00000004
39 #define CLIENT_FLAG_READ_SYS 0x00000100
40 #define CLIENT_FLAG_READ_STORE 0x00000200
41 #define CLIENT_FLAG_READ_FILE 0x00000400
52 typedef struct asl_client_s
54 uint32_t asl_type
; //ASL OBJECT HEADER
55 int32_t refcount
; //ASL OBJECT HEADER
64 int notify_master_token
;
66 asl_out_file_t
*out_list
;
76 const asl_jump_table_t
*asl_client_jump_table(void);
78 asl_client_t
*asl_client_open(const char *ident
, const char *facility
, uint32_t opts
) __OSX_AVAILABLE_STARTING(__MAC_10_10
, __IPHONE_7_0
);
79 asl_client_t
*asl_client_open_from_file(int descriptor
, const char *ident
, const char *facility
) __OSX_AVAILABLE_STARTING(__MAC_10_10
, __IPHONE_7_0
);
80 asl_client_t
*asl_client_retain(asl_client_t
*client
) __OSX_AVAILABLE_STARTING(__MAC_10_10
, __IPHONE_7_0
);
81 void asl_client_release(asl_client_t
*client
) __OSX_AVAILABLE_STARTING(__MAC_10_10
, __IPHONE_7_0
);
83 int asl_client_set_filter(asl_client_t
*client
, int filter
) __OSX_AVAILABLE_STARTING(__MAC_10_10
, __IPHONE_7_0
);
84 ASL_STATUS
asl_client_add_output_file(asl_client_t
*client
, int descriptor
, const char *mfmt
, const char *tfmt
, int filter
, int text_encoding
) __OSX_AVAILABLE_STARTING(__MAC_10_10
, __IPHONE_7_0
);
85 int asl_client_set_output_file_filter(asl_client_t
*client
, int fd
, int filter
) __OSX_AVAILABLE_STARTING(__MAC_10_10
, __IPHONE_7_0
);
86 ASL_STATUS
asl_client_remove_output_file(asl_client_t
*client
, int descriptor
) __OSX_AVAILABLE_STARTING(__MAC_10_10
, __IPHONE_7_0
);
88 int asl_client_log_descriptor(asl_client_t
*client
, asl_msg_t
*msg
, int level
, int descriptor
, uint32_t fd_type
) __OSX_AVAILABLE_STARTING(__MAC_10_10
, __IPHONE_7_0
);
90 asl_msg_t
*asl_client_kvdict(asl_client_t
*client
) __OSX_AVAILABLE_STARTING(__MAC_10_10
, __IPHONE_7_0
);
92 int asl_client_log(asl_client_t
*client
, asl_msg_t
*msg
, int level
, const char *format
, ...) __printflike(4, 5) __OSX_AVAILABLE_STARTING(__MAC_10_10
, __IPHONE_7_0
);
93 int asl_client_vlog(asl_client_t
*client
, asl_msg_t
*msg
, int level
, const char *format
, va_list ap
) __printflike(4, 0) __OSX_AVAILABLE_STARTING(__MAC_10_10
, __IPHONE_7_0
);
94 ASL_STATUS
asl_client_send(asl_client_t
*client
, asl_msg_t
*msg
) __OSX_AVAILABLE_STARTING(__MAC_10_10
, __IPHONE_7_0
);
96 asl_msg_list_t
*asl_client_search(asl_client_t
*client
, asl_msg_t
*query
) __OSX_AVAILABLE_STARTING(__MAC_10_10
, __IPHONE_7_0
);
97 asl_msg_list_t
*asl_client_match(asl_client_t
*client
, asl_msg_list_t
*querylist
, size_t *last
, size_t start
, size_t count
, uint32_t duration
, int32_t direction
) __OSX_AVAILABLE_STARTING(__MAC_10_10
, __IPHONE_7_0
);
101 #endif /* __ASL_CLIENT_H__ */