diff --git a/expat/gennmtab/gennmtab.c b/expat/gennmtab/gennmtab.c index 001bf583..4cbdf91d 100755 --- a/expat/gennmtab/gennmtab.c +++ b/expat/gennmtab/gennmtab.c @@ -1,5 +1,7 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ +/* +Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd +See the file copying.txt for copying permission. +*/ #include #include @@ -222,6 +224,7 @@ struct range nmstrt[] = { { 0x3021, 0x3029 }, }; +/* name chars that are not name start chars */ struct range name[] = { { '.' }, { '-' }, diff --git a/expat/sample/elements.c b/expat/sample/elements.c index 4e60e1a7..42745c4c 100755 --- a/expat/sample/elements.c +++ b/expat/sample/elements.c @@ -1,5 +1,4 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ +/* This is simple demonstration of how to use expat. This program reads an XML document from standard input and writes a line with the name of each element to standard output indenting child elements by one tab stop more than their parent element. */ diff --git a/expat/xmlec/xmlec.c b/expat/xmlec/xmlec.c index 5891bd3d..c7657744 100755 --- a/expat/xmlec/xmlec.c +++ b/expat/xmlec/xmlec.c @@ -1,5 +1,3 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ #include #include #include diff --git a/expat/xmlparse/xmlparse.c b/expat/xmlparse/xmlparse.c index 3f612e76..7da8f941 100755 --- a/expat/xmlparse/xmlparse.c +++ b/expat/xmlparse/xmlparse.c @@ -1,5 +1,7 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ +/* +Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd +See the file copying.txt for copying permission. +*/ #include "xmldef.h" #include "xmlparse.h" @@ -40,6 +42,7 @@ typedef char ICHAR; #define XML_T(x) x #endif +/* Round up n to be a multiple of sz, where sz is a power of 2. */ #define ROUND_UP(n, sz) (((n) + ((sz) - 1)) & ~((sz) - 1)) #include "xmltok.h" @@ -127,6 +130,7 @@ typedef struct { XML_Char *start; } STRING_POOL; +/* The XML_Char before the name is used to determine whether an attribute has been specified. */ typedef struct attribute_id { XML_Char *name; @@ -1569,6 +1573,7 @@ doContent(XML_Parser parser, /* not reached */ } +/* If tagNamePtr is non-null, build a real list of attributes, otherwise just check the attributes for well-formedness. */ static enum XML_Error storeAtts(XML_Parser parser, const ENCODING *enc, @@ -1843,6 +1848,7 @@ int addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId, con return 1; } +/* The idea here is to avoid using stack for each CDATA section when the whole file is parsed with one call. */ static @@ -1859,6 +1865,7 @@ enum XML_Error cdataSectionProcessor(XML_Parser parser, return result; } +/* startPtr gets set to non-null is the section is closed, and to null if the section is not yet closed. */ static @@ -1954,6 +1961,7 @@ enum XML_Error doCdataSection(XML_Parser parser, #ifdef XML_DTD +/* The idea here is to avoid using stack for each IGNORE section when the whole file is parsed with one call. */ static @@ -1970,6 +1978,7 @@ enum XML_Error ignoreSectionProcessor(XML_Parser parser, return result; } +/* startPtr gets set to non-null is the section is closed, and to null if the section is not yet closed. */ static @@ -3420,6 +3429,7 @@ static void dtdDestroy(DTD *p) poolDestroy(&(p->pool)); } +/* Do a deep copy of the DTD. Return 0 for out of memory; non-zero otherwise. The new DTD has already been initialized. */ static int dtdCopy(DTD *newDtd, const DTD *oldDtd) diff --git a/expat/xmlparse/xmlparse.h b/expat/xmlparse/xmlparse.h index 11f55e47..ce9f02a2 100755 --- a/expat/xmlparse/xmlparse.h +++ b/expat/xmlparse/xmlparse.h @@ -1,5 +1,7 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ +/* +Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd +See the file copying.txt for copying permission. +*/ #ifndef XmlParse_INCLUDED #define XmlParse_INCLUDED 1 @@ -16,7 +18,9 @@ typedef void *XML_Parser; #ifdef XML_UNICODE_WCHAR_T +/* XML_UNICODE_WCHAR_T will work only if sizeof(wchar_t) == 2 and wchar_t uses Unicode. */ +/* Information is UTF-16 encoded as wchar_ts */ #ifndef XML_UNICODE #define XML_UNICODE @@ -30,11 +34,13 @@ typedef wchar_t XML_LChar; #ifdef XML_UNICODE +/* Information is UTF-16 encoded as unsigned shorts */ typedef unsigned short XML_Char; typedef char XML_LChar; #else /* not XML_UNICODE */ +/* Information is UTF-8 encoded. */ typedef char XML_Char; typedef char XML_LChar; @@ -43,11 +49,13 @@ typedef char XML_LChar; #endif /* not XML_UNICODE_WCHAR_T */ +/* Constructs a new parser; encoding is the encoding specified by the external protocol or null if there is none specified. */ XML_Parser XMLPARSEAPI XML_ParserCreate(const XML_Char *encoding); +/* Constructs a new parser and namespace processor. Element type names and attribute names that belong to a namespace will be expanded; unprefixed attribute names are never expanded; unprefixed element type names are expanded only if there is a default namespace. The expanded @@ -61,6 +69,7 @@ XML_Parser XMLPARSEAPI XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator); +/* atts is array of name/value pairs, terminated by 0; names and values are 0 terminated. */ typedef void (*XML_StartElementHandler)(void *userData, @@ -70,19 +79,23 @@ typedef void (*XML_StartElementHandler)(void *userData, typedef void (*XML_EndElementHandler)(void *userData, const XML_Char *name); +/* s is not 0 terminated. */ typedef void (*XML_CharacterDataHandler)(void *userData, const XML_Char *s, int len); +/* target and data are 0 terminated */ typedef void (*XML_ProcessingInstructionHandler)(void *userData, const XML_Char *target, const XML_Char *data); +/* data is 0 terminated */ typedef void (*XML_CommentHandler)(void *userData, const XML_Char *data); typedef void (*XML_StartCdataSectionHandler)(void *userData); typedef void (*XML_EndCdataSectionHandler)(void *userData); +/* This is called for any characters in the XML document for which there is no applicable handler. This includes both characters that are part of markup which is of a kind that is not reported (comments, markup declarations), or characters @@ -99,13 +112,16 @@ typedef void (*XML_DefaultHandler)(void *userData, const XML_Char *s, int len); +/* This is called for the start of the DOCTYPE declaration when the name of the DOCTYPE is encountered. */ typedef void (*XML_StartDoctypeDeclHandler)(void *userData, const XML_Char *doctypeName); +/* This is called for the start of the DOCTYPE declaration when the closing > is encountered, but after processing any external subset. */ typedef void (*XML_EndDoctypeDeclHandler)(void *userData); +/* This is called for a declaration of an unparsed (NDATA) entity. The base argument is whatever was set by XML_SetBase. The entityName, systemId and notationName arguments will never be null. The other arguments may be. */ @@ -117,6 +133,7 @@ typedef void (*XML_UnparsedEntityDeclHandler)(void *userData, const XML_Char *publicId, const XML_Char *notationName); +/* This is called for a declaration of notation. The base argument is whatever was set by XML_SetBase. The notationName will never be null. The other arguments can be. */ @@ -126,6 +143,7 @@ typedef void (*XML_NotationDeclHandler)(void *userData, const XML_Char *systemId, const XML_Char *publicId); +/* When namespace processing is enabled, these are called once for each namespace declaration. The call to the start and end element handlers occur between the calls to the start and end namespace declaration handlers. For an xmlns attribute, prefix will be null. @@ -138,6 +156,7 @@ typedef void (*XML_StartNamespaceDeclHandler)(void *userData, typedef void (*XML_EndNamespaceDeclHandler)(void *userData, const XML_Char *prefix); +/* This is called if the document is not standalone (it has an external subset or a reference to a parameter entity, but does not have standalone="yes"). If this handler returns 0, then processing will not continue, and the parser will return a @@ -145,6 +164,7 @@ XML_ERROR_NOT_STANDALONE error. */ typedef int (*XML_NotStandaloneHandler)(void *userData); +/* This is called for a reference to an external parsed general entity. The referenced entity is not automatically parsed. The application can parse it immediately or later using XML_ExternalEntityParserCreate. @@ -174,6 +194,7 @@ typedef int (*XML_ExternalEntityRefHandler)(XML_Parser parser, const XML_Char *systemId, const XML_Char *publicId); +/* This structure is filled in by the XML_UnknownEncodingHandler to provide information to the parser about encodings that are unknown to the parser. The map[b] member gives information about byte sequences @@ -221,6 +242,7 @@ typedef struct { void (*release)(void *data); } XML_Encoding; +/* This is called for an encoding that is unknown to the parser. The encodingHandlerData argument is that which was passed as the second argument to XML_SetUnknownEncodingHandler. The name argument gives the name of the encoding as specified in @@ -256,12 +278,14 @@ XML_SetCdataSectionHandler(XML_Parser parser, XML_StartCdataSectionHandler start, XML_EndCdataSectionHandler end); +/* This sets the default handler and also inhibits expansion of internal entities. The entity reference will be passed to the default handler. */ void XMLPARSEAPI XML_SetDefaultHandler(XML_Parser parser, XML_DefaultHandler handler); +/* This sets the default handler but does not inhibit expansion of internal entities. The entity reference will not be passed to the default handler. */ void XMLPARSEAPI @@ -294,6 +318,7 @@ void XMLPARSEAPI XML_SetExternalEntityRefHandler(XML_Parser parser, XML_ExternalEntityRefHandler handler); +/* If a non-null value for arg is specified here, then it will be passed as the first argument to the external entity ref handler instead of the parser object. */ void XMLPARSEAPI @@ -304,27 +329,33 @@ XML_SetUnknownEncodingHandler(XML_Parser parser, XML_UnknownEncodingHandler handler, void *encodingHandlerData); +/* 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. */ void XMLPARSEAPI XML_DefaultCurrent(XML_Parser parser); +/* This value is passed as the userData argument to callbacks. */ void XMLPARSEAPI XML_SetUserData(XML_Parser parser, void *userData); +/* Returns the last value set by XML_SetUserData or null. */ #define XML_GetUserData(parser) (*(void **)(parser)) +/* This is equivalent to supplying an encoding argument to XML_ParserCreate. It must not be called after XML_Parse or XML_ParseBuffer. */ int XMLPARSEAPI XML_SetEncoding(XML_Parser parser, const XML_Char *encoding); +/* If this function is called, then the parser will be passed as the first argument to callbacks instead of userData. The userData will still be accessible using XML_GetUserData. */ void XMLPARSEAPI XML_UseParserAsHandlerArg(XML_Parser parser); +/* Sets the base to be used for resolving relative URIs in system identifiers in declarations. Resolving relative identifiers is left to the application: this value will be passed through as the base argument to the XML_ExternalEntityRefHandler, XML_NotationDeclHandler @@ -337,6 +368,7 @@ XML_SetBase(XML_Parser parser, const XML_Char *base); const XML_Char XMLPARSEAPI * XML_GetBase(XML_Parser parser); +/* Returns the number of the attribute/value pairs passed in last call to the XML_StartElementHandler that were specified in the start-tag rather than defaulted. Each attribute/value pair counts as 2; thus this correspondds to an index into the atts array passed to the @@ -344,11 +376,13 @@ XML_StartElementHandler. */ int XMLPARSEAPI XML_GetSpecifiedAttributeCount(XML_Parser parser); +/* Returns the index of the ID attribute passed in the last call to XML_StartElementHandler, or -1 if there is no ID attribute. Each attribute/value pair counts as 2; thus this correspondds to an index into the atts array passed to the XML_StartElementHandler. */ int XMLPARSEAPI 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). */ int XMLPARSEAPI @@ -360,6 +394,7 @@ XML_GetBuffer(XML_Parser parser, int len); int XMLPARSEAPI XML_ParseBuffer(XML_Parser parser, int len, int isFinal); +/* Creates an XML_Parser object that can parse an external general entity; context is a '\0'-terminated string specifying the parse context; encoding is a '\0'-terminated string giving the name of the externally specified encoding, or null if there is no externally specified encoding. @@ -383,6 +418,7 @@ enum XML_ParamEntityParsing { XML_PARAM_ENTITY_PARSING_ALWAYS }; +/* Controls parsing of parameter entities (including the external DTD subset). If parsing of parameter entities is enabled, then references to external parameter entities (including the external DTD subset) will be passed to the handler set with @@ -431,10 +467,12 @@ enum XML_Error { XML_ERROR_NOT_STANDALONE }; +/* If XML_Parse or XML_ParseBuffer have returned 0, then XML_GetErrorCode returns information about the error. */ enum XML_Error XMLPARSEAPI XML_GetErrorCode(XML_Parser parser); +/* These functions return information about the current parse location. They may be called when XML_Parse or XML_ParseBuffer return 0; in this case the location is the location of the character at which the error was detected. @@ -446,17 +484,21 @@ int XMLPARSEAPI XML_GetCurrentLineNumber(XML_Parser parser); int XMLPARSEAPI XML_GetCurrentColumnNumber(XML_Parser parser); long XMLPARSEAPI XML_GetCurrentByteIndex(XML_Parser parser); +/* Return the number of bytes in the current event. Returns 0 if the event is in an internal entity. */ int XMLPARSEAPI XML_GetCurrentByteCount(XML_Parser parser); +/* For backwards compatibility with previous versions. */ #define XML_GetErrorLineNumber XML_GetCurrentLineNumber #define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber #define XML_GetErrorByteIndex XML_GetCurrentByteIndex +/* Frees memory used by the parser. */ void XMLPARSEAPI XML_ParserFree(XML_Parser parser); +/* Returns a string describing the error. */ const XML_LChar XMLPARSEAPI *XML_ErrorString(int code); #ifdef __cplusplus diff --git a/expat/xmltok/ascii.h b/expat/xmltok/ascii.h index 94970caa..a8a621ce 100755 --- a/expat/xmltok/ascii.h +++ b/expat/xmltok/ascii.h @@ -1,5 +1,7 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ +/* +Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd +See the file copying.txt for copying permission. +*/ #define ASCII_A 0x41 #define ASCII_B 0x42 diff --git a/expat/xmltok/asciitab.h b/expat/xmltok/asciitab.h index 127e0f57..e994576a 100755 --- a/expat/xmltok/asciitab.h +++ b/expat/xmltok/asciitab.h @@ -1,3 +1,37 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ +/* +Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd +See the file copying.txt for copying permission. +*/ +/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, +/* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML, +/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, +/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, +/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, +/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, +/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, +/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, +/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, +/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, +/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, +/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, +/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, +/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, +/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, +/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, +/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, +/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, diff --git a/expat/xmltok/dllmain.c b/expat/xmltok/dllmain.c index 6d792e0e..d5aa4a3e 100755 --- a/expat/xmltok/dllmain.c +++ b/expat/xmltok/dllmain.c @@ -1,5 +1,7 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ +/* +Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd +See the file copying.txt for copying permission. +*/ #define STRICT 1 #define WIN32_LEAN_AND_MEAN 1 diff --git a/expat/xmltok/iasciitab.h b/expat/xmltok/iasciitab.h index 127e0f57..2694d9d6 100755 --- a/expat/xmltok/iasciitab.h +++ b/expat/xmltok/iasciitab.h @@ -1,3 +1,38 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ +/* +Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd +See the file copying.txt for copying permission. +*/ +/* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */ +/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, +/* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML, +/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, +/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, +/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, +/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, +/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, +/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, +/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, +/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, +/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, +/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, +/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, +/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, +/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, +/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, +/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, +/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, diff --git a/expat/xmltok/latin1tab.h b/expat/xmltok/latin1tab.h index 127e0f57..6e01d50e 100755 --- a/expat/xmltok/latin1tab.h +++ b/expat/xmltok/latin1tab.h @@ -1,3 +1,37 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ +/* +Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd +See the file copying.txt for copying permission. +*/ +/* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, +/* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME, +/* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, +/* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, +/* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, +/* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, +/* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, +/* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, diff --git a/expat/xmltok/utf8tab.h b/expat/xmltok/utf8tab.h index 0b493121..28d9b596 100755 --- a/expat/xmltok/utf8tab.h +++ b/expat/xmltok/utf8tab.h @@ -1,4 +1,38 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ +/* +Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd +See the file copying.txt for copying permission. +*/ +/* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL, +/* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, +/* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, +/* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, +/* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, +/* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, +/* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, +/* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, +/* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2, +/* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, +/* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, +/* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, +/* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3, +/* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4, +/* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, +/* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM, diff --git a/expat/xmltok/xmldef.h b/expat/xmltok/xmldef.h index e69be006..e63e1a52 100755 --- a/expat/xmltok/xmldef.h +++ b/expat/xmltok/xmldef.h @@ -1,5 +1,7 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ +/* +Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd +See the file copying.txt for copying permission. +*/ #include @@ -21,6 +23,7 @@ See the file copying.txt for copying permission. */ #endif /* not XML_WINLIB */ +/* This file can be used for any definitions needed in particular environments. */ #ifdef MOZILLA diff --git a/expat/xmltok/xmlrole.c b/expat/xmltok/xmlrole.c index 06a58f61..20bd518a 100755 --- a/expat/xmltok/xmlrole.c +++ b/expat/xmltok/xmlrole.c @@ -1,14 +1,18 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ +/* +Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd +See the file copying.txt for copying permission. +*/ #include "xmldef.h" #include "xmlrole.h" #include "ascii.h" +/* Doesn't check: that ,| are not mixed in a model group content of literals +*/ static const char KW_ANY[] = { ASCII_A, ASCII_N, ASCII_Y, '\0' }; static const char KW_ATTLIST[] = { ASCII_A, ASCII_T, ASCII_T, ASCII_L, ASCII_I, ASCII_S, ASCII_T, '\0' }; @@ -846,6 +850,7 @@ int attlist7(PROLOG_STATE *state, return common(state, tok); } +/* default value */ static int attlist8(PROLOG_STATE *state, int tok, diff --git a/expat/xmltok/xmlrole.h b/expat/xmltok/xmlrole.h index 9551fb93..087d5bdc 100755 --- a/expat/xmltok/xmlrole.h +++ b/expat/xmltok/xmlrole.h @@ -1,5 +1,7 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ +/* +Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd +See the file copying.txt for copying permission. +*/ #ifndef XmlRole_INCLUDED #define XmlRole_INCLUDED 1 diff --git a/expat/xmltok/xmltok.c b/expat/xmltok/xmltok.c index 446e3ef7..9d7e46b6 100755 --- a/expat/xmltok/xmltok.c +++ b/expat/xmltok/xmltok.c @@ -1,5 +1,7 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ +/* +Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd +See the file copying.txt for copying permission. +*/ #include "xmldef.h" #include "xmltok.h" @@ -30,6 +32,7 @@ See the file copying.txt for copying permission. */ #define UCS2_GET_NAMING(pages, hi, lo) \ (namingBitmap[(pages[hi] << 3) + ((lo) >> 5)] & (1 << ((lo) & 0x1F))) +/* A 2 byte UTF-8 representation splits the characters 11 bits between the bottom 5 and 6 bits of the bytes. We need 8 bits to index into pages, 3 bits to add to that index and 5 bits to generate the mask. */ @@ -39,6 +42,7 @@ We need 8 bits to index into pages, 3 bits to add to that index and + ((((byte)[1]) >> 5) & 1)] \ & (1 << (((byte)[1]) & 0x1F))) +/* A 3 byte UTF-8 representation splits the characters 16 bits between the bottom 4, 6 and 6 bits of the bytes. We need 8 bits to index into pages, 3 bits to add to that index and 5 bits to generate the mask. */ @@ -174,6 +178,7 @@ static int checkCharRefNumber(int); #ifdef XML_MIN_SIZE #define MINBPC(enc) ((enc)->minBytesPerChar) #else +/* minimum bytes per character */ #define MINBPC(enc) 1 #endif @@ -230,6 +235,7 @@ int sb_charMatches(const ENCODING *enc, const char *p, int c) return *p == c; } #else +/* c is an ASCII character */ #define CHAR_MATCHES(enc, p, c) (*(p) == c) #endif @@ -430,6 +436,7 @@ static const struct normal_encoding ascii_encoding_ns = { { VTABLE1, ascii_toUtf8, latin1_toUtf16, 1, 1, 0 }, { #include "asciitab.h" +/* BT_NONXML == 0 */ }, STANDARD_VTABLE(sb_) }; @@ -442,6 +449,7 @@ static const struct normal_encoding ascii_encoding = { #define BT_COLON BT_NMSTRT #include "asciitab.h" #undef BT_COLON +/* BT_NONXML == 0 */ }, STANDARD_VTABLE(sb_) }; @@ -616,6 +624,7 @@ int little2_isNmstrtMin(const ENCODING *enc, const char *p) #undef PREFIX #define PREFIX(ident) little2_ ## ident #define MINBPC(enc) 2 +/* CHAR_MATCHES is guaranteed to have MINBPC bytes available. */ #define BYTE_TYPE(enc, p) LITTLE2_BYTE_TYPE(enc, p) #define BYTE_TO_ASCII(enc, p) LITTLE2_BYTE_TO_ASCII(enc, p) #define CHAR_MATCHES(enc, p, c) LITTLE2_CHAR_MATCHES(enc, p, c) @@ -754,6 +763,7 @@ int big2_isNmstrtMin(const ENCODING *enc, const char *p) #undef PREFIX #define PREFIX(ident) big2_ ## ident #define MINBPC(enc) 2 +/* CHAR_MATCHES is guaranteed to have MINBPC bytes available. */ #define BYTE_TYPE(enc, p) BIG2_BYTE_TYPE(enc, p) #define BYTE_TO_ASCII(enc, p) BIG2_BYTE_TO_ASCII(enc, p) #define CHAR_MATCHES(enc, p, c) BIG2_CHAR_MATCHES(enc, p, c) @@ -892,6 +902,7 @@ int isSpace(int c) return 0; } +/* Return 1 if there's just optional white space or there's an S followed by name=val. */ static int parsePseudoAttribute(const ENCODING *enc, @@ -1331,6 +1342,7 @@ XmlInitUnknownEncoding(void *mem, return &(e->normal.enc); } +/* If this enumeration is changed, getEncodingIndex and encodings must also be changed. */ enum { UNKNOWN_ENC = -1, @@ -1383,15 +1395,18 @@ int getEncodingIndex(const char *name) return UNKNOWN_ENC; } +/* For binary compatibility, we store the index of the encoding specified at initialization in the isUtf16 member. */ #define INIT_ENC_INDEX(enc) ((int)(enc)->initEnc.isUtf16) #define SET_INIT_ENC_INDEX(enc, i) ((enc)->initEnc.isUtf16 = (char)i) +/* This is what detects the encoding. encodingTable maps from encoding indices to encodings; INIT_ENC_INDEX(enc) is the index of the external (protocol) specified encoding; state is XML_CONTENT_STATE if we're parsing an external text entity, and XML_PROLOG_STATE otherwise. +*/ static diff --git a/expat/xmltok/xmltok.h b/expat/xmltok/xmltok.h index 57e31990..4edf4d8b 100755 --- a/expat/xmltok/xmltok.h +++ b/expat/xmltok/xmltok.h @@ -1,5 +1,7 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ +/* +Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd +See the file copying.txt for copying permission. +*/ #ifndef XmlTok_INCLUDED #define XmlTok_INCLUDED 1 @@ -12,8 +14,10 @@ extern "C" { #define XMLTOKAPI /* as nothing */ #endif +/* The following token may be returned by XmlContentTok */ #define XML_TOK_TRAILING_RSQB -5 /* ] or ]] at the end of the scan; might be start of illegal ]]> sequence */ +/* The following tokens may be returned by both XmlPrologTok and XmlContentTok */ #define XML_TOK_NONE -4 /* The string to be scanned is empty */ #define XML_TOK_TRAILING_CR -3 /* A CR at the end of the scan; might be part of CRLF sequence */ @@ -21,6 +25,7 @@ extern "C" { #define XML_TOK_PARTIAL -1 /* only part of a token */ #define XML_TOK_INVALID 0 +/* The following tokens are returned by XmlContentTok; some are also returned by XmlAttributeValueTok, XmlEntityTok, XmlCdataSectionTok */ #define XML_TOK_START_TAG_WITH_ATTS 1 @@ -34,11 +39,13 @@ extern "C" { #define XML_TOK_ENTITY_REF 9 #define XML_TOK_CHAR_REF 10 /* numeric character reference */ +/* The following tokens may be returned by both XmlPrologTok and XmlContentTok */ #define XML_TOK_PI 11 /* processing instruction */ #define XML_TOK_XML_DECL 12 /* XML decl or text decl */ #define XML_TOK_COMMENT 13 #define XML_TOK_BOM 14 /* Byte order mark */ +/* The following tokens are returned only by XmlPrologTok */ #define XML_TOK_PROLOG_S 15 #define XML_TOK_DECL_OPEN 16 /* */ @@ -55,6 +62,7 @@ extern "C" { #define XML_TOK_PARAM_ENTITY_REF 28 #define XML_TOK_INSTANCE_START 29 +/* The following occur only in element type declarations */ #define XML_TOK_NAME_QUESTION 30 /* name? */ #define XML_TOK_NAME_ASTERISK 31 /* name* */ #define XML_TOK_NAME_PLUS 32 /* name+ */ @@ -65,10 +73,13 @@ extern "C" { #define XML_TOK_CLOSE_PAREN_PLUS 37 /* )+ */ #define XML_TOK_COMMA 38 +/* The following token is returned only by XmlAttributeValueTok */ #define XML_TOK_ATTRIBUTE_VALUE_S 39 +/* The following token is returned only by XmlCdataSectionTok */ #define XML_TOK_CDATA_SECT_CLOSE 40 +/* With namespace processing this is returned by XmlPrologTok for a name with a colon. */ #define XML_TOK_PREFIXED_NAME 41 @@ -93,7 +104,9 @@ extern "C" { #define XML_ATTRIBUTE_VALUE_LITERAL 0 #define XML_ENTITY_VALUE_LITERAL 1 +/* The size of the buffer passed to XmlUtf8Encode must be at least this. */ #define XML_UTF8_ENCODE_MAX 4 +/* The size of the buffer passed to XmlUtf16Encode must be at least this. */ #define XML_UTF16_ENCODE_MAX 2 typedef struct position { @@ -152,6 +165,7 @@ struct encoding { char isUtf16; }; +/* Scan the string starting at ptr until the end of the next complete token, but do not scan past eptr. Return an integer giving the type of token. @@ -169,6 +183,7 @@ to the character following the end of that token. Each data character counts as a single token, but adjacent data characters may be returned together. Similarly for characters in the prolog outside literals, comments and processing instructions. +*/ #define XmlTok(enc, state, ptr, end, nextTokPtr) \ @@ -190,6 +205,7 @@ literals, comments and processing instructions. #endif /* XML_DTD */ +/* This is used for performing a 2nd-level tokenization on the content of a literal that has already been returned by XmlTok. */ #define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \ diff --git a/expat/xmltok/xmltok_impl.c b/expat/xmltok/xmltok_impl.c index 284c5326..b46e4416 100755 --- a/expat/xmltok/xmltok_impl.c +++ b/expat/xmltok/xmltok_impl.c @@ -1,5 +1,7 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ +/* +Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd +See the file copying.txt for copying permission. +*/ #ifndef IS_INVALID_CHAR #define IS_INVALID_CHAR(enc, ptr, n) (0) @@ -83,6 +85,7 @@ See the file copying.txt for copying permission. */ #define PREFIX(ident) ident #endif +/* ptr points to character following " diff --git a/expat/xmlwf/readfilemap.c b/expat/xmlwf/readfilemap.c index 1b8cb6ff..249af3ec 100755 --- a/expat/xmlwf/readfilemap.c +++ b/expat/xmlwf/readfilemap.c @@ -1,5 +1,7 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ +/* +Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd +See the file copying.txt for copying permission. +*/ #include #include diff --git a/expat/xmlwf/unixfilemap.c b/expat/xmlwf/unixfilemap.c index 3434deae..4944b02a 100755 --- a/expat/xmlwf/unixfilemap.c +++ b/expat/xmlwf/unixfilemap.c @@ -1,5 +1,7 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ +/* +Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd +See the file copying.txt for copying permission. +*/ #include #include diff --git a/expat/xmlwf/wfcheck.c b/expat/xmlwf/wfcheck.c index 9d725af4..c18abd29 100755 --- a/expat/xmlwf/wfcheck.c +++ b/expat/xmlwf/wfcheck.c @@ -1,5 +1,3 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ #include #include @@ -356,6 +354,7 @@ int attcmp(const void *p1, const void *p2) return 1; } +/* Note that this trashes the attribute values. */ static enum WfCheckResult checkAttributeUniqueness(CONTEXT *context, const ENCODING *enc, int nAtts, diff --git a/expat/xmlwf/wfcheck.h b/expat/xmlwf/wfcheck.h index 2d49a4f6..ea8fe573 100755 --- a/expat/xmlwf/wfcheck.h +++ b/expat/xmlwf/wfcheck.h @@ -1,5 +1,3 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ #include diff --git a/expat/xmlwf/wfcheckmessage.c b/expat/xmlwf/wfcheckmessage.c index ad5ba7bf..95e811f4 100755 --- a/expat/xmlwf/wfcheckmessage.c +++ b/expat/xmlwf/wfcheckmessage.c @@ -1,5 +1,3 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ #include "wfcheck.h" const char *wfCheckMessage(enum WfCheckResult result) diff --git a/expat/xmlwf/win32filemap.c b/expat/xmlwf/win32filemap.c index 6325da96..ec30ff65 100755 --- a/expat/xmlwf/win32filemap.c +++ b/expat/xmlwf/win32filemap.c @@ -1,5 +1,7 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ +/* +Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd +See the file copying.txt for copying permission. +*/ #define STRICT 1 #define WIN32_LEAN_AND_MEAN 1 diff --git a/expat/xmlwf/xmlfile.c b/expat/xmlwf/xmlfile.c index d0ee4964..3775c3a3 100755 --- a/expat/xmlwf/xmlfile.c +++ b/expat/xmlwf/xmlfile.c @@ -1,5 +1,7 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ +/* +Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd +See the file copying.txt for copying permission. +*/ #include #include diff --git a/expat/xmlwf/xmlfile.h b/expat/xmlwf/xmlfile.h index 5fed8e55..0c7ac193 100755 --- a/expat/xmlwf/xmlfile.h +++ b/expat/xmlwf/xmlfile.h @@ -1,5 +1,7 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ +/* +Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd +See the file copying.txt for copying permission. +*/ #define XML_MAP_FILE 01 #define XML_EXTERNAL_ENTITIES 02 diff --git a/expat/xmlwf/xmlmime.c b/expat/xmlwf/xmlmime.c index 48213dd2..4b32c86f 100755 --- a/expat/xmlwf/xmlmime.c +++ b/expat/xmlwf/xmlmime.c @@ -1,5 +1,3 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ #include #include "xmlmime.h" @@ -73,6 +71,7 @@ const char *getTok(const char **pp) /* not reached */ } +/* key must be lowercase ASCII */ static int matchkey(const char *start, const char *end, const char *key) diff --git a/expat/xmlwf/xmlmime.h b/expat/xmlwf/xmlmime.h index bfd39124..79654b69 100755 --- a/expat/xmlwf/xmlmime.h +++ b/expat/xmlwf/xmlmime.h @@ -1,13 +1,13 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ #ifdef __cplusplus extern "C" { #endif +/* Registered charset names are at most 40 characters long. */ #define CHARSET_MAX 41 +/* Figure out the charset to use from the ContentType. buf contains the body of the header field (the part after "Content-Type:"). charset gets the charset to use. It must be at least CHARSET_MAX chars long. charset will be empty if the default charset should be used. */ diff --git a/expat/xmlwf/xmltchar.h b/expat/xmlwf/xmltchar.h index 3812d8cd..10885755 100755 --- a/expat/xmlwf/xmltchar.h +++ b/expat/xmlwf/xmltchar.h @@ -1,5 +1,3 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ #ifdef XML_UNICODE #ifndef XML_UNICODE_WCHAR_T #error xmlwf requires a 16-bit Unicode-compatible wchar_t diff --git a/expat/xmlwf/xmlurl.h b/expat/xmlwf/xmlurl.h index b404ff08..3ab17268 100755 --- a/expat/xmlwf/xmlurl.h +++ b/expat/xmlwf/xmlurl.h @@ -1,5 +1,3 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ #ifdef __cplusplus extern "C" { #endif diff --git a/expat/xmlwf/xmlwf.c b/expat/xmlwf/xmlwf.c index 6448267b..0a86de92 100755 --- a/expat/xmlwf/xmlwf.c +++ b/expat/xmlwf/xmlwf.c @@ -1,5 +1,7 @@ -/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd -See the file copying.txt for copying permission. */ +/* +Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd +See the file copying.txt for copying permission. +*/ #include #include @@ -15,6 +17,7 @@ See the file copying.txt for copying permission. */ #include #endif +/* This ensures proper sorting. */ #define NSSEP T('\001') @@ -100,6 +103,7 @@ static void attributeValue(FILE *fp, const XML_Char *s) } } +/* Lexicographically comparing UTF-8 encoded attribute values, is equivalent to lexicographically comparing based on the character number. */ static int attcmp(const void *att1, const void *att2)