Path: blob/master/venv/Lib/site-packages/lxml/includes/libxml/entities.h
811 views
/*1* Summary: interface for the XML entities handling2* Description: this module provides some of the entity API needed3* for the parser and applications.4*5* Copy: See Copyright for the status of this software.6*7* Author: Daniel Veillard8*/910#ifndef __XML_ENTITIES_H__11#define __XML_ENTITIES_H__1213#include <libxml/xmlversion.h>14#include <libxml/tree.h>1516#ifdef __cplusplus17extern "C" {18#endif1920/*21* The different valid entity types.22*/23typedef enum {24XML_INTERNAL_GENERAL_ENTITY = 1,25XML_EXTERNAL_GENERAL_PARSED_ENTITY = 2,26XML_EXTERNAL_GENERAL_UNPARSED_ENTITY = 3,27XML_INTERNAL_PARAMETER_ENTITY = 4,28XML_EXTERNAL_PARAMETER_ENTITY = 5,29XML_INTERNAL_PREDEFINED_ENTITY = 630} xmlEntityType;3132/*33* An unit of storage for an entity, contains the string, the value34* and the linkind data needed for the linking in the hash table.35*/3637struct _xmlEntity {38void *_private; /* application data */39xmlElementType type; /* XML_ENTITY_DECL, must be second ! */40const xmlChar *name; /* Entity name */41struct _xmlNode *children; /* First child link */42struct _xmlNode *last; /* Last child link */43struct _xmlDtd *parent; /* -> DTD */44struct _xmlNode *next; /* next sibling link */45struct _xmlNode *prev; /* previous sibling link */46struct _xmlDoc *doc; /* the containing document */4748xmlChar *orig; /* content without ref substitution */49xmlChar *content; /* content or ndata if unparsed */50int length; /* the content length */51xmlEntityType etype; /* The entity type */52const xmlChar *ExternalID; /* External identifier for PUBLIC */53const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC Entity */5455struct _xmlEntity *nexte; /* unused */56const xmlChar *URI; /* the full URI as computed */57int owner; /* does the entity own the childrens */58int checked; /* was the entity content checked */59/* this is also used to count entities60* references done from that entity61* and if it contains '<' */62};6364/*65* All entities are stored in an hash table.66* There is 2 separate hash tables for global and parameter entities.67*/6869typedef struct _xmlHashTable xmlEntitiesTable;70typedef xmlEntitiesTable *xmlEntitiesTablePtr;7172/*73* External functions:74*/7576#ifdef LIBXML_LEGACY_ENABLED77XMLPUBFUN void XMLCALL78xmlInitializePredefinedEntities (void);79#endif /* LIBXML_LEGACY_ENABLED */8081XMLPUBFUN xmlEntityPtr XMLCALL82xmlNewEntity (xmlDocPtr doc,83const xmlChar *name,84int type,85const xmlChar *ExternalID,86const xmlChar *SystemID,87const xmlChar *content);88XMLPUBFUN xmlEntityPtr XMLCALL89xmlAddDocEntity (xmlDocPtr doc,90const xmlChar *name,91int type,92const xmlChar *ExternalID,93const xmlChar *SystemID,94const xmlChar *content);95XMLPUBFUN xmlEntityPtr XMLCALL96xmlAddDtdEntity (xmlDocPtr doc,97const xmlChar *name,98int type,99const xmlChar *ExternalID,100const xmlChar *SystemID,101const xmlChar *content);102XMLPUBFUN xmlEntityPtr XMLCALL103xmlGetPredefinedEntity (const xmlChar *name);104XMLPUBFUN xmlEntityPtr XMLCALL105xmlGetDocEntity (const xmlDoc *doc,106const xmlChar *name);107XMLPUBFUN xmlEntityPtr XMLCALL108xmlGetDtdEntity (xmlDocPtr doc,109const xmlChar *name);110XMLPUBFUN xmlEntityPtr XMLCALL111xmlGetParameterEntity (xmlDocPtr doc,112const xmlChar *name);113#ifdef LIBXML_LEGACY_ENABLED114XMLPUBFUN const xmlChar * XMLCALL115xmlEncodeEntities (xmlDocPtr doc,116const xmlChar *input);117#endif /* LIBXML_LEGACY_ENABLED */118XMLPUBFUN xmlChar * XMLCALL119xmlEncodeEntitiesReentrant(xmlDocPtr doc,120const xmlChar *input);121XMLPUBFUN xmlChar * XMLCALL122xmlEncodeSpecialChars (const xmlDoc *doc,123const xmlChar *input);124XMLPUBFUN xmlEntitiesTablePtr XMLCALL125xmlCreateEntitiesTable (void);126#ifdef LIBXML_TREE_ENABLED127XMLPUBFUN xmlEntitiesTablePtr XMLCALL128xmlCopyEntitiesTable (xmlEntitiesTablePtr table);129#endif /* LIBXML_TREE_ENABLED */130XMLPUBFUN void XMLCALL131xmlFreeEntitiesTable (xmlEntitiesTablePtr table);132#ifdef LIBXML_OUTPUT_ENABLED133XMLPUBFUN void XMLCALL134xmlDumpEntitiesTable (xmlBufferPtr buf,135xmlEntitiesTablePtr table);136XMLPUBFUN void XMLCALL137xmlDumpEntityDecl (xmlBufferPtr buf,138xmlEntityPtr ent);139#endif /* LIBXML_OUTPUT_ENABLED */140#ifdef LIBXML_LEGACY_ENABLED141XMLPUBFUN void XMLCALL142xmlCleanupPredefinedEntities(void);143#endif /* LIBXML_LEGACY_ENABLED */144145146#ifdef __cplusplus147}148#endif149150# endif /* __XML_ENTITIES_H__ */151152153