Hello all,
Luke J Crook <[EMAIL PROTECTED]> wrote:

>I just downloaded and compiled the latest SWIG from CVS and I have a 
>question regarding the new functionality that you added this month. 
>
>* -extern-all ; This does not seem to work. No symbols are exported. 

I need to remove this option from being shown. It is not present and there
is no plan to add it, because it is unnecessary.
>
>* -lispify? What -cffi option do I use to test this? 
>
OK. I will give some examples and show how to use the new features. Also,
I will suggest reading the section
11.3 Features and the %feature directive in the SWIG docs.
SWIG/Doc/Manual/Customization.html

Say, file: test.i

%module test

%feature("inline") sleep; //this will inline the sleep function

%feature("export");     //start exporting symbols   
%feature("intern_function"); //start lispifying symbols
%include "test.cpp"     
%feature("intern_function",""); //start lispifying symbols

%feature("intern_function","lispify"); //start lispifying symbols
int test1();
%feature("intern_function",""); //start lispifying symbols

%feature("export",""); //stop exporting symbols


The file test.cpp as:

void sleep(float t);

int APPTerminating;

void xyz();

And the output file will be:


(cl:declaim (cl:inline #.(swig-lispify "sleep" 'function)))

(cffi:defcfun ("sleep" #.(swig-lispify "sleep" 'function)) :void
  (t_arg0 :float))

(cl:export '#.(swig-lispify "sleep" 'function))

(cffi:defcvar ("APPTerminating" #.(swig-lispify "APPTerminating" 'variable))
 :int)

(cl:export 'APPTerminating)

(cffi:defcfun ("xyz" #.(swig-lispify "xyz" 'function)) :void)

(cl:export '#.(swig-lispify "xyz" 'function))

(cffi:defcfun ("test1" #.(lispify "test1" 'function)) :int)

(cl:export '#.(lispify "test1" 'function))


I have removed the SWIG wrapper code generated at the top of file.
What do you think about the feature name as 'intern_function'? I am 
thinking that it should be `lispify_function' or at least there should
be an alternate with the same name.

>SWIG requests:
>I'm not sure if you added any of these, but it would be great if you could: 
>
>1) Instead of substituting :pointer for enums, replace with the enum name, 
>or :int for anonymous enums, for example:
>>>>
>enum Boolean { true = 0, false = 1 };
>Boolean returnBoolean(int value); 
>
>Should generate:
>(defcfun ("returnBoolean" returnBoolean) boolean
> (value :int))
><<< 
>
>2) For enums, SWIG should treat 'enum Boolean' as Boolean. For example:
>>>>
>enum Boolean returnBoolean(int value); 
>
>Should generate:
>(defcfun ("returnBoolean" returnBoolean) boolean
> (value :int))
><<<< 
>

I will next see what can be done about the above.

-- 
Surendra Singhi
http://ssinghi.kreeti.com/, http://www.kreeti.com



__________________________________________________________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need.

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp
_______________________________________________
application-builder mailing list
[email protected]
http://www.lispniks.com/mailman/listinfo/application-builder

Reply via email to