Updated chicken documentation

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5899 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
John Lenz 2004-05-02 22:20:53 +00:00
commit 1439a8f7c9

View file

@ -65,7 +65,7 @@
CHICKEN support was introduced to SWIG in version 1.3.18. SWIG CHICKEN support was introduced to SWIG in version 1.3.18. SWIG
relies on some recent additions to CHICKEN, which are only relies on some recent additions to CHICKEN, which are only
present in releases of CHICKEN with version number present in releases of CHICKEN with version number
<strong>greater than or equal to <tt>1.0</tt></strong>. <strong>greater than or equal to <tt>1.40</tt></strong>.
<br></br> CHICKEN can be downloaded from <a <br></br> CHICKEN can be downloaded from <a
href="http://www.call-with-current-continuation.org/chicken.html">http://www.call-with-current-continuation.org/chicken.html</a> href="http://www.call-with-current-continuation.org/chicken.html">http://www.call-with-current-continuation.org/chicken.html</a>
@ -495,8 +495,8 @@ CHICKEN_HOME=/usr/local/share/chicken</pre>
For pointer types, SWIG uses CHICKEN tagged pointers. For pointer types, SWIG uses CHICKEN tagged pointers.
A tagged pointer is an ordinary CHICKEN pointer with an A tagged pointer is an ordinary CHICKEN pointer with an
extra slot for an arbitrary Scheme object. With SWIG extra slot for a void *. With SWIG
CHICKEN, this Scheme object is a reference to a type-info CHICKEN, this void * is a pointer to a type-info
structure. So each pointer used as input or output from structure. So each pointer used as input or output from
the SWIG-generated CHICKEN wrappers will have type the SWIG-generated CHICKEN wrappers will have type
information attached to it. This will let the wrappers information attached to it. This will let the wrappers
@ -506,22 +506,20 @@ CHICKEN_HOME=/usr/local/share/chicken</pre>
</p> </p>
<p> <p>
To construct a Scheme object from a C pointer, the wrapper code To construct a Scheme object from a C pointer, the wrapper code
calls the function <code>swig_new_pointer_obj()</code>, passing calls the function
stack allocation space of size SWIG_ALLOCSZ_POINTER (see <code>SWIG_NewPointerObj(void *ptr, swig_type_info *type, int owner)</code>,
definition in Lib/chicken/chickenrun.swg and also The function that calls <code>SWIG_NewPointerObj</code> must have a variable declared
<code>C_alloc()</code> in the CHICKEN documentation) and a <code>C_word *known_space = C_alloc(C_SIZEOF_SWIG_POINTER);</code>
pointer to a struct representing the pointer type. It is ok to call <code>SWIG_NewPointerObj</code> more than once,
just make sure known_space has enough space for all the created pointers.
</p> </p>
<p> <p>
To get the pointer represented by a CHICKEN tagged pointer, the To get the pointer represented by a CHICKEN tagged pointer, the
wrapper code calls the function <code>swig_convert_ptr()</code>, wrapper code calls the function
<code>SWIG_ConvertPtr(C_word s, void **result, swig_type_info *type, int flags)</code>,
passing a pointer to a struct representing the expected pointer passing a pointer to a struct representing the expected pointer
type. If the Scheme object passed was not a tagged pointer type.
representing a compatible pointer, a non-zero value is returned.
</p> </p>
<p><strong>Warning:</strong> The Chicken typechecking code seems
to be broken (Bug #782468), so that type errors may not be
reported.
<a name="n16"></a><H2>25.8 Unsupported features</H2> <a name="n16"></a><H2>25.8 Unsupported features</H2>