11#pragma convert("ISO8859-1")
130 xmlFreeNodeList(
entity->children);
164 ret->type = XML_ENTITY_DECL;
172 if (ExternalID !=
NULL)
174 if (SystemID !=
NULL)
205 xmlEntityPtr
ret, predef;
211 if (dtd->doc !=
NULL)
212 dict = dtd->doc->dict;
219 if (predef !=
NULL) {
225 int c = predef->content[0];
228 ((
c ==
'>') || (
c ==
'\'') || (
c ==
'"'))) {
242 ref[0] =
'0' +
c / 10 % 10;
243 ref[1] =
'0' +
c % 10;
251 "xmlAddEntity: invalid redeclaration of predefined"
252 " entity '%s'",
name);
256 if (dtd->entities ==
NULL)
258 table = dtd->entities;
262 if (dtd->pentities ==
NULL)
264 table = dtd->pentities;
344 "xmlAddDtdEntity: document is NULL");
347 if (doc->extSubset ==
NULL) {
349 "xmlAddDtdEntity: document without external subset");
352 dtd = doc->extSubset;
361 if (dtd->last ==
NULL) {
362 dtd->children = dtd->last = (xmlNodePtr)
ret;
364 dtd->last->next = (xmlNodePtr)
ret;
365 ret->prev = dtd->last;
366 dtd->last = (xmlNodePtr)
ret;
393 "xmlAddDocEntity: document is NULL");
396 if (doc->intSubset ==
NULL) {
398 "xmlAddDocEntity: document without internal subset");
401 dtd = doc->intSubset;
410 if (dtd->last ==
NULL) {
411 dtd->children = dtd->last = (xmlNodePtr)
ret;
413 dtd->last->next = (xmlNodePtr)
ret;
414 ret->prev = dtd->last;
415 dtd->last = (xmlNodePtr)
ret;
444 if ((doc !=
NULL) && (doc->intSubset !=
NULL)) {
491 if ((doc->intSubset !=
NULL) && (doc->intSubset->pentities !=
NULL)) {
497 if ((doc->extSubset !=
NULL) && (doc->extSubset->pentities !=
NULL)) {
499 return(xmlGetEntityFromTable(
table,
name));
521 if ((doc->extSubset !=
NULL) && (doc->extSubset->entities !=
NULL)) {
523 return(xmlGetEntityFromTable(
table,
name));
545 if ((doc->intSubset !=
NULL) && (doc->intSubset->entities !=
NULL)) {
551 if (doc->standalone != 1) {
552 if ((doc->extSubset !=
NULL) &&
553 (doc->extSubset->entities !=
NULL)) {
567#define growBufferReentrant() { \
569 size_t new_size = buffer_size * 2; \
570 if (new_size < buffer_size) goto mem_error; \
571 tmp = (xmlChar *) xmlRealloc(buffer, new_size); \
572 if (tmp == NULL) goto mem_error; \
574 buffer_size = new_size; \
600 html = (doc->type == XML_HTML_DOCUMENT_NODE);
613 while (*
cur !=
'\0') {
631 (
cur[1] ==
'!') && (
cur[2] ==
'-') && (
cur[3] ==
'-') &&
650 }
else if (*
cur ==
'>') {
655 }
else if (*
cur ==
'&') {
660 if (html &&
attr && (
cur[1] ==
'{') &&
662 while (*
cur !=
'}') {
678 }
else if (((*
cur >= 0x20) && (*
cur < 0x80)) ||
679 (*
cur ==
'\n') || (*
cur ==
'\t') || ((html) && (*
cur ==
'\r'))) {
684 }
else if (*
cur >= 0x80) {
685 if (((doc !=
NULL) && (doc->encoding !=
NULL)) || (html)) {
713 if (((
cur[0] & 0xC0) != 0xC0) ||
714 ((
cur[1] & 0xC0) != 0x80) ||
715 (((
cur[0] & 0xE0) == 0xE0) && ((
cur[2] & 0xC0) != 0x80)) ||
716 (((
cur[0] & 0xF0) == 0xF0) && ((
cur[3] & 0xC0) != 0x80)) ||
717 (((
cur[0] & 0xF8) == 0xF8))) {
719 "xmlEncodeEntities: input not UTF-8");
726 }
else if (*
cur < 0xE0) {
731 }
else if (*
cur < 0xF0) {
738 }
else if (*
cur < 0xF8) {
750 "xmlEncodeEntities: char out of range\n");
800 return xmlEncodeEntitiesInternal(doc,
input, 1);
817 return xmlEncodeEntitiesInternal(doc,
input, 0);
849 while (*
cur !=
'\0') {
865 }
else if (*
cur ==
'>') {
870 }
else if (*
cur ==
'&') {
876 }
else if (*
cur ==
'"') {
883 }
else if (*
cur ==
'\r') {
944#ifdef LIBXML_TREE_ENABLED
955 xmlEntityPtr ent = (xmlEntityPtr) payload;
964 cur->type = XML_ENTITY_DECL;
966 cur->etype = ent->etype;
967 if (ent->name !=
NULL)
969 if (ent->ExternalID !=
NULL)
971 if (ent->SystemID !=
NULL)
973 if (ent->content !=
NULL)
975 if (ent->orig !=
NULL)
977 if (ent->URI !=
NULL)
996#ifdef LIBXML_OUTPUT_ENABLED
1011 xmlBufferCCat(
buf,
"\"");
1020 }
else if (*
cur ==
'%') {
1032 xmlBufferCCat(
buf,
"\"");
1046xmlDumpEntityDecl(xmlBufferPtr
buf, xmlEntityPtr ent) {
1048 switch (ent->etype) {
1050 xmlBufferWriteChar(
buf,
"<!ENTITY ");
1051 xmlBufferWriteCHAR(
buf, ent->name);
1052 xmlBufferWriteChar(
buf,
" ");
1053 if (ent->orig !=
NULL)
1054 xmlBufferWriteQuotedString(
buf, ent->orig);
1056 xmlDumpEntityContent(
buf, ent->content);
1057 xmlBufferWriteChar(
buf,
">\n");
1060 xmlBufferWriteChar(
buf,
"<!ENTITY ");
1061 xmlBufferWriteCHAR(
buf, ent->name);
1062 if (ent->ExternalID !=
NULL) {
1063 xmlBufferWriteChar(
buf,
" PUBLIC ");
1064 xmlBufferWriteQuotedString(
buf, ent->ExternalID);
1065 xmlBufferWriteChar(
buf,
" ");
1066 xmlBufferWriteQuotedString(
buf, ent->SystemID);
1068 xmlBufferWriteChar(
buf,
" SYSTEM ");
1069 xmlBufferWriteQuotedString(
buf, ent->SystemID);
1071 xmlBufferWriteChar(
buf,
">\n");
1074 xmlBufferWriteChar(
buf,
"<!ENTITY ");
1075 xmlBufferWriteCHAR(
buf, ent->name);
1076 if (ent->ExternalID !=
NULL) {
1077 xmlBufferWriteChar(
buf,
" PUBLIC ");
1078 xmlBufferWriteQuotedString(
buf, ent->ExternalID);
1079 xmlBufferWriteChar(
buf,
" ");
1080 xmlBufferWriteQuotedString(
buf, ent->SystemID);
1082 xmlBufferWriteChar(
buf,
" SYSTEM ");
1083 xmlBufferWriteQuotedString(
buf, ent->SystemID);
1085 if (ent->content !=
NULL) {
1086 xmlBufferWriteChar(
buf,
" NDATA ");
1087 if (ent->orig !=
NULL)
1088 xmlBufferWriteCHAR(
buf, ent->orig);
1090 xmlBufferWriteCHAR(
buf, ent->content);
1092 xmlBufferWriteChar(
buf,
">\n");
1095 xmlBufferWriteChar(
buf,
"<!ENTITY % ");
1096 xmlBufferWriteCHAR(
buf, ent->name);
1097 xmlBufferWriteChar(
buf,
" ");
1098 if (ent->orig ==
NULL)
1099 xmlDumpEntityContent(
buf, ent->content);
1101 xmlBufferWriteQuotedString(
buf, ent->orig);
1102 xmlBufferWriteChar(
buf,
">\n");
1105 xmlBufferWriteChar(
buf,
"<!ENTITY % ");
1106 xmlBufferWriteCHAR(
buf, ent->name);
1107 if (ent->ExternalID !=
NULL) {
1108 xmlBufferWriteChar(
buf,
" PUBLIC ");
1109 xmlBufferWriteQuotedString(
buf, ent->ExternalID);
1110 xmlBufferWriteChar(
buf,
" ");
1111 xmlBufferWriteQuotedString(
buf, ent->SystemID);
1113 xmlBufferWriteChar(
buf,
" SYSTEM ");
1114 xmlBufferWriteQuotedString(
buf, ent->SystemID);
1116 xmlBufferWriteChar(
buf,
">\n");
1120 "xmlDumpEntitiesDecl: internal: unknown type entity type");
1132xmlDumpEntityDeclScan(
void *ent,
void *
buf,
1134 xmlDumpEntityDecl((xmlBufferPtr)
buf, (xmlEntityPtr) ent);
_ACRTIMP char *__cdecl strchr(const char *, int)
static xmlEntity xmlEntityLt
static xmlEntity xmlEntityApos
#define growBufferReentrant()
static xmlEntity xmlEntityGt
static xmlEntity xmlEntityQuot
static xmlEntity xmlEntityAmp
static void xmlEntitiesErrMemory(const char *extra)
GLuint GLuint GLsizei GLenum type
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum GLenum GLenum input
XMLPUBFUN xmlEntityPtr xmlNewEntity(xmlDocPtr doc, const xmlChar *name, int type, const xmlChar *ExternalID, const xmlChar *SystemID, const xmlChar *content)
XMLPUBFUN xmlEntityPtr xmlGetDtdEntity(xmlDocPtr doc, const xmlChar *name)
XMLPUBFUN xmlEntitiesTablePtr xmlCreateEntitiesTable(void)
XMLPUBFUN xmlEntityPtr xmlAddDocEntity(xmlDocPtr doc, const xmlChar *name, int type, const xmlChar *ExternalID, const xmlChar *SystemID, const xmlChar *content)
XMLPUBFUN xmlChar * xmlEncodeSpecialChars(const xmlDoc *doc, const xmlChar *input)
XMLPUBFUN void xmlFreeEntity(xmlEntityPtr entity)
XMLPUBFUN xmlEntityPtr xmlGetDocEntity(const xmlDoc *doc, const xmlChar *name)
XMLPUBFUN xmlEntityPtr xmlGetPredefinedEntity(const xmlChar *name)
@ XML_EXTERNAL_GENERAL_PARSED_ENTITY
@ XML_INTERNAL_PREDEFINED_ENTITY
@ XML_EXTERNAL_GENERAL_UNPARSED_ENTITY
@ XML_INTERNAL_GENERAL_ENTITY
@ XML_INTERNAL_PARAMETER_ENTITY
@ XML_EXTERNAL_PARAMETER_ENTITY
XMLPUBFUN void xmlFreeEntitiesTable(xmlEntitiesTablePtr table)
xmlEntitiesTable * xmlEntitiesTablePtr
XMLPUBFUN xmlEntityPtr xmlAddDtdEntity(xmlDocPtr doc, const xmlChar *name, int type, const xmlChar *ExternalID, const xmlChar *SystemID, const xmlChar *content)
XMLPUBFUN xmlEntityPtr xmlGetParameterEntity(xmlDocPtr doc, const xmlChar *name)
XMLPUBFUN xmlChar * xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input)
XML_HIDDEN xmlChar * xmlEncodeAttributeEntities(xmlDocPtr doc, const xmlChar *input)
int xmlDictOwns(xmlDictPtr dict, const xmlChar *str)
const xmlChar * xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len)
void xmlHashScan(xmlHashTablePtr hash, xmlHashScanner scan, void *data)
void xmlHashFree(xmlHashTablePtr hash, xmlHashDeallocator dealloc)
void * xmlHashLookup(xmlHashTablePtr hash, const xmlChar *key)
int xmlHashAddEntry(xmlHashTablePtr hash, const xmlChar *key, void *payload)
xmlHashTablePtr xmlHashCreate(int size)
xmlHashTablePtr xmlHashCopy(xmlHashTablePtr hash, xmlHashCopier copy)
xmlHashTablePtr xmlHashCreateDict(int size, xmlDictPtr dict)
XML_HIDDEN void XML_HIDDEN void __xmlSimpleError(int domain, int code, struct _xmlNode *node, const char *msg, const char *extra) LIBXML_ATTR_FORMAT(4
XML_HIDDEN void __xmlRaiseError(xmlStructuredErrorFunc schannel, xmlGenericErrorFunc channel, void *data, void *ctx, void *nod, int domain, int code, xmlErrorLevel level, const char *file, int line, const char *str1, const char *str2, const char *str3, int int1, int col, const char *msg,...) LIBXML_ATTR_FORMAT(16
XML_HIDDEN void xmlParserErrors const char const xmlChar * str1
wchar_t const *const size_t const buffer_size
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
@ XML_ERR_ENTITY_PROCESSING
XMLPUBFUN xmlChar * xmlStrndup(const xmlChar *cur, int len)
XMLPUBFUN int xmlStrlen(const xmlChar *str)
XMLPUBFUN int xmlStrcasecmp(const xmlChar *str1, const xmlChar *str2)
XMLPUBFUN const xmlChar * xmlStrstr(const xmlChar *str, const xmlChar *val)
XMLPUBFUN int xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
XMLPUBFUN const xmlChar * xmlStrchr(const xmlChar *str, xmlChar val)
XMLPUBFUN xmlChar * xmlStrdup(const xmlChar *cur)
#define LIBXML_ATTR_FORMAT(fmt, args)