Fix screwup in changing copyright notices
diff --git a/expat/gennmtab/gennmtab.c b/expat/gennmtab/gennmtab.c
index 001bf58..4cbdf91 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 <string.h>
 #include <stdio.h>
@@ -222,6 +224,7 @@
   { 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 4e60e1a..42745c4 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 5891bd3..c765774 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 <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/expat/xmlparse/xmlparse.c b/expat/xmlparse/xmlparse.c
index 3f612e7..7da8f94 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 @@
 #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 @@
   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 @@
   /* 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 @@
   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 @@
   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 @@
 
 #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 @@
   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 @@
   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 11f55e4..ce9f02a 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 @@
 
 #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 @@
 
 #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 @@
 #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_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_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 @@
 				   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 @@
 					      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 @@
 					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_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 @@
 
 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 @@
 					    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 @@
   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_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 @@
 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_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 @@
 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 @@
 
 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 @@
 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 @@
   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 @@
   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_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 94970ca..a8a621c 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 127e0f5..e994576 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 6d792e0..d5aa4a3 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 127e0f5..2694d9d 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 127e0f5..6e01d50 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 0b49312..28d9b59 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 e69be00..e63e1a5 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 <string.h>
 
@@ -21,6 +23,7 @@
 
 #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 06a58f6..20bd518 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 @@
   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 9551fb9..087d5bd 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 446e3ef..9d7e46b 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 @@
 #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 @@
                       + ((((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 @@
 #ifdef XML_MIN_SIZE
 #define MINBPC(enc) ((enc)->minBytesPerChar)
 #else
+/* minimum bytes per character */
 #define MINBPC(enc) 1
 #endif
 
@@ -230,6 +235,7 @@
   return *p == c;
 }
 #else
+/* c is an ASCII character */
 #define CHAR_MATCHES(enc, p, c) (*(p) == c)
 #endif
 
@@ -430,6 +436,7 @@
   { VTABLE1, ascii_toUtf8, latin1_toUtf16, 1, 1, 0 },
   {
 #include "asciitab.h"
+/* BT_NONXML == 0 */
   },
   STANDARD_VTABLE(sb_)
 };
@@ -442,6 +449,7 @@
 #define BT_COLON BT_NMSTRT
 #include "asciitab.h"
 #undef BT_COLON
+/* BT_NONXML == 0 */
   },
   STANDARD_VTABLE(sb_)
 };
@@ -616,6 +624,7 @@
 #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 @@
 #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 @@
   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 @@
   return &(e->normal.enc);
 }
 
+/* If this enumeration is changed, getEncodingIndex and encodings
 must also be changed. */
 enum {
   UNKNOWN_ENC = -1,
@@ -1383,15 +1395,18 @@
   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 57e3199..4edf4d8 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 @@
 #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 @@
 #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 @@
 #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 /* <!foo */
 #define XML_TOK_DECL_CLOSE 17 /* > */
@@ -55,6 +62,7 @@
 #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 @@
 #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 @@
 #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 @@
   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 @@
 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 @@
 
 #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 284c532..b46e441 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 @@
 #define PREFIX(ident) ident
 #endif
 
+/* ptr points to character following "<!-" */
 
 static
 int PREFIX(scanComment)(const ENCODING *enc, const char *ptr, const char *end,
@@ -120,6 +123,7 @@
   return XML_TOK_PARTIAL;
 }
 
+/* ptr points to character following "<!" */
 
 static
 int PREFIX(scanDecl)(const ENCODING *enc, const char *ptr, const char *end,
@@ -210,6 +214,7 @@
   return 1;
 }
 
+/* ptr points to character following "<?" */
 
 static
 int PREFIX(scanPi)(const ENCODING *enc, const char *ptr, const char *end,
@@ -369,6 +374,7 @@
   return XML_TOK_DATA_CHARS;
 }
 
+/* ptr points to character following "</" */
 
 static
 int PREFIX(scanEndTag)(const ENCODING *enc, const char *ptr, const char *end,
@@ -416,6 +422,7 @@
   return XML_TOK_PARTIAL;
 }
 
+/* ptr points to character following "&#X" */
 
 static
 int PREFIX(scanHexCharRef)(const ENCODING *enc, const char *ptr, const char *end,
@@ -447,6 +454,7 @@
   return XML_TOK_PARTIAL;
 }
 
+/* ptr points to character following "&#" */
 
 static
 int PREFIX(scanCharRef)(const ENCODING *enc, const char *ptr, const char *end,
@@ -478,6 +486,7 @@
   return XML_TOK_PARTIAL;
 }
 
+/* ptr points to character following "&" */
 
 static
 int PREFIX(scanRef)(const ENCODING *enc, const char *ptr, const char *end,
@@ -507,6 +516,7 @@
   return XML_TOK_PARTIAL;
 }
 
+/* ptr points to character following first character of attribute name */
 
 static
 int PREFIX(scanAtts)(const ENCODING *enc, const char *ptr, const char *end,
@@ -666,6 +676,7 @@
   return XML_TOK_PARTIAL;
 }
 
+/* ptr points to character following "<" */
 
 static
 int PREFIX(scanLt)(const ENCODING *enc, const char *ptr, const char *end,
@@ -863,6 +874,7 @@
   return XML_TOK_DATA_CHARS;
 }
 
+/* ptr points to character following "%" */
 
 static
 int PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end,
@@ -1400,6 +1412,7 @@
   return 1;
 }
 
+/* This must only be called for a well-formed start-tag or empty element tag.
 Returns the number of attributes.  Pointers to the first attsMax attributes 
 are stored in atts. */
 
diff --git a/expat/xmltok/xmltok_impl.h b/expat/xmltok/xmltok_impl.h
index 78d1abc..eb92802 100755
--- a/expat/xmltok/xmltok_impl.h
+++ b/expat/xmltok/xmltok_impl.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.
+*/
 
 enum {
   BT_NONXML,
diff --git a/expat/xmltok/xmltok_ns.c b/expat/xmltok/xmltok_ns.c
index 278ac6e..2427898 100755
--- a/expat/xmltok/xmltok_ns.c
+++ b/expat/xmltok/xmltok_ns.c
@@ -1,5 +1,3 @@
-/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
-See the file copying.txt for copying permission. */
 const ENCODING *NS(XmlGetUtf8InternalEncoding)(void)
 {
   return &ns(internal_utf8_encoding).enc;
diff --git a/expat/xmlwf/codepage.c b/expat/xmlwf/codepage.c
index 4e9962d..fe7ab15 100755
--- a/expat/xmlwf/codepage.c
+++ b/expat/xmlwf/codepage.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 "codepage.h"
 
diff --git a/expat/xmlwf/codepage.h b/expat/xmlwf/codepage.h
index ac954b2..b19a7f6 100755
--- a/expat/xmlwf/codepage.h
+++ b/expat/xmlwf/codepage.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.
+*/
 
 int codepageMap(int cp, int *map);
 int codepageConvert(int cp, const char *p);
diff --git a/expat/xmlwf/ct.c b/expat/xmlwf/ct.c
index 520c5a7..098699d 100755
--- a/expat/xmlwf/ct.c
+++ b/expat/xmlwf/ct.c
@@ -1,5 +1,3 @@
-/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
-See the file copying.txt for copying permission. */
 #define CHARSET_MAX 41
 
 static
@@ -69,6 +67,7 @@
   /* not reached */
 }
 
+/* key must be lowercase ASCII */
 
 static
 int matchkey(const char *start, const char *end, const char *key)
diff --git a/expat/xmlwf/filemap.h b/expat/xmlwf/filemap.h
index e742839..a0a1847 100755
--- a/expat/xmlwf/filemap.h
+++ b/expat/xmlwf/filemap.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 <stddef.h>
diff --git a/expat/xmlwf/readfilemap.c b/expat/xmlwf/readfilemap.c
index 1b8cb6f..249af3e 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 <sys/types.h>
 #include <sys/stat.h>
diff --git a/expat/xmlwf/unixfilemap.c b/expat/xmlwf/unixfilemap.c
index 3434dea..4944b02 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 <sys/types.h>
 #include <sys/mman.h>
diff --git a/expat/xmlwf/wfcheck.c b/expat/xmlwf/wfcheck.c
index 9d725af..c18abd2 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 <stdlib.h>
 #include <string.h>
 
@@ -356,6 +354,7 @@
     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 2d49a4f..ea8fe57 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 <stddef.h>
 
diff --git a/expat/xmlwf/wfcheckmessage.c b/expat/xmlwf/wfcheckmessage.c
index ad5ba7b..95e811f 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 6325da9..ec30ff6 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 d0ee496..3775c3a 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 <stdio.h>
 #include <stdlib.h>
diff --git a/expat/xmlwf/xmlfile.h b/expat/xmlwf/xmlfile.h
index 5fed8e5..0c7ac19 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 48213dd..4b32c86 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 <string.h>
 #include "xmlmime.h"
 
@@ -73,6 +71,7 @@
   /* 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 bfd3912..79654b6 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 3812d8c..1088575 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 b404ff0..3ab1726 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 6448267..0a86de9 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 <stdio.h>
 #include <stdlib.h>
@@ -15,6 +17,7 @@
 #include <crtdbg.h>
 #endif
 
+/* This ensures proper sorting. */
 
 #define NSSEP T('\001')
 
@@ -100,6 +103,7 @@
   }
 }
 
+/* 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)