From fdrake@users.sourceforge.net Fri Aug 2 14:16:36 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri Aug 2 13:16:36 2002 Subject: [Expat-checkins] expat/lib xmlparse.c,1.59,1.60 Message-ID: Update of /cvsroot/expat/expat/lib In directory usw-pr-cvs1:/tmp/cvs-serv7811/lib Modified Files: xmlparse.c Log Message: Define specific return values for the XML_Parse*() functions, and use them to test all XML_Parse*() return values in the test and sample code. This is binary-compatible with previous Expat 1.95.x releases. dtdInit(): Make this a void function, since there is only one possible return value. parserInit(), poolGrow(), setContext(): Make these return XML_Bool values, to match their intended semantics. XML_ParseBuffer(): Use NULL instead of 0 for a pointer value. Index: xmlparse.c =================================================================== RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- xmlparse.c 1 Aug 2002 05:42:57 -0000 1.59 +++ xmlparse.c 2 Aug 2002 19:44:09 -0000 1.60 @@ -335,9 +335,9 @@ const char *end); static const XML_Char *getContext(XML_Parser parser); -static int setContext(XML_Parser parser, const XML_Char *context); +static XML_Bool setContext(XML_Parser parser, const XML_Char *context); static void normalizePublicId(XML_Char *s); -static int dtdInit(DTD *, XML_Parser parser); +static void dtdInit(DTD *, XML_Parser parser); static void dtdDestroy(DTD *, XML_Parser parser); @@ -365,7 +365,7 @@ static XML_Char *poolStoreString(STRING_POOL *pool, const ENCODING *enc, const char *ptr, const char *end); -static int poolGrow(STRING_POOL *pool); +static XML_Bool poolGrow(STRING_POOL *pool); static int nextScaffoldPart(XML_Parser parser); static XML_Content *build_model(XML_Parser parser); @@ -379,7 +379,7 @@ const char *ptr, const char *end); -static int parserInit(XML_Parser parser, const XML_Char *encodingName); +static XML_Bool parserInit(XML_Parser parser, const XML_Char *encodingName); #define poolStart(pool) ((pool)->start) #define poolEnd(pool) ((pool)->ptr) @@ -694,7 +694,7 @@ return parser; } -static int +static XML_Bool parserInit(XML_Parser parser, const XML_Char *encodingName) { processor = prologInitProcessor; @@ -765,7 +765,8 @@ isParamEntity = XML_FALSE; paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER; #endif - return dtdInit(&dtd, parser); + dtdInit(&dtd, parser); + return XML_TRUE; } int @@ -1222,19 +1223,19 @@ #endif } -int +enum XML_Status XML_Parse(XML_Parser parser, const char *s, int len, int isFinal) { if (len == 0) { if (!isFinal) - return 1; + return XML_STATUS_OK; positionPtr = bufferPtr; errorCode = processor(parser, bufferPtr, parseEndPtr = bufferEnd, 0); if (errorCode == XML_ERROR_NONE) - return 1; + return XML_STATUS_OK; eventEndPtr = eventPtr; processor = errorProcessor; - return 0; + return XML_STATUS_ERROR; } #ifndef XML_CONTEXT_BYTES else if (bufferPtr == bufferEnd) { @@ -1245,16 +1246,16 @@ if (isFinal) { errorCode = processor(parser, s, parseEndPtr = s + len, 0); if (errorCode == XML_ERROR_NONE) - return 1; + return XML_STATUS_OK; eventEndPtr = eventPtr; processor = errorProcessor; - return 0; + return XML_STATUS_ERROR; } errorCode = processor(parser, s, parseEndPtr = s + len, &end); if (errorCode != XML_ERROR_NONE) { eventEndPtr = eventPtr; processor = errorProcessor; - return 0; + return XML_STATUS_ERROR; } XmlUpdatePosition(encoding, positionPtr, end, &position); nLeftOver = s + len - end; @@ -1265,14 +1266,14 @@ temp = buffer == 0 ? MALLOC(len * 2) : REALLOC(buffer, len * 2); if (temp == NULL) { errorCode = XML_ERROR_NO_MEMORY; - return 0; + return XML_STATUS_ERROR; } buffer = temp; if (!buffer) { errorCode = XML_ERROR_NO_MEMORY; eventPtr = eventEndPtr = NULL; processor = errorProcessor; - return 0; + return XML_STATUS_ERROR; } bufferLim = buffer + len * 2; } @@ -1280,13 +1281,13 @@ bufferPtr = buffer; bufferEnd = buffer + nLeftOver; } - return 1; + return XML_STATUS_OK; } #endif /* not defined XML_CONTEXT_BYTES */ else { void *buff = XML_GetBuffer(parser, len); if (buff == NULL) - return 0; + return XML_STATUS_ERROR; else { memcpy(buff, s, len); return XML_ParseBuffer(parser, len, isFinal); @@ -1294,7 +1295,7 @@ } } -int +enum XML_Status XML_ParseBuffer(XML_Parser parser, int len, int isFinal) { const char *start = bufferPtr; @@ -1302,16 +1303,16 @@ bufferEnd += len; parseEndByteIndex += len; errorCode = processor(parser, start, parseEndPtr = bufferEnd, - isFinal ? (const char **)0 : &bufferPtr); + isFinal ? (const char **)NULL : &bufferPtr); if (errorCode == XML_ERROR_NONE) { if (!isFinal) XmlUpdatePosition(encoding, positionPtr, bufferPtr, &position); - return 1; + return XML_STATUS_OK; } else { eventEndPtr = eventPtr; processor = errorProcessor; - return 0; + return XML_STATUS_ERROR; } } @@ -4490,7 +4491,7 @@ return tempPool.start; } -static int +static XML_Bool setContext(XML_Parser parser, const XML_Char *context) { const XML_Char *s = context; @@ -4499,7 +4500,7 @@ if (*s == CONTEXT_SEP || *s == XML_T('\0')) { ENTITY *e; if (!poolAppendChar(&tempPool, XML_T('\0'))) - return 0; + return XML_FALSE; e = (ENTITY *)lookup(&dtd.generalEntities, poolStart(&tempPool), 0); if (e) e->open = XML_TRUE; @@ -4514,15 +4515,15 @@ prefix = &dtd.defaultPrefix; else { if (!poolAppendChar(&tempPool, XML_T('\0'))) - return 0; + return XML_FALSE; prefix = (PREFIX *)lookup(&dtd.prefixes, poolStart(&tempPool), sizeof(PREFIX)); if (!prefix) - return 0; + return XML_FALSE; if (prefix->name == poolStart(&tempPool)) { prefix->name = poolCopyString(&dtd.pool, prefix->name); if (!prefix->name) - return 0; + return XML_FALSE; } poolDiscard(&tempPool); } @@ -4530,12 +4531,12 @@ *context != CONTEXT_SEP && *context != XML_T('\0'); context++) if (!poolAppendChar(&tempPool, *context)) - return 0; + return XML_FALSE; if (!poolAppendChar(&tempPool, XML_T('\0'))) - return 0; + return XML_FALSE; if (!addBinding(parser, prefix, 0, poolStart(&tempPool), &inheritedBindings)) - return 0; + return XML_FALSE; poolDiscard(&tempPool); if (*context != XML_T('\0')) ++context; @@ -4543,11 +4544,11 @@ } else { if (!poolAppendChar(&tempPool, *s)) - return 0; + return XML_FALSE; s++; } } - return 1; + return XML_TRUE; } static void @@ -4572,7 +4573,7 @@ *p = XML_T('\0'); } -static int +static void dtdInit(DTD *p, XML_Parser parser) { XML_Memory_Handling_Suite *ms = &((Parser *) parser)->m_mem; @@ -4601,8 +4602,6 @@ p->contentStringLen = 0; p->scaffSize = 0; p->scaffCount = 0; - - return 1; } #ifdef XML_DTD @@ -4999,10 +4998,10 @@ p = tem; } } - pool->blocks = 0; - pool->start = 0; - pool->ptr = 0; - pool->end = 0; + pool->blocks = NULL; + pool->start = NULL; + pool->ptr = NULL; + pool->end = NULL; } static void @@ -5014,17 +5013,17 @@ pool->mem->free_fcn(p); p = tem; } - pool->blocks = 0; + pool->blocks = NULL; p = pool->freeBlocks; while (p) { BLOCK *tem = p->next; pool->mem->free_fcn(p); p = tem; } - pool->freeBlocks = 0; - pool->ptr = 0; - pool->start = 0; - pool->end = 0; + pool->freeBlocks = NULL; + pool->ptr = NULL; + pool->start = NULL; + pool->end = NULL; } static XML_Char * @@ -5092,7 +5091,7 @@ return pool->start; } -static int +static XML_Bool poolGrow(STRING_POOL *pool) { if (pool->freeBlocks) { @@ -5103,7 +5102,7 @@ pool->start = pool->blocks->s; pool->end = pool->start + pool->blocks->size; pool->ptr = pool->start; - return 1; + return XML_TRUE; } if (pool->end - pool->start < pool->freeBlocks->size) { BLOCK *tem = pool->freeBlocks->next; @@ -5115,7 +5114,7 @@ pool->ptr = pool->blocks->s + (pool->ptr - pool->start); pool->start = pool->blocks->s; pool->end = pool->start + pool->blocks->size; - return 1; + return XML_TRUE; } } if (pool->blocks && pool->start == pool->blocks->s) { @@ -5123,8 +5122,8 @@ pool->blocks = pool->mem->realloc_fcn(pool->blocks, offsetof(BLOCK, s) + blockSize * sizeof(XML_Char)); - if (!pool->blocks) - return 0; + if (pool->blocks == NULL) + return XML_FALSE; pool->blocks->size = blockSize; pool->ptr = pool->blocks->s + (pool->ptr - pool->start); pool->start = pool->blocks->s; @@ -5140,7 +5139,7 @@ tem = pool->mem->malloc_fcn(offsetof(BLOCK, s) + blockSize * sizeof(XML_Char)); if (!tem) - return 0; + return XML_FALSE; tem->size = blockSize; tem->next = pool->blocks; pool->blocks = tem; @@ -5151,7 +5150,7 @@ pool->start = tem->s; pool->end = tem->s + blockSize; } - return 1; + return XML_TRUE; } static int From fdrake@users.sourceforge.net Fri Aug 2 14:16:42 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri Aug 2 13:16:42 2002 Subject: [Expat-checkins] expat/lib expat.h,1.29,1.30 Message-ID: Update of /cvsroot/expat/expat/lib In directory usw-pr-cvs1:/tmp/cvs-serv6238/lib Modified Files: expat.h Log Message: Define specific return values for the XML_Parse*() functions, and use them to test all XML_Parse*() return values in the test and sample code. This is binary-compatible with previous Expat 1.95.x releases. Index: expat.h =================================================================== RCS file: /cvsroot/expat/expat/lib/expat.h,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- expat.h 31 Jul 2002 22:10:42 -0000 1.29 +++ expat.h 2 Aug 2002 19:40:09 -0000 1.30 @@ -648,17 +648,39 @@ XMLPARSEAPI(int) XML_GetIdAttributeIndex(XML_Parser parser); -/* Parses some input. Returns 0 if a fatal error is detected. The - last call to XML_Parse must have isFinal true; len may be zero for - this call (or any other). +/* Parses some input. Returns XML_STATUS_ERROR if a fatal error is + detected. The last call to XML_Parse must have isFinal true; len + may be zero for this call (or any other). + + The XML_Status enum gives the possible return values for the + XML_Parse and XML_ParseBuffer functions. Though the return values + for these functions has always been described as a Boolean value, + the implementation, at least for the 1.95.x series, has always + returned exactly one of these values. The preprocessor #defines + are included so this stanza can be added to code that still needs + to support older versions of Expat 1.95.x: + + #ifndef XML_STATUS_OK + #define XML_STATUS_OK 1 + #define XML_STATUS_ERROR 0 + #endif + + Otherwise, the #define hackery is quite ugly and would have been dropped. */ -XMLPARSEAPI(int) +enum XML_Status { + XML_STATUS_ERROR = 0, +#define XML_STATUS_ERROR XML_STATUS_ERROR + XML_STATUS_OK = 1 +#define XML_STATUS_OK XML_STATUS_OK +}; + +XMLPARSEAPI(enum XML_Status) XML_Parse(XML_Parser parser, const char *s, int len, int isFinal); XMLPARSEAPI(void *) XML_GetBuffer(XML_Parser parser, int len); -XMLPARSEAPI(int) +XMLPARSEAPI(enum XML_Status) XML_ParseBuffer(XML_Parser parser, int len, int isFinal); /* Creates an XML_Parser object that can parse an external general From fdrake@users.sourceforge.net Fri Aug 2 14:16:42 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri Aug 2 13:16:42 2002 Subject: [Expat-checkins] expat/examples elements.c,1.2,1.3 outline.c,1.3,1.4 Message-ID: Update of /cvsroot/expat/expat/examples In directory usw-pr-cvs1:/tmp/cvs-serv6238/examples Modified Files: elements.c outline.c Log Message: Define specific return values for the XML_Parse*() functions, and use them to test all XML_Parse*() return values in the test and sample code. This is binary-compatible with previous Expat 1.95.x releases. Index: elements.c =================================================================== RCS file: /cvsroot/expat/expat/examples/elements.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- elements.c 1 Jul 2002 14:45:51 -0000 1.2 +++ elements.c 2 Aug 2002 19:40:09 -0000 1.3 @@ -37,7 +37,7 @@ do { size_t len = fread(buf, 1, sizeof(buf), stdin); done = len < sizeof(buf); - if (!XML_Parse(parser, buf, len, done)) { + if (XML_Parse(parser, buf, len, done) == XML_STATUS_ERROR) { fprintf(stderr, "%s at line %d\n", XML_ErrorString(XML_GetErrorCode(parser)), Index: outline.c =================================================================== RCS file: /cvsroot/expat/expat/examples/outline.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- outline.c 1 Jul 2002 14:45:51 -0000 1.3 +++ outline.c 2 Aug 2002 19:40:09 -0000 1.4 @@ -76,7 +76,7 @@ } done = feof(stdin); - if (! XML_Parse(p, Buff, len, done)) { + if (XML_Parse(p, Buff, len, done) == XML_STATUS_ERROR) { fprintf(stderr, "Parse error at line %d:\n%s\n", XML_GetCurrentLineNumber(p), XML_ErrorString(XML_GetErrorCode(p))); From fdrake@users.sourceforge.net Fri Aug 2 14:16:43 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri Aug 2 13:16:43 2002 Subject: [Expat-checkins] expat/tests runtests.c,1.27,1.28 Message-ID: Update of /cvsroot/expat/expat/tests In directory usw-pr-cvs1:/tmp/cvs-serv6238/tests Modified Files: runtests.c Log Message: Define specific return values for the XML_Parse*() functions, and use them to test all XML_Parse*() return values in the test and sample code. This is binary-compatible with previous Expat 1.95.x releases. Index: runtests.c =================================================================== RCS file: /cvsroot/expat/expat/tests/runtests.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- runtests.c 24 Jul 2002 01:20:18 -0000 1.27 +++ runtests.c 2 Aug 2002 19:40:09 -0000 1.28 @@ -55,7 +55,7 @@ char text[] = "\0"; /* test that a NUL byte (in US-ASCII data) is an error */ - if (XML_Parse(parser, text, sizeof(text) - 1, 1)) + if (XML_Parse(parser, text, sizeof(text) - 1, 1) == XML_STATUS_OK) fail("Parser did not report error on NUL-byte."); if (XML_GetErrorCode(parser) != XML_ERROR_INVALID_TOKEN) xml_failure(parser); @@ -68,7 +68,7 @@ char *text = ""; /* test that a NUL byte (in US-ASCII data) is an error */ - if (XML_Parse(parser, text, strlen(text), 1)) + if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_OK) fail("Parser did not report error on NUL-byte."); if (XML_GetErrorCode(parser) != XML_ERROR_BAD_CHAR_REF) xml_failure(parser); @@ -80,7 +80,7 @@ /* This test is really just making sure we don't core on a UTF-8 BOM. */ char *text = "\357\273\277"; - if (!XML_Parse(parser, text, strlen(text), 1)) + if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR) xml_failure(parser); } END_TEST @@ -89,7 +89,7 @@ { char text[] = "\376\377\0<\0e\0/\0>"; - if (!XML_Parse(parser, text, sizeof(text) - 1, 1)) + if (XML_Parse(parser, text, sizeof(text) - 1, 1) == XML_STATUS_ERROR) xml_failure(parser); } END_TEST @@ -98,7 +98,7 @@ { char text[] = "\377\376<\0e\0/\0>\0"; - if (!XML_Parse(parser, text, sizeof(text) - 1, 1)) + if (XML_Parse(parser, text, sizeof(text) - 1, 1) == XML_STATUS_ERROR) xml_failure(parser); } END_TEST @@ -129,7 +129,7 @@ CharData_Init(&storage); XML_SetUserData(parser, &storage); XML_SetCharacterDataHandler(parser, accumulate_characters); - if (!XML_Parse(parser, text, strlen(text), 1)) + if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR) xml_failure(parser); CharData_CheckXMLChars(&storage, expected); } @@ -142,7 +142,7 @@ CharData_Init(&storage); XML_SetUserData(parser, &storage); XML_SetStartElementHandler(parser, accumulate_attribute); - if (!XML_Parse(parser, text, strlen(text), 1)) + if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR) xml_failure(parser); CharData_CheckXMLChars(&storage, expected); } @@ -211,7 +211,7 @@ for (i = 128; i <= 255; ++i) { sprintf(text, "%ccd", i); - if (XML_Parse(parser, text, strlen(text), 1)) { + if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_OK) { sprintf(text, "expected token error for '%c' (ordinal %d) in UTF-8 text", i, i); @@ -238,7 +238,7 @@ "\000<\000d\000o\000c\000 \000a\000=\000'\0001\0002\0003\000'" "\000>\000s\000o\000m\000e\000 \000t\000e\000x\000t\000<\000/" "\000d\000o\000c\000>"; - if (!XML_Parse(parser, text, sizeof(text) - 1, 1)) + if (XML_Parse(parser, text, sizeof(text) - 1, 1) == XML_STATUS_ERROR) xml_failure(parser); } END_TEST @@ -271,7 +271,7 @@ " \n" ""; int lineno; - if (!XML_Parse(parser, text, strlen(text), 1)) + if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR) xml_failure(parser); lineno = XML_GetCurrentLineNumber(parser); if (lineno != 3) { @@ -312,7 +312,7 @@ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+" ""; - if (!XML_Parse(parser, text, strlen(text), 1)) + if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR) xml_failure(parser); } END_TEST @@ -339,7 +339,7 @@ CharData_Init(&storage); XML_SetUserData(parser, &storage); XML_SetEndElementHandler(parser, end_element_event_handler); - if (!XML_Parse(parser, text, strlen(text), 1)) + if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR) xml_failure(parser); CharData_CheckString(&storage, expected); } @@ -452,7 +452,7 @@ XML_SetStartElementHandler(parser, check_attr_contains_normalized_whitespace); - if (!XML_Parse(parser, text, strlen(text), 1)) + if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR) xml_failure(parser); } END_TEST @@ -469,7 +469,7 @@ "\n" "&eee;"; - if (!XML_Parse(parser, text, strlen(text), 1)) { + if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR) { if (XML_GetErrorCode(parser) != XML_ERROR_MISPLACED_XML_PI) xml_failure(parser); } @@ -503,7 +503,7 @@ ""; XML_SetUnknownEncodingHandler(parser, UnknownEncodingHandler, NULL); - if (!XML_Parse(parser, text, strlen(text), 1)) + if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR) xml_failure(parser); } END_TEST @@ -575,7 +575,7 @@ XML_SetReturnNSTriplet(parser, 1); XML_SetUserData(parser, elemstr); XML_SetElementHandler(parser, triplet_start_checker, triplet_end_checker); - if (!XML_Parse(parser, text, strlen(text), 1)) + if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR) xml_failure(parser); } END_TEST @@ -612,7 +612,7 @@ XML_SetUserData(parser, &storage); XML_SetElementHandler(parser, overwrite_start_checker, overwrite_end_checker); - if (!XML_Parse(parser, text, strlen(text), 1)) + if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR) xml_failure(parser); CharData_CheckString(&storage, result); } From fdrake@users.sourceforge.net Fri Aug 2 14:16:44 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri Aug 2 13:16:44 2002 Subject: [Expat-checkins] expat/xmlwf xmlfile.c,1.11,1.12 Message-ID: Update of /cvsroot/expat/expat/xmlwf In directory usw-pr-cvs1:/tmp/cvs-serv6238/xmlwf Modified Files: xmlfile.c Log Message: Define specific return values for the XML_Parse*() functions, and use them to test all XML_Parse*() return values in the test and sample code. This is binary-compatible with previous Expat 1.95.x releases. Index: xmlfile.c =================================================================== RCS file: /cvsroot/expat/expat/xmlwf/xmlfile.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- xmlfile.c 1 Jul 2002 15:13:01 -0000 1.11 +++ xmlfile.c 2 Aug 2002 19:40:09 -0000 1.12 @@ -66,7 +66,7 @@ { XML_Parser parser = ((PROCESS_ARGS *)args)->parser; int *retPtr = ((PROCESS_ARGS *)args)->retPtr; - if (!XML_Parse(parser, data, size, 1)) { + if (XML_Parse(parser, data, size, 1) == XML_STATUS_ERROR) { reportError(parser, filename); *retPtr = 0; } @@ -167,7 +167,7 @@ close(fd); return 0; } - if (!XML_ParseBuffer(parser, nread, nread == 0)) { + if (XML_ParseBuffer(parser, nread, nread == 0) == XML_STATUS_ERROR) { reportError(parser, filename != NULL ? filename : "STDIN"); if (filename != NULL) close(fd); From fdrake@users.sourceforge.net Thu Aug 8 12:55:03 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu Aug 8 11:55:03 2002 Subject: [Expat-checkins] expat/doc reference.html,1.14,1.15 Message-ID: Update of /cvsroot/expat/expat/doc In directory usw-pr-cvs1:/tmp/cvs-serv12006 Modified Files: reference.html Log Message: Update the API documentation with the use of XML_Status for the XML_Parse() and XML_ParseBuffer() functions. Index: reference.html =================================================================== RCS file: /cvsroot/expat/expat/doc/reference.html,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- reference.html 27 Jul 2002 23:13:16 -0000 1.14 +++ reference.html 8 Aug 2002 18:54:15 -0000 1.15 @@ -646,12 +646,18 @@ apply to the parser created by XML_ExternalEntityParserCreate.

+
+enum XML_Status {
+  XML_STATUS_ERROR = 0,
+  XML_STATUS_OK = 1
+};
+
Parse some more of the document. The string s is a buffer containing part (or perhaps all) of the document. The number of bytes of s @@ -662,20 +668,21 @@ isFinal parameter informs the parser that this is the last piece of the document. Frequently, the last piece is empty (i.e. len is zero.) -If a parse error occurred, it returns 0. Otherwise it returns a non-zero -value. +If a parse error occurred, it returns XML_STATUS_ERROR. +Otherwise it returns XML_STATUS_OK value.
-This is just like XML_Parse, except in this case expat provides the buffer. -By obtaining the buffer from expat with the XML_GetBuffer -function, the application can avoid double copying of the input. +This is just like XML_Parse, except in this case expat +provides the buffer. By obtaining the buffer from expat with the +XML_GetBuffer function, the application can avoid double +copying of the input.
+

Sets a handler for any characters in the document which wouldn't -otherwise be handled. This includes both data for which no handlers can be -set (like some kinds of DTD declarations) and data which could be reported -but which currently has no handler set. Note that a contiguous piece of -data that is destined to be reported to the default handler may actually -be reported over several calls to the handler. Setting the handler with +otherwise be handled. This includes both data for which no handlers +can be set (like some kinds of DTD declarations) and data which could +be reported but which currently has no handler set. The characters +are passed exactly as they were present in the XML document except +that they will be encoded in UTF-8. Line boundaries are not +normalized. Note that a byte order mark character is not passed to the +default handler. There are no guarantees about how characters are +divided between calls to the default handler: for example, a comment +might be split between multiple calls. Setting the handler with this call has the side effect of turning off expansion of references to internally defined general entities. Instead these references are passed to the default handler.

+ +

See also XML_DefaultCurrent.

@@ -898,8 +907,12 @@ const XML_Char *s, int len);
-

This sets a default handler, but doesn't affect expansion of internal -entity references.

+

This sets a default handler, but doesn't inhibit the expansion of +internal entity references. The entity reference will not be passed +to the default handler.

+ +

See also XML_DefaultCurrent.

@@ -1521,6 +1534,20 @@ The order of returned parts is URI, local name, and prefix.

If do_nst is zero, then namespaces are reported in the default manner, URI then local_name separated by the namespace separator.

+
+ + +
+This can be called within a handler for a start element, end element, +processing instruction or character data. It causes the corresponding +markup to be passed to the default handler set by XML_SetDefaultHandler or +XML_SetDefaultHandlerExpand. It does nothing if there is +>not a default handler.




From fdrake@users.sourceforge.net  Thu Aug  8 14:38:03 2002
From: fdrake@users.sourceforge.net (Fred L. Drake)
Date: Thu Aug  8 13:38:03 2002
Subject: [Expat-checkins] expat/doc style.css,1.2,1.3
Message-ID: 

Update of /cvsroot/expat/expat/doc
In directory usw-pr-cvs1:/tmp/cvs-serv13256

Modified Files:
	style.css 
Log Message:
Style cleanup.


Index: style.css
===================================================================
RCS file: /cvsroot/expat/expat/doc/style.css,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- style.css	20 Dec 2000 22:30:54 -0000	1.2
+++ style.css	8 Aug 2002 20:37:11 -0000	1.3
@@ -5,22 +5,22 @@
 .eg {
   padding-left: 1em;
   padding-top: .5em;
+  padding-bottom: .5em;
   border: solid thin;
   margin: 1em 0;
   background-color: tan;
-  margin-left: 5%;
+  margin-left: 2em;
   margin-right: 10%;
 }
 
 .handler {
   width: 100%;
   border-top-width: thin;  
-  margin-left: 5%;
   margin-bottom: 1em;
 }
 
 .handler p {
-  margin-left: 3%;
+  margin-left: 2em;
 }
 
 .setter {
@@ -38,7 +38,7 @@
 }
 
 .fcndef {
-  margin-left: 5%;
+  margin-left: 2em;
   margin-bottom: 2em;
 }
 




From fdrake@users.sourceforge.net  Thu Aug  8 14:42:03 2002
From: fdrake@users.sourceforge.net (Fred L. Drake)
Date: Thu Aug  8 13:42:03 2002
Subject: [Expat-checkins] expat/doc reference.html,1.16,1.17
Message-ID: 

Update of /cvsroot/expat/expat/doc
In directory usw-pr-cvs1:/tmp/cvs-serv14710

Modified Files:
	reference.html 
Log Message:
Lots of really minor changes:
- Wrap paragraphs more consistently.
- Make this well-formed XML.
- When making a hyperlink to a function description, consistently
  place the anchor inside the code, not the other way around.
- Make more references to function names hyperlinks to the
  descriptions.
- Fix a few small typos.
- Don't always use an extra div to carry a class attribute, just stick
  it on the pre.


Index: reference.html
===================================================================
RCS file: /cvsroot/expat/expat/doc/reference.html,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- reference.html	8 Aug 2002 19:29:08 -0000	1.16
+++ reference.html	8 Aug 2002 20:41:43 -0000	1.17
@@ -8,9 +8,9 @@
      This is free software. You may distribute or modify according to
      the terms of the MIT/X License -->
   Expat XML Parser
-  
-  
-  
+  
+  
+  
 
 
[...1156 lines suppressed...]
-
+
 typedef struct {
   int major;
   int minor;
   int micro;
 } XML_Expat_Version;
-
+
Some macros are also defined that support compile-time tests of the library version:
    @@ -1581,7 +1596,6 @@ Testing these constants is currently the best way to determine if particular parts of the Expat API are available.
- From fdrake@users.sourceforge.net Thu Aug 8 15:52:01 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu Aug 8 14:52:01 2002 Subject: [Expat-checkins] expat/doc valid-xhtml10.png,NONE,1.1 Message-ID: Update of /cvsroot/expat/expat/doc In directory usw-pr-cvs1:/tmp/cvs-serv4776 Added Files: valid-xhtml10.png Log Message: Add the "Valid XHTML 1.0" icon. --- NEW FILE: valid-xhtml10.png --- (This appears to be a binary file; contents omitted.) From fdrake@users.sourceforge.net Thu Aug 8 15:52:03 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu Aug 8 14:52:03 2002 Subject: [Expat-checkins] expat/doc reference.html,1.17,1.18 Message-ID: Update of /cvsroot/expat/expat/doc In directory usw-pr-cvs1:/tmp/cvs-serv4898 Modified Files: reference.html Log Message: Specify XHTML 1.0 Strict, conform, and add the "Valid XHTML 1.0" icon. Rip out a lot of the extra layers of