22
22
#ifdef LIBXML_EXPAT_COMPAT
23
23
24
24
static void
25
- _qualify_namespace (XML_Parser parser , const xmlChar * name , const xmlChar * URI , xmlChar * * qualified )
25
+ qualify_namespace (XML_Parser parser , const xmlChar * name , const xmlChar * URI , xmlChar * * qualified )
26
26
{
27
27
if (URI ) {
28
28
/* Use libxml functions otherwise its memory deallocation is screwed up */
@@ -35,7 +35,7 @@ _qualify_namespace(XML_Parser parser, const xmlChar *name, const xmlChar *URI, x
35
35
}
36
36
37
37
static void
38
- _start_element_handler (void * user , const xmlChar * name , const xmlChar * * attributes )
38
+ start_element_handler (void * user , const xmlChar * name , const xmlChar * * attributes )
39
39
{
40
40
XML_Parser parser = (XML_Parser ) user ;
41
41
xmlChar * qualified_name = NULL ;
@@ -71,7 +71,7 @@ _start_element_handler(void *user, const xmlChar *name, const xmlChar **attribut
71
71
}
72
72
73
73
static void
74
- _start_element_handler_ns (void * user , const xmlChar * name , const xmlChar * prefix , const xmlChar * URI , int nb_namespaces , const xmlChar * * namespaces , int nb_attributes , int nb_defaulted , const xmlChar * * attributes )
74
+ start_element_handler_ns (void * user , const xmlChar * name , const xmlChar * prefix , const xmlChar * URI , int nb_namespaces , const xmlChar * * namespaces , int nb_attributes , int nb_defaulted , const xmlChar * * attributes )
75
75
{
76
76
XML_Parser parser = (XML_Parser ) user ;
77
77
xmlChar * qualified_name = NULL ;
@@ -150,7 +150,7 @@ _start_element_handler_ns(void *user, const xmlChar *name, const xmlChar *prefix
150
150
}
151
151
return ;
152
152
}
153
- _qualify_namespace (parser , name , URI , & qualified_name );
153
+ qualify_namespace (parser , name , URI , & qualified_name );
154
154
155
155
if (attributes != NULL ) {
156
156
xmlChar * qualified_name_attr = NULL ;
@@ -159,7 +159,7 @@ _start_element_handler_ns(void *user, const xmlChar *name, const xmlChar *prefix
159
159
for (i = 0 ; i < nb_attributes ; i += 1 ) {
160
160
161
161
if (attributes [y + 1 ] != NULL ) {
162
- _qualify_namespace (parser , attributes [y ] , attributes [y + 2 ], & qualified_name_attr );
162
+ qualify_namespace (parser , attributes [y ] , attributes [y + 2 ], & qualified_name_attr );
163
163
} else {
164
164
qualified_name_attr = xmlStrdup (attributes [y ]);
165
165
}
@@ -182,7 +182,7 @@ _start_element_handler_ns(void *user, const xmlChar *name, const xmlChar *prefix
182
182
}
183
183
184
184
static void
185
- _end_element_handler (void * user , const xmlChar * name )
185
+ end_element_handler (void * user , const xmlChar * name )
186
186
{
187
187
XML_Parser parser = (XML_Parser ) user ;
188
188
@@ -201,7 +201,7 @@ _end_element_handler(void *user, const xmlChar *name)
201
201
}
202
202
203
203
static void
204
- _end_element_handler_ns (void * user , const xmlChar * name , const xmlChar * prefix , const xmlChar * URI )
204
+ end_element_handler_ns (void * user , const xmlChar * name , const xmlChar * prefix , const xmlChar * URI )
205
205
{
206
206
xmlChar * qualified_name ;
207
207
XML_Parser parser = (XML_Parser ) user ;
@@ -222,15 +222,15 @@ _end_element_handler_ns(void *user, const xmlChar *name, const xmlChar * prefix,
222
222
return ;
223
223
}
224
224
225
- _qualify_namespace (parser , name , URI , & qualified_name );
225
+ qualify_namespace (parser , name , URI , & qualified_name );
226
226
227
227
parser -> h_end_element (parser -> user , (const XML_Char * ) qualified_name );
228
228
229
229
xmlFree (qualified_name );
230
230
}
231
231
232
232
static void
233
- _cdata_handler (void * user , const xmlChar * cdata , int cdata_len )
233
+ cdata_handler (void * user , const xmlChar * cdata , int cdata_len )
234
234
{
235
235
XML_Parser parser = (XML_Parser ) user ;
236
236
@@ -245,7 +245,7 @@ _cdata_handler(void *user, const xmlChar *cdata, int cdata_len)
245
245
}
246
246
247
247
static void
248
- _pi_handler (void * user , const xmlChar * target , const xmlChar * data )
248
+ pi_handler (void * user , const xmlChar * target , const xmlChar * data )
249
249
{
250
250
XML_Parser parser = (XML_Parser ) user ;
251
251
@@ -263,7 +263,7 @@ _pi_handler(void *user, const xmlChar *target, const xmlChar *data)
263
263
}
264
264
265
265
static void
266
- _unparsed_entity_decl_handler (void * user ,
266
+ unparsed_entity_decl_handler (void * user ,
267
267
const xmlChar * name ,
268
268
const xmlChar * pub_id ,
269
269
const xmlChar * sys_id ,
@@ -279,7 +279,7 @@ _unparsed_entity_decl_handler(void *user,
279
279
}
280
280
281
281
static void
282
- _notation_decl_handler (void * user , const xmlChar * notation , const xmlChar * pub_id , const xmlChar * sys_id )
282
+ notation_decl_handler (void * user , const xmlChar * notation , const xmlChar * pub_id , const xmlChar * sys_id )
283
283
{
284
284
XML_Parser parser = (XML_Parser ) user ;
285
285
@@ -291,7 +291,7 @@ _notation_decl_handler(void *user, const xmlChar *notation, const xmlChar *pub_i
291
291
}
292
292
293
293
static void
294
- _build_comment (const xmlChar * data , size_t data_len , xmlChar * * comment , size_t * comment_len )
294
+ build_comment (const xmlChar * data , size_t data_len , xmlChar * * comment , size_t * comment_len )
295
295
{
296
296
* comment_len = data_len + 7 ;
297
297
@@ -304,22 +304,22 @@ _build_comment(const xmlChar *data, size_t data_len, xmlChar **comment, size_t *
304
304
}
305
305
306
306
static void
307
- _comment_handler (void * user , const xmlChar * comment )
307
+ comment_handler (void * user , const xmlChar * comment )
308
308
{
309
309
XML_Parser parser = (XML_Parser ) user ;
310
310
311
311
if (parser -> h_default ) {
312
312
xmlChar * d_comment ;
313
313
size_t d_comment_len ;
314
314
315
- _build_comment (comment , (size_t ) xmlStrlen (comment ), & d_comment , & d_comment_len );
315
+ build_comment (comment , (size_t ) xmlStrlen (comment ), & d_comment , & d_comment_len );
316
316
parser -> h_default (parser -> user , d_comment , d_comment_len );
317
317
xmlFree (d_comment );
318
318
}
319
319
}
320
320
321
321
static void
322
- _build_entity (const xmlChar * name , size_t len , xmlChar * * entity , size_t * entity_len )
322
+ build_entity (const xmlChar * name , size_t len , xmlChar * * entity , size_t * entity_len )
323
323
{
324
324
* entity_len = len + 2 ;
325
325
* entity = xmlMalloc (* entity_len + 1 );
@@ -330,7 +330,7 @@ _build_entity(const xmlChar *name, size_t len, xmlChar **entity, size_t *entity_
330
330
}
331
331
332
332
static void
333
- _external_entity_ref_handler (void * user , const xmlChar * names , const xmlChar * sys_id , const xmlChar * pub_id )
333
+ external_entity_ref_handler (void * user , const xmlChar * names , const xmlChar * sys_id , const xmlChar * pub_id )
334
334
{
335
335
XML_Parser parser = (XML_Parser ) user ;
336
336
@@ -345,7 +345,7 @@ _external_entity_ref_handler(void *user, const xmlChar *names, const xmlChar *sy
345
345
}
346
346
347
347
static xmlEntityPtr
348
- _get_entity (void * user , const xmlChar * name )
348
+ get_entity (void * user , const xmlChar * name )
349
349
{
350
350
XML_Parser parser = (XML_Parser ) user ;
351
351
xmlEntityPtr ret = NULL ;
@@ -362,7 +362,7 @@ _get_entity(void *user, const xmlChar *name)
362
362
xmlChar * entity ;
363
363
size_t len ;
364
364
365
- _build_entity (name , (size_t ) xmlStrlen (name ), & entity , & len );
365
+ build_entity (name , (size_t ) xmlStrlen (name ), & entity , & len );
366
366
parser -> h_default (parser -> user , (const xmlChar * ) entity , len );
367
367
xmlFree (entity );
368
368
} else {
@@ -374,7 +374,7 @@ _get_entity(void *user, const xmlChar *name)
374
374
}
375
375
} else {
376
376
if (ret -> etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY ) {
377
- _external_entity_ref_handler (user , ret -> name , ret -> SystemID , ret -> ExternalID );
377
+ external_entity_ref_handler (user , ret -> name , ret -> SystemID , ret -> ExternalID );
378
378
}
379
379
}
380
380
}
@@ -390,32 +390,32 @@ php_xml_compat_handlers = {
390
390
NULL , /* hasInternalSubset */
391
391
NULL , /* hasExternalSubset */
392
392
NULL , /* resolveEntity */
393
- _get_entity , /* getEntity */
393
+ get_entity , /* getEntity */
394
394
NULL , /* entityDecl */
395
- _notation_decl_handler ,
395
+ notation_decl_handler ,
396
396
NULL , /* attributeDecl */
397
397
NULL , /* elementDecl */
398
- _unparsed_entity_decl_handler , /* unparsedEntity */
398
+ unparsed_entity_decl_handler , /* unparsedEntity */
399
399
NULL , /* setDocumentLocator */
400
400
NULL , /* startDocument */
401
401
NULL , /* endDocument */
402
- _start_element_handler , /* startElement */
403
- _end_element_handler , /* endElement */
402
+ start_element_handler , /* startElement */
403
+ end_element_handler , /* endElement */
404
404
NULL , /* reference */
405
- _cdata_handler ,
405
+ cdata_handler ,
406
406
NULL , /* ignorableWhitespace */
407
- _pi_handler ,
408
- _comment_handler , /* comment */
407
+ pi_handler ,
408
+ comment_handler , /* comment */
409
409
NULL , /* warning */
410
410
NULL , /* error */
411
411
NULL , /* fatalError */
412
412
NULL , /* getParameterEntity */
413
- _cdata_handler , /* cdataBlock */
413
+ cdata_handler , /* cdataBlock */
414
414
NULL , /* externalSubset */
415
415
XML_SAX2_MAGIC ,
416
416
NULL ,
417
- _start_element_handler_ns ,
418
- _end_element_handler_ns ,
417
+ start_element_handler_ns ,
418
+ end_element_handler_ns ,
419
419
NULL
420
420
};
421
421
@@ -439,8 +439,8 @@ XML_ParserCreate_MM(const XML_Char *encoding, const XML_Memory_Handling_Suite *m
439
439
{
440
440
XML_Parser parser ;
441
441
442
- parser = ( XML_Parser ) emalloc (sizeof (struct _XML_Parser ));
443
- memset (parser , 0 , sizeof (struct _XML_Parser ));
442
+ parser = emalloc (sizeof (struct XML_Parser_Struct ));
443
+ memset (parser , 0 , sizeof (struct XML_Parser_Struct ));
444
444
parser -> use_namespace = 0 ;
445
445
parser -> _ns_separator = NULL ;
446
446
0 commit comments