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

Function xmlParseName

ThirdParty/libxml2/vtklibxml2/parser.c:3371–3412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3369 */
3370
3371const xmlChar *
3372xmlParseName(xmlParserCtxtPtr ctxt) {
3373 const xmlChar *in;
3374 const xmlChar *ret;
3375 size_t count = 0;
3376 size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
3377 XML_MAX_TEXT_LENGTH :
3378 XML_MAX_NAME_LENGTH;
3379
3380 GROW;
3381
3382 /*
3383 * Accelerator for simple ASCII names
3384 */
3385 in = ctxt->input->cur;
3386 if (((*in >= 0x61) && (*in <= 0x7A)) ||
3387 ((*in >= 0x41) && (*in <= 0x5A)) ||
3388 (*in == '_') || (*in == ':')) {
3389 in++;
3390 while (((*in >= 0x61) && (*in <= 0x7A)) ||
3391 ((*in >= 0x41) && (*in <= 0x5A)) ||
3392 ((*in >= 0x30) && (*in <= 0x39)) ||
3393 (*in == '_') || (*in == '-') ||
3394 (*in == ':') || (*in == '.'))
3395 in++;
3396 if ((*in > 0) && (*in < 0x80)) {
3397 count = in - ctxt->input->cur;
3398 if (count > maxLength) {
3399 xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Name");
3400 return(NULL);
3401 }
3402 ret = xmlDictLookup(ctxt->dict, ctxt->input->cur, count);
3403 ctxt->input->cur = in;
3404 ctxt->input->col += count;
3405 if (ret == NULL)
3406 xmlErrMemory(ctxt);
3407 return(ret);
3408 }
3409 }
3410 /* accelerator for special cases */
3411 return(xmlParseNameComplex(ctxt));
3412}
3413
3414static xmlHashedString
3415xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) {

Callers 14

xmlParseNameAndCompareFunction · 0.85
xmlParsePITargetFunction · 0.85
xmlParseNotationDeclFunction · 0.85
xmlParseEntityDeclFunction · 0.85
xmlParseNotationTypeFunction · 0.85
xmlParseElementDeclFunction · 0.85
xmlParsePEReferenceFunction · 0.85
xmlParseDocTypeDeclFunction · 0.85

Calls 4

xmlFatalErrFunction · 0.85
xmlDictLookupFunction · 0.85
xmlErrMemoryFunction · 0.85
xmlParseNameComplexFunction · 0.85

Tested by

no test coverage detected