Lines Matching refs:xml_info

167 MagickExport XMLTreeInfo *AddChildToXMLTree(XMLTreeInfo *xml_info,  in AddChildToXMLTree()  argument
173 if (xml_info == (XMLTreeInfo *) NULL) in AddChildToXMLTree()
184 return(InsertTagIntoXMLTree(xml_info,child,offset)); in AddChildToXMLTree()
215 MagickPrivate XMLTreeInfo *AddPathToXMLTree(XMLTreeInfo *xml_info, in AddPathToXMLTree() argument
236 assert(xml_info != (XMLTreeInfo *) NULL); in AddPathToXMLTree()
237 assert((xml_info->signature == MagickCoreSignature) || in AddPathToXMLTree()
238 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in AddPathToXMLTree()
239 if (xml_info->debug != MagickFalse) in AddPathToXMLTree()
241 node=xml_info; in AddPathToXMLTree()
462 static void DestroyXMLTreeChild(XMLTreeInfo *xml_info) in DestroyXMLTreeChild() argument
468 child=xml_info->child; in DestroyXMLTreeChild()
478 static void DestroyXMLTreeOrdered(XMLTreeInfo *xml_info) in DestroyXMLTreeOrdered() argument
484 ordered=xml_info->ordered; in DestroyXMLTreeOrdered()
494 static void DestroyXMLTreeRoot(XMLTreeInfo *xml_info) in DestroyXMLTreeRoot() argument
508 assert(xml_info != (XMLTreeInfo *) NULL); in DestroyXMLTreeRoot()
509 assert((xml_info->signature == MagickCoreSignature) || in DestroyXMLTreeRoot()
510 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in DestroyXMLTreeRoot()
511 if (xml_info->debug != MagickFalse) in DestroyXMLTreeRoot()
513 if (xml_info->parent != (XMLTreeInfo *) NULL) in DestroyXMLTreeRoot()
518 root=(XMLTreeRoot *) xml_info; in DestroyXMLTreeRoot()
557 MagickExport XMLTreeInfo *DestroyXMLTree(XMLTreeInfo *xml_info) in DestroyXMLTree() argument
559 assert(xml_info != (XMLTreeInfo *) NULL); in DestroyXMLTree()
560 assert((xml_info->signature == MagickCoreSignature) || in DestroyXMLTree()
561 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in DestroyXMLTree()
562 if (xml_info->debug != MagickFalse) in DestroyXMLTree()
564 DestroyXMLTreeChild(xml_info); in DestroyXMLTree()
565 DestroyXMLTreeOrdered(xml_info); in DestroyXMLTree()
566 DestroyXMLTreeRoot(xml_info); in DestroyXMLTree()
567 xml_info->attributes=DestroyXMLTreeAttributes(xml_info->attributes); in DestroyXMLTree()
568 xml_info->content=DestroyString(xml_info->content); in DestroyXMLTree()
569 xml_info->tag=DestroyString(xml_info->tag); in DestroyXMLTree()
570 xml_info=(XMLTreeInfo *) RelinquishMagickMemory(xml_info); in DestroyXMLTree()
743 MagickExport XMLTreeInfo *GetNextXMLTreeTag(XMLTreeInfo *xml_info) in GetNextXMLTreeTag() argument
745 assert(xml_info != (XMLTreeInfo *) NULL); in GetNextXMLTreeTag()
746 assert((xml_info->signature == MagickCoreSignature) || in GetNextXMLTreeTag()
747 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in GetNextXMLTreeTag()
748 if (xml_info->debug != MagickFalse) in GetNextXMLTreeTag()
750 return(xml_info->next); in GetNextXMLTreeTag()
778 MagickExport const char *GetXMLTreeAttribute(XMLTreeInfo *xml_info, in GetXMLTreeAttribute() argument
790 assert(xml_info != (XMLTreeInfo *) NULL); in GetXMLTreeAttribute()
791 assert((xml_info->signature == MagickCoreSignature) || in GetXMLTreeAttribute()
792 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in GetXMLTreeAttribute()
793 if (xml_info->debug != MagickFalse) in GetXMLTreeAttribute()
795 if (xml_info->attributes == (char **) NULL) in GetXMLTreeAttribute()
798 while ((xml_info->attributes[i] != (char *) NULL) && in GetXMLTreeAttribute()
799 (strcmp(xml_info->attributes[i],tag) != 0)) in GetXMLTreeAttribute()
801 if (xml_info->attributes[i] != (char *) NULL) in GetXMLTreeAttribute()
802 return(xml_info->attributes[i+1]); in GetXMLTreeAttribute()
803 root=(XMLTreeRoot*) xml_info; in GetXMLTreeAttribute()
808 (strcmp(root->attributes[i][0],xml_info->tag) != 0)) in GetXMLTreeAttribute()
848 const XMLTreeInfo *xml_info,SplayTreeInfo *attributes) in GetXMLTreeAttributes() argument
853 assert(xml_info != (XMLTreeInfo *) NULL); in GetXMLTreeAttributes()
854 assert((xml_info->signature == MagickCoreSignature) || in GetXMLTreeAttributes()
855 (((const XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in GetXMLTreeAttributes()
856 if (xml_info->debug != MagickFalse) in GetXMLTreeAttributes()
859 if (xml_info->attributes == (char **) NULL) in GetXMLTreeAttributes()
862 while (xml_info->attributes[i] != (char *) NULL) in GetXMLTreeAttributes()
865 ConstantString(xml_info->attributes[i]), in GetXMLTreeAttributes()
866 ConstantString(xml_info->attributes[i+1])); in GetXMLTreeAttributes()
895 MagickExport XMLTreeInfo *GetXMLTreeChild(XMLTreeInfo *xml_info,const char *tag) in GetXMLTreeChild() argument
900 assert(xml_info != (XMLTreeInfo *) NULL); in GetXMLTreeChild()
901 assert((xml_info->signature == MagickCoreSignature) || in GetXMLTreeChild()
902 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in GetXMLTreeChild()
903 if (xml_info->debug != MagickFalse) in GetXMLTreeChild()
905 child=xml_info->child; in GetXMLTreeChild()
935 MagickExport const char *GetXMLTreeContent(XMLTreeInfo *xml_info) in GetXMLTreeContent() argument
937 assert(xml_info != (XMLTreeInfo *) NULL); in GetXMLTreeContent()
938 assert((xml_info->signature == MagickCoreSignature) || in GetXMLTreeContent()
939 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in GetXMLTreeContent()
940 if (xml_info->debug != MagickFalse) in GetXMLTreeContent()
942 return(xml_info->content); in GetXMLTreeContent()
967 MagickPrivate XMLTreeInfo *GetXMLTreeOrdered(XMLTreeInfo *xml_info) in GetXMLTreeOrdered() argument
969 assert(xml_info != (XMLTreeInfo *) NULL); in GetXMLTreeOrdered()
970 assert((xml_info->signature == MagickCoreSignature) || in GetXMLTreeOrdered()
971 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in GetXMLTreeOrdered()
972 if (xml_info->debug != MagickFalse) in GetXMLTreeOrdered()
974 return(xml_info->ordered); in GetXMLTreeOrdered()
1002 MagickPrivate XMLTreeInfo *GetXMLTreePath(XMLTreeInfo *xml_info, in GetXMLTreePath() argument
1022 assert(xml_info != (XMLTreeInfo *) NULL); in GetXMLTreePath()
1023 assert((xml_info->signature == MagickCoreSignature) || in GetXMLTreePath()
1024 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in GetXMLTreePath()
1025 if (xml_info->debug != MagickFalse) in GetXMLTreePath()
1027 node=xml_info; in GetXMLTreePath()
1079 XMLTreeInfo *xml_info,const char *target) in GetXMLTreeProcessingInstructions() argument
1087 assert(xml_info != (XMLTreeInfo *) NULL); in GetXMLTreeProcessingInstructions()
1088 assert((xml_info->signature == MagickCoreSignature) || in GetXMLTreeProcessingInstructions()
1089 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in GetXMLTreeProcessingInstructions()
1090 if (xml_info->debug != MagickFalse) in GetXMLTreeProcessingInstructions()
1092 root=(XMLTreeRoot *) xml_info; in GetXMLTreeProcessingInstructions()
1126 MagickExport XMLTreeInfo *GetXMLTreeSibling(XMLTreeInfo *xml_info) in GetXMLTreeSibling() argument
1128 assert(xml_info != (XMLTreeInfo *) NULL); in GetXMLTreeSibling()
1129 assert((xml_info->signature == MagickCoreSignature) || in GetXMLTreeSibling()
1130 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in GetXMLTreeSibling()
1131 if (xml_info->debug != MagickFalse) in GetXMLTreeSibling()
1133 return(xml_info->sibling); in GetXMLTreeSibling()
1158 MagickExport const char *GetXMLTreeTag(XMLTreeInfo *xml_info) in GetXMLTreeTag() argument
1160 assert(xml_info != (XMLTreeInfo *) NULL); in GetXMLTreeTag()
1161 assert((xml_info->signature == MagickCoreSignature) || in GetXMLTreeTag()
1162 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in GetXMLTreeTag()
1163 if (xml_info->debug != MagickFalse) in GetXMLTreeTag()
1165 return(xml_info->tag); in GetXMLTreeTag()
1196 MagickPrivate XMLTreeInfo *InsertTagIntoXMLTree(XMLTreeInfo *xml_info, in InsertTagIntoXMLTree() argument
1208 child->parent=xml_info; in InsertTagIntoXMLTree()
1209 if (xml_info->child == (XMLTreeInfo *) NULL) in InsertTagIntoXMLTree()
1211 xml_info->child=child; in InsertTagIntoXMLTree()
1214 head=xml_info->child; in InsertTagIntoXMLTree()
1218 xml_info->child=child; in InsertTagIntoXMLTree()
1552 *xml_info; in ParseCharacterContent() local
1554 xml_info=root->node; in ParseCharacterContent()
1555 if ((xml_info == (XMLTreeInfo *) NULL) || (xml_info->tag == (char *) NULL) || in ParseCharacterContent()
1560 if ((xml_info->content != (char *) NULL) && (*xml_info->content != '\0')) in ParseCharacterContent()
1562 (void) ConcatenateString(&xml_info->content,xml); in ParseCharacterContent()
1567 if (xml_info->content != (char *) NULL) in ParseCharacterContent()
1568 xml_info->content=DestroyString(xml_info->content); in ParseCharacterContent()
1569 xml_info->content=xml; in ParseCharacterContent()
1920 *xml_info; in ParseOpenTag() local
1922 xml_info=root->node; in ParseOpenTag()
1923 if (xml_info->tag == (char *) NULL) in ParseOpenTag()
1924 xml_info->tag=ConstantString(tag); in ParseOpenTag()
1926 xml_info=AddChildToXMLTree(xml_info,tag,strlen(xml_info->content)); in ParseOpenTag()
1927 if (xml_info != (XMLTreeInfo *) NULL) in ParseOpenTag()
1928 xml_info->attributes=attributes; in ParseOpenTag()
1929 root->node=xml_info; in ParseOpenTag()
2417 MagickPrivate XMLTreeInfo *PruneTagFromXMLTree(XMLTreeInfo *xml_info) in PruneTagFromXMLTree() argument
2422 assert(xml_info != (XMLTreeInfo *) NULL); in PruneTagFromXMLTree()
2423 assert((xml_info->signature == MagickCoreSignature) || in PruneTagFromXMLTree()
2424 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in PruneTagFromXMLTree()
2425 if (xml_info->debug != MagickFalse) in PruneTagFromXMLTree()
2427 if (xml_info->next != (XMLTreeInfo *) NULL) in PruneTagFromXMLTree()
2428 xml_info->next->sibling=xml_info->sibling; in PruneTagFromXMLTree()
2429 if (xml_info->parent != (XMLTreeInfo *) NULL) in PruneTagFromXMLTree()
2431 node=xml_info->parent->child; in PruneTagFromXMLTree()
2432 if (node == xml_info) in PruneTagFromXMLTree()
2433 xml_info->parent->child=xml_info->ordered; in PruneTagFromXMLTree()
2436 while (node->ordered != xml_info) in PruneTagFromXMLTree()
2439 node=xml_info->parent->child; in PruneTagFromXMLTree()
2440 if (strcmp(node->tag,xml_info->tag) != 0) in PruneTagFromXMLTree()
2442 while (strcmp(node->sibling->tag,xml_info->tag) != 0) in PruneTagFromXMLTree()
2444 if (node->sibling != xml_info) in PruneTagFromXMLTree()
2447 node->sibling=(xml_info->next != (XMLTreeInfo *) NULL) ? in PruneTagFromXMLTree()
2448 xml_info->next : node->sibling->sibling; in PruneTagFromXMLTree()
2451 (node->next != xml_info)) in PruneTagFromXMLTree()
2457 xml_info->ordered=(XMLTreeInfo *) NULL; in PruneTagFromXMLTree()
2458 xml_info->sibling=(XMLTreeInfo *) NULL; in PruneTagFromXMLTree()
2459 xml_info->next=(XMLTreeInfo *) NULL; in PruneTagFromXMLTree()
2460 return(xml_info); in PruneTagFromXMLTree()
2491 MagickPrivate XMLTreeInfo *SetXMLTreeAttribute(XMLTreeInfo *xml_info, in SetXMLTreeAttribute() argument
2500 assert(xml_info != (XMLTreeInfo *) NULL); in SetXMLTreeAttribute()
2501 assert((xml_info->signature == MagickCoreSignature) || in SetXMLTreeAttribute()
2502 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in SetXMLTreeAttribute()
2503 if (xml_info->debug != MagickFalse) in SetXMLTreeAttribute()
2506 while ((xml_info->attributes[i] != (char *) NULL) && in SetXMLTreeAttribute()
2507 (strcmp(xml_info->attributes[i],tag) != 0)) in SetXMLTreeAttribute()
2509 if (xml_info->attributes[i] == (char *) NULL) in SetXMLTreeAttribute()
2515 return(xml_info); in SetXMLTreeAttribute()
2516 if (xml_info->attributes != sentinel) in SetXMLTreeAttribute()
2517 xml_info->attributes=(char **) ResizeQuantumMemory( in SetXMLTreeAttribute()
2518 xml_info->attributes,(size_t) (i+4),sizeof(*xml_info->attributes)); in SetXMLTreeAttribute()
2521 xml_info->attributes=(char **) AcquireQuantumMemory(4, in SetXMLTreeAttribute()
2522 sizeof(*xml_info->attributes)); in SetXMLTreeAttribute()
2523 if (xml_info->attributes != (char **) NULL) in SetXMLTreeAttribute()
2524 xml_info->attributes[1]=ConstantString(""); in SetXMLTreeAttribute()
2526 if (xml_info->attributes == (char **) NULL) in SetXMLTreeAttribute()
2528 xml_info->attributes[i]=ConstantString(tag); in SetXMLTreeAttribute()
2529 xml_info->attributes[i+2]=(char *) NULL; in SetXMLTreeAttribute()
2530 (void) strlen(xml_info->attributes[i+1]); in SetXMLTreeAttribute()
2535 for (j=i; xml_info->attributes[j] != (char *) NULL; j+=2) ; in SetXMLTreeAttribute()
2536 if (xml_info->attributes[i+1] != (char *) NULL) in SetXMLTreeAttribute()
2537 xml_info->attributes[i+1]=DestroyString(xml_info->attributes[i+1]); in SetXMLTreeAttribute()
2540 xml_info->attributes[i+1]=ConstantString(value); in SetXMLTreeAttribute()
2541 return(xml_info); in SetXMLTreeAttribute()
2543 if (xml_info->attributes[i] != (char *) NULL) in SetXMLTreeAttribute()
2544 xml_info->attributes[i]=DestroyString(xml_info->attributes[i]); in SetXMLTreeAttribute()
2545 (void) memmove(xml_info->attributes+i,xml_info->attributes+i+2,(size_t) in SetXMLTreeAttribute()
2546 (j-i)*sizeof(*xml_info->attributes)); in SetXMLTreeAttribute()
2547 xml_info->attributes=(char **) ResizeQuantumMemory(xml_info->attributes, in SetXMLTreeAttribute()
2548 (size_t) (j+2),sizeof(*xml_info->attributes)); in SetXMLTreeAttribute()
2549 if (xml_info->attributes == (char **) NULL) in SetXMLTreeAttribute()
2552 (void) memmove(xml_info->attributes[j+1]+(i/2),xml_info->attributes[j+1]+ in SetXMLTreeAttribute()
2553 (i/2)+1,(size_t) (((j+2)/2)-(i/2))*sizeof(**xml_info->attributes)); in SetXMLTreeAttribute()
2554 return(xml_info); in SetXMLTreeAttribute()
2583 MagickExport XMLTreeInfo *SetXMLTreeContent(XMLTreeInfo *xml_info, in SetXMLTreeContent() argument
2586 assert(xml_info != (XMLTreeInfo *) NULL); in SetXMLTreeContent()
2587 assert((xml_info->signature == MagickCoreSignature) || in SetXMLTreeContent()
2588 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in SetXMLTreeContent()
2589 if (xml_info->debug != MagickFalse) in SetXMLTreeContent()
2591 if (xml_info->content != (char *) NULL) in SetXMLTreeContent()
2592 xml_info->content=DestroyString(xml_info->content); in SetXMLTreeContent()
2593 xml_info->content=(char *) ConstantString(content); in SetXMLTreeContent()
2594 return(xml_info); in SetXMLTreeContent()
2654 static char *XMLTreeTagToXML(XMLTreeInfo *xml_info,char **source,size_t *length, in XMLTreeTagToXML() argument
2673 if (xml_info->parent != (XMLTreeInfo *) NULL) in XMLTreeTagToXML()
2674 content=xml_info->parent->content; in XMLTreeTagToXML()
2676 *source=EncodePredefinedEntities(content+start,(ssize_t) (xml_info->offset- in XMLTreeTagToXML()
2678 if ((*length+strlen(xml_info->tag)+MagickPathExtent) > *extent) in XMLTreeTagToXML()
2680 *extent=(*length)+strlen(xml_info->tag)+MagickPathExtent; in XMLTreeTagToXML()
2685 *length+=FormatLocaleString(*source+(*length),*extent,"<%s",xml_info->tag); in XMLTreeTagToXML()
2686 for (i=0; xml_info->attributes[i]; i+=2) in XMLTreeTagToXML()
2688 attribute=GetXMLTreeAttribute(xml_info,xml_info->attributes[i]); in XMLTreeTagToXML()
2689 if (attribute != xml_info->attributes[i+1]) in XMLTreeTagToXML()
2691 if ((*length+strlen(xml_info->attributes[i])+MagickPathExtent) > *extent) in XMLTreeTagToXML()
2693 *extent=(*length)+strlen(xml_info->attributes[i])+MagickPathExtent; in XMLTreeTagToXML()
2699 xml_info->attributes[i]); in XMLTreeTagToXML()
2700 (void) EncodePredefinedEntities(xml_info->attributes[i+1],-1,source,length, in XMLTreeTagToXML()
2706 (strcmp(attributes[i][0],xml_info->tag) != 0)) in XMLTreeTagToXML()
2713 (GetXMLTreeAttribute(xml_info,attributes[i][j]) != attributes[i][j+1])) in XMLTreeTagToXML()
2732 *length+=FormatLocaleString(*source+(*length),*extent,*xml_info->content ? in XMLTreeTagToXML()
2734 if (xml_info->child != (XMLTreeInfo *) NULL) in XMLTreeTagToXML()
2735 *source=XMLTreeTagToXML(xml_info->child,source,length,extent,0,attributes); in XMLTreeTagToXML()
2737 *source=EncodePredefinedEntities(xml_info->content,-1,source,length,extent, in XMLTreeTagToXML()
2739 if ((*length+strlen(xml_info->tag)+MagickPathExtent) > *extent) in XMLTreeTagToXML()
2741 *extent=(*length)+strlen(xml_info->tag)+MagickPathExtent; in XMLTreeTagToXML()
2746 if (*xml_info->content != '\0') in XMLTreeTagToXML()
2748 xml_info->tag); in XMLTreeTagToXML()
2749 while ((offset < xml_info->offset) && (content[offset] != '\0')) in XMLTreeTagToXML()
2751 if (xml_info->ordered != (XMLTreeInfo *) NULL) in XMLTreeTagToXML()
2752 content=XMLTreeTagToXML(xml_info->ordered,source,length,extent,offset, in XMLTreeTagToXML()
2760 MagickExport char *XMLTreeInfoToXML(XMLTreeInfo *xml_info) in XMLTreeInfoToXML() argument
2787 assert(xml_info != (XMLTreeInfo *) NULL); in XMLTreeInfoToXML()
2788 assert((xml_info->signature == MagickCoreSignature) || in XMLTreeInfoToXML()
2789 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in XMLTreeInfoToXML()
2790 if (xml_info->debug != MagickFalse) in XMLTreeInfoToXML()
2792 if (xml_info->tag == (char *) NULL) in XMLTreeInfoToXML()
2797 root=(XMLTreeRoot *) xml_info; in XMLTreeInfoToXML()
2800 parent=xml_info->parent; in XMLTreeInfoToXML()
2829 ordered=xml_info->ordered; in XMLTreeInfoToXML()
2830 xml_info->parent=(XMLTreeInfo *) NULL; in XMLTreeInfoToXML()
2831 xml_info->ordered=(XMLTreeInfo *) NULL; in XMLTreeInfoToXML()
2832 xml=XMLTreeTagToXML(xml_info,&xml,&length,&extent,0,root->attributes); in XMLTreeInfoToXML()
2833 xml_info->parent=parent; in XMLTreeInfoToXML()
2834 xml_info->ordered=ordered; in XMLTreeInfoToXML()