]>
Commit | Line | Data |
---|---|---|
81582353 A |
1 | /* |
2 | * Copyright (c) 2007-2011 Apple Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
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 | |
11 | * file. | |
12 | * | |
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. | |
20 | * | |
21 | * @APPLE_LICENSE_HEADER_END@ | |
22 | */ | |
23 | ||
24 | #ifndef __ASL_STORE_H__ | |
25 | #define __ASL_STORE_H__ | |
26 | ||
27 | #include <stdio.h> | |
28 | #include <stdint.h> | |
29 | #include <sys/time.h> | |
30 | #include <asl.h> | |
f3df4c03 A |
31 | #include <asl_file.h> |
32 | #include <asl_core.h> | |
81582353 | 33 | #include <Availability.h> |
f3df4c03 A |
34 | #include <os/object.h> |
35 | #include <os/object_private.h> | |
81582353 A |
36 | #include <TargetConditionals.h> |
37 | ||
f3df4c03 A |
38 | #define PATH_ASL_STORE (asl_filesystem_path(ASL_PLACE_DATABASE)) |
39 | #define PATH_ASL_ARCHIVE (asl_filesystem_path(ASL_PLACE_ARCHIVE)) | |
81582353 A |
40 | |
41 | #define FILE_ASL_STORE_DATA "StoreData" | |
42 | ||
f3df4c03 A |
43 | #define ASL_STORE_FLAG_NO_ACLS 0x00000001 |
44 | #define ASL_STORE_FLAG_NO_TTL 0x00000002 | |
45 | ||
81582353 A |
46 | #define FILE_CACHE_SIZE 64 |
47 | #define FILE_CACHE_TTL 300 | |
48 | ||
49 | typedef struct | |
50 | { | |
51 | time_t ts; | |
52 | uid_t u; | |
53 | gid_t g; | |
54 | time_t bb; | |
55 | char *path; | |
56 | asl_file_t *f; | |
57 | } asl_cached_file_t; | |
58 | ||
f3df4c03 | 59 | typedef struct asl_store_s |
81582353 | 60 | { |
f3df4c03 A |
61 | uint32_t asl_type; //ASL OBJECT HEADER |
62 | int32_t refcount; //ASL OBJECT HEADER | |
63 | uint64_t curr; | |
81582353 A |
64 | char *base_dir; |
65 | FILE *storedata; | |
66 | uint64_t next_id; | |
67 | asl_cached_file_t file_cache[FILE_CACHE_SIZE]; | |
68 | void *work; | |
69 | time_t start_today; | |
70 | time_t start_tomorrow; | |
71 | time_t last_write; | |
72 | size_t max_file_size; | |
f3df4c03 | 73 | uint32_t flags; |
81582353 A |
74 | } asl_store_t; |
75 | ||
f3df4c03 A |
76 | __BEGIN_DECLS |
77 | ||
78 | const asl_jump_table_t *asl_store_jump_table(void); | |
79 | ||
af7d442c A |
80 | uint32_t asl_store_open_write(const char *basedir, asl_store_t **s) __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)); |
81 | uint32_t asl_store_open_read(const char *basedir, asl_store_t **s) __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)); | |
82 | uint32_t asl_store_close(asl_store_t *s) __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)); | |
83 | asl_store_t *asl_store_retain(asl_store_t *s) __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)); | |
84 | void asl_store_release(asl_store_t *s) __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)); | |
85 | uint32_t asl_store_statistics(asl_store_t *s, asl_msg_t **msg) __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)); | |
f3df4c03 | 86 | |
af7d442c | 87 | uint32_t asl_store_set_flags(asl_store_t *s, uint32_t flags) __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)); |
81582353 | 88 | |
af7d442c | 89 | uint32_t asl_store_save(asl_store_t *s, asl_msg_t *msg) __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)); |
81582353 | 90 | |
af7d442c | 91 | asl_msg_list_t *asl_store_match(asl_store_t *s, asl_msg_list_t *query, uint64_t *last, uint64_t start, uint32_t count, uint32_t duration, int32_t direction) __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)); |
81582353 | 92 | |
af7d442c A |
93 | uint32_t asl_store_match_start(asl_store_t *s, uint64_t start_id, int32_t direction) __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)); |
94 | uint32_t asl_store_match_next(asl_store_t *s, asl_msg_list_t *query, asl_msg_list_t **res, uint32_t count) __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)); | |
81582353 | 95 | |
af7d442c A |
96 | uint32_t asl_store_max_file_size(asl_store_t *s, size_t max) __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)); |
97 | uint32_t asl_store_sweep_file_cache(asl_store_t *s) __API_DEPRECATED("os_log(3) has replaced asl(3)", macosx(10.5,10.12), ios(3.2,10.0), watchos(2.0,3.0), tvos(9.0,10.0)); | |
81582353 | 98 | |
af7d442c | 99 | uint32_t asl_store_open_aux(asl_store_t *s, asl_msg_t *msg, int *fd, char **url) __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)); |
f3df4c03 A |
100 | |
101 | __END_DECLS | |
81582353 A |
102 | |
103 | #endif /* __ASL_STORE_H__ */ |