You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by gs...@locus.apache.org on 2000/07/01 13:33:07 UTC

cvs commit: apache-2.0/src/lib/expat-lite CHANGES hashtable.c hashtable.h xmldef.h xmlparse.c xmltok.c xmltok_impl.c

gstein      00/07/01 04:33:07

  Modified:    src/lib/expat-lite CHANGES hashtable.c hashtable.h xmldef.h
                        xmlparse.c xmltok.c xmltok_impl.c
  Log:
  bring up to date with respect to Apache 1.3 src/lib/expat-lite/
  
  Revision  Changes    Path
  1.3       +36 -12    apache-2.0/src/lib/expat-lite/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/expat-lite/CHANGES,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CHANGES	2000/03/10 00:06:51	1.2
  +++ CHANGES	2000/07/01 11:33:01	1.3
  @@ -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 @@
   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.
   
  -=== CHANGES TO ORIGINAL ===
  +.cvsignore has been added.
  +
   
  -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.
  
  
  
  1.2       +1 -1      apache-2.0/src/lib/expat-lite/hashtable.c
  
  Index: hashtable.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/expat-lite/hashtable.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- hashtable.c	1999/06/18 18:39:25	1.1
  +++ hashtable.c	2000/07/01 11:33:02	1.2
  @@ -58,7 +58,7 @@
     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) {
  
  
  
  1.2       +1 -1      apache-2.0/src/lib/expat-lite/hashtable.h
  
  Index: hashtable.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/expat-lite/hashtable.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- hashtable.h	1999/06/18 18:39:25	1.1
  +++ hashtable.h	2000/07/01 11:33:02	1.2
  @@ -56,7 +56,7 @@
     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 *);
   
  
  
  
  1.2       +7 -0      apache-2.0/src/lib/expat-lite/xmldef.h
  
  Index: xmldef.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/expat-lite/xmldef.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- xmldef.h	1999/06/18 18:39:25	1.1
  +++ xmldef.h	2000/07/01 11:33:02	1.2
  @@ -61,3 +61,10 @@
   #define int int32
   
   #endif /* MOZILLA */
  +
  +#ifdef APACHE
  +
  +#include "ap_config.h"
  +#define XML_BYTE_ORDER AP_BYTE_ORDER
  +
  +#endif /* APACHE */
  
  
  
  1.2       +20 -21    apache-2.0/src/lib/expat-lite/xmlparse.c
  
  Index: xmlparse.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/expat-lite/xmlparse.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- xmlparse.c	1999/06/18 18:39:25	1.1
  +++ xmlparse.c	2000/07/01 11:33:02	1.2
  @@ -1132,7 +1132,7 @@
   				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 @@
     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 @@
         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 @@
   	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 @@
   	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 @@
         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 @@
   			       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 @@
         }
         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 @@
     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 @@
         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 @@
   	  }
   	  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 @@
         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 @@
         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 @@
       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 @@
       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 @@
         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 @@
       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 @@
       }
       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 @@
       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) {
  
  
  
  1.2       +3 -3      apache-2.0/src/lib/expat-lite/xmltok.c
  
  Index: xmltok.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/expat-lite/xmltok.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- xmltok.c	1999/06/18 18:39:25	1.1
  +++ xmltok.c	2000/07/01 11:33:02	1.2
  @@ -930,7 +930,7 @@
   			 const char **nextTokPtr)
   {
     int c;
  -  char open;
  +  char openchar;
     if (ptr == end) {
       *namePtr = 0;
       return 1;
  @@ -981,12 +981,12 @@
       *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')
  
  
  
  1.2       +13 -13    apache-2.0/src/lib/expat-lite/xmltok_impl.c
  
  Index: xmltok_impl.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/expat-lite/xmltok_impl.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- xmltok_impl.c	1999/06/18 18:39:26	1.1
  +++ xmltok_impl.c	2000/07/01 11:33:02	1.2
  @@ -593,7 +593,7 @@
       /* fall through */
       case BT_EQUALS:
         {
  -	int open;
  +	int opentype;
   #ifdef XML_NS
   	hadColon = 0;
   #endif
  @@ -602,10 +602,10 @@
   	  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 @@
   	  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 @@
   }
   
   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 @@
       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 @@
   {
     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 @@
   	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 @@
   	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 @@
   	       && (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: