]>
Commit | Line | Data |
---|---|---|
57b0aad2 A |
1 | /* |
2 | * Copyright (c) 2007-2008 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_mini_memory_H__ | |
25 | #define __asl_mini_memory_H__ | |
26 | #include <stdint.h> | |
27 | #include <asl.h> | |
28 | ||
29 | #define ASL_MINI_MSG_FLAG_SEARCH_MATCH 0x80 | |
30 | #define ASL_MINI_MSG_FLAG_SEARCH_CLEAR 0x7f | |
31 | ||
32 | typedef struct | |
33 | { | |
34 | uint32_t hash; | |
35 | uint32_t refcount; | |
36 | char str[]; | |
37 | } mini_mem_string_t; | |
38 | ||
39 | typedef struct | |
40 | { | |
41 | uint32_t mid; | |
42 | uint64_t time; | |
43 | uint8_t level; | |
44 | uint8_t flags; | |
45 | uint32_t pid; | |
46 | uint32_t uid; | |
47 | uint32_t gid; | |
48 | uint32_t kvcount; | |
49 | mini_mem_string_t *sender; | |
50 | mini_mem_string_t *facility; | |
51 | mini_mem_string_t *message; | |
52 | mini_mem_string_t **kvlist; | |
53 | } mini_mem_record_t; | |
54 | ||
55 | typedef struct | |
56 | { | |
57 | uint32_t next_id; | |
58 | uint32_t string_count; | |
59 | void **string_cache; | |
60 | uint32_t record_count; | |
61 | uint32_t record_first; | |
62 | mini_mem_record_t **record; | |
63 | mini_mem_record_t *buffer_record; | |
64 | } asl_mini_memory_t; | |
65 | ||
66 | uint32_t asl_mini_memory_open(uint32_t max_records, asl_mini_memory_t **s); | |
67 | uint32_t asl_mini_memory_close(asl_mini_memory_t *s); | |
68 | uint32_t asl_mini_memory_statistics(asl_mini_memory_t *s, aslmsg *msg); | |
69 | ||
70 | uint32_t asl_mini_memory_save(asl_mini_memory_t *s, aslmsg msg, uint64_t *mid); | |
71 | uint32_t asl_mini_memory_fetch(asl_mini_memory_t *s, uint64_t mid, aslmsg *msg); | |
72 | ||
73 | uint32_t asl_mini_memory_match(asl_mini_memory_t *s, aslresponse query, aslresponse *res, uint64_t *last_id, uint64_t start_id, uint32_t count, int32_t direction); | |
74 | ||
75 | #endif __asl_mini_memory_H__ |