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

Function xmlParseQNameAndCompare

ThirdParty/libxml2/vtklibxml2/parser.c:8699–8740  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8697 */
8698
8699static const xmlChar *
8700xmlParseQNameAndCompare(xmlParserCtxtPtr ctxt, xmlChar const *name,
8701 xmlChar const *prefix) {
8702 const xmlChar *cmp;
8703 const xmlChar *in;
8704 const xmlChar *ret;
8705 const xmlChar *prefix2;
8706
8707 if (prefix == NULL) return(xmlParseNameAndCompare(ctxt, name));
8708
8709 GROW;
8710 in = ctxt->input->cur;
8711
8712 cmp = prefix;
8713 while (*in != 0 && *in == *cmp) {
8714 ++in;
8715 ++cmp;
8716 }
8717 if ((*cmp == 0) && (*in == ':')) {
8718 in++;
8719 cmp = name;
8720 while (*in != 0 && *in == *cmp) {
8721 ++in;
8722 ++cmp;
8723 }
8724 if (*cmp == 0 && (*in == '>' || IS_BLANK_CH (*in))) {
8725 /* success */
8726 ctxt->input->col += in - ctxt->input->cur;
8727 ctxt->input->cur = in;
8728 return((const xmlChar*) 1);
8729 }
8730 }
8731 /*
8732 * all strings coms from the dictionary, equality can be done directly
8733 */
8734 ret = xmlParseQName (ctxt, &prefix2);
8735 if (ret == NULL)
8736 return(NULL);
8737 if ((ret == name) && (prefix == prefix2))
8738 return((const xmlChar*) 1);
8739 return ret;
8740}
8741
8742/**
8743 * xmlParseAttribute2:

Callers 1

xmlParseEndTag2Function · 0.85

Calls 2

xmlParseNameAndCompareFunction · 0.85
xmlParseQNameFunction · 0.85

Tested by

no test coverage detected