MCPcopy Create free account
hub / github.com/Kitware/VTK / LIBXML_ATTR_FORMAT

Function LIBXML_ATTR_FORMAT

ThirdParty/libxml2/vtklibxml2/xpointer.c:63–100  ·  view source on GitHub ↗

* xmlXPtrErr: * @ctxt: an XPTR evaluation context * @extra: extra information * * Handle an XPointer error */

(3,0)

Source from the content-addressed store, hash-verified

61 * Handle an XPointer error
62 */
63static void LIBXML_ATTR_FORMAT(3,0)
64xmlXPtrErr(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,

Callers

nothing calls this directly

Calls 3

xmlResetErrorFunction · 0.85
xmlStrdupFunction · 0.85
xmlXPathPErrMemoryFunction · 0.85

Tested by

no test coverage detected