Lines 46-51
Link Here
|
46 |
#error Expat is unusable -- it has been compiled for wide characters |
46 |
#error Expat is unusable -- it has been compiled for wide characters |
47 |
#endif |
47 |
#endif |
48 |
|
48 |
|
|
|
49 |
#ifndef XML_VERSION_AT_LEAST |
50 |
#define XML_VERSION_AT_LEAST(major,minor,patch) \ |
51 |
(((major) < XML_MAJOR_VERSION) \ |
52 |
|| ((major) == XML_MAJOR_VERSION && (minor) < XML_MINOR_VERSION) \ |
53 |
|| ((major) == XML_MAJOR_VERSION && (minor) == XML_MINOR_VERSION && \ |
54 |
(patch) <= XML_MICRO_VERSION)) |
55 |
#endif /* XML_VERSION_AT_LEAST */ |
56 |
|
49 |
const char * |
57 |
const char * |
50 |
svn_xml__compiled_version(void) |
58 |
svn_xml__compiled_version(void) |
51 |
{ |
59 |
{ |
Lines 361-366
Link Here
|
361 |
(*svn_parser->data_handler)(svn_parser->baton, s, (apr_size_t)len); |
369 |
(*svn_parser->data_handler)(svn_parser->baton, s, (apr_size_t)len); |
362 |
} |
370 |
} |
363 |
|
371 |
|
|
|
372 |
#if XML_VERSION_AT_LEAST(1, 95, 8) |
373 |
static void expat_entity_declaration(void *userData, |
374 |
const XML_Char *entityName, |
375 |
int is_parameter_entity, |
376 |
const XML_Char *value, |
377 |
int value_length, |
378 |
const XML_Char *base, |
379 |
const XML_Char *systemId, |
380 |
const XML_Char *publicId, |
381 |
const XML_Char *notationName) |
382 |
{ |
383 |
svn_xml_parser_t *svn_parser = userData; |
384 |
|
385 |
/* Stop the parser if an entity declaration is hit. */ |
386 |
XML_StopParser(svn_parser->parser, 0 /* resumable */); |
387 |
} |
388 |
#else |
389 |
/* A noop default_handler. */ |
390 |
static void expat_default_handler(void *userData, const XML_Char *s, int len) |
391 |
{ |
392 |
} |
393 |
#endif |
364 |
|
394 |
|
365 |
/*** Making a parser. ***/ |
395 |
/*** Making a parser. ***/ |
366 |
|
396 |
|
Lines 382-387
Link Here
|
382 |
XML_SetCharacterDataHandler(parser, |
412 |
XML_SetCharacterDataHandler(parser, |
383 |
data_handler ? expat_data_handler : NULL); |
413 |
data_handler ? expat_data_handler : NULL); |
384 |
|
414 |
|
|
|
415 |
#if XML_VERSION_AT_LEAST(1, 95, 8) |
416 |
XML_SetEntityDeclHandler(parser, expat_entity_declaration); |
417 |
#else |
418 |
XML_SetDefaultHandler(parser, expat_default_handler); |
419 |
#endif |
420 |
|
385 |
/* ### we probably don't want this pool; or at least we should pass it |
421 |
/* ### we probably don't want this pool; or at least we should pass it |
386 |
### to the callbacks and clear it periodically. */ |
422 |
### to the callbacks and clear it periodically. */ |
387 |
subpool = svn_pool_create(pool); |
423 |
subpool = svn_pool_create(pool); |
Lines 463-468
Link Here
|
463 |
/* This will cause the current XML_Parse() call to finish quickly! */ |
499 |
/* This will cause the current XML_Parse() call to finish quickly! */ |
464 |
XML_SetElementHandler(svn_parser->parser, NULL, NULL); |
500 |
XML_SetElementHandler(svn_parser->parser, NULL, NULL); |
465 |
XML_SetCharacterDataHandler(svn_parser->parser, NULL); |
501 |
XML_SetCharacterDataHandler(svn_parser->parser, NULL); |
|
|
502 |
#if XML_VERSION_AT_LEAST(1, 95, 8) |
503 |
XML_SetEntityDeclHandler(svn_parser->parser, NULL); |
504 |
#endif |
466 |
|
505 |
|
467 |
/* Once outside of XML_Parse(), the existence of this field will |
506 |
/* Once outside of XML_Parse(), the existence of this field will |
468 |
cause svn_delta_parse()'s main read-loop to return error. */ |
507 |
cause svn_delta_parse()'s main read-loop to return error. */ |