entities.h
上传用户:szjkjd
上传日期:2022-06-27
资源大小:8968k
文件大小:5k
源码类别:

浏览器

开发平台:

Visual C++

  1. /*
  2.  * Summary: interface for the XML entities handling
  3.  * Description: this module provides some of the entity API needed
  4.  *              for the parser and applications.
  5.  *
  6.  * Copy: See Copyright for the status of this software.
  7.  *
  8.  * Author: Daniel Veillard
  9.  */
  10. #ifndef __XML_ENTITIES_H__
  11. #define __XML_ENTITIES_H__
  12. #include <libxml/xmlversion.h>
  13. #include <libxml/tree.h>
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. /*
  18.  * The different valid entity types.
  19.  */
  20. typedef enum {
  21.     XML_INTERNAL_GENERAL_ENTITY = 1,
  22.     XML_EXTERNAL_GENERAL_PARSED_ENTITY = 2,
  23.     XML_EXTERNAL_GENERAL_UNPARSED_ENTITY = 3,
  24.     XML_INTERNAL_PARAMETER_ENTITY = 4,
  25.     XML_EXTERNAL_PARAMETER_ENTITY = 5,
  26.     XML_INTERNAL_PREDEFINED_ENTITY = 6
  27. } xmlEntityType;
  28. /*
  29.  * An unit of storage for an entity, contains the string, the value
  30.  * and the linkind data needed for the linking in the hash table.
  31.  */
  32. struct _xmlEntity {
  33.     void           *_private;         /* application data */
  34.     xmlElementType          type;       /* XML_ENTITY_DECL, must be second ! */
  35.     const xmlChar          *name; /* Entity name */
  36.     struct _xmlNode    *children; /* First child link */
  37.     struct _xmlNode        *last; /* Last child link */
  38.     struct _xmlDtd       *parent; /* -> DTD */
  39.     struct _xmlNode        *next; /* next sibling link  */
  40.     struct _xmlNode        *prev; /* previous sibling link  */
  41.     struct _xmlDoc          *doc;       /* the containing document */
  42.     xmlChar                *orig; /* content without ref substitution */
  43.     xmlChar             *content; /* content or ndata if unparsed */
  44.     int                   length; /* the content length */
  45.     xmlEntityType          etype; /* The entity type */
  46.     const xmlChar    *ExternalID; /* External identifier for PUBLIC */
  47.     const xmlChar      *SystemID; /* URI for a SYSTEM or PUBLIC Entity */
  48.     struct _xmlEntity     *nexte; /* unused */
  49.     const xmlChar           *URI; /* the full URI as computed */
  50.     int                    owner; /* does the entity own the childrens */
  51.     int  checked; /* was the entity content checked */
  52. /* this is also used to count entites
  53.  * references done from that entity */
  54. };
  55. /*
  56.  * All entities are stored in an hash table.
  57.  * There is 2 separate hash tables for global and parameter entities.
  58.  */
  59. typedef struct _xmlHashTable xmlEntitiesTable;
  60. typedef xmlEntitiesTable *xmlEntitiesTablePtr;
  61. /*
  62.  * External functions:
  63.  */
  64. #ifdef LIBXML_LEGACY_ENABLED
  65. XMLPUBFUN void XMLCALL
  66. xmlInitializePredefinedEntities (void);
  67. #endif /* LIBXML_LEGACY_ENABLED */
  68. XMLPUBFUN xmlEntityPtr XMLCALL
  69. xmlNewEntity (xmlDocPtr doc,
  70.  const xmlChar *name,
  71.  int type,
  72.  const xmlChar *ExternalID,
  73.  const xmlChar *SystemID,
  74.  const xmlChar *content);
  75. XMLPUBFUN xmlEntityPtr XMLCALL
  76. xmlAddDocEntity (xmlDocPtr doc,
  77.  const xmlChar *name,
  78.  int type,
  79.  const xmlChar *ExternalID,
  80.  const xmlChar *SystemID,
  81.  const xmlChar *content);
  82. XMLPUBFUN xmlEntityPtr XMLCALL
  83. xmlAddDtdEntity (xmlDocPtr doc,
  84.  const xmlChar *name,
  85.  int type,
  86.  const xmlChar *ExternalID,
  87.  const xmlChar *SystemID,
  88.  const xmlChar *content);
  89. XMLPUBFUN xmlEntityPtr XMLCALL
  90. xmlGetPredefinedEntity (const xmlChar *name);
  91. XMLPUBFUN xmlEntityPtr XMLCALL
  92. xmlGetDocEntity (xmlDocPtr doc,
  93.  const xmlChar *name);
  94. XMLPUBFUN xmlEntityPtr XMLCALL
  95. xmlGetDtdEntity (xmlDocPtr doc,
  96.  const xmlChar *name);
  97. XMLPUBFUN xmlEntityPtr XMLCALL
  98. xmlGetParameterEntity (xmlDocPtr doc,
  99.  const xmlChar *name);
  100. #ifdef LIBXML_LEGACY_ENABLED
  101. XMLPUBFUN const xmlChar * XMLCALL
  102. xmlEncodeEntities (xmlDocPtr doc,
  103.  const xmlChar *input);
  104. #endif /* LIBXML_LEGACY_ENABLED */
  105. XMLPUBFUN xmlChar * XMLCALL
  106. xmlEncodeEntitiesReentrant(xmlDocPtr doc,
  107.  const xmlChar *input);
  108. XMLPUBFUN xmlChar * XMLCALL
  109. xmlEncodeSpecialChars (xmlDocPtr doc,
  110.  const xmlChar *input);
  111. XMLPUBFUN xmlEntitiesTablePtr XMLCALL
  112. xmlCreateEntitiesTable (void);
  113. #ifdef LIBXML_TREE_ENABLED
  114. XMLPUBFUN xmlEntitiesTablePtr XMLCALL
  115. xmlCopyEntitiesTable (xmlEntitiesTablePtr table);
  116. #endif /* LIBXML_TREE_ENABLED */
  117. XMLPUBFUN void XMLCALL
  118. xmlFreeEntitiesTable (xmlEntitiesTablePtr table);
  119. #ifdef LIBXML_OUTPUT_ENABLED
  120. XMLPUBFUN void XMLCALL
  121. xmlDumpEntitiesTable (xmlBufferPtr buf,
  122.  xmlEntitiesTablePtr table);
  123. XMLPUBFUN void XMLCALL
  124. xmlDumpEntityDecl (xmlBufferPtr buf,
  125.  xmlEntityPtr ent);
  126. #endif /* LIBXML_OUTPUT_ENABLED */
  127. #ifdef LIBXML_LEGACY_ENABLED
  128. XMLPUBFUN void XMLCALL
  129. xmlCleanupPredefinedEntities(void);
  130. #endif /* LIBXML_LEGACY_ENABLED */
  131. #ifdef __cplusplus
  132. }
  133. #endif
  134. # endif /* __XML_ENTITIES_H__ */