summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Lenz <jlenz2@math.uiuc.edu>2005-10-20 01:02:43 +0000
committerJohn Lenz <jlenz2@math.uiuc.edu>2005-10-20 01:02:43 +0000
commit733322c5391af70e6c7bbfd4160b3ed26e539088 (patch)
tree74bab2d4acd3c2855b28de62ed98249c2c474875
parent153ceb2f5b5450983ba7bb1597b836d331e5119b (diff)
downloadswig-733322c5391af70e6c7bbfd4160b3ed26e539088.tar.gz
Update the typemap documentation
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7691 626c5289-ae23-0410-ae9c-e8d60b6d4f22
-rw-r--r--CHANGES.current3
-rw-r--r--Doc/Manual/Typemaps.html42
2 files changed, 5 insertions, 40 deletions
diff --git a/CHANGES.current b/CHANGES.current
index c4418b456..83c77431b 100644
--- a/CHANGES.current
+++ b/CHANGES.current
@@ -1,6 +1,9 @@
Version 1.3.27 (October 15, 2005)
=================================
+10/19/2005: wuzzeb
+ Update the Runtime Typemap documentation in Typemaps.html
+
10/18/2005: wuzzeb
Chicken:
- Correctly handle %ignored classes
diff --git a/Doc/Manual/Typemaps.html b/Doc/Manual/Typemaps.html
index e2a8b5d3f..412f8065a 100644
--- a/Doc/Manual/Typemaps.html
+++ b/Doc/Manual/Typemaps.html
@@ -3005,7 +3005,7 @@ to have ONE <tt>swig_type_info</tt> for each type. If two modules both use the
second module loaded must lookup and use the swig_type_info structure from the module already loaded.
Because no dynamic memory is used and the circular dependencies of the
casting information, loading the type information is somewhat tricky, and not explained here.
-A complete description is in the <tt>common.swg</tt> file (and near the top of any generated file).
+A complete description is in the <tt>Lib/swiginit.swg</tt> file (and near the top of any generated file).
</p>
<p>
@@ -3123,47 +3123,9 @@ interface file.
</p>
<p>
-A final problem related to the type-checker is the conversion of types
-in code that is external to the SWIG wrapper file. This situation is
-somewhat rare in practice, but occasionally a programmer may want to
-convert a typed pointer object into a C++ pointer somewhere else in
-their program. The only problem is that the SWIG type descriptor
-objects are only defined in the wrapper code and not normally
-accessible.
-</p>
-
-<p>
-To correctly deal with this situation, the following technique can be used:
-</p>
-
-<div class="code">
-<pre>
-
-/* Some non-SWIG file */
-
-/* External declarations */
-extern void *SWIG_TypeQuery(const char *);
-extern int SWIG_ConvertPtr(PyObject *, void **ptr, void *descr);
-
-void foo(PyObject *o) {
- Foo *f;
- static void *descr = 0;
- if (!descr) {
- descr = SWIG_TypeQuery("Foo *"); /* Get the type descriptor structure for Foo */
- assert(descr);
- }
- if ((SWIG_ConvertPtr(o,(void **) &amp;f, descr) == -1)) {
- abort();
- }
- ...
-}
-</pre>
-</div>
-
-<p>
Further details about the run-time type checking can be found in the documentation for
individual language modules. Reading the source code may also help. The file
-<tt>swigrun.swg</tt> in the SWIG library contains all of the source code for
+<tt>Lib/swigrun.swg</tt> in the SWIG library contains all of the source code for
type-checking. This code is also included in every generated wrapped file so you
probably just look at the output of SWIG to get a better sense for how types are
managed.