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

Function xmlCatalogConvertEntry

ThirdParty/libxml2/vtklibxml2/catalog.c:699–756  ·  view source on GitHub ↗

* xmlCatalogConvertEntry: * @entry: the entry * @catal: pointer to the catalog being converted * * Convert one entry from the catalog */

Source from the content-addressed store, hash-verified

697 * Convert one entry from the catalog
698 */
699static void
700xmlCatalogConvertEntry(void *payload, void *data,
701 const xmlChar *name ATTRIBUTE_UNUSED) {
702 xmlCatalogEntryPtr entry = (xmlCatalogEntryPtr) payload;
703 xmlCatalogPtr catal = (xmlCatalogPtr) data;
704 if ((entry == NULL) || (catal == NULL) || (catal->sgml == NULL) ||
705 (catal->xml == NULL))
706 return;
707 switch (entry->type) {
708 case SGML_CATA_ENTITY:
709 entry->type = XML_CATA_PUBLIC;
710 break;
711 case SGML_CATA_PENTITY:
712 entry->type = XML_CATA_PUBLIC;
713 break;
714 case SGML_CATA_DOCTYPE:
715 entry->type = XML_CATA_PUBLIC;
716 break;
717 case SGML_CATA_LINKTYPE:
718 entry->type = XML_CATA_PUBLIC;
719 break;
720 case SGML_CATA_NOTATION:
721 entry->type = XML_CATA_PUBLIC;
722 break;
723 case SGML_CATA_PUBLIC:
724 entry->type = XML_CATA_PUBLIC;
725 break;
726 case SGML_CATA_SYSTEM:
727 entry->type = XML_CATA_SYSTEM;
728 break;
729 case SGML_CATA_DELEGATE:
730 entry->type = XML_CATA_DELEGATE_PUBLIC;
731 break;
732 case SGML_CATA_CATALOG:
733 entry->type = XML_CATA_CATALOG;
734 break;
735 default:
736 xmlHashRemoveEntry(catal->sgml, entry->name, xmlFreeCatalogEntry);
737 return;
738 }
739 /*
740 * Conversion successful, remove from the SGML catalog
741 * and add it to the default XML one
742 */
743 xmlHashRemoveEntry(catal->sgml, entry->name, NULL);
744 entry->parent = catal->xml;
745 entry->next = NULL;
746 if (catal->xml->children == NULL)
747 catal->xml->children = entry;
748 else {
749 xmlCatalogEntryPtr prev;
750
751 prev = catal->xml->children;
752 while (prev->next != NULL)
753 prev = prev->next;
754 prev->next = entry;
755 }
756}

Callers

nothing calls this directly

Calls 1

xmlHashRemoveEntryFunction · 0.85

Tested by

no test coverage detected