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

Function LIBXML_ATTR_FORMAT

ThirdParty/libxml2/vtklibxml2/HTMLparser.c:76–139  ·  view source on GitHub ↗

* htmlParseErr: * @ctxt: an HTML parser context * @error: the error number * @msg: the error message * @str1: string infor * @str2: string infor * * Handle a fatal parser error, i.e. violating Well-Formedness constraints */

(3,0)

Source from the content-addressed store, hash-verified

74 * Handle a fatal parser error, i.e. violating Well-Formedness constraints
75 */
76static void LIBXML_ATTR_FORMAT(3,0)
77htmlParseErr(xmlParserCtxtPtr ctxt, xmlParserErrors error,
78 const char *msg, const xmlChar *str1, const xmlChar *str2)
79{
80 xmlCtxtErr(ctxt, NULL, XML_FROM_HTML, error, XML_ERR_ERROR,
81 str1, str2, NULL, 0, msg, str1, str2);
82}
83
84/**
85 * htmlParseErrInt:
86 * @ctxt: an HTML parser context
87 * @error: the error number
88 * @msg: the error message
89 * @val: integer info
90 *
91 * Handle a fatal parser error, i.e. violating Well-Formedness constraints
92 */
93static void LIBXML_ATTR_FORMAT(3,0)
94htmlParseErrInt(xmlParserCtxtPtr ctxt, xmlParserErrors error,
95 const char *msg, int val)
96{
97 xmlCtxtErr(ctxt, NULL, XML_FROM_HTML, error, XML_ERR_ERROR,
98 NULL, NULL, NULL, val, msg, val);
99}
100
101/************************************************************************
102 * *
103 * Parser stacks related functions and macros *
104 * *
105 ************************************************************************/
106
107/**
108 * htmlnamePush:
109 * @ctxt: an HTML parser context
110 * @value: the element name
111 *
112 * Pushes a new element name on top of the name stack
113 *
114 * Returns -1 in case of error, the index in the stack otherwise
115 */
116static int
117htmlnamePush(htmlParserCtxtPtr ctxt, const xmlChar * value)
118{
119 if ((ctxt->html < 3) && (xmlStrEqual(value, BAD_CAST "head")))
120 ctxt->html = 3;
121 if ((ctxt->html < 10) && (xmlStrEqual(value, BAD_CAST "body")))
122 ctxt->html = 10;
123 if (ctxt->nameNr >= ctxt->nameMax) {
124 size_t newSize = ctxt->nameMax * 2;
125 const xmlChar **tmp;
126
127 tmp = xmlRealloc((xmlChar **) ctxt->nameTab,
128 newSize * sizeof(ctxt->nameTab[0]));
129 if (tmp == NULL) {
130 htmlErrMemory(ctxt);
131 return (-1);
132 }
133 ctxt->nameTab = tmp;

Callers

nothing calls this directly

Calls 2

xmlStrEqualFunction · 0.85
htmlErrMemoryFunction · 0.85

Tested by

no test coverage detected