merge from trunk
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-sploving@11423 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
commit
37ebcb9e67
31 changed files with 560 additions and 369 deletions
|
|
@ -1,6 +1,16 @@
|
|||
Version 1.3.40 (in progress)
|
||||
============================
|
||||
|
||||
2009-07-15: olly
|
||||
[Perl] Don't specify Perl prototype "()" for a constructor with a
|
||||
different name to the class, as such constructors can still take
|
||||
parameters.
|
||||
|
||||
2009-07-05: olly
|
||||
[PHP] Update the list of PHP keywords - "cfunction" is no longer a
|
||||
keyword in PHP5 and PHP 5.3 added "goto", "namespace", "__DIR__",
|
||||
and "__NAMESPACE__".
|
||||
|
||||
2009-07-03: olly
|
||||
[Tcl] To complement USE_TCL_STUBS, add support for USE_TK_STUBS
|
||||
and SWIG_TCL_STUBS_VERSION. Document all three in the Tcl chapter
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
<li><a href="#Perl5_nn24">Modules and packages</a>
|
||||
</ul>
|
||||
<li><a href="#Perl5_nn25">Input and output parameters</a>
|
||||
<li><a href="#Perl5_nn26">Exception handling </a>
|
||||
<li><a href="#Perl5_nn26">Exception handling</a>
|
||||
<li><a href="#Perl5_nn27">Remapping datatypes with typemaps</a>
|
||||
<ul>
|
||||
<li><a href="#Perl5_nn28">A simple typemap example</a>
|
||||
|
|
@ -50,8 +50,8 @@
|
|||
</ul>
|
||||
<li><a href="#Perl5_nn32">Typemap Examples</a>
|
||||
<ul>
|
||||
<li><a href="#Perl5_nn33">Converting a Perl5 array to a char ** </a>
|
||||
<li><a href="#Perl5_nn34">Return values </a>
|
||||
<li><a href="#Perl5_nn33">Converting a Perl5 array to a char **</a>
|
||||
<li><a href="#Perl5_nn34">Return values</a>
|
||||
<li><a href="#Perl5_nn35">Returning values from arguments</a>
|
||||
<li><a href="#Perl5_nn36">Accessing array structure members</a>
|
||||
<li><a href="#Perl5_nn37">Turning Perl references into C pointers</a>
|
||||
|
|
@ -815,7 +815,7 @@ extern char *path; // Declared later in the input
|
|||
|
||||
|
||||
<p>
|
||||
Constants are wrapped as read-only Perl variables. For example:
|
||||
By default, constants are wrapped as read-only Perl variables. For example:
|
||||
</p>
|
||||
|
||||
<div class="code">
|
||||
|
|
@ -838,6 +838,19 @@ $example::FOO = 2; # Error
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
Alternatively, if you use swig's <tt>-const</tt> option, constants are wrapped
|
||||
such that the leading $ isn't required (by using a constant subroutine), which
|
||||
usually gives a more natural Perl interface, for example:
|
||||
</p>
|
||||
|
||||
<div class="targetlang">
|
||||
<pre>
|
||||
use example;
|
||||
print example::FOO,"\n";
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Perl5_nn18"></a>28.4.4 Pointers</H3>
|
||||
|
||||
|
||||
|
|
@ -879,7 +892,7 @@ if (defined($ptr)) {
|
|||
</pre></div>
|
||||
|
||||
<p>
|
||||
To create a NULL pointer, you should pass the <tt>undef </tt>value to
|
||||
To create a NULL pointer, you should pass the <tt>undef</tt> value to
|
||||
a function.
|
||||
</p>
|
||||
|
||||
|
|
@ -889,7 +902,7 @@ pointer that SWIG wrapper functions return. Suppose that <tt>$a</tt>
|
|||
and <tt>$b</tt> are two references that point to the same C object.
|
||||
In general, <tt>$a</tt> and <tt>$b</tt> will be different--since they
|
||||
are different references. Thus, it is a mistake to check the equality
|
||||
of <tt>$a </tt>and <tt>$b</tt> to check the equality of two C
|
||||
of <tt>$a</tt> and <tt>$b</tt> to check the equality of two C
|
||||
pointers. The correct method to check equality of C pointers is to
|
||||
dereference them as follows :
|
||||
</p>
|
||||
|
|
@ -1567,7 +1580,7 @@ print "$c\n";
|
|||
<b>Note:</b> The <tt>REFERENCE</tt> feature is only currently supported for numeric types (integers and floating point).
|
||||
</p>
|
||||
|
||||
<H2><a name="Perl5_nn26"></a>28.6 Exception handling </H2>
|
||||
<H2><a name="Perl5_nn26"></a>28.6 Exception handling</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -2107,7 +2120,7 @@ might look at the files "<tt>perl5.swg</tt>" and "<tt>typemaps.i</tt>" in
|
|||
the SWIG library.
|
||||
</p>
|
||||
|
||||
<H3><a name="Perl5_nn33"></a>28.8.1 Converting a Perl5 array to a char ** </H3>
|
||||
<H3><a name="Perl5_nn33"></a>28.8.1 Converting a Perl5 array to a char **</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -2199,7 +2212,7 @@ print @$b,"\n"; # Print it out
|
|||
</pre></div>
|
||||
|
||||
|
||||
<H3><a name="Perl5_nn34"></a>28.8.2 Return values </H3>
|
||||
<H3><a name="Perl5_nn34"></a>28.8.2 Return values</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -2714,7 +2727,7 @@ corresponding Perl object (this situation turns out to come up
|
|||
frequently when constructing objects like linked lists and trees).
|
||||
When C takes possession of an object, you can change Perl's ownership
|
||||
by simply deleting the object from the <tt>%OWNER</tt> hash. This is
|
||||
done using the <tt>DISOWN </tt>method.
|
||||
done using the <tt>DISOWN</tt> method.
|
||||
</p>
|
||||
|
||||
<div class="targetlang"><pre>
|
||||
|
|
|
|||
|
|
@ -2636,8 +2636,9 @@ The example above also shows a common approach of issuing a warning for an as ye
|
|||
<p>
|
||||
The "out" typemap is the main typemap for return types.
|
||||
This typemap supports an optional attribute flag called "optimal", which is for reducing
|
||||
temporary variables and the amount of generated code.
|
||||
It only really makes a difference when returning objects by value and it cannot always be used,
|
||||
temporary variables and the amount of generated code, thereby giving the compiler the opportunity to
|
||||
use <i>return value optimization</i> for generating faster executing code.
|
||||
It only really makes a difference when returning objects by value and has some limitations on usage,
|
||||
as explained later on.
|
||||
</p>
|
||||
|
||||
|
|
@ -2695,7 +2696,7 @@ XX(const XX &)
|
|||
Note that three objects are being created as well as an assignment.
|
||||
Wouldn't it be great if the <tt>XX::create()</tt> method was the only time a constructor was called?
|
||||
As the method returns by value, this is asking a lot and the code that SWIG generates by default
|
||||
makes it impossible for the compiler to make this type of optimisation.
|
||||
makes it impossible for the compiler to use <i>return value optimisation (RVO)</i>.
|
||||
However, this is where the "optimal" attribute in the "out" typemap can help out.
|
||||
If the typemap code is kept the same and just the "optimal" attribute specified like this:
|
||||
</p>
|
||||
|
|
@ -2754,7 +2755,7 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_XX_create() {
|
|||
<p>
|
||||
The major difference is the <tt>result</tt> temporary variable holding the value returned from <tt>XX::create()</tt> is no longer generated and instead the copy constructor call is made directly from
|
||||
the value returned by <tt>XX::create()</tt>.
|
||||
With modern compiler optimisations turned on, the copy is not actually done, in fact the object is never created
|
||||
With modern compilers implementing RVO, the copy is not actually done, in fact the object is never created
|
||||
on the stack in <tt>XX::create()</tt> at all, it is simply created directly on the heap.
|
||||
In the first instance, the <tt>$1</tt> special variable in the typemap is expanded into <tt>result</tt>.
|
||||
In the second instance, <tt>$1</tt> is expanded into <tt>XX::create()</tt> and this is essentially
|
||||
|
|
@ -2762,7 +2763,7 @@ what the "optimal" attribute is telling SWIG to do.
|
|||
</p>
|
||||
|
||||
<p>
|
||||
This kind of optimisation is not turned on by default as it has a number of restrictions.
|
||||
The "optimal" attribute optimisation is not turned on by default as it has a number of restrictions.
|
||||
Firstly, some code cannot be condensed into a simple call for passing into the copy constructor.
|
||||
One common occurrence is when <a href="Customization.html#exception">%exception</a> is used.
|
||||
Consider adding the following <tt>%exception</tt> to the example:
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ Execute the steps in the order shown and don't use spaces in path names. In fact
|
|||
<ol>
|
||||
<li>
|
||||
Download the following packages from the <a href="http://www.mingw.org/download.shtml">MinGW download page</a>
|
||||
or <a href="http://sourceforge.net/project/showfiles.php?group_id=2435">MinGW SourceForge download page</a>.
|
||||
or <a href="http://sourceforge.net/projects/mingw/files/">MinGW SourceForge download page</a>.
|
||||
Note that at the time of writing, the majority of these are in the Current
|
||||
release list and some are in the Snapshot or Previous release list.
|
||||
<ul>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SRCS = example.i
|
||||
SRCS = example.c
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,26 @@
|
|||
/* File : example.i */
|
||||
%module example
|
||||
FILE *fopen(char *filename, char *mode);
|
||||
int fputs(char* , FILE *);
|
||||
int fclose(FILE *);
|
||||
|
||||
%{
|
||||
extern void add(int *, int *, int *);
|
||||
extern void sub(int *, int *, int *);
|
||||
extern int divide(int, int, int *);
|
||||
%}
|
||||
|
||||
/* This example illustrates a couple of different techniques
|
||||
for manipulating C pointers */
|
||||
|
||||
/* First we'll use the pointer library */
|
||||
extern void add(int *x, int *y, int *result);
|
||||
%include cpointer.i
|
||||
%pointer_functions(int, intp);
|
||||
|
||||
/* Next we'll use some typemaps */
|
||||
|
||||
%include typemaps.i
|
||||
extern void sub(int *INPUT, int *INPUT, int *OUTPUT);
|
||||
|
||||
/* Next we'll use typemaps and the %apply directive */
|
||||
|
||||
%apply int *OUTPUT { int *r };
|
||||
extern int divide(int n, int d, int *r);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../preinst-swig
|
||||
SRCS = example.i
|
||||
SRCS = example.c
|
||||
TARGET = example
|
||||
INTERFACE = example.i
|
||||
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ CPP_TEST_BROKEN += \
|
|||
extend_variable \
|
||||
li_std_vector_ptr \
|
||||
namespace_union \
|
||||
nested_struct \
|
||||
nested_structs \
|
||||
overload_complicated \
|
||||
template_default_pointer \
|
||||
template_expr
|
||||
|
|
@ -220,6 +220,7 @@ CPP_TEST_CASES += \
|
|||
li_typemaps \
|
||||
li_windows \
|
||||
long_long_apply \
|
||||
memberin_extend \
|
||||
member_pointer \
|
||||
member_template \
|
||||
minherit \
|
||||
|
|
|
|||
26
Examples/test-suite/java/memberin_extend_runme.java
Normal file
26
Examples/test-suite/java/memberin_extend_runme.java
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
import memberin_extend.*;
|
||||
|
||||
public class memberin_extend_runme {
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("memberin_extend");
|
||||
} catch (UnsatisfiedLinkError e) {
|
||||
System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String argv[])
|
||||
{
|
||||
ExtendMe em1 = new ExtendMe();
|
||||
ExtendMe em2 = new ExtendMe();
|
||||
em1.setThing("em1thing");
|
||||
em2.setThing("em2thing");
|
||||
if (!em1.getThing().equals("em1thing"))
|
||||
throw new RuntimeException("wrong: " + em1.getThing());
|
||||
if (!em2.getThing().equals("em2thing"))
|
||||
throw new RuntimeException("wrong: " + em2.getThing());
|
||||
}
|
||||
}
|
||||
|
||||
22
Examples/test-suite/memberin_extend.i
Normal file
22
Examples/test-suite/memberin_extend.i
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
%module memberin_extend
|
||||
|
||||
// Tests memberin typemap. The default char * memberin typemap will be used.
|
||||
// The test extends the struct with a pseudo member variable
|
||||
|
||||
%inline %{
|
||||
#include <string>
|
||||
struct ExtendMe {
|
||||
};
|
||||
%}
|
||||
|
||||
%{
|
||||
#include <map>
|
||||
std::map<ExtendMe*, char *> ExtendMeStringMap;
|
||||
#define ExtendMe_thing_set(self_, val_) ExtendMeStringMap[self_]
|
||||
#define ExtendMe_thing_get(self_) ExtendMeStringMap[self_]
|
||||
%}
|
||||
|
||||
%extend ExtendMe {
|
||||
char *thing;
|
||||
}
|
||||
|
||||
|
|
@ -1 +1,17 @@
|
|||
empty
|
||||
|
||||
printf("begin\n");
|
||||
who global
|
||||
|
||||
printf("after load\n");
|
||||
who global
|
||||
|
||||
#clear -g
|
||||
printf("after clear\n");
|
||||
who global
|
||||
|
||||
#clear empty
|
||||
printf("after clear specific\n");
|
||||
who global
|
||||
|
||||
printf("before shutdown\n");
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@ require "rename_scope.php";
|
|||
|
||||
check::classes(array("rename_scope","Interface_UP","Interface_BP","Natural_UP","Natural_BP","Bucket"));
|
||||
|
||||
check::classmethods("Interface_UP",array("interface_up"));
|
||||
check::classmethods("Interface_BP",array("interface_bp"));
|
||||
check::classmethods("Natural_UP",array("interface_up","natural_up","rtest"));
|
||||
check::classmethods("Natural_BP",array("interface_bp","natural_bp","rtest"));
|
||||
check::classparent("Natural_UP","interface_up");
|
||||
check::classparent("Natural_BP","interface_bp");
|
||||
check::classmethods("Interface_UP",array("__construct"));
|
||||
check::classmethods("Interface_BP",array("__construct"));
|
||||
check::classmethods("Natural_UP",array("__construct","rtest"));
|
||||
check::classmethods("Natural_BP",array("__construct","rtest"));
|
||||
check::classparent("Natural_UP","Interface_UP");
|
||||
check::classparent("Natural_BP","Interface_BP");
|
||||
|
||||
check::done();
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,9 @@
|
|||
|
||||
%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Namespace::enum1;
|
||||
%warnfilter(SWIGWARN_RUBY_WRONG_NAME) Namespace::enum2;
|
||||
#ifdef SWIGPHP
|
||||
%warnfilter(SWIGWARN_PARSE_KEYWORD) Namespace;
|
||||
#endif
|
||||
|
||||
// Tests SWIG's automatic exception mechanism
|
||||
|
||||
|
|
|
|||
|
|
@ -105,27 +105,35 @@ namespace Swig {
|
|||
|
||||
typedef std::map < void *, Director * > rtdir_map;
|
||||
|
||||
SWIGINTERN rtdir_map &get_rtdir_map() {
|
||||
SWIGINTERN rtdir_map* get_rtdir_map() {
|
||||
static swig_module_info *module = 0;
|
||||
if (!module)
|
||||
module = SWIG_GetModule(0);
|
||||
assert(module);
|
||||
if (!module)
|
||||
return 0;
|
||||
if (!module->clientdata)
|
||||
module->clientdata = new rtdir_map;
|
||||
return *(rtdir_map *) module->clientdata;
|
||||
return (rtdir_map *) module->clientdata;
|
||||
}
|
||||
|
||||
SWIGINTERNINLINE void set_rtdir(void *vptr, Director *d) {
|
||||
get_rtdir_map()[vptr] = d;
|
||||
rtdir_map* rm = get_rtdir_map();
|
||||
if (rm)
|
||||
(*rm)[vptr] = d;
|
||||
}
|
||||
|
||||
SWIGINTERNINLINE void erase_rtdir(void *vptr) {
|
||||
get_rtdir_map().erase(vptr);
|
||||
rtdir_map* rm = get_rtdir_map();
|
||||
if (rm)
|
||||
(*rm).erase(vptr);
|
||||
}
|
||||
|
||||
SWIGINTERNINLINE Director *get_rtdir(void *vptr) {
|
||||
rtdir_map::const_iterator pos = get_rtdir_map().find(vptr);
|
||||
Director *rtdir = (pos != get_rtdir_map().end())? pos->second : 0;
|
||||
rtdir_map* rm = get_rtdir_map();
|
||||
if (!rm)
|
||||
return 0;
|
||||
rtdir_map::const_iterator pos = rm->find(vptr);
|
||||
Director *rtdir = (pos != rm->end())? pos->second : 0;
|
||||
return rtdir;
|
||||
}
|
||||
}
|
||||
|
|
@ -439,9 +447,15 @@ namespace Swig {
|
|||
install_builtin_function(it->second.first->method, it->first,
|
||||
it->second.first->doc?it->second.first->doc:std::string());
|
||||
else if (it->second.second.is_defined()) {
|
||||
#if USE_OCTAVE_API_VERSION<37
|
||||
link_to_global_variable(curr_sym_tab->lookup(it->first, true));
|
||||
#else
|
||||
symbol_table::varref(it->first);
|
||||
symbol_table::mark_global(it->first);
|
||||
#endif
|
||||
set_global_value(it->first, it->second.second);
|
||||
|
||||
#if USE_OCTAVE_API_VERSION<37
|
||||
octave_swig_type *ost = Swig::swig_value_deref(it->second.second);
|
||||
if (ost) {
|
||||
const char* h = ost->help_text();
|
||||
|
|
@ -450,6 +464,7 @@ namespace Swig {
|
|||
sr->document(h);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1352,6 +1367,11 @@ SWIGRUNTIME swig_module_info *SWIG_Octave_GetModule(void *clientdata) {
|
|||
SWIGRUNTIME void SWIG_Octave_SetModule(void *clientdata, swig_module_info *pointer) {
|
||||
octave_value ov = new octave_swig_packed(0, &pointer, sizeof(swig_module_info *));
|
||||
const char *module_var = "__SWIG_MODULE__" SWIG_TYPE_TABLE_NAME SWIG_RUNTIME_VERSION;
|
||||
#if USE_OCTAVE_API_VERSION<37
|
||||
link_to_global_variable(curr_sym_tab->lookup(module_var, true));
|
||||
#else
|
||||
symbol_table::varref(module_var);
|
||||
symbol_table::mark_global(module_var);
|
||||
#endif
|
||||
set_global_value(module_var, ov);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,11 +72,33 @@ DEFUN_DLD (SWIG_name,args,nargout,SWIG_name_d) {
|
|||
module_ns->install_global();
|
||||
module_ns->decref();
|
||||
|
||||
#if USE_OCTAVE_API_VERSION<37
|
||||
link_to_global_variable(curr_sym_tab->lookup(SWIG_name_d,true));
|
||||
#else
|
||||
symbol_table::varref(SWIG_name_d);
|
||||
symbol_table::mark_global(SWIG_name_d);
|
||||
#endif
|
||||
set_global_value(SWIG_name_d,Swig::swig_value_ref(module_ns));
|
||||
|
||||
#if USE_OCTAVE_API_VERSION>=37
|
||||
mlock();
|
||||
#endif
|
||||
|
||||
return octave_value_list();
|
||||
}
|
||||
|
||||
// workaround bug in octave where installing global variable of custom type and then
|
||||
// exiting without explicitly clearing the variable causes octave to segfault.
|
||||
#if USE_OCTAVE_API_VERSION>=37
|
||||
struct oct_file_unload {
|
||||
~oct_file_unload() {
|
||||
string_vector vars = symbol_table::global_variable_names();
|
||||
for (int i = 0; i < vars.length(); i++)
|
||||
symbol_table::clear_global(vars[i]);
|
||||
}
|
||||
};
|
||||
static oct_file_unload __unload;
|
||||
#endif
|
||||
|
||||
%}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,21 +8,22 @@
|
|||
* when used as class methods.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
#define PHPKW(x) %keywordwarn("'" `x` "' is a php keyword, renamed as 'c_" `x` "'",sourcefmt="%(lower)s", rename="c_%s",fullname=1) `x`
|
||||
#define PHPKW(x) %keywordwarn("'" `x` "' is a PHP keyword, renamed as 'c_" `x` "'",sourcefmt="%(lower)s", rename="c_%s",fullname=1) `x`
|
||||
|
||||
%define PHPCN(x)
|
||||
%keywordwarn("'" `x` "' is a php reserved class name, class renamed as 'c_" `x` "'",%$isclass,rename="c_%s") `x`;
|
||||
%keywordwarn("'" `x` "' is a php reserved class name, constructor renamed as 'c_" `x` "'",%$isconstructor,rename="c_%s") `x`;
|
||||
%keywordwarn("'" `x` "' is a PHP reserved class name, class renamed as 'c_" `x` "'",%$isclass,rename="c_%s") `x`;
|
||||
%keywordwarn("'" `x` "' is a PHP reserved class name, constructor renamed as 'c_" `x` "'",%$isconstructor,rename="c_%s") `x`;
|
||||
%enddef
|
||||
|
||||
#define PHPBN1(x) %builtinwarn("'" `x` "' conflicts with a built-in name in php",sourcefmt="%(lower)s",fullname=1) `x`
|
||||
#define PHPBN2(x) %builtinwarn("'" `x` "' conflicts with a built-in name in php") "::" `x`
|
||||
#define PHPBN1(x) %builtinwarn("'" `x` "' conflicts with a built-in name in PHP",sourcefmt="%(lower)s",fullname=1) `x`
|
||||
#define PHPBN2(x) %builtinwarn("'" `x` "' conflicts with a built-in name in PHP") "::" `x`
|
||||
|
||||
|
||||
/*
|
||||
From
|
||||
|
||||
http://aspn.activestate.com/ASPN/docs/PHP/reserved.html
|
||||
http://php.net/manual/en/reserved.keywords.php
|
||||
|
||||
and reviewed by Olly Betts.
|
||||
|
||||
|
|
@ -30,76 +31,81 @@
|
|||
*/
|
||||
|
||||
/* We classify these as kw since PHP will not run if used globally. */
|
||||
/* "You cannot use any of the following words as constants, class names,
|
||||
* function or method names. Using them as variable names is generally OK, but
|
||||
* could lead to confusion."
|
||||
*/
|
||||
/* case insensitive */
|
||||
PHPKW(__halt_compiler);
|
||||
PHPKW(abstract);
|
||||
PHPKW(and);
|
||||
PHPKW(array);
|
||||
PHPKW(as);
|
||||
PHPKW(break);
|
||||
PHPKW(case);
|
||||
PHPKW(cfunction); /* No longer reserved in PHP5 */
|
||||
PHPKW(catch);
|
||||
PHPKW(class);
|
||||
PHPKW(clone);
|
||||
PHPKW(const);
|
||||
PHPKW(continue);
|
||||
PHPKW(declare);
|
||||
PHPKW(default);
|
||||
PHPKW(die);
|
||||
PHPKW(die); // "Language construct"
|
||||
PHPKW(do);
|
||||
PHPKW(echo);
|
||||
PHPKW(echo); // "Language construct"
|
||||
PHPKW(else);
|
||||
PHPKW(elseif);
|
||||
PHPKW(empty);
|
||||
PHPKW(empty); // "Language construct"
|
||||
PHPKW(enddeclare);
|
||||
PHPKW(endfor);
|
||||
PHPKW(endforeach);
|
||||
PHPKW(endif);
|
||||
PHPKW(endswitch);
|
||||
PHPKW(endwhile);
|
||||
PHPKW(eval);
|
||||
PHPKW(exit);
|
||||
PHPKW(eval); // "Language construct"
|
||||
PHPKW(exit); // "Language construct"
|
||||
PHPKW(extends);
|
||||
PHPKW(final);
|
||||
PHPKW(for);
|
||||
PHPKW(foreach);
|
||||
PHPKW(function);
|
||||
PHPKW(global);
|
||||
PHPKW(goto); // As of PHP5.3
|
||||
PHPKW(if);
|
||||
PHPKW(include);
|
||||
PHPKW(include_once);
|
||||
PHPKW(isset);
|
||||
PHPKW(list);
|
||||
PHPKW(implements);
|
||||
PHPKW(include); // "Language construct"
|
||||
PHPKW(include_once); // "Language construct"
|
||||
PHPKW(instanceof);
|
||||
PHPKW(interface);
|
||||
PHPKW(isset); // "Language construct"
|
||||
PHPKW(list); // "Language construct"
|
||||
PHPKW(namespace); // As of PHP5.3
|
||||
PHPKW(new);
|
||||
// PHPKW(old_function); /* No longer reserved in PHP5 */
|
||||
PHPKW(or);
|
||||
PHPKW(print);
|
||||
PHPKW(require);
|
||||
PHPKW(require_once);
|
||||
PHPKW(return);
|
||||
PHPKW(print); // "Language construct"
|
||||
PHPKW(private);
|
||||
PHPKW(protected);
|
||||
PHPKW(public);
|
||||
PHPKW(require); // "Language construct"
|
||||
PHPKW(require_once); // "Language construct"
|
||||
PHPKW(return); // "Language construct"
|
||||
PHPKW(static);
|
||||
PHPKW(switch);
|
||||
PHPKW(unset);
|
||||
PHPKW(throw);
|
||||
PHPKW(try);
|
||||
PHPKW(unset); // "Language construct"
|
||||
PHPKW(use);
|
||||
PHPKW(var);
|
||||
PHPKW(while);
|
||||
PHPKW(xor);
|
||||
PHPKW(__FILE__);
|
||||
PHPKW(__LINE__);
|
||||
PHPKW(__FUNCTION__);
|
||||
// Compile-time constants
|
||||
PHPKW(__CLASS__);
|
||||
|
||||
/* Added in PHP5 */
|
||||
PHPKW(__halt_compiler);
|
||||
PHPKW(abstract);
|
||||
PHPKW(catch);
|
||||
PHPKW(clone);
|
||||
PHPKW(final);
|
||||
PHPKW(implements);
|
||||
PHPKW(instanceof);
|
||||
PHPKW(interface);
|
||||
PHPKW(private);
|
||||
PHPKW(protected);
|
||||
PHPKW(public);
|
||||
PHPKW(throw);
|
||||
PHPKW(try);
|
||||
PHPKW(__DIR__); // As of PHP5.3
|
||||
PHPKW(__FILE__);
|
||||
PHPKW(__FUNCTION__);
|
||||
PHPKW(__METHOD__);
|
||||
PHPKW(__NAMESPACE__); // As of PHP5.3
|
||||
PHPKW(__LINE__);
|
||||
|
||||
/* We classify these as built-in names since they conflict, but PHP still runs */
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ static int default_error_code = E_ERROR;
|
|||
|
||||
/* used to wrap returned objects in so we know whether they are newobject
|
||||
and need freeing, or not */
|
||||
typedef struct _swig_object_wrapper {
|
||||
typedef struct {
|
||||
void * ptr;
|
||||
int newobject;
|
||||
} swig_object_wrapper;
|
||||
|
|
|
|||
|
|
@ -248,13 +248,6 @@
|
|||
|
||||
/* please leave 850-869 free for Modula 3 */
|
||||
|
||||
/* These are needed for backward compatibility, but you don't need to add
|
||||
* PHP4 versions of new warnings since existing user interface files can't
|
||||
* be using them.
|
||||
*/
|
||||
#define WARN_PHP_MULTIPLE_INHERITANCE 870
|
||||
#define WARN_PHP_UNKNOWN_PRAGMA 871
|
||||
|
||||
#define WARN_PHP_MULTIPLE_INHERITANCE 870
|
||||
#define WARN_PHP_UNKNOWN_PRAGMA 871
|
||||
|
||||
|
|
|
|||
|
|
@ -626,7 +626,7 @@ void note_implicit_template_instantiation(SwigType *t) {
|
|||
add_defined_foreign_type(0, 0, t, t, implicit_ns ? implicit_ns : current_namespace);
|
||||
}
|
||||
|
||||
String *get_ffi_type(SwigType *ty, const_String_or_char_ptr name) {
|
||||
String *get_ffi_type(Node *n, SwigType *ty, const_String_or_char_ptr name) {
|
||||
/* lookup defined foreign type.
|
||||
if it exists, it will return a form suitable for placing
|
||||
into lisp code to generate the def-foreign-type name */
|
||||
|
|
@ -641,18 +641,20 @@ String *get_ffi_type(SwigType *ty, const_String_or_char_ptr name) {
|
|||
#ifdef ALLEGROCL_TYPE_DEBUG
|
||||
Printf(stderr, "found_type '%s'\n", found_type);
|
||||
#endif
|
||||
return (Strcmp(found_type, "forward-reference") ? Copy(found_type) :
|
||||
get_ffi_type(fwdref_ffi_type, ""));
|
||||
return (Strcmp(found_type, "forward-reference") ? Copy(found_type) : get_ffi_type(n, fwdref_ffi_type, ""));
|
||||
} else {
|
||||
Hash *typemap = Swig_typemap_search("ffitype", ty, name, 0);
|
||||
|
||||
if (typemap) {
|
||||
String *typespec = Getattr(typemap, "code");
|
||||
Node *node = NewHash();
|
||||
Setattr(node, "type", ty);
|
||||
Setfile(node, Getfile(n));
|
||||
Setline(node, Getline(n));
|
||||
const String *tm = Swig_typemap_lookup("ffitype", node, name, 0);
|
||||
Delete(node);
|
||||
|
||||
if (tm) {
|
||||
#ifdef ALLEGROCL_TYPE_DEBUG
|
||||
Printf(stderr, "g-f-t: found ffitype typemap '%s'\n%s\n", typespec, typemap);
|
||||
Printf(stderr, "g-f-t: found ffitype typemap '%s'\n", tm);
|
||||
#endif
|
||||
return NewString(typespec);
|
||||
return NewString(tm);
|
||||
}
|
||||
|
||||
if (SwigType_istemplate(ty)) {
|
||||
|
|
@ -673,7 +675,7 @@ String *lookup_defined_foreign_ltype(String *l) {
|
|||
|
||||
/* walk type and return string containing lisp version.
|
||||
recursive. */
|
||||
String *internal_compose_foreign_type(SwigType *ty) {
|
||||
String *internal_compose_foreign_type(Node *n, SwigType *ty) {
|
||||
|
||||
SwigType *tok;
|
||||
String *ffiType = NewString("");
|
||||
|
|
@ -691,18 +693,18 @@ String *internal_compose_foreign_type(SwigType *ty) {
|
|||
Printf(ffiType, "("); // start parm list
|
||||
for (Iterator i = First(pl); i.item; i = Next(i)) {
|
||||
SwigType *f_arg = SwigType_strip_qualifiers(i.item);
|
||||
Printf(ffiType, "%s ", internal_compose_foreign_type(f_arg));
|
||||
Printf(ffiType, "%s ", internal_compose_foreign_type(n, f_arg));
|
||||
Delete(f_arg);
|
||||
}
|
||||
Printf(ffiType, ")"); // end parm list.
|
||||
|
||||
// do function return type.
|
||||
Printf(ffiType, " %s)", internal_compose_foreign_type(ty));
|
||||
Printf(ffiType, " %s)", internal_compose_foreign_type(n, ty));
|
||||
break;
|
||||
} else if (SwigType_ispointer(tok) || SwigType_isreference(tok)) {
|
||||
Printf(ffiType, "(* %s)", internal_compose_foreign_type(ty));
|
||||
Printf(ffiType, "(* %s)", internal_compose_foreign_type(n, ty));
|
||||
} else if (SwigType_isarray(tok)) {
|
||||
Printf(ffiType, "(:array %s", internal_compose_foreign_type(ty));
|
||||
Printf(ffiType, "(:array %s", internal_compose_foreign_type(n, ty));
|
||||
String *atype = NewString("int");
|
||||
String *dim = convert_literal(SwigType_array_getdim(tok, 0), atype);
|
||||
Delete(atype);
|
||||
|
|
@ -713,18 +715,18 @@ String *internal_compose_foreign_type(SwigType *ty) {
|
|||
}
|
||||
} else if (SwigType_ismemberpointer(tok)) {
|
||||
// temp
|
||||
Printf(ffiType, "(* %s)", internal_compose_foreign_type(ty));
|
||||
Printf(ffiType, "(* %s)", internal_compose_foreign_type(n, ty));
|
||||
} else {
|
||||
String *res = get_ffi_type(tok, "");
|
||||
String *res = get_ffi_type(n, tok, "");
|
||||
if (res) {
|
||||
Printf(ffiType, "%s", res);
|
||||
} else {
|
||||
SwigType *resolved_type = SwigType_typedef_resolve(tok);
|
||||
if (resolved_type) {
|
||||
res = get_ffi_type(resolved_type, "");
|
||||
res = get_ffi_type(n, resolved_type, "");
|
||||
if (res) {
|
||||
} else {
|
||||
res = internal_compose_foreign_type(resolved_type);
|
||||
res = internal_compose_foreign_type(n, resolved_type);
|
||||
}
|
||||
if (res)
|
||||
Printf(ffiType, "%s", res);
|
||||
|
|
@ -762,7 +764,7 @@ String *internal_compose_foreign_type(SwigType *ty) {
|
|||
|
||||
add_forward_referenced_type(nn, 0);
|
||||
// tok_name is dangling here, unused. ouch. why?
|
||||
Printf(ffiType, "%s", get_ffi_type(tok, ""), tok_name);
|
||||
Printf(ffiType, "%s", get_ffi_type(n, tok, ""), tok_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -770,9 +772,7 @@ String *internal_compose_foreign_type(SwigType *ty) {
|
|||
return ffiType;
|
||||
}
|
||||
|
||||
String *compose_foreign_type(SwigType *ty, String * /*id*/ = 0) {
|
||||
|
||||
/* Hash *lookup_res = Swig_typemap_search("ffitype", ty, id, 0); */
|
||||
String *compose_foreign_type(Node *n, SwigType *ty, String * /*id*/ = 0) {
|
||||
|
||||
#ifdef ALLEGROCL_TYPE_DEBUG
|
||||
Printf(stderr, "compose_foreign_type: ENTER (%s)...\n ", ty);
|
||||
|
|
@ -802,7 +802,7 @@ String *compose_foreign_type(SwigType *ty, String * /*id*/ = 0) {
|
|||
*/
|
||||
|
||||
SwigType *temp = SwigType_strip_qualifiers(ty);
|
||||
String *res = internal_compose_foreign_type(temp);
|
||||
String *res = internal_compose_foreign_type(n, temp);
|
||||
Delete(temp);
|
||||
|
||||
#ifdef ALLEGROCL_TYPE_DEBUG
|
||||
|
|
@ -1239,7 +1239,7 @@ void emit_full_class(Node *n) {
|
|||
#ifdef ALLEGROCL_WRAP_DEBUG
|
||||
Printf(stderr, "slot name = '%s' ns = '%s' class-of '%s' and type = '%s'\n", cname, ns, name, childType);
|
||||
#endif
|
||||
Printf(slotdefs, "(#.(swig-insert-id \"%s\" %s :type :slot :class \"%s\") %s)", cname, ns, name, compose_foreign_type(childType));
|
||||
Printf(slotdefs, "(#.(swig-insert-id \"%s\" %s :type :slot :class \"%s\") %s)", cname, ns, name, compose_foreign_type(n, childType));
|
||||
Delete(ns);
|
||||
if (access && Strcmp(access, "public"))
|
||||
Printf(slotdefs, " ;; %s member", access);
|
||||
|
|
@ -1322,7 +1322,7 @@ void emit_typedef(Node *n) {
|
|||
String *name;
|
||||
String *sym_name = Getattr(n, "sym:name");
|
||||
String *type = NewStringf("%s%s", Getattr(n, "decl"), Getattr(n, "type"));
|
||||
String *lisp_type = compose_foreign_type(type);
|
||||
String *lisp_type = compose_foreign_type(n, type);
|
||||
Delete(type);
|
||||
Node *in_class = Getattr(n, "allegrocl:typedef:in-class");
|
||||
|
||||
|
|
@ -1371,9 +1371,13 @@ void emit_enum_type_no_wrap(Node *n) {
|
|||
name = unnamed ? Getattr(n, "allegrocl:name") : Getattr(n, "sym:name");
|
||||
SwigType *tmp = NewStringf("enum %s", unnamed ? unnamed : name);
|
||||
|
||||
Hash *typemap = Swig_typemap_search("ffitype", tmp, 0, 0);
|
||||
String *enumtype = Getattr(typemap, "code");
|
||||
// enumtype = compose_foreign_type(tmp);
|
||||
Node *node = NewHash();
|
||||
Setattr(node, "type", tmp);
|
||||
Setfile(node, Getfile(n));
|
||||
Setline(node, Getline(n));
|
||||
const String *enumtype = Swig_typemap_lookup("ffitype", node, "", 0);
|
||||
Delete(node);
|
||||
|
||||
Delete(tmp);
|
||||
|
||||
if (name) {
|
||||
|
|
@ -1427,12 +1431,14 @@ void emit_enum_type(Node *n) {
|
|||
|
||||
name = unnamed ? Getattr(n, "allegrocl:name") : Getattr(n, "sym:name");
|
||||
SwigType *tmp = NewStringf("enum %s", unnamed ? unnamed : name);
|
||||
// SwigType *tmp = NewStringf("enum ACL_SWIG_ENUM_NAME");
|
||||
|
||||
Hash *typemap = Swig_typemap_search("ffitype", tmp, 0, 0);
|
||||
String *enumtype = Getattr(typemap, "code");
|
||||
Node *node = NewHash();
|
||||
Setattr(node, "type", tmp);
|
||||
Setfile(node, Getfile(n));
|
||||
Setline(node, Getline(n));
|
||||
const String *enumtype = Swig_typemap_lookup("ffitype", node, "", 0);
|
||||
Delete(node);
|
||||
|
||||
// enumtype = compose_foreign_type(tmp);
|
||||
Delete(tmp);
|
||||
|
||||
if (name) {
|
||||
|
|
@ -1979,14 +1985,16 @@ int any_varargs(ParmList *pl) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
String *get_lisp_type(SwigType *ty, const_String_or_char_ptr name) {
|
||||
Hash *typemap = Swig_typemap_search("lisptype", ty, name, 0);
|
||||
if (typemap) {
|
||||
String *typespec = Getattr(typemap, "code");
|
||||
return NewString(typespec);
|
||||
} else {
|
||||
return NewString("");
|
||||
}
|
||||
String *get_lisp_type(Node *n, SwigType *ty, const_String_or_char_ptr name) {
|
||||
Node *node = NewHash();
|
||||
Setattr(node, "type", ty);
|
||||
Setattr(node, "name", name);
|
||||
Setfile(node, Getfile(n));
|
||||
Setline(node, Getline(n));
|
||||
const String *tm = Swig_typemap_lookup("lisptype", node, "", 0);
|
||||
Delete(node);
|
||||
|
||||
return tm ? NewString(tm) : NewString("");
|
||||
}
|
||||
|
||||
Node *parent_node_skipping_extends(Node *n) {
|
||||
|
|
@ -2274,18 +2282,21 @@ int ALLEGROCL::emit_buffered_defuns(Node *n) {
|
|||
return SWIG_OK;
|
||||
}
|
||||
|
||||
String *dispatching_type(Parm *p) {
|
||||
String *dispatching_type(Node *n, Parm *p) {
|
||||
String *result = 0;
|
||||
|
||||
String *parsed = Getattr(p, "type"); //Swig_cparse_type(Getattr(p,"tmap:ctype"));
|
||||
String *cl_t = SwigType_typedef_resolve_all(parsed);
|
||||
|
||||
Hash *typemap = Swig_typemap_search("lispclass", parsed, Getattr(p, "name"), 0);
|
||||
// Printf(stderr,"inspecting type '%s' for class\n", parsed);
|
||||
// Printf(stderr," cfcocr = '%s' res_all = '%s'\n",
|
||||
// class_from_class_or_class_ref(parsed), cl_t);
|
||||
if (typemap) {
|
||||
result = Copy(Getattr(typemap, "code"));
|
||||
Node *node = NewHash();
|
||||
Setattr(node, "type", parsed);
|
||||
Setfile(node, Getfile(n));
|
||||
Setline(node, Getline(n));
|
||||
const String *tm = Swig_typemap_lookup("lispclass", node, Getattr(p, "name"), 0);
|
||||
Delete(node);
|
||||
|
||||
if (tm) {
|
||||
result = Copy(tm);
|
||||
} else {
|
||||
String *lookup_type = class_from_class_or_class_ref(parsed);
|
||||
if (lookup_type)
|
||||
|
|
@ -2305,24 +2316,6 @@ String *dispatching_type(Parm *p) {
|
|||
return result;
|
||||
}
|
||||
|
||||
String *defmethod_lambda_list(Node *overload) {
|
||||
String *result = NewString("");
|
||||
|
||||
ParmList *parms = Getattr(overload, "wrap:parms");
|
||||
Parm *p;
|
||||
int a;
|
||||
|
||||
for (a = 0, p = parms; p; p = nextSibling(p), ++a) {
|
||||
if (a != 0)
|
||||
Printf(result, " ");
|
||||
Printf(result, "(arg%d ", a);
|
||||
Printf(result, "%s", dispatching_type(p));
|
||||
Printf(result, ")");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int ALLEGROCL::emit_dispatch_defun(Node *n) {
|
||||
#ifdef ALLEGROCL_WRAP_DEBUG
|
||||
Printf(stderr, "emit_dispatch_defun: ENTER... ");
|
||||
|
|
@ -2429,9 +2422,9 @@ int ALLEGROCL::emit_defun(Node *n, File *fcl) {
|
|||
String *argname = NewStringf("PARM%d_%s", largnum, Getattr(p, "name"));
|
||||
|
||||
// Printf(stderr,"%s\n", Getattr(p,"tmap:lin"));
|
||||
String *ffitype = compose_foreign_type(argtype, Getattr(p,"name"));
|
||||
String *ffitype = compose_foreign_type(n, argtype, Getattr(p,"name"));
|
||||
String *deref_ffitype = dereference_ffitype(ffitype);
|
||||
String *lisptype = get_lisp_type(parmtype, Getattr(p, "name"));
|
||||
String *lisptype = get_lisp_type(n, parmtype, Getattr(p, "name"));
|
||||
|
||||
#ifdef ALLEGROCL_DEBUG
|
||||
Printf(stderr, "lisptype of '%s' '%s' = '%s'\n", parmtype,
|
||||
|
|
@ -2454,7 +2447,7 @@ int ALLEGROCL::emit_defun(Node *n, File *fcl) {
|
|||
Replaceall(wrap->code, "$body", parm_code);
|
||||
}
|
||||
|
||||
String *dispatchtype = Getattr(n, "sym:overloaded") ? dispatching_type(p) : NewString("");
|
||||
String *dispatchtype = Getattr(n, "sym:overloaded") ? dispatching_type(n, p) : NewString("");
|
||||
|
||||
// if this parameter has been removed from the C/++ wrapper
|
||||
// it shouldn't be in the lisp wrapper either.
|
||||
|
|
@ -2485,13 +2478,13 @@ int ALLEGROCL::emit_defun(Node *n, File *fcl) {
|
|||
SwigType *parsed = Swig_cparse_type(Getattr(n, "tmap:ctype"));
|
||||
// SwigType *cl_t = SwigType_typedef_resolve_all(parsed);
|
||||
SwigType *cl_t = class_from_class_or_class_ref(parsed);
|
||||
String *out_ffitype = compose_foreign_type(parsed);
|
||||
String *out_ffitype = compose_foreign_type(n, parsed);
|
||||
String *deref_out_ffitype;
|
||||
String *out_temp = Copy(parsed);
|
||||
|
||||
if (SwigType_ispointer(out_temp)) {
|
||||
SwigType_pop(out_temp);
|
||||
deref_out_ffitype = compose_foreign_type(out_temp);
|
||||
deref_out_ffitype = compose_foreign_type(n, out_temp);
|
||||
} else {
|
||||
deref_out_ffitype = Copy(out_ffitype);
|
||||
}
|
||||
|
|
@ -2547,7 +2540,7 @@ int ALLEGROCL::emit_defun(Node *n, File *fcl) {
|
|||
/////////////////////////////////////////////////////
|
||||
// Lisp foreign call return type and optimizations //
|
||||
/////////////////////////////////////////////////////
|
||||
Printf(fcl, " (:returning (%s %s)", compose_foreign_type(result_type), get_lisp_type(Getattr(n, "type"), "result"));
|
||||
Printf(fcl, " (:returning (%s %s)", compose_foreign_type(n, result_type), get_lisp_type(n, Getattr(n, "type"), "result"));
|
||||
|
||||
for (Iterator option = First(n); option.item; option = Next(option)) {
|
||||
if (Strncmp("feature:ffargs:", option.key, 15))
|
||||
|
|
@ -2926,10 +2919,6 @@ int ALLEGROCL::variableWrapper(Node *n) {
|
|||
Printf(f_runtime, "EXPORT %s %s;\n%s %s = %s%s;\n", ctype, mangled_name, ctype, mangled_name, (pointer_added ? "&" : ""), name);
|
||||
|
||||
Printf(f_cl, "(swig-defvar \"%s\" :type %s)\n", mangled_name, ((SwigType_isconst(type)) ? ":constant" : ":variable"));
|
||||
/*
|
||||
Printf(f_runtime, "// swigtype: %s\n", SwigType_typedef_resolve_all(Getattr(n,"type")));
|
||||
Printf(f_runtime, "// vwrap: %s\n", compose_foreign_type(SwigType_strip_qualifiers(Copy(rtype))));
|
||||
*/
|
||||
|
||||
Printf(stderr,"***\n");
|
||||
Delete(mangled_name);
|
||||
|
|
@ -2971,7 +2960,7 @@ int ALLEGROCL::typedefHandler(Node *n) {
|
|||
SwigType *typedef_type = Getattr(n,"type");
|
||||
// has the side-effect of noting any implicit
|
||||
// template instantiations in type.
|
||||
String *ff_type = compose_foreign_type(typedef_type);
|
||||
String *ff_type = compose_foreign_type(n, typedef_type);
|
||||
|
||||
String *sym_name = Getattr(n, "sym:name");
|
||||
|
||||
|
|
@ -3132,7 +3121,7 @@ int ALLEGROCL::cppClassHandler(Node *n) {
|
|||
Printf(stderr, "looking at child '%x' of type '%s'\n", c, childType);
|
||||
#endif
|
||||
if (!SwigType_isfunction(childType))
|
||||
Delete(compose_foreign_type(childType));
|
||||
Delete(compose_foreign_type(n, childType));
|
||||
|
||||
Delete(childType);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -819,21 +819,24 @@ void CFFI::emit_struct_union(Node *n, bool un = false) {
|
|||
// Getattr(c, "type"));
|
||||
// SWIG_exit(EXIT_FAILURE);
|
||||
} else {
|
||||
SwigType *childType = NewStringf("%s%s", Getattr(c, "decl"),
|
||||
Getattr(c, "type"));
|
||||
SwigType *childType = NewStringf("%s%s", Getattr(c, "decl"), Getattr(c, "type"));
|
||||
|
||||
Hash *typemap = Swig_typemap_search("cin", childType, "", 0);
|
||||
String *typespec = NewString("");
|
||||
if (typemap) {
|
||||
typespec = NewString(Getattr(typemap, "code"));
|
||||
}
|
||||
Node *node = NewHash();
|
||||
Setattr(node, "type", childType);
|
||||
Setfile(node, Getfile(n));
|
||||
Setline(node, Getline(n));
|
||||
const String *tm = Swig_typemap_lookup("cin", node, "", 0);
|
||||
|
||||
String *typespec = tm ? NewString(tm) : NewString("");
|
||||
|
||||
String *slot_name = lispify_name(c, Getattr(c, "sym:name"), "'slotname");
|
||||
if (Strcmp(slot_name, "t") == 0 || Strcmp(slot_name, "T") == 0)
|
||||
slot_name = NewStringf("t_var");
|
||||
slot_name = NewStringf("t_var");
|
||||
|
||||
Printf(f_cl, "\n\t(%s %s)", slot_name, typespec);
|
||||
|
||||
Delete(node);
|
||||
Delete(childType);
|
||||
Delete(typespec);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue