Chameleon

Chameleon Svn Source Tree

Root/branches/meklortOld/i386/libsaio/xml.h

Source at commit 1146 created 12 years 10 months ago.
By azimutz, Sync with trunk (r1145). Add nVidia dev id's, 0DF4 for "GeForce GT 450M" (issue 99) and 1251 for "GeForce GTX 560M" (thanks to oSxFr33k for testing).
1/*
2 * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
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 2.0 (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.
13 *
14 * The Original Code and all software distributed under the License are
15 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
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.
21 *
22 * @APPLE_LICENSE_HEADER_END@
23 */
24
25#ifndef __LIBSAIO_XML_H
26#define __LIBSAIO_XML_H
27
28enum xmltype {
29 kTagTypeNone = 0,
30 kTagTypeDict,
31 kTagTypeKey,
32 kTagTypeString,
33 kTagTypeInteger,
34 kTagTypeData,
35 kTagTypeDate,
36 kTagTypeFalse,
37 kTagTypeTrue,
38 kTagTypeArray
39};
40
41
42struct string_ref
43{
44char* string;
45int id;
46struct string_ref* next;
47};
48typedef struct string_ref string_ref;
49
50extern string_ref* ref_strings;
51
52#define kXMLTagPList "plist "
53#define kXMLTagDict "dict"
54#define kXMLTagKey "key"
55#define kXMLTagString "string"
56#define kXMLTagInteger "integer"
57#define kXMLTagData "data"
58#define kXMLTagDate "date"
59#define kXMLTagFalse "false/"
60#define kXMLTagTrue "true/"
61#define kXMLTagArray "array"
62
63#define kXMLStringID"ID="
64#define kXMLStringIDRef "IDREF="
65
66
67#define kPropCFBundleIdentifier ("CFBundleIdentifier")
68#define kPropCFBundleExecutable ("CFBundleExecutable")
69#define kPropOSBundleRequired ("OSBundleRequired")
70#define kPropOSBundleLibraries ("OSBundleLibraries")
71#define kPropIOKitPersonalities ("IOKitPersonalities")
72#define kPropIONameMatch ("IONameMatch")
73
74/*
75struct Tag {
76 long type;
77 char *string;
78 struct Tag *tag;
79 struct Tag *tagNext;
80};
81typedef struct Tag Tag, *TagPtr;
82 */
83
84extern long gImageFirstBootXAddr;
85extern long gImageLastKernelAddr;
86
87TagPtr XMLGetProperty( TagPtr dict, const char * key );
88TagPtr XMLGetElement( TagPtr dict, int id );
89int XMLTagCount( TagPtr dict );
90
91bool XMLIsType(TagPtr dict, enum xmltype type);
92
93bool XMLCastBoolean( TagPtr dict );
94char* XMLCastString( TagPtr dict );
95long XMLCastStringOffset(TagPtr dict);
96int XMLCastInteger ( TagPtr dict );
97TagPtr XMLCastDict ( TagPtr dict );
98TagPtr XMLCastArray( TagPtr dict );
99
100long XMLParseNextTag(char *buffer, TagPtr *tag);
101void XMLFreeTag(TagPtr tag);
102char* XMLDecode(const char *in);
103//==========================================================================
104// XMLParseFile
105// Expects to see one dictionary in the XML file.
106// Puts the first dictionary it finds in the
107// tag pointer and returns 0, or returns -1 if not found.
108//
109long XMLParseFile( char * buffer, TagPtr * dict );
110
111#endif /* __LIBSAIO_XML_H */
112

Archive Download this file

Revision: 1146