[pypy-svn] r62939 - pypy/trunk/pypy/lib

afa at codespeak.net afa at codespeak.net
Fri Mar 13 16:43:06 CET 2009


Author: afa
Date: Fri Mar 13 16:43:06 2009
New Revision: 62939

Modified:
   pypy/trunk/pypy/lib/pyexpat.py
Log:
Add UseForeignDTD to pyexpat.
Completely untested, since ctypes_configure does not work on Windows :-(


Modified: pypy/trunk/pypy/lib/pyexpat.py
==============================================================================
--- pypy/trunk/pypy/lib/pyexpat.py	(original)
+++ pypy/trunk/pypy/lib/pyexpat.py	Fri Mar 13 16:43:06 2009
@@ -70,6 +70,8 @@
 declare_external('XML_StopParser', [XML_Parser, c_int], None)
 declare_external('XML_ErrorString', [c_int], c_char_p)
 declare_external('XML_SetBase', [XML_Parser, c_char_p], None)
+if XML_COMBINED_VERSION >= 19505:
+    declare_external('XML_UseForeignDTD', [XML_Parser, c_int], None)
 
 declare_external('XML_SetUnknownEncodingHandler', [XML_Parser, c_void_p,
                                                    c_void_p], None)
@@ -419,6 +421,14 @@
     def SetParamEntityParsing(self, arg):
         XML_SetParamEntityParsing(self.itself, arg)
 
+    if XML_COMBINED_VERSION >= 19505:
+        def UseForeignDTD(self, arg=True):
+            if arg:
+                flag = XML_TRUE
+            else:
+                flag = XML_FALSE
+            XML_SetParamEntityParsing(self.itself, flag)
+
     def __getattr__(self, name):
         if name == 'buffer_text':
             return self.buffer is not None



More information about the Pypy-commit mailing list