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

Function xmlSchemaIDCStoreKey

ThirdParty/libxml2/vtklibxml2/xmlschemas.c:22038–22066  ·  view source on GitHub ↗

* xmlSchemaIDCStoreKey: * @vctxt: the WXS validation context * @item: the IDC key * * The validation context is used to store an IDC key. * * Returns 0 if succeeded, -1 on internal errors. */

Source from the content-addressed store, hash-verified

22036 * Returns 0 if succeeded, -1 on internal errors.
22037 */
22038static int
22039xmlSchemaIDCStoreKey(xmlSchemaValidCtxtPtr vctxt,
22040 xmlSchemaPSVIIDCKeyPtr key)
22041{
22042 /*
22043 * Add to global list.
22044 */
22045 if (vctxt->idcKeys == NULL) {
22046 vctxt->idcKeys = (xmlSchemaPSVIIDCKeyPtr *)
22047 xmlMalloc(40 * sizeof(xmlSchemaPSVIIDCKeyPtr));
22048 if (vctxt->idcKeys == NULL) {
22049 xmlSchemaVErrMemory(vctxt);
22050 return (-1);
22051 }
22052 vctxt->sizeIdcKeys = 40;
22053 } else if (vctxt->sizeIdcKeys <= vctxt->nbIdcKeys) {
22054 vctxt->sizeIdcKeys *= 2;
22055 vctxt->idcKeys = (xmlSchemaPSVIIDCKeyPtr *)
22056 xmlRealloc(vctxt->idcKeys, vctxt->sizeIdcKeys *
22057 sizeof(xmlSchemaPSVIIDCKeyPtr));
22058 if (vctxt->idcKeys == NULL) {
22059 xmlSchemaVErrMemory(vctxt);
22060 return (-1);
22061 }
22062 }
22063 vctxt->idcKeys[vctxt->nbIdcKeys++] = key;
22064
22065 return (0);
22066}
22067
22068/**
22069 * xmlSchemaIDCAppendNodeTableItem:

Callers 1

Calls 1

xmlSchemaVErrMemoryFunction · 0.85

Tested by

no test coverage detected