Lines Matching refs:root
109 root; member
506 *root; in DestroyXMLTreeRoot() local
518 root=(XMLTreeRoot *) xml_info; in DestroyXMLTreeRoot()
519 for (i=NumberPredefinedEntities; root->entities[i] != (char *) NULL; i+=2) in DestroyXMLTreeRoot()
520 root->entities[i+1]=DestroyString(root->entities[i+1]); in DestroyXMLTreeRoot()
521 root->entities=(char **) RelinquishMagickMemory(root->entities); in DestroyXMLTreeRoot()
522 for (i=0; root->attributes[i] != (char **) NULL; i++) in DestroyXMLTreeRoot()
524 attributes=root->attributes[i]; in DestroyXMLTreeRoot()
538 if (root->attributes[0] != (char **) NULL) in DestroyXMLTreeRoot()
539 root->attributes=(char ***) RelinquishMagickMemory(root->attributes); in DestroyXMLTreeRoot()
540 if (root->processing_instructions[0] != (char **) NULL) in DestroyXMLTreeRoot()
542 for (i=0; root->processing_instructions[i] != (char **) NULL; i++) in DestroyXMLTreeRoot()
544 for (j=0; root->processing_instructions[i][j] != (char *) NULL; j++) in DestroyXMLTreeRoot()
545 root->processing_instructions[i][j]=DestroyString( in DestroyXMLTreeRoot()
546 root->processing_instructions[i][j]); in DestroyXMLTreeRoot()
547 root->processing_instructions[i][j+1]=DestroyString( in DestroyXMLTreeRoot()
548 root->processing_instructions[i][j+1]); in DestroyXMLTreeRoot()
549 root->processing_instructions[i]=(char **) RelinquishMagickMemory( in DestroyXMLTreeRoot()
550 root->processing_instructions[i]); in DestroyXMLTreeRoot()
552 root->processing_instructions=(char ***) RelinquishMagickMemory( in DestroyXMLTreeRoot()
553 root->processing_instructions); in DestroyXMLTreeRoot()
789 *root; in GetXMLTreeAttribute() local
804 root=(XMLTreeRoot*) xml_info; in GetXMLTreeAttribute()
805 while (root->root.parent != (XMLTreeInfo *) NULL) in GetXMLTreeAttribute()
806 root=(XMLTreeRoot *) root->root.parent; in GetXMLTreeAttribute()
808 while ((root->attributes[i] != (char **) NULL) && in GetXMLTreeAttribute()
809 (strcmp(root->attributes[i][0],xml_info->tag) != 0)) in GetXMLTreeAttribute()
811 if (root->attributes[i] == (char **) NULL) in GetXMLTreeAttribute()
814 while ((root->attributes[i][j] != (char *) NULL) && in GetXMLTreeAttribute()
815 (strcmp(root->attributes[i][j],tag) != 0)) in GetXMLTreeAttribute()
817 if (root->attributes[i][j] == (char *) NULL) in GetXMLTreeAttribute()
819 return(root->attributes[i][j+1]); in GetXMLTreeAttribute()
1085 *root; in GetXMLTreeProcessingInstructions() local
1092 root=(XMLTreeRoot *) xml_info; in GetXMLTreeProcessingInstructions()
1093 while (root->root.parent != (XMLTreeInfo *) NULL) in GetXMLTreeProcessingInstructions()
1094 root=(XMLTreeRoot *) root->root.parent; in GetXMLTreeProcessingInstructions()
1096 while ((root->processing_instructions[i] != (char **) NULL) && in GetXMLTreeProcessingInstructions()
1097 (strcmp(root->processing_instructions[i][0],target) != 0)) in GetXMLTreeProcessingInstructions()
1099 if (root->processing_instructions[i] == (char **) NULL) in GetXMLTreeProcessingInstructions()
1101 return((const char **) (root->processing_instructions[i]+1)); in GetXMLTreeProcessingInstructions()
1542 static void ParseCharacterContent(XMLTreeRoot *root,char *xml, in ParseCharacterContent() argument
1548 xml_info=root->node; in ParseCharacterContent()
1553 xml=ParseEntities(xml,root->entities,state); in ParseCharacterContent()
1567 static XMLTreeInfo *ParseCloseTag(XMLTreeRoot *root,char *tag, in ParseCloseTag() argument
1570 if ((root->node == (XMLTreeInfo *) NULL) || in ParseCloseTag()
1571 (root->node->tag == (char *) NULL) || (strcmp(tag,root->node->tag) != 0)) in ParseCloseTag()
1575 return(&root->root); in ParseCloseTag()
1577 root->node=root->node->parent; in ParseCloseTag()
1607 static void ParseProcessingInstructions(XMLTreeRoot *root,char *xml, in ParseProcessingInstructions() argument
1632 root->standalone=MagickTrue; in ParseProcessingInstructions()
1635 if (root->processing_instructions[0] == (char **) NULL) in ParseProcessingInstructions()
1637 root->processing_instructions=(char ***) AcquireMagickMemory(sizeof( in ParseProcessingInstructions()
1638 *root->processing_instructions)); in ParseProcessingInstructions()
1639 if (root->processing_instructions ==(char ***) NULL) in ParseProcessingInstructions()
1641 *root->processing_instructions=(char **) NULL; in ParseProcessingInstructions()
1644 while ((root->processing_instructions[i] != (char **) NULL) && in ParseProcessingInstructions()
1645 (strcmp(target,root->processing_instructions[i][0]) != 0)) in ParseProcessingInstructions()
1647 if (root->processing_instructions[i] == (char **) NULL) in ParseProcessingInstructions()
1649 root->processing_instructions=(char ***) ResizeQuantumMemory( in ParseProcessingInstructions()
1650 root->processing_instructions,(size_t) (i+2), in ParseProcessingInstructions()
1651 sizeof(*root->processing_instructions)); in ParseProcessingInstructions()
1652 if (root->processing_instructions == (char ***) NULL) in ParseProcessingInstructions()
1654 root->processing_instructions[i]=(char **) AcquireQuantumMemory(3, in ParseProcessingInstructions()
1655 sizeof(**root->processing_instructions)); in ParseProcessingInstructions()
1656 if (root->processing_instructions[i] == (char **) NULL) in ParseProcessingInstructions()
1658 root->processing_instructions[i+1]=(char **) NULL; in ParseProcessingInstructions()
1659 root->processing_instructions[i][0]=ConstantString(target); in ParseProcessingInstructions()
1660 root->processing_instructions[i][1]=(char *) in ParseProcessingInstructions()
1661 root->processing_instructions[i+1]; in ParseProcessingInstructions()
1662 root->processing_instructions[i+1]=(char **) NULL; in ParseProcessingInstructions()
1663 root->processing_instructions[i][2]=ConstantString(""); in ParseProcessingInstructions()
1666 while (root->processing_instructions[i][j] != (char *) NULL) in ParseProcessingInstructions()
1668 root->processing_instructions[i]=(char **) ResizeQuantumMemory( in ParseProcessingInstructions()
1669 root->processing_instructions[i],(size_t) (j+3), in ParseProcessingInstructions()
1670 sizeof(**root->processing_instructions)); in ParseProcessingInstructions()
1671 if (root->processing_instructions[i] == (char **) NULL) in ParseProcessingInstructions()
1673 root->processing_instructions[i][j+2]=(char *) ResizeQuantumMemory( in ParseProcessingInstructions()
1674 root->processing_instructions[i][j+1],(size_t) (j+1), in ParseProcessingInstructions()
1675 sizeof(***root->processing_instructions)); in ParseProcessingInstructions()
1676 if (root->processing_instructions[i][j+2] == (char *) NULL) in ParseProcessingInstructions()
1678 (void) CopyMagickString(root->processing_instructions[i][j+2]+j-1, in ParseProcessingInstructions()
1679 root->root.tag != (char *) NULL ? ">" : "<",2); in ParseProcessingInstructions()
1680 root->processing_instructions[i][j]=ConstantString(xml); in ParseProcessingInstructions()
1681 root->processing_instructions[i][j+1]=(char *) NULL; in ParseProcessingInstructions()
1684 static MagickBooleanType ParseInternalDoctype(XMLTreeRoot *root,char *xml, in ParseInternalDoctype() argument
1734 entities=(*c == '%') ? predefined_entitites : root->entities; in ParseInternalDoctype()
1743 root->entities=entities; in ParseInternalDoctype()
1787 while ((root->attributes[i] != (char **) NULL) && in ParseInternalDoctype()
1789 (strcmp(n,root->attributes[i][0]) != 0)) in ParseInternalDoctype()
1841 if (root->attributes[i] == (char **) NULL) in ParseInternalDoctype()
1847 root->attributes=(char ***) AcquireQuantumMemory(2, in ParseInternalDoctype()
1848 sizeof(*root->attributes)); in ParseInternalDoctype()
1850 root->attributes=(char ***) ResizeQuantumMemory( in ParseInternalDoctype()
1851 root->attributes,(size_t) (i+2), in ParseInternalDoctype()
1852 sizeof(*root->attributes)); in ParseInternalDoctype()
1853 if (root->attributes == (char ***) NULL) in ParseInternalDoctype()
1856 root->attributes[i]=(char **) AcquireQuantumMemory(2, in ParseInternalDoctype()
1857 sizeof(**root->attributes)); in ParseInternalDoctype()
1858 if (root->attributes[i] == (char **) NULL) in ParseInternalDoctype()
1861 root->attributes[i][0]=ConstantString(t); in ParseInternalDoctype()
1862 root->attributes[i][1]=(char *) NULL; in ParseInternalDoctype()
1863 root->attributes[i+1]=(char **) NULL; in ParseInternalDoctype()
1865 for (j=1; root->attributes[i][j] != (char *) NULL; j+=3) ; in ParseInternalDoctype()
1866 root->attributes[i]=(char **) ResizeQuantumMemory( in ParseInternalDoctype()
1867 root->attributes[i],(size_t) (j+4),sizeof(**root->attributes)); in ParseInternalDoctype()
1868 if (root->attributes[i] == (char **) NULL) in ParseInternalDoctype()
1871 root->attributes[i][j+3]=(char *) NULL; in ParseInternalDoctype()
1872 root->attributes[i][j+2]=ConstantString(c); in ParseInternalDoctype()
1873 root->attributes[i][j+1]=(char *) NULL; in ParseInternalDoctype()
1875 root->attributes[i][j+1]=ParseEntities(v,root->entities,*c); in ParseInternalDoctype()
1876 root->attributes[i][j]=ConstantString(n); in ParseInternalDoctype()
1889 ParseProcessingInstructions(root,c,(size_t) (xml-c)); in ParseInternalDoctype()
1897 if ((*(xml++) == '%') && (root->standalone == MagickFalse)) in ParseInternalDoctype()
1904 static void ParseOpenTag(XMLTreeRoot *root,char *tag,char **attributes) in ParseOpenTag() argument
1909 xml_info=root->node; in ParseOpenTag()
1916 root->node=xml_info; in ParseOpenTag()
1972 *root; in NewXMLTree() local
1983 root=(XMLTreeRoot *) NewXMLTreeTag((char *) NULL); in NewXMLTree()
2018 if (root->node == (XMLTreeInfo *) NULL) in NewXMLTree()
2023 return(&root->root); in NewXMLTree()
2036 while ((root->attributes[i] != (char **) NULL) && in NewXMLTree()
2037 (strcmp(root->attributes[i][0],tag) != 0)) in NewXMLTree()
2039 attribute=root->attributes[i]; in NewXMLTree()
2057 return(&root->root); in NewXMLTree()
2090 return(&root->root); in NewXMLTree()
2098 root->entities,(attribute != (char **) NULL) && in NewXMLTree()
2127 return(&root->root); in NewXMLTree()
2131 ParseOpenTag(root,tag,attributes); in NewXMLTree()
2132 (void) ParseCloseTag(root,tag,exception); in NewXMLTree()
2142 ParseOpenTag(root,tag,attributes); in NewXMLTree()
2157 return(&root->root); in NewXMLTree()
2175 return(&root->root); in NewXMLTree()
2178 if (ignore_depth == 0 && ParseCloseTag(root,tag,exception) != in NewXMLTree()
2182 return(&root->root); in NewXMLTree()
2203 return(&root->root); in NewXMLTree()
2217 ParseCharacterContent(root,tag+8,(size_t) (p-tag-10),'c'); in NewXMLTree()
2224 return(&root->root); in NewXMLTree()
2243 return(&root->root); in NewXMLTree()
2249 status=ParseInternalDoctype(root,tag,(size_t) (p-tag), in NewXMLTree()
2254 return(&root->root); in NewXMLTree()
2278 return(&root->root); in NewXMLTree()
2280 ParseProcessingInstructions(root,tag+1,(size_t) (p-tag-2)); in NewXMLTree()
2287 return(&root->root); in NewXMLTree()
2303 ParseCharacterContent(root,tag,(size_t) (p-tag),'&'); in NewXMLTree()
2310 if (root->node == (XMLTreeInfo *) NULL) in NewXMLTree()
2311 return(&root->root); in NewXMLTree()
2312 if (root->node->tag == (char *) NULL) in NewXMLTree()
2316 return(&root->root); in NewXMLTree()
2319 "ParseError","unclosed tag: '%s'",root->node->tag); in NewXMLTree()
2320 return(&root->root); in NewXMLTree()
2355 *root; in NewXMLTreeTag() local
2357 root=(XMLTreeRoot *) AcquireMagickMemory(sizeof(*root)); in NewXMLTreeTag()
2358 if (root == (XMLTreeRoot *) NULL) in NewXMLTreeTag()
2360 (void) ResetMagickMemory(root,0,sizeof(*root)); in NewXMLTreeTag()
2361 root->root.tag=(char *) NULL; in NewXMLTreeTag()
2363 root->root.tag=ConstantString(tag); in NewXMLTreeTag()
2364 root->node=(&root->root); in NewXMLTreeTag()
2365 root->root.content=ConstantString(""); in NewXMLTreeTag()
2366 root->entities=(char **) AcquireMagickMemory(sizeof(predefined_entities)); in NewXMLTreeTag()
2367 if (root->entities == (char **) NULL) in NewXMLTreeTag()
2369 (void) CopyMagickMemory(root->entities,predefined_entities, in NewXMLTreeTag()
2371 root->root.attributes=sentinel; in NewXMLTreeTag()
2372 root->attributes=(char ***) root->root.attributes; in NewXMLTreeTag()
2373 root->processing_instructions=(char ***) root->root.attributes; in NewXMLTreeTag()
2374 root->debug=IsEventLogging(); in NewXMLTreeTag()
2375 root->signature=MagickCoreSignature; in NewXMLTreeTag()
2376 return(&root->root); in NewXMLTreeTag()
2771 *root; in XMLTreeInfoToXML() local
2783 root=(XMLTreeRoot *) xml_info; in XMLTreeInfoToXML()
2784 while (root->root.parent != (XMLTreeInfo *) NULL) in XMLTreeInfoToXML()
2785 root=(XMLTreeRoot *) root->root.parent; in XMLTreeInfoToXML()
2788 for (i=0; root->processing_instructions[i] != (char **) NULL; i++) in XMLTreeInfoToXML()
2793 for (k=2; root->processing_instructions[i][k-1]; k++) ; in XMLTreeInfoToXML()
2794 p=root->processing_instructions[i][1]; in XMLTreeInfoToXML()
2797 if (root->processing_instructions[i][k][j-1] == '>') in XMLTreeInfoToXML()
2799 p=root->processing_instructions[i][j]; in XMLTreeInfoToXML()
2802 q=root->processing_instructions[i][0]; in XMLTreeInfoToXML()
2812 p=root->processing_instructions[i][j]; in XMLTreeInfoToXML()
2818 xml=XMLTreeTagToXML(xml_info,&xml,&length,&extent,0,root->attributes); in XMLTreeInfoToXML()
2822 for (i=0; root->processing_instructions[i] != (char **) NULL; i++) in XMLTreeInfoToXML()
2827 for (k=2; root->processing_instructions[i][k-1]; k++) ; in XMLTreeInfoToXML()
2828 p=root->processing_instructions[i][1]; in XMLTreeInfoToXML()
2831 if (root->processing_instructions[i][k][j-1] == '<') in XMLTreeInfoToXML()
2833 p=root->processing_instructions[i][j]; in XMLTreeInfoToXML()
2836 q=root->processing_instructions[i][0]; in XMLTreeInfoToXML()
2846 p=root->processing_instructions[i][j]; in XMLTreeInfoToXML()