| 3549 | } |
| 3550 | |
| 3551 | static enum XML_Error PTRCALL |
| 3552 | externalParEntProcessor(XML_Parser parser, |
| 3553 | const char *s, |
| 3554 | const char *end, |
| 3555 | const char **nextPtr) |
| 3556 | { |
| 3557 | const char *next = s; |
| 3558 | int tok; |
| 3559 | |
| 3560 | tok = XmlPrologTok(encoding, s, end, &next); |
| 3561 | if (tok <= 0) { |
| 3562 | if (!ps_finalBuffer && tok != XML_TOK_INVALID) { |
| 3563 | *nextPtr = s; |
| 3564 | return XML_ERROR_NONE; |
| 3565 | } |
| 3566 | switch (tok) { |
| 3567 | case XML_TOK_INVALID: |
| 3568 | return XML_ERROR_INVALID_TOKEN; |
| 3569 | case XML_TOK_PARTIAL: |
| 3570 | return XML_ERROR_UNCLOSED_TOKEN; |
| 3571 | case XML_TOK_PARTIAL_CHAR: |
| 3572 | return XML_ERROR_PARTIAL_CHAR; |
| 3573 | case XML_TOK_NONE: /* start == end */ |
| 3574 | default: |
| 3575 | break; |
| 3576 | } |
| 3577 | } |
| 3578 | /* This would cause the next stage, i.e. doProlog to be passed XML_TOK_BOM. |
| 3579 | However, when parsing an external subset, doProlog will not accept a BOM |
| 3580 | as valid, and report a syntax error, so we have to skip the BOM |
| 3581 | */ |
| 3582 | else if (tok == XML_TOK_BOM) { |
| 3583 | s = next; |
| 3584 | tok = XmlPrologTok(encoding, s, end, &next); |
| 3585 | } |
| 3586 | |
| 3587 | processor = prologProcessor; |
| 3588 | return doProlog(parser, encoding, s, end, tok, next, |
| 3589 | nextPtr, (XML_Bool)!ps_finalBuffer); |
| 3590 | } |
| 3591 | |
| 3592 | static enum XML_Error PTRCALL |
| 3593 | entityValueProcessor(XML_Parser parser, |
no test coverage detected