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()
463 static void DestroyXMLTreeChild(XMLTreeInfo *xml_info) in DestroyXMLTreeChild() argument
469 child=xml_info->child; in DestroyXMLTreeChild()
479 static void DestroyXMLTreeOrdered(XMLTreeInfo *xml_info) in DestroyXMLTreeOrdered() argument
485 ordered=xml_info->ordered; in DestroyXMLTreeOrdered()
495 static void DestroyXMLTreeRoot(XMLTreeInfo *xml_info) in DestroyXMLTreeRoot() argument
509 assert(xml_info != (XMLTreeInfo *) NULL); in DestroyXMLTreeRoot()
510 assert((xml_info->signature == MagickCoreSignature) || in DestroyXMLTreeRoot()
511 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in DestroyXMLTreeRoot()
512 if (xml_info->debug != MagickFalse) in DestroyXMLTreeRoot()
514 if (xml_info->parent != (XMLTreeInfo *) NULL) in DestroyXMLTreeRoot()
519 root=(XMLTreeRoot *) xml_info; in DestroyXMLTreeRoot()
558 MagickExport XMLTreeInfo *DestroyXMLTree(XMLTreeInfo *xml_info) in DestroyXMLTree() argument
560 assert(xml_info != (XMLTreeInfo *) NULL); in DestroyXMLTree()
561 assert((xml_info->signature == MagickCoreSignature) || in DestroyXMLTree()
562 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in DestroyXMLTree()
563 if (xml_info->debug != MagickFalse) in DestroyXMLTree()
565 DestroyXMLTreeChild(xml_info); in DestroyXMLTree()
566 DestroyXMLTreeOrdered(xml_info); in DestroyXMLTree()
567 DestroyXMLTreeRoot(xml_info); in DestroyXMLTree()
568 xml_info->attributes=DestroyXMLTreeAttributes(xml_info->attributes); in DestroyXMLTree()
569 xml_info->content=DestroyString(xml_info->content); in DestroyXMLTree()
570 xml_info->tag=DestroyString(xml_info->tag); in DestroyXMLTree()
571 xml_info=(XMLTreeInfo *) RelinquishMagickMemory(xml_info); in DestroyXMLTree()
744 MagickExport XMLTreeInfo *GetNextXMLTreeTag(XMLTreeInfo *xml_info) in GetNextXMLTreeTag() argument
746 assert(xml_info != (XMLTreeInfo *) NULL); in GetNextXMLTreeTag()
747 assert((xml_info->signature == MagickCoreSignature) || in GetNextXMLTreeTag()
748 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in GetNextXMLTreeTag()
749 if (xml_info->debug != MagickFalse) in GetNextXMLTreeTag()
751 return(xml_info->next); in GetNextXMLTreeTag()
779 MagickExport const char *GetXMLTreeAttribute(XMLTreeInfo *xml_info, in GetXMLTreeAttribute() argument
791 assert(xml_info != (XMLTreeInfo *) NULL); in GetXMLTreeAttribute()
792 assert((xml_info->signature == MagickCoreSignature) || in GetXMLTreeAttribute()
793 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in GetXMLTreeAttribute()
794 if (xml_info->debug != MagickFalse) in GetXMLTreeAttribute()
796 if (xml_info->attributes == (char **) NULL) in GetXMLTreeAttribute()
799 while ((xml_info->attributes[i] != (char *) NULL) && in GetXMLTreeAttribute()
800 (strcmp(xml_info->attributes[i],tag) != 0)) in GetXMLTreeAttribute()
802 if (xml_info->attributes[i] != (char *) NULL) in GetXMLTreeAttribute()
803 return(xml_info->attributes[i+1]); in GetXMLTreeAttribute()
804 root=(XMLTreeRoot*) xml_info; in GetXMLTreeAttribute()
809 (strcmp(root->attributes[i][0],xml_info->tag) != 0)) in GetXMLTreeAttribute()
849 const XMLTreeInfo *xml_info,SplayTreeInfo *attributes) in GetXMLTreeAttributes() argument
854 assert(xml_info != (XMLTreeInfo *) NULL); in GetXMLTreeAttributes()
855 assert((xml_info->signature == MagickCoreSignature) || in GetXMLTreeAttributes()
856 (((const XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in GetXMLTreeAttributes()
857 if (xml_info->debug != MagickFalse) in GetXMLTreeAttributes()
860 if (xml_info->attributes == (char **) NULL) in GetXMLTreeAttributes()
863 while (xml_info->attributes[i] != (char *) NULL) in GetXMLTreeAttributes()
866 ConstantString(xml_info->attributes[i]), in GetXMLTreeAttributes()
867 ConstantString(xml_info->attributes[i+1])); in GetXMLTreeAttributes()
896 MagickExport XMLTreeInfo *GetXMLTreeChild(XMLTreeInfo *xml_info,const char *tag) in GetXMLTreeChild() argument
901 assert(xml_info != (XMLTreeInfo *) NULL); in GetXMLTreeChild()
902 assert((xml_info->signature == MagickCoreSignature) || in GetXMLTreeChild()
903 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in GetXMLTreeChild()
904 if (xml_info->debug != MagickFalse) in GetXMLTreeChild()
906 child=xml_info->child; in GetXMLTreeChild()
936 MagickExport const char *GetXMLTreeContent(XMLTreeInfo *xml_info) in GetXMLTreeContent() argument
938 assert(xml_info != (XMLTreeInfo *) NULL); in GetXMLTreeContent()
939 assert((xml_info->signature == MagickCoreSignature) || in GetXMLTreeContent()
940 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in GetXMLTreeContent()
941 if (xml_info->debug != MagickFalse) in GetXMLTreeContent()
943 return(xml_info->content); in GetXMLTreeContent()
968 MagickPrivate XMLTreeInfo *GetXMLTreeOrdered(XMLTreeInfo *xml_info) in GetXMLTreeOrdered() argument
970 assert(xml_info != (XMLTreeInfo *) NULL); in GetXMLTreeOrdered()
971 assert((xml_info->signature == MagickCoreSignature) || in GetXMLTreeOrdered()
972 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in GetXMLTreeOrdered()
973 if (xml_info->debug != MagickFalse) in GetXMLTreeOrdered()
975 return(xml_info->ordered); in GetXMLTreeOrdered()
1003 MagickPrivate XMLTreeInfo *GetXMLTreePath(XMLTreeInfo *xml_info, in GetXMLTreePath() argument
1023 assert(xml_info != (XMLTreeInfo *) NULL); in GetXMLTreePath()
1024 assert((xml_info->signature == MagickCoreSignature) || in GetXMLTreePath()
1025 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in GetXMLTreePath()
1026 if (xml_info->debug != MagickFalse) in GetXMLTreePath()
1028 node=xml_info; in GetXMLTreePath()
1080 XMLTreeInfo *xml_info,const char *target) in GetXMLTreeProcessingInstructions() argument
1088 assert(xml_info != (XMLTreeInfo *) NULL); in GetXMLTreeProcessingInstructions()
1089 assert((xml_info->signature == MagickCoreSignature) || in GetXMLTreeProcessingInstructions()
1090 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in GetXMLTreeProcessingInstructions()
1091 if (xml_info->debug != MagickFalse) in GetXMLTreeProcessingInstructions()
1093 root=(XMLTreeRoot *) xml_info; in GetXMLTreeProcessingInstructions()
1127 MagickExport XMLTreeInfo *GetXMLTreeSibling(XMLTreeInfo *xml_info) in GetXMLTreeSibling() argument
1129 assert(xml_info != (XMLTreeInfo *) NULL); in GetXMLTreeSibling()
1130 assert((xml_info->signature == MagickCoreSignature) || in GetXMLTreeSibling()
1131 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in GetXMLTreeSibling()
1132 if (xml_info->debug != MagickFalse) in GetXMLTreeSibling()
1134 return(xml_info->sibling); in GetXMLTreeSibling()
1159 MagickExport const char *GetXMLTreeTag(XMLTreeInfo *xml_info) in GetXMLTreeTag() argument
1161 assert(xml_info != (XMLTreeInfo *) NULL); in GetXMLTreeTag()
1162 assert((xml_info->signature == MagickCoreSignature) || in GetXMLTreeTag()
1163 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in GetXMLTreeTag()
1164 if (xml_info->debug != MagickFalse) in GetXMLTreeTag()
1166 return(xml_info->tag); in GetXMLTreeTag()
1197 MagickPrivate XMLTreeInfo *InsertTagIntoXMLTree(XMLTreeInfo *xml_info, in InsertTagIntoXMLTree() argument
1209 child->parent=xml_info; in InsertTagIntoXMLTree()
1210 if (xml_info->child == (XMLTreeInfo *) NULL) in InsertTagIntoXMLTree()
1212 xml_info->child=child; in InsertTagIntoXMLTree()
1215 head=xml_info->child; in InsertTagIntoXMLTree()
1219 xml_info->child=child; in InsertTagIntoXMLTree()
1551 *xml_info; in ParseCharacterContent() local
1553 xml_info=root->node; in ParseCharacterContent()
1554 if ((xml_info == (XMLTreeInfo *) NULL) || (xml_info->tag == (char *) NULL) || in ParseCharacterContent()
1559 if ((xml_info->content != (char *) NULL) && (*xml_info->content != '\0')) in ParseCharacterContent()
1561 (void) ConcatenateString(&xml_info->content,xml); in ParseCharacterContent()
1566 if (xml_info->content != (char *) NULL) in ParseCharacterContent()
1567 xml_info->content=DestroyString(xml_info->content); in ParseCharacterContent()
1568 xml_info->content=xml; in ParseCharacterContent()
1917 *xml_info; in ParseOpenTag() local
1919 xml_info=root->node; in ParseOpenTag()
1920 if (xml_info->tag == (char *) NULL) in ParseOpenTag()
1921 xml_info->tag=ConstantString(tag); in ParseOpenTag()
1923 xml_info=AddChildToXMLTree(xml_info,tag,strlen(xml_info->content)); in ParseOpenTag()
1924 if (xml_info != (XMLTreeInfo *) NULL) in ParseOpenTag()
1925 xml_info->attributes=attributes; in ParseOpenTag()
1926 root->node=xml_info; in ParseOpenTag()
2414 MagickPrivate XMLTreeInfo *PruneTagFromXMLTree(XMLTreeInfo *xml_info) in PruneTagFromXMLTree() argument
2419 assert(xml_info != (XMLTreeInfo *) NULL); in PruneTagFromXMLTree()
2420 assert((xml_info->signature == MagickCoreSignature) || in PruneTagFromXMLTree()
2421 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in PruneTagFromXMLTree()
2422 if (xml_info->debug != MagickFalse) in PruneTagFromXMLTree()
2424 if (xml_info->next != (XMLTreeInfo *) NULL) in PruneTagFromXMLTree()
2425 xml_info->next->sibling=xml_info->sibling; in PruneTagFromXMLTree()
2426 if (xml_info->parent != (XMLTreeInfo *) NULL) in PruneTagFromXMLTree()
2428 node=xml_info->parent->child; in PruneTagFromXMLTree()
2429 if (node == xml_info) in PruneTagFromXMLTree()
2430 xml_info->parent->child=xml_info->ordered; in PruneTagFromXMLTree()
2433 while (node->ordered != xml_info) in PruneTagFromXMLTree()
2436 node=xml_info->parent->child; in PruneTagFromXMLTree()
2437 if (strcmp(node->tag,xml_info->tag) != 0) in PruneTagFromXMLTree()
2439 while (strcmp(node->sibling->tag,xml_info->tag) != 0) in PruneTagFromXMLTree()
2441 if (node->sibling != xml_info) in PruneTagFromXMLTree()
2444 node->sibling=(xml_info->next != (XMLTreeInfo *) NULL) ? in PruneTagFromXMLTree()
2445 xml_info->next : node->sibling->sibling; in PruneTagFromXMLTree()
2448 (node->next != xml_info)) in PruneTagFromXMLTree()
2454 xml_info->ordered=(XMLTreeInfo *) NULL; in PruneTagFromXMLTree()
2455 xml_info->sibling=(XMLTreeInfo *) NULL; in PruneTagFromXMLTree()
2456 xml_info->next=(XMLTreeInfo *) NULL; in PruneTagFromXMLTree()
2457 return(xml_info); in PruneTagFromXMLTree()
2488 MagickPrivate XMLTreeInfo *SetXMLTreeAttribute(XMLTreeInfo *xml_info, in SetXMLTreeAttribute() argument
2497 assert(xml_info != (XMLTreeInfo *) NULL); in SetXMLTreeAttribute()
2498 assert((xml_info->signature == MagickCoreSignature) || in SetXMLTreeAttribute()
2499 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in SetXMLTreeAttribute()
2500 if (xml_info->debug != MagickFalse) in SetXMLTreeAttribute()
2503 while ((xml_info->attributes[i] != (char *) NULL) && in SetXMLTreeAttribute()
2504 (strcmp(xml_info->attributes[i],tag) != 0)) in SetXMLTreeAttribute()
2506 if (xml_info->attributes[i] == (char *) NULL) in SetXMLTreeAttribute()
2512 return(xml_info); in SetXMLTreeAttribute()
2513 if (xml_info->attributes != sentinel) in SetXMLTreeAttribute()
2514 xml_info->attributes=(char **) ResizeQuantumMemory( in SetXMLTreeAttribute()
2515 xml_info->attributes,(size_t) (i+4),sizeof(*xml_info->attributes)); in SetXMLTreeAttribute()
2518 xml_info->attributes=(char **) AcquireQuantumMemory(4, in SetXMLTreeAttribute()
2519 sizeof(*xml_info->attributes)); in SetXMLTreeAttribute()
2520 if (xml_info->attributes != (char **) NULL) in SetXMLTreeAttribute()
2521 xml_info->attributes[1]=ConstantString(""); in SetXMLTreeAttribute()
2523 if (xml_info->attributes == (char **) NULL) in SetXMLTreeAttribute()
2525 xml_info->attributes[i]=ConstantString(tag); in SetXMLTreeAttribute()
2526 xml_info->attributes[i+2]=(char *) NULL; in SetXMLTreeAttribute()
2527 (void) strlen(xml_info->attributes[i+1]); in SetXMLTreeAttribute()
2532 for (j=i; xml_info->attributes[j] != (char *) NULL; j+=2) ; in SetXMLTreeAttribute()
2533 if (xml_info->attributes[i+1] != (char *) NULL) in SetXMLTreeAttribute()
2534 xml_info->attributes[i+1]=DestroyString(xml_info->attributes[i+1]); in SetXMLTreeAttribute()
2537 xml_info->attributes[i+1]=ConstantString(value); in SetXMLTreeAttribute()
2538 return(xml_info); in SetXMLTreeAttribute()
2540 if (xml_info->attributes[i] != (char *) NULL) in SetXMLTreeAttribute()
2541 xml_info->attributes[i]=DestroyString(xml_info->attributes[i]); in SetXMLTreeAttribute()
2542 (void) memmove(xml_info->attributes+i,xml_info->attributes+i+2,(size_t) in SetXMLTreeAttribute()
2543 (j-i)*sizeof(*xml_info->attributes)); in SetXMLTreeAttribute()
2544 xml_info->attributes=(char **) ResizeQuantumMemory(xml_info->attributes, in SetXMLTreeAttribute()
2545 (size_t) (j+2),sizeof(*xml_info->attributes)); in SetXMLTreeAttribute()
2546 if (xml_info->attributes == (char **) NULL) in SetXMLTreeAttribute()
2549 (void) memmove(xml_info->attributes[j+1]+(i/2),xml_info->attributes[j+1]+ in SetXMLTreeAttribute()
2550 (i/2)+1,(size_t) (((j+2)/2)-(i/2))*sizeof(**xml_info->attributes)); in SetXMLTreeAttribute()
2551 return(xml_info); in SetXMLTreeAttribute()
2580 MagickExport XMLTreeInfo *SetXMLTreeContent(XMLTreeInfo *xml_info, in SetXMLTreeContent() argument
2583 assert(xml_info != (XMLTreeInfo *) NULL); in SetXMLTreeContent()
2584 assert((xml_info->signature == MagickCoreSignature) || in SetXMLTreeContent()
2585 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in SetXMLTreeContent()
2586 if (xml_info->debug != MagickFalse) in SetXMLTreeContent()
2588 if (xml_info->content != (char *) NULL) in SetXMLTreeContent()
2589 xml_info->content=DestroyString(xml_info->content); in SetXMLTreeContent()
2590 xml_info->content=(char *) ConstantString(content); in SetXMLTreeContent()
2591 return(xml_info); in SetXMLTreeContent()
2651 static char *XMLTreeTagToXML(XMLTreeInfo *xml_info,char **source,size_t *length, in XMLTreeTagToXML() argument
2670 if (xml_info->parent != (XMLTreeInfo *) NULL) in XMLTreeTagToXML()
2671 content=xml_info->parent->content; in XMLTreeTagToXML()
2673 *source=EncodePredefinedEntities(content+start,(ssize_t) (xml_info->offset- in XMLTreeTagToXML()
2675 if ((*length+strlen(xml_info->tag)+MagickPathExtent) > *extent) in XMLTreeTagToXML()
2677 *extent=(*length)+strlen(xml_info->tag)+MagickPathExtent; in XMLTreeTagToXML()
2682 *length+=FormatLocaleString(*source+(*length),*extent,"<%s",xml_info->tag); in XMLTreeTagToXML()
2683 for (i=0; xml_info->attributes[i]; i+=2) in XMLTreeTagToXML()
2685 attribute=GetXMLTreeAttribute(xml_info,xml_info->attributes[i]); in XMLTreeTagToXML()
2686 if (attribute != xml_info->attributes[i+1]) in XMLTreeTagToXML()
2688 if ((*length+strlen(xml_info->attributes[i])+MagickPathExtent) > *extent) in XMLTreeTagToXML()
2690 *extent=(*length)+strlen(xml_info->attributes[i])+MagickPathExtent; in XMLTreeTagToXML()
2696 xml_info->attributes[i]); in XMLTreeTagToXML()
2697 (void) EncodePredefinedEntities(xml_info->attributes[i+1],-1,source,length, in XMLTreeTagToXML()
2703 (strcmp(attributes[i][0],xml_info->tag) != 0)) in XMLTreeTagToXML()
2710 (GetXMLTreeAttribute(xml_info,attributes[i][j]) != attributes[i][j+1])) in XMLTreeTagToXML()
2729 *length+=FormatLocaleString(*source+(*length),*extent,*xml_info->content ? in XMLTreeTagToXML()
2731 if (xml_info->child != (XMLTreeInfo *) NULL) in XMLTreeTagToXML()
2732 *source=XMLTreeTagToXML(xml_info->child,source,length,extent,0,attributes); in XMLTreeTagToXML()
2734 *source=EncodePredefinedEntities(xml_info->content,-1,source,length,extent, in XMLTreeTagToXML()
2736 if ((*length+strlen(xml_info->tag)+MagickPathExtent) > *extent) in XMLTreeTagToXML()
2738 *extent=(*length)+strlen(xml_info->tag)+MagickPathExtent; in XMLTreeTagToXML()
2743 if (*xml_info->content != '\0') in XMLTreeTagToXML()
2745 xml_info->tag); in XMLTreeTagToXML()
2746 while ((offset < xml_info->offset) && (content[offset] != '\0')) in XMLTreeTagToXML()
2748 if (xml_info->ordered != (XMLTreeInfo *) NULL) in XMLTreeTagToXML()
2749 content=XMLTreeTagToXML(xml_info->ordered,source,length,extent,offset, in XMLTreeTagToXML()
2757 MagickExport char *XMLTreeInfoToXML(XMLTreeInfo *xml_info) in XMLTreeInfoToXML() argument
2784 assert(xml_info != (XMLTreeInfo *) NULL); in XMLTreeInfoToXML()
2785 assert((xml_info->signature == MagickCoreSignature) || in XMLTreeInfoToXML()
2786 (((XMLTreeRoot *) xml_info)->signature == MagickCoreSignature)); in XMLTreeInfoToXML()
2787 if (xml_info->debug != MagickFalse) in XMLTreeInfoToXML()
2789 if (xml_info->tag == (char *) NULL) in XMLTreeInfoToXML()
2794 root=(XMLTreeRoot *) xml_info; in XMLTreeInfoToXML()
2797 parent=xml_info->parent; in XMLTreeInfoToXML()
2826 ordered=xml_info->ordered; in XMLTreeInfoToXML()
2827 xml_info->parent=(XMLTreeInfo *) NULL; in XMLTreeInfoToXML()
2828 xml_info->ordered=(XMLTreeInfo *) NULL; in XMLTreeInfoToXML()
2829 xml=XMLTreeTagToXML(xml_info,&xml,&length,&extent,0,root->attributes); in XMLTreeInfoToXML()
2830 xml_info->parent=parent; in XMLTreeInfoToXML()
2831 xml_info->ordered=ordered; in XMLTreeInfoToXML()