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

Function xmlSchemaFindRedefCompInGraph

ThirdParty/libxml2/vtklibxml2/xmlschemas.c:4996–5075  ·  view source on GitHub ↗

* xmlSchemaFindRedefCompInGraph: * ATTENTION TODO: This uses pointer comp. for strings. */

Source from the content-addressed store, hash-verified

4994* ATTENTION TODO: This uses pointer comp. for strings.
4995*/
4996static xmlSchemaBasicItemPtr
4997xmlSchemaFindRedefCompInGraph(xmlSchemaBucketPtr bucket,
4998 xmlSchemaTypeType type,
4999 const xmlChar *name,
5000 const xmlChar *nsName)
5001{
5002 xmlSchemaBasicItemPtr ret;
5003 int i;
5004
5005 if ((bucket == NULL) || (name == NULL))
5006 return(NULL);
5007 if ((bucket->globals == NULL) ||
5008 (bucket->globals->nbItems == 0))
5009 goto subschemas;
5010 /*
5011 * Search in global components.
5012 */
5013 for (i = 0; i < bucket->globals->nbItems; i++) {
5014 ret = bucket->globals->items[i];
5015 if (ret->type == type) {
5016 switch (type) {
5017 case XML_SCHEMA_TYPE_COMPLEX:
5018 case XML_SCHEMA_TYPE_SIMPLE:
5019 if ((WXS_COMP_NAME(ret, xmlSchemaTypePtr) == name) &&
5020 (WXS_COMP_TNS(ret, xmlSchemaTypePtr) ==
5021 nsName))
5022 {
5023 return(ret);
5024 }
5025 break;
5026 case XML_SCHEMA_TYPE_GROUP:
5027 if ((WXS_COMP_NAME(ret,
5028 xmlSchemaModelGroupDefPtr) == name) &&
5029 (WXS_COMP_TNS(ret,
5030 xmlSchemaModelGroupDefPtr) == nsName))
5031 {
5032 return(ret);
5033 }
5034 break;
5035 case XML_SCHEMA_TYPE_ATTRIBUTEGROUP:
5036 if ((WXS_COMP_NAME(ret,
5037 xmlSchemaAttributeGroupPtr) == name) &&
5038 (WXS_COMP_TNS(ret,
5039 xmlSchemaAttributeGroupPtr) == nsName))
5040 {
5041 return(ret);
5042 }
5043 break;
5044 default:
5045 /* Should not be hit. */
5046 return(NULL);
5047 }
5048 }
5049 }
5050subschemas:
5051 /*
5052 * Process imported/included schemas.
5053 */

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected