summaryrefslogtreecommitdiff
path: root/python/libxslt.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2002-02-22 22:58:47 +0000
committerDaniel Veillard <veillard@src.gnome.org>2002-02-22 22:58:47 +0000
commitbd90990db204676575730e94e032305d1d07d4c3 (patch)
tree339f50f552db3fc96c6e283ef716a133e4250a83 /python/libxslt.c
parentac7602771834007af95df5c19775dbd9ad458824 (diff)
downloadlibxslt-bd90990db204676575730e94e032305d1d07d4c3.tar.gz
libxslt-bd90990db204676575730e94e032305d1d07d4c3.tar.bz2
libxslt-bd90990db204676575730e94e032305d1d07d4c3.zip
changes for the 'usual' setup.py to allow building a libxml2-python module
* python/generator.py python/libxslt.c: changes for the 'usual' setup.py to allow building a libxml2-python module based on the same code. The initialization is however different the 2 .so files fo libxml2 and libxslt are identical and they entry point initialize both libraries. this is done to avoid some possible nasty problem since the Python don't merge the maps of all shared modules. * python/libxsl.py: attempt to cope with the shared library loading problem when both modules are not merged. Daniel
Diffstat (limited to 'python/libxslt.c')
-rw-r--r--python/libxslt.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/python/libxslt.c b/python/libxslt.c
index 4ede77c0..4f75a934 100644
--- a/python/libxslt.c
+++ b/python/libxslt.c
@@ -4,6 +4,9 @@
* entry points where an automatically generated stub is either
* unpractical or would not match cleanly the Python model.
*
+ * If compiled with MERGED_MODULES, the entry point will be used to
+ * initialize both the libxml2 and the libxslt wrappers
+ *
* See Copyright for the status of this software.
*
* daniel@veillard.com
@@ -352,8 +355,17 @@ static PyMethodDef libxsltMethods[] = {
{ NULL }
};
+#ifdef MERGED_MODULES
+extern void initlibxml2mod(void);
+#endif
+
void initlibxsltmod(void) {
PyObject *m;
+
+#ifdef MERGED_MODULES
+ initlibxml2mod();
+#endif
+
m = Py_InitModule("libxsltmod", libxsltMethods);
/* libxslt_xmlErrorInitialize(); */
/*
@@ -365,5 +377,7 @@ void initlibxsltmod(void) {
xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
/* xmlDefaultSAXHandlerInit(); */
xmlDefaultSAXHandler.cdataBlock = NULL;
+
}
+