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

Function xmlSchematronPushInclude

ThirdParty/libxml2/vtklibxml2/schematron.c:803–832  ·  view source on GitHub ↗

* xmlSchematronPushInclude: * @ctxt: the schema parser context * @doc: the included document * @cur: the current include node * * Add an included document */

Source from the content-addressed store, hash-verified

801 * Add an included document
802 */
803static void
804xmlSchematronPushInclude(xmlSchematronParserCtxtPtr ctxt,
805 xmlDocPtr doc, xmlNodePtr cur)
806{
807 if (ctxt->includes == NULL) {
808 ctxt->maxIncludes = 10;
809 ctxt->includes = (xmlNodePtr *)
810 xmlMalloc(ctxt->maxIncludes * 2 * sizeof(xmlNodePtr));
811 if (ctxt->includes == NULL) {
812 xmlSchematronPErrMemory(NULL);
813 return;
814 }
815 ctxt->nbIncludes = 0;
816 } else if (ctxt->nbIncludes + 2 >= ctxt->maxIncludes) {
817 xmlNodePtr *tmp;
818
819 tmp = (xmlNodePtr *)
820 xmlRealloc(ctxt->includes, ctxt->maxIncludes * 4 *
821 sizeof(xmlNodePtr));
822 if (tmp == NULL) {
823 xmlSchematronPErrMemory(NULL);
824 return;
825 }
826 ctxt->includes = tmp;
827 ctxt->maxIncludes *= 2;
828 }
829 ctxt->includes[2 * ctxt->nbIncludes] = cur;
830 ctxt->includes[2 * ctxt->nbIncludes + 1] = (xmlNodePtr) doc;
831 ctxt->nbIncludes++;
832}
833
834/**
835 * xmlSchematronPopInclude:

Callers 1

xmlSchematronLoadIncludeFunction · 0.85

Calls 1

xmlSchematronPErrMemoryFunction · 0.85

Tested by

no test coverage detected