]>
Commit | Line | Data |
---|---|---|
f083c6c3 A |
1 | /* |
2 | * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
4f6e3300 A |
6 | * Portions Copyright (c) 2003 Apple Computer, Inc. All Rights |
7 | * Reserved. This file contains Original Code and/or Modifications of | |
8 | * Original Code as defined in and that are subject to the Apple Public | |
9 | * Source License Version 1.2 (the "License"). You may not use this file | |
10 | * except in compliance with the License. Please obtain a copy of the | |
11 | * License at http://www.apple.com/publicsource and read it before using | |
12 | * this file. | |
f083c6c3 A |
13 | * |
14 | * The Original Code and all software distributed under the License are | |
4f6e3300 | 15 | * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER |
f083c6c3 A |
16 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
17 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
4f6e3300 A |
18 | * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the |
19 | * License for the specific language governing rights and limitations | |
20 | * under the License. | |
f083c6c3 A |
21 | * |
22 | * @APPLE_LICENSE_HEADER_END@ | |
23 | */ | |
24 | ||
25 | #ifndef __LIBSAIO_XML_H | |
26 | #define __LIBSAIO_XML_H | |
27 | ||
28 | enum { | |
29 | kTagTypeNone = 0, | |
30 | kTagTypeDict, | |
31 | kTagTypeKey, | |
32 | kTagTypeString, | |
33 | kTagTypeInteger, | |
34 | kTagTypeData, | |
35 | kTagTypeDate, | |
36 | kTagTypeFalse, | |
37 | kTagTypeTrue, | |
38 | kTagTypeArray | |
39 | }; | |
40 | ||
41 | #define kXMLTagPList "plist " | |
42 | #define kXMLTagDict "dict" | |
43 | #define kXMLTagKey "key" | |
44 | #define kXMLTagString "string" | |
45 | #define kXMLTagInteger "integer" | |
46 | #define kXMLTagData "data" | |
47 | #define kXMLTagDate "date" | |
48 | #define kXMLTagFalse "false/" | |
49 | #define kXMLTagTrue "true/" | |
50 | #define kXMLTagArray "array" | |
51 | ||
52 | ||
53 | #define kPropCFBundleIdentifier ("CFBundleIdentifier") | |
54 | #define kPropCFBundleExecutable ("CFBundleExecutable") | |
55 | #define kPropOSBundleRequired ("OSBundleRequired") | |
56 | #define kPropOSBundleLibraries ("OSBundleLibraries") | |
57 | #define kPropIOKitPersonalities ("IOKitPersonalities") | |
58 | #define kPropIONameMatch ("IONameMatch") | |
59 | ||
60 | struct Tag { | |
61 | long type; | |
62 | char *string; | |
63 | struct Tag *tag; | |
64 | struct Tag *tagNext; | |
65 | }; | |
66 | typedef struct Tag Tag, *TagPtr; | |
67 | ||
68 | extern long gImageFirstBootXAddr; | |
69 | extern long gImageLastKernelAddr; | |
70 | ||
71 | TagPtr XMLGetProperty( TagPtr dict, const char * key ); | |
72 | long XMLParseNextTag(char *buffer, TagPtr *tag); | |
73 | void XMLFreeTag(TagPtr tag); | |
74 | //========================================================================== | |
75 | // XMLParseFile | |
76 | // Expects to see one dictionary in the XML file. | |
77 | // Puts the first dictionary it finds in the | |
78 | // tag pointer and returns 0, or returns -1 if not found. | |
79 | // | |
80 | long XMLParseFile( char * buffer, TagPtr * dict ); | |
81 | ||
82 | #if 0 | |
83 | // BootX shim functions | |
84 | ||
85 | extern long AllocateBootXMemory( long inSize ); | |
86 | extern long InitBootXMemorySupport(void); | |
87 | #endif | |
88 | ||
89 | #endif /* __LIBSAIO_XML_H */ |