* xmlXPtrErr: * @ctxt: an XPTR evaluation context * @extra: extra information * * Handle an XPointer error */
(3,0)
| 61 | * Handle an XPointer error |
| 62 | */ |
| 63 | static void LIBXML_ATTR_FORMAT(3,0) |
| 64 | xmlXPtrErr(xmlXPathParserContextPtr ctxt, int code, |
| 65 | const char * msg, const xmlChar *extra) |
| 66 | { |
| 67 | xmlStructuredErrorFunc serror = NULL; |
| 68 | void *data = NULL; |
| 69 | xmlNodePtr node = NULL; |
| 70 | int res; |
| 71 | |
| 72 | if (ctxt == NULL) |
| 73 | return; |
| 74 | /* Only report the first error */ |
| 75 | if (ctxt->error != 0) |
| 76 | return; |
| 77 | |
| 78 | ctxt->error = code; |
| 79 | |
| 80 | if (ctxt->context != NULL) { |
| 81 | xmlErrorPtr err = &ctxt->context->lastError; |
| 82 | |
| 83 | /* cleanup current last error */ |
| 84 | xmlResetError(err); |
| 85 | |
| 86 | err->domain = XML_FROM_XPOINTER; |
| 87 | err->code = code; |
| 88 | err->level = XML_ERR_ERROR; |
| 89 | err->str1 = (char *) xmlStrdup(ctxt->base); |
| 90 | if (err->str1 == NULL) { |
| 91 | xmlXPathPErrMemory(ctxt); |
| 92 | return; |
| 93 | } |
| 94 | err->int1 = ctxt->cur - ctxt->base; |
| 95 | err->node = ctxt->context->debugNode; |
| 96 | |
| 97 | serror = ctxt->context->error; |
| 98 | data = ctxt->context->userData; |
| 99 | node = ctxt->context->debugNode; |
| 100 | } |
| 101 | |
| 102 | res = __xmlRaiseError(serror, NULL, data, NULL, node, |
| 103 | XML_FROM_XPOINTER, code, XML_ERR_ERROR, NULL, 0, |
nothing calls this directly
no test coverage detected