OLD | NEW |
1 /* | 1 /* |
2 * SAX2.c : Default SAX2 handler to build a tree. | 2 * SAX2.c : Default SAX2 handler to build a tree. |
3 * | 3 * |
4 * See Copyright for the status of this software. | 4 * See Copyright for the status of this software. |
5 * | 5 * |
6 * Daniel Veillard <daniel@veillard.com> | 6 * Daniel Veillard <daniel@veillard.com> |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #define IN_LIBXML | 10 #define IN_LIBXML |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 #define TODO \ | 48 #define TODO \ |
49 xmlGenericError(xmlGenericErrorContext, \ | 49 xmlGenericError(xmlGenericErrorContext, \ |
50 "Unimplemented block at %s:%d\n", \ | 50 "Unimplemented block at %s:%d\n", \ |
51 __FILE__, __LINE__); | 51 __FILE__, __LINE__); |
52 | 52 |
53 /* | 53 /* |
54 * xmlSAX2ErrMemory: | 54 * xmlSAX2ErrMemory: |
55 * @ctxt: an XML validation parser context | 55 * @ctxt: an XML validation parser context |
56 * @msg: a string to accompany the error message | 56 * @msg: a string to accompany the error message |
57 */ | 57 */ |
58 static void | 58 static void LIBXML_ATTR_FORMAT(2,0) |
59 xmlSAX2ErrMemory(xmlParserCtxtPtr ctxt, const char *msg) { | 59 xmlSAX2ErrMemory(xmlParserCtxtPtr ctxt, const char *msg) { |
60 xmlStructuredErrorFunc schannel = NULL; | 60 xmlStructuredErrorFunc schannel = NULL; |
61 const char *str1 = "out of memory\n"; | 61 const char *str1 = "out of memory\n"; |
62 | 62 |
63 if (ctxt != NULL) { | 63 if (ctxt != NULL) { |
64 ctxt->errNo = XML_ERR_NO_MEMORY; | 64 ctxt->errNo = XML_ERR_NO_MEMORY; |
65 if ((ctxt->sax != NULL) && (ctxt->sax->initialized == XML_SAX2_MAGIC)) | 65 if ((ctxt->sax != NULL) && (ctxt->sax->initialized == XML_SAX2_MAGIC)) |
66 schannel = ctxt->sax->serror; | 66 schannel = ctxt->sax->serror; |
67 __xmlRaiseError(schannel, | 67 __xmlRaiseError(schannel, |
68 ctxt->vctxt.error, ctxt->vctxt.userData, | 68 ctxt->vctxt.error, ctxt->vctxt.userData, |
(...skipping 17 matching lines...) Expand all Loading... |
86 /** | 86 /** |
87 * xmlValidError: | 87 * xmlValidError: |
88 * @ctxt: an XML validation parser context | 88 * @ctxt: an XML validation parser context |
89 * @error: the error number | 89 * @error: the error number |
90 * @msg: the error message | 90 * @msg: the error message |
91 * @str1: extra data | 91 * @str1: extra data |
92 * @str2: extra data | 92 * @str2: extra data |
93 * | 93 * |
94 * Handle a validation error | 94 * Handle a validation error |
95 */ | 95 */ |
96 static void | 96 static void LIBXML_ATTR_FORMAT(3,0) |
97 xmlErrValid(xmlParserCtxtPtr ctxt, xmlParserErrors error, | 97 xmlErrValid(xmlParserCtxtPtr ctxt, xmlParserErrors error, |
98 const char *msg, const char *str1, const char *str2) | 98 const char *msg, const char *str1, const char *str2) |
99 { | 99 { |
100 xmlStructuredErrorFunc schannel = NULL; | 100 xmlStructuredErrorFunc schannel = NULL; |
101 | 101 |
102 if ((ctxt != NULL) && (ctxt->disableSAX != 0) && | 102 if ((ctxt != NULL) && (ctxt->disableSAX != 0) && |
103 (ctxt->instate == XML_PARSER_EOF)) | 103 (ctxt->instate == XML_PARSER_EOF)) |
104 return; | 104 return; |
105 if (ctxt != NULL) { | 105 if (ctxt != NULL) { |
106 ctxt->errNo = error; | 106 ctxt->errNo = error; |
(...skipping 19 matching lines...) Expand all Loading... |
126 /** | 126 /** |
127 * xmlFatalErrMsg: | 127 * xmlFatalErrMsg: |
128 * @ctxt: an XML parser context | 128 * @ctxt: an XML parser context |
129 * @error: the error number | 129 * @error: the error number |
130 * @msg: the error message | 130 * @msg: the error message |
131 * @str1: an error string | 131 * @str1: an error string |
132 * @str2: an error string | 132 * @str2: an error string |
133 * | 133 * |
134 * Handle a fatal parser error, i.e. violating Well-Formedness constraints | 134 * Handle a fatal parser error, i.e. violating Well-Formedness constraints |
135 */ | 135 */ |
136 static void | 136 static void LIBXML_ATTR_FORMAT(3,0) |
137 xmlFatalErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, | 137 xmlFatalErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, |
138 const char *msg, const xmlChar *str1, const xmlChar *str2) | 138 const char *msg, const xmlChar *str1, const xmlChar *str2) |
139 { | 139 { |
140 if ((ctxt != NULL) && (ctxt->disableSAX != 0) && | 140 if ((ctxt != NULL) && (ctxt->disableSAX != 0) && |
141 (ctxt->instate == XML_PARSER_EOF)) | 141 (ctxt->instate == XML_PARSER_EOF)) |
142 return; | 142 return; |
143 if (ctxt != NULL) | 143 if (ctxt != NULL) |
144 ctxt->errNo = error; | 144 ctxt->errNo = error; |
145 __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_PARSER, error, | 145 __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_PARSER, error, |
146 XML_ERR_FATAL, NULL, 0, | 146 XML_ERR_FATAL, NULL, 0, |
(...skipping 10 matching lines...) Expand all Loading... |
157 /** | 157 /** |
158 * xmlWarnMsg: | 158 * xmlWarnMsg: |
159 * @ctxt: an XML parser context | 159 * @ctxt: an XML parser context |
160 * @error: the error number | 160 * @error: the error number |
161 * @msg: the error message | 161 * @msg: the error message |
162 * @str1: an error string | 162 * @str1: an error string |
163 * @str2: an error string | 163 * @str2: an error string |
164 * | 164 * |
165 * Handle a parser warning | 165 * Handle a parser warning |
166 */ | 166 */ |
167 static void | 167 static void LIBXML_ATTR_FORMAT(3,0) |
168 xmlWarnMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, | 168 xmlWarnMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, |
169 const char *msg, const xmlChar *str1) | 169 const char *msg, const xmlChar *str1) |
170 { | 170 { |
171 if ((ctxt != NULL) && (ctxt->disableSAX != 0) && | 171 if ((ctxt != NULL) && (ctxt->disableSAX != 0) && |
172 (ctxt->instate == XML_PARSER_EOF)) | 172 (ctxt->instate == XML_PARSER_EOF)) |
173 return; | 173 return; |
174 if (ctxt != NULL) | 174 if (ctxt != NULL) |
175 ctxt->errNo = error; | 175 ctxt->errNo = error; |
176 __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_PARSER, error, | 176 __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_PARSER, error, |
177 XML_ERR_WARNING, NULL, 0, | 177 XML_ERR_WARNING, NULL, 0, |
178 (const char *) str1, NULL, | 178 (const char *) str1, NULL, |
179 NULL, 0, 0, msg, str1); | 179 NULL, 0, 0, msg, str1); |
180 } | 180 } |
181 | 181 |
182 /** | 182 /** |
183 * xmlNsErrMsg: | 183 * xmlNsErrMsg: |
184 * @ctxt: an XML parser context | 184 * @ctxt: an XML parser context |
185 * @error: the error number | 185 * @error: the error number |
186 * @msg: the error message | 186 * @msg: the error message |
187 * @str1: an error string | 187 * @str1: an error string |
188 * @str2: an error string | 188 * @str2: an error string |
189 * | 189 * |
190 * Handle a namespace error | 190 * Handle a namespace error |
191 */ | 191 */ |
192 static void | 192 static void LIBXML_ATTR_FORMAT(3,0) |
193 xmlNsErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, | 193 xmlNsErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, |
194 const char *msg, const xmlChar *str1, const xmlChar *str2) | 194 const char *msg, const xmlChar *str1, const xmlChar *str2) |
195 { | 195 { |
196 if ((ctxt != NULL) && (ctxt->disableSAX != 0) && | 196 if ((ctxt != NULL) && (ctxt->disableSAX != 0) && |
197 (ctxt->instate == XML_PARSER_EOF)) | 197 (ctxt->instate == XML_PARSER_EOF)) |
198 return; | 198 return; |
199 if (ctxt != NULL) | 199 if (ctxt != NULL) |
200 ctxt->errNo = error; | 200 ctxt->errNo = error; |
201 __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_NAMESPACE, error, | 201 __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_NAMESPACE, error, |
202 XML_ERR_ERROR, NULL, 0, | 202 XML_ERR_ERROR, NULL, 0, |
203 (const char *) str1, (const char *) str2, | 203 (const char *) str1, (const char *) str2, |
204 NULL, 0, 0, msg, str1, str2); | 204 NULL, 0, 0, msg, str1, str2); |
205 } | 205 } |
206 | 206 |
207 /** | 207 /** |
208 * xmlNsWarnMsg: | 208 * xmlNsWarnMsg: |
209 * @ctxt: an XML parser context | 209 * @ctxt: an XML parser context |
210 * @error: the error number | 210 * @error: the error number |
211 * @msg: the error message | 211 * @msg: the error message |
212 * @str1: an error string | 212 * @str1: an error string |
213 * | 213 * |
214 * Handle a namespace warning | 214 * Handle a namespace warning |
215 */ | 215 */ |
216 static void | 216 static void LIBXML_ATTR_FORMAT(3,0) |
217 xmlNsWarnMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, | 217 xmlNsWarnMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, |
218 const char *msg, const xmlChar *str1, const xmlChar *str2) | 218 const char *msg, const xmlChar *str1, const xmlChar *str2) |
219 { | 219 { |
220 if ((ctxt != NULL) && (ctxt->disableSAX != 0) && | 220 if ((ctxt != NULL) && (ctxt->disableSAX != 0) && |
221 (ctxt->instate == XML_PARSER_EOF)) | 221 (ctxt->instate == XML_PARSER_EOF)) |
222 return; | 222 return; |
223 if (ctxt != NULL) | 223 if (ctxt != NULL) |
224 ctxt->errNo = error; | 224 ctxt->errNo = error; |
225 __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_NAMESPACE, error, | 225 __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_NAMESPACE, error, |
226 XML_ERR_WARNING, NULL, 0, | 226 XML_ERR_WARNING, NULL, 0, |
(...skipping 2809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3036 */ | 3036 */ |
3037 void | 3037 void |
3038 docbDefaultSAXHandlerInit(void) | 3038 docbDefaultSAXHandlerInit(void) |
3039 { | 3039 { |
3040 xmlSAX2InitDocbDefaultSAXHandler((xmlSAXHandlerPtr) &docbDefaultSAXHandler); | 3040 xmlSAX2InitDocbDefaultSAXHandler((xmlSAXHandlerPtr) &docbDefaultSAXHandler); |
3041 } | 3041 } |
3042 | 3042 |
3043 #endif /* LIBXML_DOCB_ENABLED */ | 3043 #endif /* LIBXML_DOCB_ENABLED */ |
3044 #define bottom_SAX2 | 3044 #define bottom_SAX2 |
3045 #include "elfgcchack.h" | 3045 #include "elfgcchack.h" |
OLD | NEW |