git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9666 626c5289-ae23-0410-ae9c-e8d60b6d4f22

This commit is contained in:
Surendra Singhi 2007-04-01 13:22:36 +00:00
commit 85a3666f7c
4 changed files with 60 additions and 14 deletions

View file

@ -1,6 +1,10 @@
Version 1.3.32 (in progress) Version 1.3.32 (in progress)
============================ ============================
04/01/2007: efuzzyone
[CFFI] Patch #1684261: fixes handling of unsigned int literals, thanks Leigh Smith.
Also, improved documentation.
03/30/2007: olly 03/30/2007: olly
Avoid generating '<:' token when using SwigValueWrapper<> on a type Avoid generating '<:' token when using SwigValueWrapper<> on a type
which starts with '::' (patch #1690948). which starts with '::' (patch #1690948).

View file

@ -823,13 +823,14 @@
<li><a href="Lisp.html#Lisp_nn4">Additional Commandline Options </a> <li><a href="Lisp.html#Lisp_nn4">Additional Commandline Options </a>
<li><a href="Lisp.html#Lisp_nn5">Generating CFFI bindings</a> <li><a href="Lisp.html#Lisp_nn5">Generating CFFI bindings</a>
<li><a href="Lisp.html#Lisp_nn6">Generating CFFI bindings for C++ code</a> <li><a href="Lisp.html#Lisp_nn6">Generating CFFI bindings for C++ code</a>
<li><a href="Lisp.html#Lisp_nn7">Inserting user code into generated files</a></li>
</ul> </ul>
<li><a href="Lisp.html#Lisp_nn7">CLISP</a> <li><a href="Lisp.html#Lisp_nn8">CLISP</a>
<ul> <ul>
<li><a href="Lisp.html#Lisp_nn8">Additional Commandline Options </a> <li><a href="Lisp.html#Lisp_nn9">Additional Commandline Options </a>
<li><a href="Lisp.html#Lisp_nn9">Details on CLISP bindings</a> <li><a href="Lisp.html#Lisp_nn10">Details on CLISP bindings</a>
</ul> </ul>
<li><a href="Lisp.html#Lisp_nn10">UFFI </a> <li><a href="Lisp.html#Lisp_nn11">UFFI </a>
</ul> </ul>
</div> </div>
<!-- INDEX --> <!-- INDEX -->

View file

@ -16,13 +16,14 @@
<li><a href="#Lisp_nn4">Additional Commandline Options </a> <li><a href="#Lisp_nn4">Additional Commandline Options </a>
<li><a href="#Lisp_nn5">Generating CFFI bindings</a> <li><a href="#Lisp_nn5">Generating CFFI bindings</a>
<li><a href="#Lisp_nn6">Generating CFFI bindings for C++ code</a> <li><a href="#Lisp_nn6">Generating CFFI bindings for C++ code</a>
<li><a href="#Lisp_nn7">Inserting user code into generated files</a></li>
</ul> </ul>
<li><a href="#Lisp_nn7">CLISP</a> <li><a href="#Lisp_nn8">CLISP</a>
<ul> <ul>
<li><a href="#Lisp_nn8">Additional Commandline Options </a> <li><a href="#Lisp_nn9">Additional Commandline Options </a>
<li><a href="#Lisp_nn9">Details on CLISP bindings</a> <li><a href="#Lisp_nn10">Details on CLISP bindings</a>
</ul> </ul>
<li><a href="#Lisp_nn10">UFFI </a> <li><a href="#Lisp_nn11">UFFI </a>
</ul> </ul>
</div> </div>
<!-- INDEX --> <!-- INDEX -->
@ -567,7 +568,46 @@ If you have any questions, suggestions, patches, etc., related to CFFI
module feel free to contact us on the SWIG mailing list, and module feel free to contact us on the SWIG mailing list, and
also please add a "[CFFI]" tag in the subject line. also please add a "[CFFI]" tag in the subject line.
<H2><a name="Lisp_nn7"></a>21.3 CLISP</H2> <H3><a name="Lisp_nn7"></a>21.2.4 Inserting user code into generated files</H3>
<p>
It is often necessary to <a href="SWIG.html#SWIG_nn40">include user-defined code</a>
into the automatically generated interface files. For example, when building
a C++ interface, example_wrap.cxx will likely not compile unless
you add a <tt>#include "header.h"</tt> directive. This can be done
using the SWIG <tt>%insert(section) %{ ...code... %}</tt> directive:
</p>
<div class="code">
<pre>
%module example
%insert("runtime") %{
#include "header.h"
%}
%include "header.h"
int fact(int n);
</pre>
</div>
<p>
Additional sections have been added for inserting into the
generated lisp interface file:
</p>
<ul>
<li><tt>lisphead</tt> - inserts before type declarations</li>
<li><tt>swiglisp</tt> - inserts after type declarations according to
where it appears in the .i file</li>
</ul>
<p>
Note that the block <tt>%{ ... %}</tt> is effectively a shortcut for
<tt>%insert("runtime") %{ ... %}</tt>.
</p>
<H2><a name="Lisp_nn8"></a>21.3 CLISP</H2>
<p> <p>
@ -597,7 +637,7 @@ swig -clisp -module <i>module-name</i> <i>file-name</i>
interface file for the CLISP module. The CLISP module tries to interface file for the CLISP module. The CLISP module tries to
produce code which is both human readable and easily modifyable. produce code which is both human readable and easily modifyable.
</p> </p>
<H3><a name="Lisp_nn8"></a>21.3.1 Additional Commandline Options </H3> <H3><a name="Lisp_nn9"></a>21.3.1 Additional Commandline Options </H3>
<p> <p>
@ -630,7 +670,7 @@ and global variables will be created otherwise only definitions for<br/>
</table> </table>
<H3><a name="Lisp_nn9"></a>21.3.2 Details on CLISP bindings</H3> <H3><a name="Lisp_nn10"></a>21.3.2 Details on CLISP bindings</H3>
<p> <p>
@ -754,7 +794,7 @@ struct bar {
</pre></div> </pre></div>
<H2><a name="Lisp_nn10"></a>21.4 UFFI </H2> <H2><a name="Lisp_nn11"></a>21.4 UFFI </H2>
</body> </body>

View file

@ -881,7 +881,7 @@ String *CFFI::infix_to_prefix(String *val, char split_op, const String *op, Stri
} }
/* To be called by code generating the lisp interface /* To be called by code generating the lisp interface
Will return a containing the literal based on type. Will return a String containing the literal based on type.
Will return null if there are problems. Will return null if there are problems.
try_to_split defaults to true (see stub above). try_to_split defaults to true (see stub above).
@ -953,7 +953,8 @@ String *CFFI::convert_literal(String *literal, String *type, bool try_to_split)
/* Use CL syntax for string literals */ /* Use CL syntax for string literals */
Delete(num); Delete(num);
return NewStringf("\"%s\"", num_param); return NewStringf("\"%s\"", num_param);
} else if (SwigType_type(type) == T_INT) { } else if (SwigType_type(type) == T_INT || SwigType_type(type) == T_UINT) {
// Printf(stderr, "Is a T_INT or T_UINT %s, before replaceall\n", s);
Replaceall(num, "u", ""); Replaceall(num, "u", "");
Replaceall(num, "U", ""); Replaceall(num, "U", "");
Replaceall(num, "l", ""); Replaceall(num, "l", "");