annotate plugins/jabber/xmltok.h @ 1522:31c0850f9340

[gaim-migrate @ 1532] this should fix a segfault or two committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 01 Mar 2001 10:05:18 +0000
parents afa63ac2fd84
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1347
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
1 /*
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
2 The contents of this file are subject to the Mozilla Public License
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
3 Version 1.1 (the "License"); you may not use this file except in
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
4 compliance with the License. You may obtain a copy of the License at
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
5 http://www.mozilla.org/MPL/
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
6
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
7 Software distributed under the License is distributed on an "AS IS"
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
8 basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
9 License for the specific language governing rights and limitations
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
10 under the License.
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
11
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
12 The Original Code is expat.
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
13
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
14 The Initial Developer of the Original Code is James Clark.
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
15 Portions created by James Clark are Copyright (C) 1998, 1999
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
16 James Clark. All Rights Reserved.
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
17
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
18 Contributor(s):
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
19
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
20 Alternatively, the contents of this file may be used under the terms
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
21 of the GNU General Public License (the "GPL"), in which case the
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
22 provisions of the GPL are applicable instead of those above. If you
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
23 wish to allow use of your version of this file only under the terms of
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
24 the GPL and not to allow others to use your version of this file under
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
25 the MPL, indicate your decision by deleting the provisions above and
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
26 replace them with the notice and other provisions required by the
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
27 GPL. If you do not delete the provisions above, a recipient may use
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
28 your version of this file under either the MPL or the GPL.
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
29 */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
30
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
31 #ifndef XmlTok_INCLUDED
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
32 #define XmlTok_INCLUDED 1
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
33
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
34 #ifdef __cplusplus
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
35 extern "C" {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
36 #endif
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
37
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
38 #ifndef XMLTOKAPI
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
39 #define XMLTOKAPI /* as nothing */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
40 #endif
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
41
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
42 /* The following token may be returned by XmlContentTok */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
43 #define XML_TOK_TRAILING_RSQB -5 /* ] or ]] at the end of the scan; might be start of
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
44 illegal ]]> sequence */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
45 /* The following tokens may be returned by both XmlPrologTok and XmlContentTok */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
46 #define XML_TOK_NONE -4 /* The string to be scanned is empty */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
47 #define XML_TOK_TRAILING_CR -3 /* A CR at the end of the scan;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
48 might be part of CRLF sequence */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
49 #define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
50 #define XML_TOK_PARTIAL -1 /* only part of a token */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
51 #define XML_TOK_INVALID 0
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
52
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
53 /* The following tokens are returned by XmlContentTok; some are also
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
54 returned by XmlAttributeValueTok, XmlEntityTok, XmlCdataSectionTok */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
55
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
56 #define XML_TOK_START_TAG_WITH_ATTS 1
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
57 #define XML_TOK_START_TAG_NO_ATTS 2
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
58 #define XML_TOK_EMPTY_ELEMENT_WITH_ATTS 3 /* empty element tag <e/> */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
59 #define XML_TOK_EMPTY_ELEMENT_NO_ATTS 4
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
60 #define XML_TOK_END_TAG 5
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
61 #define XML_TOK_DATA_CHARS 6
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
62 #define XML_TOK_DATA_NEWLINE 7
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
63 #define XML_TOK_CDATA_SECT_OPEN 8
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
64 #define XML_TOK_ENTITY_REF 9
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
65 #define XML_TOK_CHAR_REF 10 /* numeric character reference */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
66
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
67 /* The following tokens may be returned by both XmlPrologTok and XmlContentTok */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
68 #define XML_TOK_PI 11 /* processing instruction */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
69 #define XML_TOK_XML_DECL 12 /* XML decl or text decl */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
70 #define XML_TOK_COMMENT 13
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
71 #define XML_TOK_BOM 14 /* Byte order mark */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
72
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
73 /* The following tokens are returned only by XmlPrologTok */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
74 #define XML_TOK_PROLOG_S 15
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
75 #define XML_TOK_DECL_OPEN 16 /* <!foo */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
76 #define XML_TOK_DECL_CLOSE 17 /* > */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
77 #define XML_TOK_NAME 18
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
78 #define XML_TOK_NMTOKEN 19
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
79 #define XML_TOK_POUND_NAME 20 /* #name */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
80 #define XML_TOK_OR 21 /* | */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
81 #define XML_TOK_PERCENT 22
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
82 #define XML_TOK_OPEN_PAREN 23
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
83 #define XML_TOK_CLOSE_PAREN 24
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
84 #define XML_TOK_OPEN_BRACKET 25
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
85 #define XML_TOK_CLOSE_BRACKET 26
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
86 #define XML_TOK_LITERAL 27
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
87 #define XML_TOK_PARAM_ENTITY_REF 28
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
88 #define XML_TOK_INSTANCE_START 29
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
89
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
90 /* The following occur only in element type declarations */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
91 #define XML_TOK_NAME_QUESTION 30 /* name? */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
92 #define XML_TOK_NAME_ASTERISK 31 /* name* */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
93 #define XML_TOK_NAME_PLUS 32 /* name+ */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
94 #define XML_TOK_COND_SECT_OPEN 33 /* <![ */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
95 #define XML_TOK_COND_SECT_CLOSE 34 /* ]]> */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
96 #define XML_TOK_CLOSE_PAREN_QUESTION 35 /* )? */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
97 #define XML_TOK_CLOSE_PAREN_ASTERISK 36 /* )* */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
98 #define XML_TOK_CLOSE_PAREN_PLUS 37 /* )+ */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
99 #define XML_TOK_COMMA 38
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
100
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
101 /* The following token is returned only by XmlAttributeValueTok */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
102 #define XML_TOK_ATTRIBUTE_VALUE_S 39
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
103
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
104 /* The following token is returned only by XmlCdataSectionTok */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
105 #define XML_TOK_CDATA_SECT_CLOSE 40
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
106
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
107 /* With namespace processing this is returned by XmlPrologTok
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
108 for a name with a colon. */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
109 #define XML_TOK_PREFIXED_NAME 41
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
110
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
111 #define XML_N_STATES 3
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
112 #define XML_PROLOG_STATE 0
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
113 #define XML_CONTENT_STATE 1
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
114 #define XML_CDATA_SECTION_STATE 2
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
115
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
116 #define XML_N_LITERAL_TYPES 2
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
117 #define XML_ATTRIBUTE_VALUE_LITERAL 0
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
118 #define XML_ENTITY_VALUE_LITERAL 1
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
119
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
120 /* The size of the buffer passed to XmlUtf8Encode must be at least this. */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
121 #define XML_UTF8_ENCODE_MAX 4
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
122 /* The size of the buffer passed to XmlUtf16Encode must be at least this. */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
123 #define XML_UTF16_ENCODE_MAX 2
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
124
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
125 typedef struct position {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
126 /* first line and first column are 0 not 1 */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
127 unsigned long lineNumber;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
128 unsigned long columnNumber;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
129 } POSITION;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
130
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
131 typedef struct {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
132 const char *name;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
133 const char *valuePtr;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
134 const char *valueEnd;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
135 char normalized;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
136 } ATTRIBUTE;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
137
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
138 struct encoding;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
139 typedef struct encoding ENCODING;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
140
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
141 struct encoding {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
142 int (*scanners[XML_N_STATES])(const ENCODING *,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
143 const char *,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
144 const char *,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
145 const char **);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
146 int (*literalScanners[XML_N_LITERAL_TYPES])(const ENCODING *,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
147 const char *,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
148 const char *,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
149 const char **);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
150 int (*sameName)(const ENCODING *,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
151 const char *, const char *);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
152 int (*nameMatchesAscii)(const ENCODING *,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
153 const char *, const char *);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
154 int (*nameLength)(const ENCODING *, const char *);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
155 const char *(*skipS)(const ENCODING *, const char *);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
156 int (*getAtts)(const ENCODING *enc, const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
157 int attsMax, ATTRIBUTE *atts);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
158 int (*charRefNumber)(const ENCODING *enc, const char *ptr);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
159 int (*predefinedEntityName)(const ENCODING *, const char *, const char *);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
160 void (*updatePosition)(const ENCODING *,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
161 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
162 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
163 POSITION *);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
164 int (*isPublicId)(const ENCODING *enc, const char *ptr, const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
165 const char **badPtr);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
166 void (*utf8Convert)(const ENCODING *enc,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
167 const char **fromP,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
168 const char *fromLim,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
169 char **toP,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
170 const char *toLim);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
171 void (*utf16Convert)(const ENCODING *enc,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
172 const char **fromP,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
173 const char *fromLim,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
174 unsigned short **toP,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
175 const unsigned short *toLim);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
176 int minBytesPerChar;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
177 char isUtf8;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
178 char isUtf16;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
179 };
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
180
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
181 /*
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
182 Scan the string starting at ptr until the end of the next complete token,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
183 but do not scan past eptr. Return an integer giving the type of token.
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
184
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
185 Return XML_TOK_NONE when ptr == eptr; nextTokPtr will not be set.
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
186
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
187 Return XML_TOK_PARTIAL when the string does not contain a complete token;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
188 nextTokPtr will not be set.
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
189
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
190 Return XML_TOK_INVALID when the string does not start a valid token; nextTokPtr
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
191 will be set to point to the character which made the token invalid.
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
192
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
193 Otherwise the string starts with a valid token; nextTokPtr will be set to point
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
194 to the character following the end of that token.
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
195
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
196 Each data character counts as a single token, but adjacent data characters
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
197 may be returned together. Similarly for characters in the prolog outside
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
198 literals, comments and processing instructions.
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
199 */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
200
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
201
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
202 #define XmlTok(enc, state, ptr, end, nextTokPtr) \
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
203 (((enc)->scanners[state])(enc, ptr, end, nextTokPtr))
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
204
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
205 #define XmlPrologTok(enc, ptr, end, nextTokPtr) \
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
206 XmlTok(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
207
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
208 #define XmlContentTok(enc, ptr, end, nextTokPtr) \
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
209 XmlTok(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
210
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
211 #define XmlCdataSectionTok(enc, ptr, end, nextTokPtr) \
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
212 XmlTok(enc, XML_CDATA_SECTION_STATE, ptr, end, nextTokPtr)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
213
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
214 /* This is used for performing a 2nd-level tokenization on
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
215 the content of a literal that has already been returned by XmlTok. */
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
216
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
217 #define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
218 (((enc)->literalScanners[literalType])(enc, ptr, end, nextTokPtr))
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
219
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
220 #define XmlAttributeValueTok(enc, ptr, end, nextTokPtr) \
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
221 XmlLiteralTok(enc, XML_ATTRIBUTE_VALUE_LITERAL, ptr, end, nextTokPtr)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
222
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
223 #define XmlEntityValueTok(enc, ptr, end, nextTokPtr) \
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
224 XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr)
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
225
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
226 #define XmlSameName(enc, ptr1, ptr2) (((enc)->sameName)(enc, ptr1, ptr2))
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
227
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
228 #define XmlNameMatchesAscii(enc, ptr1, ptr2) \
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
229 (((enc)->nameMatchesAscii)(enc, ptr1, ptr2))
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
230
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
231 #define XmlNameLength(enc, ptr) \
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
232 (((enc)->nameLength)(enc, ptr))
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
233
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
234 #define XmlSkipS(enc, ptr) \
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
235 (((enc)->skipS)(enc, ptr))
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
236
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
237 #define XmlGetAttributes(enc, ptr, attsMax, atts) \
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
238 (((enc)->getAtts)(enc, ptr, attsMax, atts))
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
239
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
240 #define XmlCharRefNumber(enc, ptr) \
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
241 (((enc)->charRefNumber)(enc, ptr))
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
242
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
243 #define XmlPredefinedEntityName(enc, ptr, end) \
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
244 (((enc)->predefinedEntityName)(enc, ptr, end))
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
245
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
246 #define XmlUpdatePosition(enc, ptr, end, pos) \
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
247 (((enc)->updatePosition)(enc, ptr, end, pos))
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
248
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
249 #define XmlIsPublicId(enc, ptr, end, badPtr) \
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
250 (((enc)->isPublicId)(enc, ptr, end, badPtr))
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
251
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
252 #define XmlUtf8Convert(enc, fromP, fromLim, toP, toLim) \
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
253 (((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim))
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
254
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
255 #define XmlUtf16Convert(enc, fromP, fromLim, toP, toLim) \
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
256 (((enc)->utf16Convert)(enc, fromP, fromLim, toP, toLim))
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
257
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
258 typedef struct {
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
259 ENCODING initEnc;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
260 const ENCODING **encPtr;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
261 } INIT_ENCODING;
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
262
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
263 int XMLTOKAPI XmlParseXmlDecl(int isGeneralTextEntity,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
264 const ENCODING *enc,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
265 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
266 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
267 const char **badPtr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
268 const char **versionPtr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
269 const char **encodingNamePtr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
270 const ENCODING **namedEncodingPtr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
271 int *standalonePtr);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
272
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
273 int XMLTOKAPI XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
274 const ENCODING XMLTOKAPI *XmlGetUtf8InternalEncoding();
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
275 const ENCODING XMLTOKAPI *XmlGetUtf16InternalEncoding();
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
276 int XMLTOKAPI XmlUtf8Encode(int charNumber, char *buf);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
277 int XMLTOKAPI XmlUtf16Encode(int charNumber, unsigned short *buf);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
278
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
279 int XMLTOKAPI XmlSizeOfUnknownEncoding();
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
280 ENCODING XMLTOKAPI *
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
281 XmlInitUnknownEncoding(void *mem,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
282 int *table,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
283 int (*conv)(void *userData, const char *p),
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
284 void *userData);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
285
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
286 int XMLTOKAPI XmlParseXmlDeclNS(int isGeneralTextEntity,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
287 const ENCODING *enc,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
288 const char *ptr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
289 const char *end,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
290 const char **badPtr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
291 const char **versionPtr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
292 const char **encodingNamePtr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
293 const ENCODING **namedEncodingPtr,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
294 int *standalonePtr);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
295 int XMLTOKAPI XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
296 const ENCODING XMLTOKAPI *XmlGetUtf8InternalEncodingNS();
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
297 const ENCODING XMLTOKAPI *XmlGetUtf16InternalEncodingNS();
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
298 ENCODING XMLTOKAPI *
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
299 XmlInitUnknownEncodingNS(void *mem,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
300 int *table,
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
301 int (*conv)(void *userData, const char *p),
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
302 void *userData);
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
303 #ifdef __cplusplus
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
304 }
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
305 #endif
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
306
afa63ac2fd84 [gaim-migrate @ 1357]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
307 #endif /* not XmlTok_INCLUDED */