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

Function xmlParseNotationType

ThirdParty/libxml2/vtklibxml2/parser.c:5997–6050  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5995 */
5996
5997xmlEnumerationPtr
5998xmlParseNotationType(xmlParserCtxtPtr ctxt) {
5999 const xmlChar *name;
6000 xmlEnumerationPtr ret = NULL, last = NULL, cur, tmp;
6001
6002 if (RAW != '(') {
6003 xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_STARTED, NULL);
6004 return(NULL);
6005 }
6006 do {
6007 NEXT;
6008 SKIP_BLANKS_PE;
6009 name = xmlParseName(ctxt);
6010 if (name == NULL) {
6011 xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
6012 "Name expected in NOTATION declaration\n");
6013 xmlFreeEnumeration(ret);
6014 return(NULL);
6015 }
6016 tmp = ret;
6017 while (tmp != NULL) {
6018 if (xmlStrEqual(name, tmp->name)) {
6019 xmlValidityError(ctxt, XML_DTD_DUP_TOKEN,
6020 "standalone: attribute notation value token %s duplicated\n",
6021 name, NULL);
6022 if (!xmlDictOwns(ctxt->dict, name))
6023 xmlFree((xmlChar *) name);
6024 break;
6025 }
6026 tmp = tmp->next;
6027 }
6028 if (tmp == NULL) {
6029 cur = xmlCreateEnumeration(name);
6030 if (cur == NULL) {
6031 xmlErrMemory(ctxt);
6032 xmlFreeEnumeration(ret);
6033 return(NULL);
6034 }
6035 if (last == NULL) ret = last = cur;
6036 else {
6037 last->next = cur;
6038 last = cur;
6039 }
6040 }
6041 SKIP_BLANKS_PE;
6042 } while (RAW == '|');
6043 if (RAW != ')') {
6044 xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_FINISHED, NULL);
6045 xmlFreeEnumeration(ret);
6046 return(NULL);
6047 }
6048 NEXT;
6049 return(ret);
6050}
6051
6052/**
6053 * xmlParseEnumerationType:

Callers 1

xmlParseEnumeratedTypeFunction · 0.85

Calls 7

xmlFatalErrFunction · 0.85
xmlParseNameFunction · 0.85
xmlFreeEnumerationFunction · 0.85
xmlStrEqualFunction · 0.85
xmlDictOwnsFunction · 0.85
xmlCreateEnumerationFunction · 0.85
xmlErrMemoryFunction · 0.85

Tested by

no test coverage detected