diff options
author | Greg Stein <gstein@apache.org> | 2000-07-01 11:33:02 +0000 |
---|---|---|
committer | Greg Stein <gstein@apache.org> | 2000-07-01 11:33:02 +0000 |
commit | 36fbc8b544e334c2d2aa756e0f2a6c2ce473ff66 (patch) | |
tree | be184cdc17769b23e93592c0ad241d6c8b5f4a59 | |
parent | 793779da108698beea089c7140bfcd07c483866c (diff) | |
download | httpd-36fbc8b544e334c2d2aa756e0f2a6c2ce473ff66.tar.gz |
bring up to date with respect to Apache 1.3 src/lib/expat-lite/
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85738 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | srclib/expat-lite/CHANGES | 48 | ||||
-rw-r--r-- | srclib/expat-lite/hashtable.c | 2 | ||||
-rw-r--r-- | srclib/expat-lite/hashtable.h | 2 | ||||
-rw-r--r-- | srclib/expat-lite/xmldef.h | 7 | ||||
-rw-r--r-- | srclib/expat-lite/xmlparse.c | 41 | ||||
-rw-r--r-- | srclib/expat-lite/xmltok.c | 6 | ||||
-rw-r--r-- | srclib/expat-lite/xmltok_impl.c | 26 |
7 files changed, 81 insertions, 51 deletions
diff --git a/srclib/expat-lite/CHANGES b/srclib/expat-lite/CHANGES index a3ee96265c..0340d07ee1 100644 --- a/srclib/expat-lite/CHANGES +++ b/srclib/expat-lite/CHANGES @@ -1,6 +1,6 @@ === PURPOSE === -This file documents the changes made by the Apache Software Foundation to James +This file documents the changes made by the Apache Group to James Clark's Expat parser. The original Expat distribution can be found at http://www.jclark.com/xml/expat.html. @@ -18,24 +18,48 @@ the following Expat distribution subdirectories: We also retain expat/expat.html for attribution to James Clark and licensing information. -In addition, we remove expat/xmltok/dllmain.c from our version since -we statically link expat-lite into the executable (rather than -building a DLL on the Win32 platform). The *.dsp files are also -removed, since we place those elsewhere in the Apache source -distribution and they will have a very different structure. +Note that Apache has replaced (with custom versions) the .dsp files +normally distributed with Expat. Other changes are detailed further +below. -Makefile.tmpl has been created from scratch to provide build -instructions to the Apache build system. + +=== FILES ADDED === This file (CHANGES) has been added to document changes from the original Expat distribution. +Makefile.tmpl has been created from scratch to provide build +instructions to the Apache build system. + +xmlparse.def and xmltok.def have been added. + +.cvsignore has been added. -=== CHANGES TO ORIGINAL === -There have been no changes made to any Expat file at this point in -time (May 31, 1999). +=== CHANGES TO ORIGINAL === The files, in their original state from the Expat distribution, have been tagged within CVS with the "EXPAT_1_1" tag. That tag may be used -as a reference for changes made by the Apache Software Foundation. +as a reference for changes made by the Apache Group. + +The following changes have been made: + +June, 1999: + + - modified xmldef.h to define XML_BYTE_ORDER in terms of the + AP_BYTE_ORDER symbol. + - removed compilation warnings from: xmlparse.c, xmltok.c, xmltok.h, + xmltok_impl.c, xmltok_ns.c + +November, 1999: + + - xmlparse.{def,dsp,mak} and xmltok.{def,dsp,mak} were added. + NOTE: the .dsp files are different from the standard Expat + distribution. + - dllmain.c (from the Expat distribution) was added + +January, 2000: + + - Renamed lookup() in hashtable.[ch] to hashTableLookup() to prevent + possible conflicts with third-party libraries and modules. Updated + calls in xmlparse.c accordingly. diff --git a/srclib/expat-lite/hashtable.c b/srclib/expat-lite/hashtable.c index 780a061041..26a3b444f7 100644 --- a/srclib/expat-lite/hashtable.c +++ b/srclib/expat-lite/hashtable.c @@ -58,7 +58,7 @@ unsigned long hash(KEY s) return h; } -NAMED *lookup(HASH_TABLE *table, KEY name, size_t createSize) +NAMED *hashTableLookup(HASH_TABLE *table, KEY name, size_t createSize) { size_t i; if (table->size == 0) { diff --git a/srclib/expat-lite/hashtable.h b/srclib/expat-lite/hashtable.h index df8ab8a4c8..5c3f38cbb2 100644 --- a/srclib/expat-lite/hashtable.h +++ b/srclib/expat-lite/hashtable.h @@ -56,7 +56,7 @@ typedef struct { size_t usedLim; } HASH_TABLE; -NAMED *lookup(HASH_TABLE *table, KEY name, size_t createSize); +NAMED *hashTableLookup(HASH_TABLE *table, KEY name, size_t createSize); void hashTableInit(HASH_TABLE *); void hashTableDestroy(HASH_TABLE *); diff --git a/srclib/expat-lite/xmldef.h b/srclib/expat-lite/xmldef.h index 49ce9ed636..20c31844d8 100644 --- a/srclib/expat-lite/xmldef.h +++ b/srclib/expat-lite/xmldef.h @@ -61,3 +61,10 @@ particular environments. */ #define int int32 #endif /* MOZILLA */ + +#ifdef APACHE + +#include "ap_config.h" +#define XML_BYTE_ORDER AP_BYTE_ORDER + +#endif /* APACHE */ diff --git a/srclib/expat-lite/xmlparse.c b/srclib/expat-lite/xmlparse.c index 8f9d09c86e..7b64fc26b5 100644 --- a/srclib/expat-lite/xmlparse.c +++ b/srclib/expat-lite/xmlparse.c @@ -1132,7 +1132,7 @@ doContent(XML_Parser parser, next - enc->minBytesPerChar); if (!name) return XML_ERROR_NO_MEMORY; - entity = (ENTITY *)lookup(&dtd.generalEntities, name, 0); + entity = (ENTITY *)hashTableLookup(&dtd.generalEntities, name, 0); poolDiscard(&dtd.pool); if (!entity) { if (dtd.complete || dtd.standalone) @@ -1496,12 +1496,12 @@ static enum XML_Error storeAtts(XML_Parser parser, const ENCODING *enc, const XML_Char *localPart; if (tagNamePtr) { - elementType = (ELEMENT_TYPE *)lookup(&dtd.elementTypes, tagNamePtr->str, 0); + elementType = (ELEMENT_TYPE *)hashTableLookup(&dtd.elementTypes, tagNamePtr->str, 0); if (!elementType) { tagNamePtr->str = poolCopyString(&dtd.pool, tagNamePtr->str); if (!tagNamePtr->str) return XML_ERROR_NO_MEMORY; - elementType = (ELEMENT_TYPE *)lookup(&dtd.elementTypes, tagNamePtr->str, sizeof(ELEMENT_TYPE)); + elementType = (ELEMENT_TYPE *)hashTableLookup(&dtd.elementTypes, tagNamePtr->str, sizeof(ELEMENT_TYPE)); if (!elementType) return XML_ERROR_NO_MEMORY; if (ns && !setElementTypePrefix(parser, elementType)) @@ -1613,7 +1613,7 @@ static enum XML_Error storeAtts(XML_Parser parser, const ENCODING *enc, if (appAtts[i][-1] == 2) { ATTRIBUTE_ID *id; ((XML_Char *)(appAtts[i]))[-1] = 0; - id = (ATTRIBUTE_ID *)lookup(&dtd.attributeIds, appAtts[i], 0); + id = (ATTRIBUTE_ID *)hashTableLookup(&dtd.attributeIds, appAtts[i], 0); if (id->prefix->binding) { int j; const BINDING *b = id->prefix->binding; @@ -2037,7 +2037,7 @@ prologProcessor(XML_Parser parser, const XML_Char *name = poolStoreString(&dtd.pool, encoding, s, next); if (!name) return XML_ERROR_NO_MEMORY; - declElementType = (ELEMENT_TYPE *)lookup(&dtd.elementTypes, name, sizeof(ELEMENT_TYPE)); + declElementType = (ELEMENT_TYPE *)hashTableLookup(&dtd.elementTypes, name, sizeof(ELEMENT_TYPE)); if (!declElementType) return XML_ERROR_NO_MEMORY; if (declElementType->name != name) @@ -2129,7 +2129,7 @@ prologProcessor(XML_Parser parser, if (!name) return XML_ERROR_NO_MEMORY; if (dtd.complete) { - declEntity = (ENTITY *)lookup(&dtd.generalEntities, name, sizeof(ENTITY)); + declEntity = (ENTITY *)hashTableLookup(&dtd.generalEntities, name, sizeof(ENTITY)); if (!declEntity) return XML_ERROR_NO_MEMORY; if (declEntity->name != name) { @@ -2411,7 +2411,6 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, int isCdata, if (!poolAppend(pool, enc, ptr, next)) return XML_ERROR_NO_MEMORY; break; - break; case XML_TOK_TRAILING_CR: next = ptr + enc->minBytesPerChar; /* fall through */ @@ -2439,7 +2438,7 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, int isCdata, next - enc->minBytesPerChar); if (!name) return XML_ERROR_NO_MEMORY; - entity = (ENTITY *)lookup(&dtd.generalEntities, name, 0); + entity = (ENTITY *)hashTableLookup(&dtd.generalEntities, name, 0); poolDiscard(&temp2Pool); if (!entity) { if (dtd.complete) { @@ -2696,7 +2695,7 @@ static int setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *elementType) } if (!poolAppendChar(&dtd.pool, XML_T('\0'))) return 0; - prefix = (PREFIX *)lookup(&dtd.prefixes, poolStart(&dtd.pool), sizeof(PREFIX)); + prefix = (PREFIX *)hashTableLookup(&dtd.prefixes, poolStart(&dtd.pool), sizeof(PREFIX)); if (!prefix) return 0; if (prefix->name == poolStart(&dtd.pool)) @@ -2721,7 +2720,7 @@ getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start, const if (!name) return 0; ++name; - id = (ATTRIBUTE_ID *)lookup(&dtd.attributeIds, name, sizeof(ATTRIBUTE_ID)); + id = (ATTRIBUTE_ID *)hashTableLookup(&dtd.attributeIds, name, sizeof(ATTRIBUTE_ID)); if (!id) return 0; if (id->name != name) @@ -2739,7 +2738,7 @@ getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start, const if (name[5] == '\0') id->prefix = &dtd.defaultPrefix; else - id->prefix = (PREFIX *)lookup(&dtd.prefixes, name + 6, sizeof(PREFIX)); + id->prefix = (PREFIX *)hashTableLookup(&dtd.prefixes, name + 6, sizeof(PREFIX)); id->xmlns = 1; } else { @@ -2753,7 +2752,7 @@ getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start, const } if (!poolAppendChar(&dtd.pool, XML_T('\0'))) return 0; - id->prefix = (PREFIX *)lookup(&dtd.prefixes, poolStart(&dtd.pool), sizeof(PREFIX)); + id->prefix = (PREFIX *)hashTableLookup(&dtd.prefixes, poolStart(&dtd.pool), sizeof(PREFIX)); if (id->prefix->name == poolStart(&dtd.pool)) poolFinish(&dtd.pool); else @@ -2846,7 +2845,7 @@ int setContext(XML_Parser parser, const XML_Char *context) ENTITY *e; if (!poolAppendChar(&tempPool, XML_T('\0'))) return 0; - e = (ENTITY *)lookup(&dtd.generalEntities, poolStart(&tempPool), 0); + e = (ENTITY *)hashTableLookup(&dtd.generalEntities, poolStart(&tempPool), 0); if (e) e->open = 1; if (*s != XML_T('\0')) @@ -2861,7 +2860,7 @@ int setContext(XML_Parser parser, const XML_Char *context) else { if (!poolAppendChar(&tempPool, XML_T('\0'))) return 0; - prefix = (PREFIX *)lookup(&dtd.prefixes, poolStart(&tempPool), sizeof(PREFIX)); + prefix = (PREFIX *)hashTableLookup(&dtd.prefixes, poolStart(&tempPool), sizeof(PREFIX)); if (!prefix) return 0; if (prefix->name == poolStart(&tempPool)) @@ -2971,7 +2970,7 @@ static int dtdCopy(DTD *newDtd, const DTD *oldDtd) name = poolCopyString(&(newDtd->pool), oldP->name); if (!name) return 0; - if (!lookup(&(newDtd->prefixes), name, sizeof(PREFIX))) + if (!hashTableLookup(&(newDtd->prefixes), name, sizeof(PREFIX))) return 0; } @@ -2993,7 +2992,7 @@ static int dtdCopy(DTD *newDtd, const DTD *oldDtd) if (!name) return 0; ++name; - newA = (ATTRIBUTE_ID *)lookup(&(newDtd->attributeIds), name, sizeof(ATTRIBUTE_ID)); + newA = (ATTRIBUTE_ID *)hashTableLookup(&(newDtd->attributeIds), name, sizeof(ATTRIBUTE_ID)); if (!newA) return 0; newA->maybeTokenized = oldA->maybeTokenized; @@ -3002,7 +3001,7 @@ static int dtdCopy(DTD *newDtd, const DTD *oldDtd) if (oldA->prefix == &oldDtd->defaultPrefix) newA->prefix = &newDtd->defaultPrefix; else - newA->prefix = (PREFIX *)lookup(&(newDtd->prefixes), oldA->prefix->name, 0); + newA->prefix = (PREFIX *)hashTableLookup(&(newDtd->prefixes), oldA->prefix->name, 0); } } @@ -3020,7 +3019,7 @@ static int dtdCopy(DTD *newDtd, const DTD *oldDtd) name = poolCopyString(&(newDtd->pool), oldE->name); if (!name) return 0; - newE = (ELEMENT_TYPE *)lookup(&(newDtd->elementTypes), name, sizeof(ELEMENT_TYPE)); + newE = (ELEMENT_TYPE *)hashTableLookup(&(newDtd->elementTypes), name, sizeof(ELEMENT_TYPE)); if (!newE) return 0; if (oldE->nDefaultAtts) { @@ -3030,9 +3029,9 @@ static int dtdCopy(DTD *newDtd, const DTD *oldDtd) } newE->allocDefaultAtts = newE->nDefaultAtts = oldE->nDefaultAtts; if (oldE->prefix) - newE->prefix = (PREFIX *)lookup(&(newDtd->prefixes), oldE->prefix->name, 0); + newE->prefix = (PREFIX *)hashTableLookup(&(newDtd->prefixes), oldE->prefix->name, 0); for (i = 0; i < newE->nDefaultAtts; i++) { - newE->defaultAtts[i].id = (ATTRIBUTE_ID *)lookup(&(newDtd->attributeIds), oldE->defaultAtts[i].id->name, 0); + newE->defaultAtts[i].id = (ATTRIBUTE_ID *)hashTableLookup(&(newDtd->attributeIds), oldE->defaultAtts[i].id->name, 0); newE->defaultAtts[i].isCdata = oldE->defaultAtts[i].isCdata; if (oldE->defaultAtts[i].value) { newE->defaultAtts[i].value = poolCopyString(&(newDtd->pool), oldE->defaultAtts[i].value); @@ -3057,7 +3056,7 @@ static int dtdCopy(DTD *newDtd, const DTD *oldDtd) name = poolCopyString(&(newDtd->pool), oldE->name); if (!name) return 0; - newE = (ENTITY *)lookup(&(newDtd->generalEntities), name, sizeof(ENTITY)); + newE = (ENTITY *)hashTableLookup(&(newDtd->generalEntities), name, sizeof(ENTITY)); if (!newE) return 0; if (oldE->systemId) { diff --git a/srclib/expat-lite/xmltok.c b/srclib/expat-lite/xmltok.c index a847d0108c..f0570d8145 100644 --- a/srclib/expat-lite/xmltok.c +++ b/srclib/expat-lite/xmltok.c @@ -930,7 +930,7 @@ int parsePseudoAttribute(const ENCODING *enc, const char **nextTokPtr) { int c; - char open; + char openchar; if (ptr == end) { *namePtr = 0; return 1; @@ -981,12 +981,12 @@ int parsePseudoAttribute(const ENCODING *enc, *nextTokPtr = ptr; return 0; } - open = c; + openchar = c; ptr += enc->minBytesPerChar; *valPtr = ptr; for (;; ptr += enc->minBytesPerChar) { c = toAscii(enc, ptr, end); - if (c == open) + if (c == openchar) break; if (!('a' <= c && c <= 'z') && !('A' <= c && c <= 'Z') diff --git a/srclib/expat-lite/xmltok_impl.c b/srclib/expat-lite/xmltok_impl.c index c52539be8a..5dfe29f1b9 100644 --- a/srclib/expat-lite/xmltok_impl.c +++ b/srclib/expat-lite/xmltok_impl.c @@ -593,7 +593,7 @@ int PREFIX(scanAtts)(const ENCODING *enc, const char *ptr, const char *end, /* fall through */ case BT_EQUALS: { - int open; + int opentype; #ifdef XML_NS hadColon = 0; #endif @@ -602,10 +602,10 @@ int PREFIX(scanAtts)(const ENCODING *enc, const char *ptr, const char *end, ptr += MINBPC(enc); if (ptr == end) return XML_TOK_PARTIAL; - open = BYTE_TYPE(enc, ptr); - if (open == BT_QUOT || open == BT_APOS) + opentype = BYTE_TYPE(enc, ptr); + if (opentype == BT_QUOT || opentype == BT_APOS) break; - switch (open) { + switch (opentype) { case BT_S: case BT_LF: case BT_CR: @@ -622,7 +622,7 @@ int PREFIX(scanAtts)(const ENCODING *enc, const char *ptr, const char *end, if (ptr == end) return XML_TOK_PARTIAL; t = BYTE_TYPE(enc, ptr); - if (t == open) + if (t == opentype) break; switch (t) { INVALID_CASES(ptr, nextTokPtr) @@ -957,7 +957,7 @@ int PREFIX(scanPoundName)(const ENCODING *enc, const char *ptr, const char *end, } static -int PREFIX(scanLit)(int open, const ENCODING *enc, +int PREFIX(scanLit)(int opentype, const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { @@ -968,7 +968,7 @@ int PREFIX(scanLit)(int open, const ENCODING *enc, case BT_QUOT: case BT_APOS: ptr += MINBPC(enc); - if (t != open) + if (t != opentype) break; if (ptr == end) return XML_TOK_PARTIAL; @@ -1391,7 +1391,7 @@ int PREFIX(getAtts)(const ENCODING *enc, const char *ptr, { enum { other, inName, inValue } state = inName; int nAtts = 0; - int open = 0; + int opentype = 0; for (ptr += MINBPC(enc);; ptr += MINBPC(enc)) { switch (BYTE_TYPE(enc, ptr)) { @@ -1418,9 +1418,9 @@ int PREFIX(getAtts)(const ENCODING *enc, const char *ptr, if (nAtts < attsMax) atts[nAtts].valuePtr = ptr + MINBPC(enc); state = inValue; - open = BT_QUOT; + opentype = BT_QUOT; } - else if (open == BT_QUOT) { + else if (opentype == BT_QUOT) { state = other; if (nAtts < attsMax) atts[nAtts].valueEnd = ptr; @@ -1432,9 +1432,9 @@ int PREFIX(getAtts)(const ENCODING *enc, const char *ptr, if (nAtts < attsMax) atts[nAtts].valuePtr = ptr + MINBPC(enc); state = inValue; - open = BT_APOS; + opentype = BT_APOS; } - else if (open == BT_APOS) { + else if (opentype == BT_APOS) { state = other; if (nAtts < attsMax) atts[nAtts].valueEnd = ptr; @@ -1454,7 +1454,7 @@ int PREFIX(getAtts)(const ENCODING *enc, const char *ptr, && (ptr == atts[nAtts].valuePtr || BYTE_TO_ASCII(enc, ptr) != ' ' || BYTE_TO_ASCII(enc, ptr + MINBPC(enc)) == ' ' - || BYTE_TYPE(enc, ptr + MINBPC(enc)) == open)) + || BYTE_TYPE(enc, ptr + MINBPC(enc)) == opentype)) atts[nAtts].normalized = 0; break; case BT_CR: case BT_LF: |