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