summaryrefslogtreecommitdiff
path: root/share/swig/2.0.11/python/pyfragments.swg
diff options
context:
space:
mode:
Diffstat (limited to 'share/swig/2.0.11/python/pyfragments.swg')
-rw-r--r--share/swig/2.0.11/python/pyfragments.swg23
1 files changed, 23 insertions, 0 deletions
diff --git a/share/swig/2.0.11/python/pyfragments.swg b/share/swig/2.0.11/python/pyfragments.swg
new file mode 100644
index 0000000..535a45b
--- /dev/null
+++ b/share/swig/2.0.11/python/pyfragments.swg
@@ -0,0 +1,23 @@
+/*
+
+ Create a file with this name, 'pyfragments.swg', in your working
+ directory and add all the %fragments you want to take precedence
+ over the default ones defined by swig.
+
+ For example, if you add:
+
+ %fragment(SWIG_AsVal_frag(int),"header") {
+ SWIGINTERNINLINE int
+ SWIG_AsVal(int)(PyObject *obj, int *val)
+ {
+ <your code here>;
+ }
+ }
+
+ this will replace the code used to retrieve an integer value for all
+ the typemaps that need it, including:
+
+ int, std::vector<int>, std::list<std::pair<int,int> >, etc.
+
+
+*/