From fdrake@users.sourceforge.net Mon Oct 1 14:04:10 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon Oct 1 13:04:10 2001 Subject: [Expat-checkins] CVS: expat/conftools ac_c_bigendian_cross.m4,1.1,1.2 Message-ID: Update of /cvsroot/expat/expat/conftools In directory usw-pr-cvs1:/tmp/cvs-serv27042 Modified Files: ac_c_bigendian_cross.m4 Log Message: Added a "-c" option to the $CC command line to make this macro work as expected on more platforms (IBM's xlC compiler in particular). Index: ac_c_bigendian_cross.m4 =================================================================== RCS file: /cvsroot/expat/expat/conftools/ac_c_bigendian_cross.m4,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ac_c_bigendian_cross.m4 2001/07/24 19:51:35 1.1 --- ac_c_bigendian_cross.m4 2001/10/01 20:03:13 1.2 *************** *** 51,55 **** EOF ] if test -f conftest.c ; then ! if ${CC-cc} conftest.c -o conftest.o && test -f conftest.o ; then if test `grep -l BIGenDianSyS conftest.o` ; then echo $ac_n ' big endian probe OK, ' 1>&AC_FD_MSG --- 51,55 ---- EOF ] if test -f conftest.c ; then ! if ${CC-cc} -c conftest.c -o conftest.o && test -f conftest.o ; then if test `grep -l BIGenDianSyS conftest.o` ; then echo $ac_n ' big endian probe OK, ' 1>&AC_FD_MSG From fdrake@users.sourceforge.net Mon Oct 1 14:16:24 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon Oct 1 13:16:24 2001 Subject: [Expat-checkins] CVS: expat Makefile.in,1.18,1.19 Message-ID: Update of /cvsroot/expat/expat In directory usw-pr-cvs1:/tmp/cvs-serv30217 Modified Files: Makefile.in Log Message: Abandon the use of directory names as target names; there are enough platforms for which .PHONY is not implemented that this causes the build to be tedious for those users, leading to bug reports. Index: Makefile.in =================================================================== RCS file: /cvsroot/expat/expat/Makefile.in,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Makefile.in 2001/08/23 13:26:37 1.18 --- Makefile.in 2001/10/01 20:15:39 1.19 *************** *** 53,57 **** LIBTOOL = @LIBTOOL@ - SUBDIRS = lib examples xmlwf CONFIG_HEADERS = config.h --- 53,56 ---- *************** *** 60,72 **** ! default: lib xmlwf ! buildlib: lib ! all: $(SUBDIRS) ! $(SUBDIRS): ! cd $@ && $(MAKE) clean: cd lib && rm -f $(LIBRARY) *.o *.lo && rm -rf .libs _libs --- 59,77 ---- ! default: library xmlwf ! buildlib: library ! all: library wfchecker samples ! library: ! cd lib && $(MAKE) + wfchecker: + cd xmlwf && $(MAKE) + + samples: + cd examples && $(MAKE) + clean: cd lib && rm -f $(LIBRARY) *.o *.lo && rm -rf .libs _libs *************** *** 84,88 **** rm -f conftools/ltconfig conftools/ltmain.sh ! check: $(SUBDIRS) cd tests && $(MAKE) check --- 89,93 ---- rm -f conftools/ltconfig conftools/ltmain.sh ! check: all cd tests && $(MAKE) check *************** *** 98,102 **** rm -f $(libdir)/$(APIHEADER) ! .PHONY: buildlib all $(SUBDIRS) \ clean distclean extraclean maintainer-clean \ dist distdir \ --- 103,107 ---- rm -f $(libdir)/$(APIHEADER) ! .PHONY: buildlib all library wfchecker samples \ clean distclean extraclean maintainer-clean \ dist distdir \ From fdrake@users.sourceforge.net Mon Oct 1 14:53:26 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon Oct 1 13:53:26 2001 Subject: [Expat-checkins] CVS: expat/lib xmlparse.c,1.23,1.24 Message-ID: Update of /cvsroot/expat/expat/lib In directory usw-pr-cvs1:/tmp/cvs-serv8475/lib Modified Files: xmlparse.c Log Message: Wrap a *lot* of long lines to fit in an 80-column world, but still not all. Change one of the error messages, closing SF bug #463032. Index: xmlparse.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** xmlparse.c 2001/08/23 12:35:53 1.23 --- xmlparse.c 2001/10/01 20:52:54 1.24 *************** *** 237,241 **** handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName); static enum XML_Error ! processXmlDecl(XML_Parser parser, int isGeneralTextEntity, const char *, const char *); static enum XML_Error initializeEncoding(XML_Parser parser); --- 237,242 ---- handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName); static enum XML_Error ! processXmlDecl(XML_Parser parser, int isGeneralTextEntity, ! const char *, const char *); static enum XML_Error initializeEncoding(XML_Parser parser); *************** *** 249,261 **** const char *start, const char *end, const char **endPtr); static enum XML_Error ! doCdataSection(XML_Parser parser, const ENCODING *, const char **startPtr, const char *end, const char **nextPtr); #ifdef XML_DTD static enum XML_Error ! doIgnoreSection(XML_Parser parser, const ENCODING *, const char **startPtr, const char *end, const char **nextPtr); #endif /* XML_DTD */ ! static enum XML_Error storeAtts(XML_Parser parser, const ENCODING *, const char *s, TAG_NAME *tagNamePtr, BINDING **bindingsPtr); static ! int addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId, const XML_Char *uri, BINDING **bindingsPtr); static int --- 250,266 ---- const char *start, const char *end, const char **endPtr); static enum XML_Error ! doCdataSection(XML_Parser parser, const ENCODING *, const char **startPtr, ! const char *end, const char **nextPtr); #ifdef XML_DTD static enum XML_Error ! doIgnoreSection(XML_Parser parser, const ENCODING *, const char **startPtr, ! const char *end, const char **nextPtr); #endif /* XML_DTD */ ! static enum XML_Error storeAtts(XML_Parser parser, const ENCODING *, ! const char *s, TAG_NAME *tagNamePtr, BINDING **bindingsPtr); static ! int addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId, ! const XML_Char *uri, BINDING **bindingsPtr); static int *************** *** 265,284 **** static enum XML_Error ! storeAttributeValue(XML_Parser parser, const ENCODING *, int isCdata, const char *, const char *, ! STRING_POOL *); static enum XML_Error ! appendAttributeValue(XML_Parser parser, const ENCODING *, int isCdata, const char *, const char *, ! STRING_POOL *); static ATTRIBUTE_ID * ! getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); static int setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *); static enum XML_Error ! storeEntityValue(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); static int ! reportProcessingInstruction(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); static int ! reportComment(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); static void ! reportDefault(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); static const XML_Char *getContext(XML_Parser parser); --- 270,294 ---- static enum XML_Error ! storeAttributeValue(XML_Parser parser, const ENCODING *, int isCdata, ! const char *, const char *, STRING_POOL *); static enum XML_Error ! appendAttributeValue(XML_Parser parser, const ENCODING *, int isCdata, ! const char *, const char *, STRING_POOL *); static ATTRIBUTE_ID * ! getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start, ! const char *end); static int setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *); static enum XML_Error ! storeEntityValue(XML_Parser parser, const ENCODING *enc, const char *start, ! const char *end); static int ! reportProcessingInstruction(XML_Parser parser, const ENCODING *enc, ! const char *start, const char *end); static int ! reportComment(XML_Parser parser, const ENCODING *enc, const char *start, ! const char *end); static void ! reportDefault(XML_Parser parser, const ENCODING *enc, const char *start, ! const char *end); static const XML_Char *getContext(XML_Parser parser); *************** *** 319,323 **** static const XML_Char *poolCopyString(STRING_POOL *pool, const XML_Char *s); ! static const XML_Char *poolCopyStringN(STRING_POOL *pool, const XML_Char *s, int n); static const XML_Char *poolAppendString(STRING_POOL *pool, const XML_Char *s); static ELEMENT_TYPE * getElementType(XML_Parser Paraser, --- 329,334 ---- static const XML_Char *poolCopyString(STRING_POOL *pool, const XML_Char *s); ! static const XML_Char *poolCopyStringN(STRING_POOL *pool, const XML_Char *s, ! int n); static const XML_Char *poolAppendString(STRING_POOL *pool, const XML_Char *s); static ELEMENT_TYPE * getElementType(XML_Parser Paraser, *************** *** 339,343 **** typedef struct { ! /* The first member must be userData so that the XML_GetUserData macro works. */ void *m_userData; void *m_handlerArg; --- 350,355 ---- typedef struct { ! /* The first member must be userData so that the XML_GetUserData ! macro works. */ void *m_userData; void *m_handlerArg; *************** *** 658,662 **** poolInit(&tempPool, &(((Parser *) parser)->m_mem)); poolInit(&temp2Pool, &(((Parser *) parser)->m_mem)); ! protocolEncodingName = encodingName ? poolCopyString(&tempPool, encodingName) : 0; curBase = 0; if (!dtdInit(&dtd, parser) || !atts || !dataBuf --- 670,676 ---- poolInit(&tempPool, &(((Parser *) parser)->m_mem)); poolInit(&temp2Pool, &(((Parser *) parser)->m_mem)); ! protocolEncodingName = (encodingName ! ? poolCopyString(&tempPool, encodingName) ! : 0); curBase = 0; if (!dtdInit(&dtd, parser) || !atts || !dataBuf *************** *** 1303,1308 **** XML_T("no element found"), XML_T("not well-formed (invalid token)"), - XML_T("unclosed token"), XML_T("unclosed token"), XML_T("mismatched tag"), XML_T("duplicate attribute"), --- 1317,1322 ---- XML_T("no element found"), XML_T("not well-formed (invalid token)"), XML_T("unclosed token"), + XML_T("partial character"), XML_T("mismatched tag"), XML_T("duplicate attribute"), *************** *** 1633,1637 **** if (nextPtr) { /* Need to guarantee that: ! tag->buf + ROUND_UP(tag->rawNameLength, sizeof(XML_Char)) <= tag->bufEnd - sizeof(XML_Char) */ if (tag->rawNameLength + (int)(sizeof(XML_Char) - 1) + (int)sizeof(XML_Char) > tag->bufEnd - tag->buf) { int bufSize = tag->rawNameLength * 4; --- 1647,1652 ---- if (nextPtr) { /* Need to guarantee that: ! tag->buf + ROUND_UP(tag->rawNameLength, sizeof(XML_Char)) ! <= tag->bufEnd - sizeof(XML_Char) */ if (tag->rawNameLength + (int)(sizeof(XML_Char) - 1) + (int)sizeof(XML_Char) > tag->bufEnd - tag->buf) { int bufSize = tag->rawNameLength * 4; *************** *** 1654,1658 **** int bufSize; if (nextPtr) ! toPtr = (XML_Char *)(tag->buf + ROUND_UP(tag->rawNameLength, sizeof(XML_Char))); else toPtr = (XML_Char *)tag->buf; --- 1669,1674 ---- int bufSize; if (nextPtr) ! toPtr = (XML_Char *)(tag->buf + ROUND_UP(tag->rawNameLength, ! sizeof(XML_Char))); else toPtr = (XML_Char *)tag->buf; *************** *** 1675,1679 **** if (result) return result; ! startElementHandler(handlerArg, tag->name.str, (const XML_Char **)atts); poolClear(&tempPool); } --- 1691,1696 ---- if (result) return result; ! startElementHandler(handlerArg, tag->name.str, ! (const XML_Char **)atts); poolClear(&tempPool); } *************** *** 1804,1811 **** changing only the character data. You set up a defaultHandler and a characterDataHandler. The defaultHandler simply copies ! characters through. The characterDataHandler does the transformation ! and writes the characters out escaping them as necessary. This case ! will fail to work if we leave out the following two lines (because & ! and < inside CDATA sections will be incorrectly escaped). However, now we have a start/endCdataSectionHandler, so it seems --- 1821,1829 ---- changing only the character data. You set up a defaultHandler and a characterDataHandler. The defaultHandler simply copies ! characters through. The characterDataHandler does the ! transformation and writes the characters out escaping them as ! necessary. This case will fail to work if we leave out the ! following two lines (because & and < inside CDATA sections will ! be incorrectly escaped). However, now we have a start/endCdataSectionHandler, so it seems *************** *** 1833,1837 **** ICHAR *dataPtr = (ICHAR *)dataBuf; XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)dataBufEnd); ! characterDataHandler(handlerArg, dataBuf, dataPtr - (ICHAR *)dataBuf); } else --- 1851,1856 ---- ICHAR *dataPtr = (ICHAR *)dataBuf; XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)dataBufEnd); ! characterDataHandler(handlerArg, dataBuf, ! dataPtr - (ICHAR *)dataBuf); } else *************** *** 1858,1862 **** XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd); *eventEndPP = s; ! characterDataHandler(handlerArg, dataBuf, dataPtr - (ICHAR *)dataBuf); if (s == next) break; --- 1877,1882 ---- XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd); *eventEndPP = s; ! characterDataHandler(handlerArg, dataBuf, ! dataPtr - (ICHAR *)dataBuf); if (s == next) break; *************** *** 1899,1903 **** ELEMENT_TYPE *elementType = 0; int nDefaultAtts = 0; ! const XML_Char **appAtts; /* the attribute list to pass to the application */ int attIndex = 0; int i; --- 1919,1923 ---- ELEMENT_TYPE *elementType = 0; int nDefaultAtts = 0; ! const XML_Char **appAtts; /* the attribute list for the application */ int attIndex = 0; int i; *************** *** 1914,1918 **** if (!tagNamePtr->str) return XML_ERROR_NO_MEMORY; ! elementType = (ELEMENT_TYPE *)lookup(&dtd.elementTypes, tagNamePtr->str, sizeof(ELEMENT_TYPE)); if (!elementType) return XML_ERROR_NO_MEMORY; --- 1934,1939 ---- if (!tagNamePtr->str) return XML_ERROR_NO_MEMORY; ! elementType = (ELEMENT_TYPE *)lookup(&dtd.elementTypes, tagNamePtr->str, ! sizeof(ELEMENT_TYPE)); if (!elementType) return XML_ERROR_NO_MEMORY; *************** *** 1979,1983 **** else if (tagNamePtr) { /* the value did not need normalizing */ ! appAtts[attIndex] = poolStoreString(&tempPool, enc, atts[i].valuePtr, atts[i].valueEnd); if (appAtts[attIndex] == 0) return XML_ERROR_NO_MEMORY; --- 2000,2005 ---- else if (tagNamePtr) { /* the value did not need normalizing */ ! appAtts[attIndex] = poolStoreString(&tempPool, enc, atts[i].valuePtr, ! atts[i].valueEnd); if (appAtts[attIndex] == 0) return XML_ERROR_NO_MEMORY; *************** *** 1988,1992 **** if (attId->xmlns) { /* deal with namespace declarations here */ ! if (!addBinding(parser, attId->prefix, attId, appAtts[attIndex], bindingsPtr)) return XML_ERROR_NO_MEMORY; --attIndex; --- 2010,2015 ---- if (attId->xmlns) { /* deal with namespace declarations here */ ! if (!addBinding(parser, attId->prefix, attId, appAtts[attIndex], ! bindingsPtr)) return XML_ERROR_NO_MEMORY; --attIndex; *************** *** 2020,2024 **** if (da->id->prefix) { if (da->id->xmlns) { ! if (!addBinding(parser, da->id->prefix, da->id, da->value, bindingsPtr)) return XML_ERROR_NO_MEMORY; } --- 2043,2048 ---- if (da->id->prefix) { if (da->id->xmlns) { ! if (!addBinding(parser, da->id->prefix, da->id, da->value, ! bindingsPtr)) return XML_ERROR_NO_MEMORY; } *************** *** 2126,2130 **** static ! int addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId, const XML_Char *uri, BINDING **bindingsPtr) { BINDING *b; --- 2150,2155 ---- static ! int addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId, ! const XML_Char *uri, BINDING **bindingsPtr) { BINDING *b; *************** *** 2183,2187 **** const char **endPtr) { ! enum XML_Error result = doCdataSection(parser, encoding, &start, end, endPtr); if (start) { processor = contentProcessor; --- 2208,2213 ---- const char **endPtr) { ! enum XML_Error result = doCdataSection(parser, encoding, &start, ! end, endPtr); if (start) { processor = contentProcessor; *************** *** 2247,2251 **** XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd); *eventEndPP = next; ! characterDataHandler(handlerArg, dataBuf, dataPtr - (ICHAR *)dataBuf); if (s == next) break; --- 2273,2278 ---- XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd); *eventEndPP = next; ! characterDataHandler(handlerArg, dataBuf, ! dataPtr - (ICHAR *)dataBuf); if (s == next) break; *************** *** 2297,2301 **** const char **endPtr) { ! enum XML_Error result = doIgnoreSection(parser, encoding, &start, end, endPtr); if (start) { processor = prologProcessor; --- 2324,2329 ---- const char **endPtr) { ! enum XML_Error result = doIgnoreSection(parser, encoding, &start, ! end, endPtr); if (start) { processor = prologProcessor; *************** *** 2458,2466 **** enum XML_Error result; if (! storedEncName) { ! storedEncName = poolStoreString(&temp2Pool, ! encoding, ! encodingName, ! encodingName ! + XmlNameLength(encoding, encodingName)); if (! storedEncName) return XML_ERROR_NO_MEMORY; --- 2486,2492 ---- enum XML_Error result; if (! storedEncName) { ! storedEncName = poolStoreString( ! &temp2Pool, encoding, encodingName, ! encodingName + XmlNameLength(encoding, encodingName)); if (! storedEncName) return XML_ERROR_NO_MEMORY; *************** *** 2491,2495 **** info.data = 0; info.release = 0; ! if (unknownEncodingHandler(unknownEncodingHandlerData, encodingName, &info)) { ENCODING *enc; unknownEncodingMem = MALLOC(XmlSizeOfUnknownEncoding()); --- 2517,2522 ---- info.data = 0; info.release = 0; ! if (unknownEncodingHandler(unknownEncodingHandlerData, encodingName, ! &info)) { ENCODING *enc; unknownEncodingMem = MALLOC(XmlSizeOfUnknownEncoding()); *************** *** 2803,2807 **** if (dtd.complete /* ID attributes aren't allowed to have a default */ ! && !defineAttribute(declElementType, declAttributeId, declAttributeIsCdata, 0, attVal, parser)) return XML_ERROR_NO_MEMORY; if (attlistDeclHandler && declAttributeType) { --- 2830,2835 ---- if (dtd.complete /* ID attributes aren't allowed to have a default */ ! && !defineAttribute(declElementType, declAttributeId, ! declAttributeIsCdata, 0, attVal, parser)) return XML_ERROR_NO_MEMORY; if (attlistDeclHandler && declAttributeType) { *************** *** 2938,2942 **** return XML_ERROR_NO_MEMORY; if (dtd.complete) { ! declEntity = (ENTITY *)lookup(&dtd.generalEntities, name, sizeof(ENTITY)); if (!declEntity) return XML_ERROR_NO_MEMORY; --- 2966,2971 ---- return XML_ERROR_NO_MEMORY; if (dtd.complete) { ! declEntity = (ENTITY *)lookup(&dtd.generalEntities, name, ! sizeof(ENTITY)); if (!declEntity) return XML_ERROR_NO_MEMORY; *************** *** 3089,3095 **** if (dtd.in_eldecl && ! groupConnector[prologState.level] ! && dtd.scaffold[dtd.scaffIndex[dtd.scaffLevel - 1]].type != XML_CTYPE_MIXED ) { ! dtd.scaffold[dtd.scaffIndex[dtd.scaffLevel - 1]].type = XML_CTYPE_CHOICE; } groupConnector[prologState.level] = '|'; --- 3118,3126 ---- if (dtd.in_eldecl && ! groupConnector[prologState.level] ! && (dtd.scaffold[dtd.scaffIndex[dtd.scaffLevel - 1]].type ! != XML_CTYPE_MIXED) ) { ! dtd.scaffold[dtd.scaffIndex[dtd.scaffLevel - 1]].type ! = XML_CTYPE_CHOICE; } groupConnector[prologState.level] = '|'; *************** *** 3186,3190 **** case XML_ROLE_CONTENT_PCDATA: if (dtd.in_eldecl) { ! dtd.scaffold[dtd.scaffIndex[dtd.scaffLevel - 1]].type = XML_CTYPE_MIXED; } break; --- 3217,3222 ---- case XML_ROLE_CONTENT_PCDATA: if (dtd.in_eldecl) { ! dtd.scaffold[dtd.scaffIndex[dtd.scaffLevel - 1]].type ! = XML_CTYPE_MIXED; } break; *************** *** 3383,3387 **** STRING_POOL *pool) { ! enum XML_Error result = appendAttributeValue(parser, enc, isCdata, ptr, end, pool); if (result) return result; --- 3415,3420 ---- STRING_POOL *pool) { ! enum XML_Error result = appendAttributeValue(parser, enc, isCdata, ptr, ! end, pool); if (result) return result; *************** *** 3498,3502 **** const XML_Char *textEnd = entity->textPtr + entity->textLen; entity->open = 1; ! result = appendAttributeValue(parser, internalEncoding, isCdata, (char *)entity->textPtr, (char *)textEnd, pool); entity->open = 0; if (result) --- 3531,3537 ---- const XML_Char *textEnd = entity->textPtr + entity->textLen; entity->open = 1; ! result = appendAttributeValue(parser, internalEncoding, isCdata, ! (char *)entity->textPtr, ! (char *)textEnd, pool); entity->open = 0; if (result) *************** *** 3647,3651 **** static int ! reportProcessingInstruction(XML_Parser parser, const ENCODING *enc, const char *start, const char *end) { const XML_Char *target; --- 3682,3687 ---- static int ! reportProcessingInstruction(XML_Parser parser, const ENCODING *enc, ! const char *start, const char *end) { const XML_Char *target; *************** *** 3675,3679 **** static int ! reportComment(XML_Parser parser, const ENCODING *enc, const char *start, const char *end) { XML_Char *data; --- 3711,3716 ---- static int ! reportComment(XML_Parser parser, const ENCODING *enc, ! const char *start, const char *end) { XML_Char *data; *************** *** 3696,3700 **** static void ! reportDefault(XML_Parser parser, const ENCODING *enc, const char *s, const char *end) { if (MUST_CONVERT(enc, s)) { --- 3733,3738 ---- static void ! reportDefault(XML_Parser parser, const ENCODING *enc, ! const char *s, const char *end) { if (MUST_CONVERT(enc, s)) { *************** *** 3740,3749 **** if (type->allocDefaultAtts == 0) { type->allocDefaultAtts = 8; ! type->defaultAtts = MALLOC(type->allocDefaultAtts*sizeof(DEFAULT_ATTRIBUTE)); } else { type->allocDefaultAtts *= 2; type->defaultAtts = REALLOC(type->defaultAtts, ! type->allocDefaultAtts*sizeof(DEFAULT_ATTRIBUTE)); } if (!type->defaultAtts) --- 3778,3789 ---- if (type->allocDefaultAtts == 0) { type->allocDefaultAtts = 8; ! type->defaultAtts = MALLOC(type->allocDefaultAtts ! * sizeof(DEFAULT_ATTRIBUTE)); } else { type->allocDefaultAtts *= 2; type->defaultAtts = REALLOC(type->defaultAtts, ! (type->allocDefaultAtts ! * sizeof(DEFAULT_ATTRIBUTE))); } if (!type->defaultAtts) *************** *** 3773,3777 **** if (!poolAppendChar(&dtd.pool, XML_T('\0'))) return 0; ! prefix = (PREFIX *)lookup(&dtd.prefixes, poolStart(&dtd.pool), sizeof(PREFIX)); if (!prefix) return 0; --- 3813,3818 ---- if (!poolAppendChar(&dtd.pool, XML_T('\0'))) return 0; ! prefix = (PREFIX *)lookup(&dtd.prefixes, poolStart(&dtd.pool), ! sizeof(PREFIX)); if (!prefix) return 0; *************** *** 3788,3792 **** static ATTRIBUTE_ID * ! getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start, const char *end) { ATTRIBUTE_ID *id; --- 3829,3834 ---- static ATTRIBUTE_ID * ! getAttributeId(XML_Parser parser, const ENCODING *enc, ! const char *start, const char *end) { ATTRIBUTE_ID *id; *************** *** 3830,3834 **** if (!poolAppendChar(&dtd.pool, XML_T('\0'))) return 0; ! id->prefix = (PREFIX *)lookup(&dtd.prefixes, poolStart(&dtd.pool), sizeof(PREFIX)); if (id->prefix->name == poolStart(&dtd.pool)) poolFinish(&dtd.pool); --- 3872,3877 ---- if (!poolAppendChar(&dtd.pool, XML_T('\0'))) return 0; ! id->prefix = (PREFIX *)lookup(&dtd.prefixes, poolStart(&dtd.pool), ! sizeof(PREFIX)); if (id->prefix->name == poolStart(&dtd.pool)) poolFinish(&dtd.pool); *************** *** 3938,3942 **** if (!poolAppendChar(&tempPool, XML_T('\0'))) return 0; ! prefix = (PREFIX *)lookup(&dtd.prefixes, poolStart(&tempPool), sizeof(PREFIX)); if (!prefix) return 0; --- 3981,3986 ---- if (!poolAppendChar(&tempPool, XML_T('\0'))) return 0; ! prefix = (PREFIX *)lookup(&dtd.prefixes, poolStart(&tempPool), ! sizeof(PREFIX)); if (!prefix) return 0; *************** *** 3948,3957 **** poolDiscard(&tempPool); } ! for (context = s + 1; *context != CONTEXT_SEP && *context != XML_T('\0'); context++) if (!poolAppendChar(&tempPool, *context)) return 0; if (!poolAppendChar(&tempPool, XML_T('\0'))) return 0; ! if (!addBinding(parser, prefix, 0, poolStart(&tempPool), &inheritedBindings)) return 0; poolDiscard(&tempPool); --- 3992,4004 ---- poolDiscard(&tempPool); } ! for (context = s + 1; ! *context != CONTEXT_SEP && *context != XML_T('\0'); ! context++) if (!poolAppendChar(&tempPool, *context)) return 0; if (!poolAppendChar(&tempPool, XML_T('\0'))) return 0; ! if (!addBinding(parser, prefix, 0, poolStart(&tempPool), ! &inheritedBindings)) return 0; poolDiscard(&tempPool); *************** *** 4096,4100 **** return 0; ++name; ! newA = (ATTRIBUTE_ID *)lookup(&(newDtd->attributeIds), name, sizeof(ATTRIBUTE_ID)); if (!newA) return 0; --- 4143,4148 ---- return 0; ++name; ! newA = (ATTRIBUTE_ID *)lookup(&(newDtd->attributeIds), name, ! sizeof(ATTRIBUTE_ID)); if (!newA) return 0; *************** *** 4105,4109 **** newA->prefix = &newDtd->defaultPrefix; else ! newA->prefix = (PREFIX *)lookup(&(newDtd->prefixes), oldA->prefix->name, 0); } } --- 4153,4158 ---- newA->prefix = &newDtd->defaultPrefix; else ! newA->prefix = (PREFIX *)lookup(&(newDtd->prefixes), ! oldA->prefix->name, 0); } } *************** *** 4123,4144 **** if (!name) return 0; ! newE = (ELEMENT_TYPE *)lookup(&(newDtd->elementTypes), name, sizeof(ELEMENT_TYPE)); if (!newE) return 0; if (oldE->nDefaultAtts) { ! newE->defaultAtts = (DEFAULT_ATTRIBUTE *)MALLOC(oldE->nDefaultAtts * sizeof(DEFAULT_ATTRIBUTE)); if (!newE->defaultAtts) return 0; } if (oldE->idAtt) ! newE->idAtt = (ATTRIBUTE_ID *)lookup(&(newDtd->attributeIds), oldE->idAtt->name, 0); newE->allocDefaultAtts = newE->nDefaultAtts = oldE->nDefaultAtts; if (oldE->prefix) ! newE->prefix = (PREFIX *)lookup(&(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].isCdata = oldE->defaultAtts[i].isCdata; if (oldE->defaultAtts[i].value) { ! newE->defaultAtts[i].value = poolCopyString(&(newDtd->pool), oldE->defaultAtts[i].value); if (!newE->defaultAtts[i].value) return 0; --- 4172,4199 ---- if (!name) return 0; ! newE = (ELEMENT_TYPE *)lookup(&(newDtd->elementTypes), name, ! sizeof(ELEMENT_TYPE)); if (!newE) return 0; if (oldE->nDefaultAtts) { ! newE->defaultAtts = (DEFAULT_ATTRIBUTE *) ! MALLOC(oldE->nDefaultAtts * sizeof(DEFAULT_ATTRIBUTE)); if (!newE->defaultAtts) return 0; } if (oldE->idAtt) ! newE->idAtt = (ATTRIBUTE_ID *) ! lookup(&(newDtd->attributeIds), oldE->idAtt->name, 0); newE->allocDefaultAtts = newE->nDefaultAtts = oldE->nDefaultAtts; if (oldE->prefix) ! newE->prefix = (PREFIX *)lookup(&(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].isCdata = oldE->defaultAtts[i].isCdata; if (oldE->defaultAtts[i].value) { ! newE->defaultAtts[i].value ! = poolCopyString(&(newDtd->pool), oldE->defaultAtts[i].value); if (!newE->defaultAtts[i].value) return 0; *************** *** 4217,4221 **** } else { ! const XML_Char *tem = poolCopyStringN(newPool, oldE->textPtr, oldE->textLen); if (!tem) return 0; --- 4272,4277 ---- } else { ! const XML_Char *tem = poolCopyStringN(newPool, oldE->textPtr, ! oldE->textLen); if (!tem) return 0; *************** *** 4439,4443 **** } ! static const XML_Char *poolCopyStringN(STRING_POOL *pool, const XML_Char *s, int n) { if (!pool->ptr && !poolGrow(pool)) --- 4495,4500 ---- } ! static const XML_Char *poolCopyStringN(STRING_POOL *pool, ! const XML_Char *s, int n) { if (!pool->ptr && !poolGrow(pool)) *************** *** 4494,4498 **** pool->blocks = pool->freeBlocks; pool->freeBlocks = tem; ! memcpy(pool->blocks->s, pool->start, (pool->end - pool->start) * sizeof(XML_Char)); pool->ptr = pool->blocks->s + (pool->ptr - pool->start); pool->start = pool->blocks->s; --- 4551,4556 ---- pool->blocks = pool->freeBlocks; pool->freeBlocks = tem; ! memcpy(pool->blocks->s, pool->start, ! (pool->end - pool->start) * sizeof(XML_Char)); pool->ptr = pool->blocks->s + (pool->ptr - pool->start); pool->start = pool->blocks->s; *************** *** 4503,4507 **** if (pool->blocks && pool->start == pool->blocks->s) { int blockSize = (pool->end - pool->start)*2; ! pool->blocks = pool->mem->realloc_fcn(pool->blocks, offsetof(BLOCK, s) + blockSize * sizeof(XML_Char)); if (!pool->blocks) return 0; --- 4561,4567 ---- if (pool->blocks && pool->start == pool->blocks->s) { int blockSize = (pool->end - pool->start)*2; ! pool->blocks = pool->mem->realloc_fcn(pool->blocks, ! offsetof(BLOCK, s) ! + blockSize * sizeof(XML_Char)); if (!pool->blocks) return 0; *************** *** 4518,4522 **** else blockSize *= 2; ! tem = pool->mem->malloc_fcn(offsetof(BLOCK, s) + blockSize * sizeof(XML_Char)); if (!tem) return 0; --- 4578,4583 ---- else blockSize *= 2; ! tem = pool->mem->malloc_fcn(offsetof(BLOCK, s) ! + blockSize * sizeof(XML_Char)); if (!tem) return 0; *************** *** 4525,4529 **** pool->blocks = tem; if (pool->ptr != pool->start) ! memcpy(tem->s, pool->start, (pool->ptr - pool->start) * sizeof(XML_Char)); pool->ptr = tem->s + (pool->ptr - pool->start); pool->start = tem->s; --- 4586,4591 ---- pool->blocks = tem; if (pool->ptr != pool->start) ! memcpy(tem->s, pool->start, ! (pool->ptr - pool->start) * sizeof(XML_Char)); pool->ptr = tem->s + (pool->ptr - pool->start); pool->start = tem->s; *************** *** 4549,4558 **** if (dtd.scaffold) { dtd.scaffSize *= 2; ! dtd.scaffold = (CONTENT_SCAFFOLD *) REALLOC(dtd.scaffold, ! dtd.scaffSize * sizeof(CONTENT_SCAFFOLD)); } else { dtd.scaffSize = 32; ! dtd.scaffold = (CONTENT_SCAFFOLD *) MALLOC(dtd.scaffSize * sizeof(CONTENT_SCAFFOLD)); } if (! dtd.scaffold) --- 4611,4621 ---- if (dtd.scaffold) { dtd.scaffSize *= 2; ! dtd.scaffold = (CONTENT_SCAFFOLD *) ! REALLOC(dtd.scaffold, dtd.scaffSize * sizeof(CONTENT_SCAFFOLD)); } else { dtd.scaffSize = 32; ! dtd.scaffold = (CONTENT_SCAFFOLD *) ! MALLOC(dtd.scaffSize * sizeof(CONTENT_SCAFFOLD)); } if (! dtd.scaffold) *************** *** 4562,4566 **** me = &dtd.scaffold[next]; if (dtd.scaffLevel) { ! CONTENT_SCAFFOLD *parent = &dtd.scaffold[dtd.scaffIndex[dtd.scaffLevel - 1]]; if (parent->lastchild) { dtd.scaffold[parent->lastchild].nextsib = next; --- 4625,4629 ---- me = &dtd.scaffold[next]; if (dtd.scaffLevel) { ! CONTENT_SCAFFOLD *parent = &dtd.scaffold[dtd.scaffIndex[dtd.scaffLevel-1]]; if (parent->lastchild) { dtd.scaffold[parent->lastchild].nextsib = next; From fdrake@users.sourceforge.net Tue Oct 2 10:41:04 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue Oct 2 09:41:04 2001 Subject: [Expat-checkins] CVS: expat Makefile.in,1.19,1.20 Message-ID: Update of /cvsroot/expat/expat In directory usw-pr-cvs1:/tmp/cvs-serv29641 Modified Files: Makefile.in Log Message: Revert previous change and use an alternate approach, this time actually tested on one of the platforms that exhibited the problem this tries to fix. Solution contributed by Michael C. Maggio; thanks! Index: Makefile.in =================================================================== RCS file: /cvsroot/expat/expat/Makefile.in,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Makefile.in 2001/10/01 20:15:39 1.19 --- Makefile.in 2001/10/02 16:40:17 1.20 *************** *** 53,56 **** --- 53,57 ---- LIBTOOL = @LIBTOOL@ + SUBDIRS = lib examples xmlwf CONFIG_HEADERS = config.h *************** *** 58,76 **** LIBRARY = libexpat.la - - default: library xmlwf - - buildlib: library ! all: library wfchecker samples ! library: ! cd lib && $(MAKE) ! wfchecker: ! cd xmlwf && $(MAKE) ! samples: ! cd examples && $(MAKE) clean: --- 59,71 ---- LIBRARY = libexpat.la ! default: lib xmlwf ! buildlib: lib ! all: $(SUBDIRS) ! $(SUBDIRS):: ! cd $@ && $(MAKE) clean: *************** *** 89,93 **** rm -f conftools/ltconfig conftools/ltmain.sh ! check: all cd tests && $(MAKE) check --- 84,88 ---- rm -f conftools/ltconfig conftools/ltmain.sh ! check: $(SUBDIRS) cd tests && $(MAKE) check *************** *** 103,107 **** rm -f $(libdir)/$(APIHEADER) ! .PHONY: buildlib all library wfchecker samples \ clean distclean extraclean maintainer-clean \ dist distdir \ --- 98,102 ---- rm -f $(libdir)/$(APIHEADER) ! .PHONY: buildlib all $(SUBDIRS) \ clean distclean extraclean maintainer-clean \ dist distdir \ From venkat_tvr_78@rediffmail.com Thu Oct 4 23:54:01 2001 From: venkat_tvr_78@rediffmail.com (raghu ram) Date: Thu Oct 4 22:54:01 2001 Subject: [Expat-checkins] can expat parser parse xsl sheets too Message-ID: <20011005060621.17378.qmail@mailweb12.rediffmail.com> Hi,=0D=0AI just want to know whether the expat 1.2 xmlparser works fine wit= h xsl pages too.=0D=0AThanks in advance=0D=0ARaghu =0A