07/19/2006: mutandiz
[allegrocl] - Add std_string.i support. - Add newobject patch submitted by mkoeppe (thanks!) - Fix type name mismatch issue for nested type definitions. specifically typedefs in templated class defns. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9220 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
31c0982668
commit
f2ff50e60e
7 changed files with 481 additions and 230 deletions
|
|
@ -204,14 +204,14 @@ int fact(char *statement); // pass it a fact, and it will rate it.
|
|||
(swig-in-package ())
|
||||
|
||||
(swig-defun ("fact")
|
||||
((PARM0_statement string (* :char) ))
|
||||
((PARM0_statement cl:string (* :char) ))
|
||||
(:returning (:int )
|
||||
:strings-convert t)
|
||||
(let ((SWIG_arg0 PARM0_statement))
|
||||
(swig-ff-call SWIG_arg0)))
|
||||
|
||||
(swig-defun ("fact")
|
||||
((PARM0_n integer :int ))
|
||||
((PARM0_n cl:integer :int ))
|
||||
(:returning (:int )
|
||||
:strings-convert t)
|
||||
(let ((SWIG_arg0 PARM0_n))
|
||||
|
|
@ -329,14 +329,14 @@ what is generated when parsing C code:
|
|||
(swig-in-package ())
|
||||
|
||||
(swig-defmethod ("fact" "ACL___fact__SWIG_0" :type :function :arity 1)
|
||||
((PARM0_statement string (* :char) ))
|
||||
((PARM0_statement cl:string (* :char) ))
|
||||
(:returning (:int )
|
||||
:strings-convert t)
|
||||
(let ((SWIG_arg0 PARM0_statement))
|
||||
(swig-ff-call SWIG_arg0)))
|
||||
|
||||
(swig-defmethod ("fact" "ACL___fact__SWIG_1" :type :function :arity 1)
|
||||
((PARM0_n integer :int ))
|
||||
((PARM0_n cl:integer :int ))
|
||||
(:returning (:int )
|
||||
:strings-convert t)
|
||||
(let ((SWIG_arg0 PARM0_n))
|
||||
|
|
@ -545,8 +545,8 @@ char *xxx();
|
|||
(swig-in-package ())
|
||||
|
||||
(swig-defmethod ("foo" "ACL___foo__SWIG_0" :type :function :arity 2)
|
||||
((PARM0_f1 single-float :float )
|
||||
(PARM1_f2 single-float :float ))
|
||||
((PARM0_f1 cl:single-float :float )
|
||||
(PARM1_f2 cl:single-float :float ))
|
||||
(:returning (:int )
|
||||
:call-direct t
|
||||
:strings-convert nil)
|
||||
|
|
@ -555,8 +555,8 @@ char *xxx();
|
|||
(swig-ff-call SWIG_arg0 SWIG_arg1))))
|
||||
|
||||
(swig-defmethod ("foo" "ACL___foo__SWIG_1" :type :function :arity 2)
|
||||
((PARM0_f1 single-float :float )
|
||||
(PARM1_c2 character :char character))
|
||||
((PARM0_f1 cl:single-float :float )
|
||||
(PARM1_c2 cl:character :char character))
|
||||
(:returning (:int )
|
||||
:call-direct t
|
||||
:strings-convert nil)
|
||||
|
|
@ -672,8 +672,9 @@ char *xxx();
|
|||
C++ namespaces are translated into Lisp packages by SWIG. The
|
||||
Global namespace is mapped to a package named by the <tt>%module</tt>
|
||||
directive or the <tt>-module</tt> command-line argument. Further
|
||||
namespaces are created using Allegro CLs nested namespace convention.
|
||||
For example:
|
||||
namespaces are generated by the <tt>swig-defpackage</tt> utility
|
||||
function and given names based on Allegro CLs nested namespace
|
||||
convention. For example:
|
||||
</p>
|
||||
|
||||
<div class="code">foo.i:
|
||||
|
|
@ -731,6 +732,16 @@ namespace car {
|
|||
case preferences, additional naming cues, etc.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Note that packages created by <tt>swig-defpackage</tt> do not
|
||||
use the COMMON-LISP or EXCL package. This reduces possible
|
||||
conflicts when defining foreign types via the SWIG interface
|
||||
in <b>all but the toplevel modules package</b>. This may
|
||||
lead to confusion if, for example, the current package is
|
||||
<tt>foo.car.tires</tt> and you attempt to use a common-lisp
|
||||
function such as <tt>(car '(1 2 3)</tt>.
|
||||
</p>
|
||||
|
||||
<H3><a name="Allegrocl_nn16"></a>16.3.2 Constants</H3>
|
||||
|
||||
|
||||
|
|
@ -771,7 +782,7 @@ namespace car {
|
|||
reduced to literal values, nodes are created, but with no simplification
|
||||
of the constant value. A very very simple infix to prefix converter
|
||||
has been implemented that tries to do the right thing for simple cases, but
|
||||
does not for more complex expressoins. If the literal parser determines
|
||||
does not for more complex expressions. If the literal parser determines
|
||||
that something is wrong, a warning will be generated and the literal
|
||||
expression will be included in the generated code, but commented out.
|
||||
</p>
|
||||
|
|
@ -788,7 +799,8 @@ namespace car {
|
|||
</pre>
|
||||
</div>
|
||||
<p>
|
||||
Users are cautioned to get to know their constants before use.
|
||||
Users are cautioned to get to know their constants before use, or
|
||||
not use the <tt>-nocwrap</tt> command-line option.
|
||||
</p>
|
||||
|
||||
<H3><a name="Allegrocl_nn17"></a>16.3.3 Variables</H3>
|
||||
|
|
@ -1399,8 +1411,8 @@ EXPORT float ACL___xxx__SWIG_2 (A *larg1, int larg2) {
|
|||
<div class="targetlang">overload.cl
|
||||
<pre>
|
||||
(swig-defmethod ("xxx" "ACL___xxx__SWIG_0" :type :function :arity 2)
|
||||
((PARM0_i integer :int )
|
||||
(PARM1_x integer :int ))
|
||||
((PARM0_i cl:integer :int )
|
||||
(PARM1_x cl:integer :int ))
|
||||
(:returning (:float )
|
||||
:strings-convert t)
|
||||
(let ((SWIG_arg0 PARM0_i))
|
||||
|
|
@ -1408,7 +1420,7 @@ EXPORT float ACL___xxx__SWIG_2 (A *larg1, int larg2) {
|
|||
(swig-ff-call SWIG_arg0 SWIG_arg1))))
|
||||
|
||||
(swig-defmethod ("xxx" "ACL___xxx__SWIG_1" :type :function :arity 1)
|
||||
((PARM0_i integer :int ))
|
||||
((PARM0_i cl:integer :int ))
|
||||
(:returning (:float )
|
||||
:strings-convert t)
|
||||
(let ((SWIG_arg0 PARM0_i))
|
||||
|
|
@ -1416,7 +1428,7 @@ EXPORT float ACL___xxx__SWIG_2 (A *larg1, int larg2) {
|
|||
|
||||
(swig-defmethod ("xxx" "ACL___xxx__SWIG_2" :type :function :arity 2)
|
||||
((PARM0_inst #.(swig-insert-id "A" () :type :class) (* #.(swig-insert-id "A" ())) )
|
||||
(PARM1_x integer :int ))
|
||||
(PARM1_x cl:integer :int ))
|
||||
(:returning (:float )
|
||||
:strings-convert t)
|
||||
(let ((SWIG_arg0 PARM0_inst))
|
||||
|
|
@ -1776,7 +1788,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
|
|||
|
||||
|
||||
<p>
|
||||
A number of custom typemaps have also been added, to facilitate
|
||||
A number of custom typemaps have also been added to facilitate
|
||||
the generation of code in the lisp side of the interface. These
|
||||
are described below. The basic code generation structure is
|
||||
applied as a series of nested expressions, one for each
|
||||
|
|
@ -1784,6 +1796,13 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
|
|||
the foreign function call itself.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Note that the typemaps below use fully qualified symbols where
|
||||
necessary. Users writing their own typemaps should do likewise.
|
||||
See the explanation in the last paragraph of
|
||||
<a href="#Allegrocl_nn15">16.3.1 Namespaces</a> for details.
|
||||
</p>
|
||||
|
||||
<H4><a name="Allegrocl_nn41"></a>16.4.2.1 LIN Typemap</H4>
|
||||
|
||||
|
||||
|
|
@ -1823,7 +1842,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
|
|||
|
||||
<div class="code">
|
||||
<pre>
|
||||
%typemap(lin) SWIGTYPE "(let (($out $in))\n $body)";
|
||||
%typemap(lin) SWIGTYPE "(cl:let (($out $in))\n $body)";
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1861,10 +1880,10 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
|
|||
float, double, long double, char *, void *, void,
|
||||
enum SWIGTYPE "$body";
|
||||
%typemap(lout) SWIGTYPE[ANY], SWIGTYPE *,
|
||||
SWIGTYPE & "(make-instance '$lclass :foreign-address $body)";
|
||||
%typemap(lout) SWIGTYPE "(let* ((address $body)\n
|
||||
(ACL_result (make-instance '$lclass :foreign-address address)))\n
|
||||
(unless (zerop address)\n
|
||||
SWIGTYPE & "(cl:make-instance '$lclass :foreign-address $body)";
|
||||
%typemap(lout) SWIGTYPE "(cl:let* ((address $body)\n
|
||||
(ACL_result (cl:make-instance '$lclass :foreign-address address)))\n
|
||||
(cl:unless (cl::zerop address)\n
|
||||
(excl:schedule-finalization ACL_result #'$ldestructor))\n
|
||||
ACL_result)";
|
||||
</pre>
|
||||
|
|
@ -1933,10 +1952,10 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
|
|||
|
||||
<div class="code">
|
||||
<pre>
|
||||
%typemap(lisptype) bool "boolean";
|
||||
%typemap(lisptype) char "character";
|
||||
%typemap(lisptype) unsigned char "integer";
|
||||
%typemap(lisptype) signed char "integer";
|
||||
%typemap(lisptype) bool "cl:boolean";
|
||||
%typemap(lisptype) char "cl:character";
|
||||
%typemap(lisptype) unsigned char "cl:integer";
|
||||
%typemap(lisptype) signed char "cl:integer";
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1952,15 +1971,15 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
|
|||
<div class="code">
|
||||
<pre>
|
||||
%typemap(lispclass) bool "t";
|
||||
%typemap(lispclass) char "character";
|
||||
%typemap(lispclass) char "cl:character";
|
||||
%typemap(lispclass) unsigned char, signed char,
|
||||
short, signed short, unsigned short,
|
||||
int, signed int, unsigned int,
|
||||
long, signed long, unsigned long,
|
||||
enum SWIGTYPE "integer";
|
||||
%typemap(lispclass) float "single-float";
|
||||
%typemap(lispclass) double "double-float";
|
||||
%typemap(lispclass) char * "string";
|
||||
enum SWIGTYPE "cl:integer";
|
||||
%typemap(lispclass) float "cl:single-float";
|
||||
%typemap(lispclass) double "cl:double-float";
|
||||
%typemap(lispclass) char * "cl:string";
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
@ -1977,7 +1996,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
|
|||
%typecheck(SWIG_TYPECHECK_UNICHAR) wchar_t { $1 = 1; };
|
||||
|
||||
%typemap(in) wchar_t "$1 = $input;";
|
||||
%typemap(lin) wchar_t "(let (($out (char-code $in)))\n $body)";
|
||||
%typemap(lin) wchar_t "(cl:let (($out (cl:char-code $in)))\n $body)";
|
||||
%typemap(lin) wchar_t* "(excl:with-native-string
|
||||
($out $in
|
||||
:external-format #+little-endian :fat-le
|
||||
|
|
@ -1985,7 +2004,7 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
|
|||
$body)"
|
||||
|
||||
%typemap(out) wchar_t "$result = $1;";
|
||||
%typemap(lout) wchar_t "(code-char $body)";
|
||||
%typemap(lout) wchar_t "(cl:code-char $body)";
|
||||
%typemap(lout) wchar_t* "(excl:native-to-string $body
|
||||
:external-format #+little-endian :fat-le
|
||||
#-little-endian :fat)";
|
||||
|
|
@ -1993,8 +2012,8 @@ return-val wrapper-name(parm0, parm1, ..., parmN)
|
|||
%typemap(ffitype) wchar_t ":unsigned-short";
|
||||
%typemap(lisptype) wchar_t "";
|
||||
%typemap(ctype) wchar_t "wchar_t";
|
||||
%typemap(lispclass) wchar_t "character";
|
||||
%typemap(lispclass) wchar_t* "string";
|
||||
%typemap(lispclass) wchar_t "cl:character";
|
||||
%typemap(lispclass) wchar_t* "cl:string";
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue