]>
Commit | Line | Data |
---|---|---|
f3df4c03 A |
1 | #ifndef __ASL_STRING_H__ |
2 | #define __ASL_STRING_H__ | |
3 | ||
4 | /* | |
5 | * Copyright (c) 2007-2013 Apple Inc. All rights reserved. | |
6 | * | |
7 | * @APPLE_LICENSE_HEADER_START@ | |
8 | * | |
9 | * This file contains Original Code and/or Modifications of Original Code | |
10 | * as defined in and that are subject to the Apple Public Source License | |
11 | * Version 2.0 (the 'License'). You may not use this file except in | |
12 | * compliance with the License. Please obtain a copy of the License at | |
13 | * http://www.opensource.apple.com/apsl/ and read it before using this | |
14 | * file. | |
15 | * | |
16 | * The Original Code and all software distributed under the License are | |
17 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
18 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
19 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
20 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | |
21 | * Please see the License for the specific language governing rights and | |
22 | * limitations under the License. | |
23 | * | |
24 | * @APPLE_LICENSE_HEADER_END@ | |
25 | */ | |
26 | ||
27 | #define ASL_ENCODE_MASK 0x0000000f | |
28 | #define ASL_STRING_VM 0x80000000 | |
29 | #define ASL_STRING_LEN 0x40000000 | |
30 | #define ASL_STRING_MIG 0xc0000002 | |
31 | ||
32 | typedef struct | |
33 | { | |
34 | uint32_t asl_type; //ASL OBJECT HEADER | |
35 | int32_t refcount; //ASL OBJECT HEADER | |
36 | uint32_t encoding; | |
37 | size_t delta; | |
38 | size_t bufsize; | |
39 | size_t cursor; | |
40 | char *buf; | |
41 | } asl_string_t; | |
42 | ||
43 | asl_string_t *asl_string_new(uint32_t encoding) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1); | |
44 | asl_string_t *asl_string_retain(asl_string_t *str) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1); | |
45 | void asl_string_release(asl_string_t *str) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1); | |
46 | char *asl_string_release_return_bytes(asl_string_t *str) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1); | |
47 | char *asl_string_bytes(asl_string_t *str) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1); | |
48 | size_t asl_string_length(asl_string_t *str) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1); | |
49 | size_t asl_string_allocated_size(asl_string_t *str) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1); | |
50 | asl_string_t *asl_string_append(asl_string_t *str, const char *app) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1); | |
51 | asl_string_t *asl_string_append_asl_key(asl_string_t *str, const char *app) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1); | |
52 | asl_string_t *asl_string_append_op(asl_string_t *str, uint32_t op) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1); | |
53 | asl_string_t *asl_string_append_no_encoding(asl_string_t *str, const char *app) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1); | |
54 | asl_string_t *asl_string_append_char_no_encoding(asl_string_t *str, const char c) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1); | |
55 | asl_string_t *asl_string_append_xml_tag(asl_string_t *str, const char *tag, const char *s) __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_5_1); | |
56 | ||
57 | #endif /* __ASL_STRING_H__ */ |