OLD | NEW |
1 /* | 1 /* |
2 * DOCBparser.c : an attempt to parse SGML Docbook documents | 2 * DOCBparser.c : an attempt to parse SGML Docbook documents |
3 * | 3 * |
4 * This is deprecated !!! | 4 * This is deprecated !!! |
5 * Code removed with release 2.6.0 it was broken. | 5 * Code removed with release 2.6.0 it was broken. |
6 * The doc are expect to be migrated to XML DocBook | 6 * The doc are expect to be migrated to XML DocBook |
7 * | 7 * |
8 * See Copyright for the status of this software. | 8 * See Copyright for the status of this software. |
9 * | 9 * |
10 * daniel@veillard.com | 10 * daniel@veillard.com |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 xmlGenericError(xmlGenericErrorContext, | 46 xmlGenericError(xmlGenericErrorContext, |
47 "docbEncodeEntities() deprecated function reached\n"); | 47 "docbEncodeEntities() deprecated function reached\n"); |
48 deprecated = 1; | 48 deprecated = 1; |
49 } | 49 } |
50 return(-1); | 50 return(-1); |
51 } | 51 } |
52 | 52 |
53 /** | 53 /** |
54 * docbParseDocument: | 54 * docbParseDocument: |
55 * @ctxt: an SGML parser context | 55 * @ctxt: an SGML parser context |
56 * | 56 * |
57 * parse an SGML document (and build a tree if using the standard SAX | 57 * parse an SGML document (and build a tree if using the standard SAX |
58 * interface). | 58 * interface). |
59 * | 59 * |
60 * Returns 0, -1 in case of error. the parser context is augmented | 60 * Returns 0, -1 in case of error. the parser context is augmented |
61 * as a result of the parsing. | 61 * as a result of the parsing. |
62 */ | 62 */ |
63 | 63 |
64 int | 64 int |
65 docbParseDocument(docbParserCtxtPtr ctxt ATTRIBUTE_UNUSED) | 65 docbParseDocument(docbParserCtxtPtr ctxt ATTRIBUTE_UNUSED) |
66 { | 66 { |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 } | 156 } |
157 | 157 |
158 return(xmlCreatePushParserCtxt(sax, user_data, chunk, size, filename)); | 158 return(xmlCreatePushParserCtxt(sax, user_data, chunk, size, filename)); |
159 } | 159 } |
160 | 160 |
161 /** | 161 /** |
162 * docbSAXParseDoc: | 162 * docbSAXParseDoc: |
163 * @cur: a pointer to an array of xmlChar | 163 * @cur: a pointer to an array of xmlChar |
164 * @encoding: a free form C string describing the SGML document encoding, or NU
LL | 164 * @encoding: a free form C string describing the SGML document encoding, or NU
LL |
165 * @sax: the SAX handler block | 165 * @sax: the SAX handler block |
166 * @userData: if using SAX, this pointer will be provided on callbacks. | 166 * @userData: if using SAX, this pointer will be provided on callbacks. |
167 * | 167 * |
168 * parse an SGML in-memory document and build a tree. | 168 * parse an SGML in-memory document and build a tree. |
169 * It use the given SAX function block to handle the parsing callback. | 169 * It use the given SAX function block to handle the parsing callback. |
170 * If sax is NULL, fallback to the default DOM tree building routines. | 170 * If sax is NULL, fallback to the default DOM tree building routines. |
171 * | 171 * |
172 * Returns the resulting document tree | 172 * Returns the resulting document tree |
173 */ | 173 */ |
174 | 174 |
175 docbDocPtr | 175 docbDocPtr |
176 docbSAXParseDoc(xmlChar * cur ATTRIBUTE_UNUSED, | 176 docbSAXParseDoc(xmlChar * cur ATTRIBUTE_UNUSED, |
177 const char *encoding ATTRIBUTE_UNUSED, | 177 const char *encoding ATTRIBUTE_UNUSED, |
178 docbSAXHandlerPtr sax ATTRIBUTE_UNUSED, | 178 docbSAXHandlerPtr sax ATTRIBUTE_UNUSED, |
179 void *userData ATTRIBUTE_UNUSED) | 179 void *userData ATTRIBUTE_UNUSED) |
180 { | 180 { |
181 static int deprecated = 0; | 181 static int deprecated = 0; |
182 | 182 |
183 if (!deprecated) { | 183 if (!deprecated) { |
184 xmlGenericError(xmlGenericErrorContext, | 184 xmlGenericError(xmlGenericErrorContext, |
185 "docbParseChunk() deprecated function reached\n"); | 185 "docbParseChunk() deprecated function reached\n"); |
186 deprecated = 1; | 186 deprecated = 1; |
187 } | 187 } |
188 | 188 |
189 return (xmlSAXParseMemoryWithData(sax, (const char *)cur, | 189 return (xmlSAXParseMemoryWithData(sax, (const char *)cur, |
190 xmlStrlen((const xmlChar *) cur), 0, userData)); | 190 xmlStrlen((const xmlChar *) cur), 0, userData)); |
191 } | 191 } |
192 | 192 |
193 /** | 193 /** |
194 * docbParseDoc: | 194 * docbParseDoc: |
195 * @cur: a pointer to an array of xmlChar | 195 * @cur: a pointer to an array of xmlChar |
196 * @encoding: a free form C string describing the SGML document encoding, or NU
LL | 196 * @encoding: a free form C string describing the SGML document encoding, or NU
LL |
197 * | 197 * |
198 * parse an SGML in-memory document and build a tree. | 198 * parse an SGML in-memory document and build a tree. |
199 * | 199 * |
200 * Returns the resulting document tree | 200 * Returns the resulting document tree |
201 */ | 201 */ |
202 | 202 |
203 docbDocPtr | 203 docbDocPtr |
204 docbParseDoc(xmlChar * cur ATTRIBUTE_UNUSED, | 204 docbParseDoc(xmlChar * cur ATTRIBUTE_UNUSED, |
205 const char *encoding ATTRIBUTE_UNUSED) | 205 const char *encoding ATTRIBUTE_UNUSED) |
206 { | 206 { |
207 static int deprecated = 0; | 207 static int deprecated = 0; |
208 | 208 |
209 if (!deprecated) { | 209 if (!deprecated) { |
210 xmlGenericError(xmlGenericErrorContext, | 210 xmlGenericError(xmlGenericErrorContext, |
211 "docbParseChunk() deprecated function reached\n"); | 211 "docbParseChunk() deprecated function reached\n"); |
212 deprecated = 1; | 212 deprecated = 1; |
213 } | 213 } |
214 | 214 |
215 return (xmlParseDoc(cur)); | 215 return (xmlParseDoc(cur)); |
216 } | 216 } |
217 | 217 |
218 | 218 |
219 /** | 219 /** |
220 * docbCreateFileParserCtxt: | 220 * docbCreateFileParserCtxt: |
221 * @filename: the filename | 221 * @filename: the filename |
222 * @encoding: the SGML document encoding, or NULL | 222 * @encoding: the SGML document encoding, or NULL |
223 * | 223 * |
224 * Create a parser context for a file content. | 224 * Create a parser context for a file content. |
225 * Automatic support for ZLIB/Compress compressed document is provided | 225 * Automatic support for ZLIB/Compress compressed document is provided |
226 * by default if found at compile-time. | 226 * by default if found at compile-time. |
227 * | 227 * |
228 * Returns the new parser context or NULL | 228 * Returns the new parser context or NULL |
229 */ | 229 */ |
230 docbParserCtxtPtr | 230 docbParserCtxtPtr |
231 docbCreateFileParserCtxt(const char *filename ATTRIBUTE_UNUSED, | 231 docbCreateFileParserCtxt(const char *filename ATTRIBUTE_UNUSED, |
232 const char *encoding ATTRIBUTE_UNUSED) | 232 const char *encoding ATTRIBUTE_UNUSED) |
233 { | 233 { |
234 static int deprecated = 0; | 234 static int deprecated = 0; |
235 | 235 |
236 if (!deprecated) { | 236 if (!deprecated) { |
237 xmlGenericError(xmlGenericErrorContext, | 237 xmlGenericError(xmlGenericErrorContext, |
238 "docbCreateFileParserCtxt() deprecated function reached\
n"); | 238 "docbCreateFileParserCtxt() deprecated function reached\
n"); |
239 deprecated = 1; | 239 deprecated = 1; |
240 } | 240 } |
241 | 241 |
242 return (xmlCreateFileParserCtxt(filename)); | 242 return (xmlCreateFileParserCtxt(filename)); |
243 } | 243 } |
244 | 244 |
245 /** | 245 /** |
246 * docbSAXParseFile: | 246 * docbSAXParseFile: |
247 * @filename: the filename | 247 * @filename: the filename |
248 * @encoding: a free form C string describing the SGML document encoding, or NU
LL | 248 * @encoding: a free form C string describing the SGML document encoding, or NU
LL |
249 * @sax: the SAX handler block | 249 * @sax: the SAX handler block |
250 * @userData: if using SAX, this pointer will be provided on callbacks. | 250 * @userData: if using SAX, this pointer will be provided on callbacks. |
251 * | 251 * |
252 * parse an SGML file and build a tree. Automatic support for ZLIB/Compress | 252 * parse an SGML file and build a tree. Automatic support for ZLIB/Compress |
253 * compressed document is provided by default if found at compile-time. | 253 * compressed document is provided by default if found at compile-time. |
254 * It use the given SAX function block to handle the parsing callback. | 254 * It use the given SAX function block to handle the parsing callback. |
255 * If sax is NULL, fallback to the default DOM tree building routines. | 255 * If sax is NULL, fallback to the default DOM tree building routines. |
256 * | 256 * |
257 * Returns the resulting document tree | 257 * Returns the resulting document tree |
258 */ | 258 */ |
259 | 259 |
260 docbDocPtr | 260 docbDocPtr |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 xmlGenericError(xmlGenericErrorContext, | 296 xmlGenericError(xmlGenericErrorContext, |
297 "docbParseFile() deprecated function reached\n"); | 297 "docbParseFile() deprecated function reached\n"); |
298 deprecated = 1; | 298 deprecated = 1; |
299 } | 299 } |
300 | 300 |
301 return (xmlParseFile(filename)); | 301 return (xmlParseFile(filename)); |
302 } | 302 } |
303 #define bottom_DOCBparser | 303 #define bottom_DOCBparser |
304 #include "elfgcchack.h" | 304 #include "elfgcchack.h" |
305 #endif /* LIBXML_DOCB_ENABLED */ | 305 #endif /* LIBXML_DOCB_ENABLED */ |
OLD | NEW |