[Expat-checkins] expat/lib expat.h,1.40,1.41 xmlparse.c,1.83,1.84

Fred L. Drake fdrake@users.sourceforge.net
Wed, 04 Sep 2002 18:48:28 -0700


Update of /cvsroot/expat/expat/lib
In directory usw-pr-cvs1:/tmp/cvs-serv24507/lib

Modified Files:
	expat.h xmlparse.c 
Log Message:
Elaborate the XML_GetFeatureList() API a bit, and add additional info
that may be needed by a hughly flexible client.  (Or at least used to check
that the Expat that it links to matches client expectations.)


Index: expat.h
===================================================================
RCS file: /cvsroot/expat/expat/lib/expat.h,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- expat.h	29 Aug 2002 15:29:52 -0000	1.40
+++ expat.h	5 Sep 2002 01:48:25 -0000	1.41
@@ -875,13 +875,18 @@
   XML_FEATURE_END = 0,
   XML_FEATURE_UNICODE,
   XML_FEATURE_UNICODE_WCHAR_T,
-  XML_FEATURE_DTD
+  XML_FEATURE_DTD,
+  XML_FEATURE_CONTEXT_BYTES,
+  XML_FEATURE_MIN_SIZE,
+  XML_FEATURE_SIZEOF_XML_CHAR,
+  XML_FEATURE_SIZEOF_XML_LCHAR
   /* Additional features must be added to the end of this enum. */
 };
 
 typedef struct {
   enum XML_FeatureEnum  feature;
   XML_LChar            *name;
+  long int              value;
 } XML_Feature;
 
 XMLPARSEAPI(const XML_Feature *)

Index: xmlparse.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -r1.83 -r1.84
--- xmlparse.c	31 Aug 2002 02:27:20 -0000	1.83
+++ xmlparse.c	5 Sep 2002 01:48:26 -0000	1.84
@@ -1607,19 +1607,30 @@
 const XML_Feature *
 XML_GetFeatureList(void)
 {
-  static const XML_Feature features[] = {
+  static XML_Feature features[] = {
+    {XML_FEATURE_SIZEOF_XML_CHAR,  XML_L("sizeof(XML_Char)")},
+    {XML_FEATURE_SIZEOF_XML_LCHAR, XML_L("sizeof(XML_LChar)")},
 #ifdef XML_UNICODE
-    {XML_FEATURE_UNICODE,         XML_L("XML_UNICODE")},
+    {XML_FEATURE_UNICODE,          XML_L("XML_UNICODE")},
 #endif
 #ifdef XML_UNICODE_WCHAR_T
-    {XML_FEATURE_UNICODE_WCHAR_T, XML_L("XML_UNICODE_WCHAR_T")},
+    {XML_FEATURE_UNICODE_WCHAR_T,  XML_L("XML_UNICODE_WCHAR_T")},
 #endif
 #ifdef XML_DTD
-    {XML_FEATURE_DTD,             XML_L("XML_DTD")},
+    {XML_FEATURE_DTD,              XML_L("XML_DTD")},
 #endif
-    {XML_FEATURE_END,             NULL}
+#ifdef XML_CONTEXT_BYTES
+    {XML_FEATURE_CONTEXT_BYTES,    XML_L("XML_CONTEXT_BYTES"),
+     XML_CONTEXT_BYTES},
+#endif
+#ifdef XML_MIN_SIZE
+    {XML_FEATURE_MIN_SIZE,         XML_L("XML_MIN_SIZE")},
+#endif
+    {XML_FEATURE_END,              NULL}
   };
 
+  features[0].value = sizeof(XML_Char);
+  features[1].value = sizeof(XML_LChar);
   return features;
 }