> > >From the very beginning I am confused.
> >
> > What is a module ? Why is the %module declaration needed ?
> What is
> > it telling swig to do ?
>
> I have only used SWIG-C#. In SWIG-C# the module name is the
> name of the static class that contains wrappers of all global
> functions and variables. Also, if you use more than one
> module, each one needs a different name.
OK, that's interesting, but just opens up more questions.
All what global functions and variables ?
All those included within the hash-included files between the %{ and %}
delimiter ?
Or anything that SWIG decides is global (how do I know?) up until the
next use of the key-word %module ?
> > Why am I hash-including and percent-including the same file ?
> > If I hash-include, surely swig now knows about the class,
> why would I
> > need to tell it again ?
>
> I agree, this is poorly explained. SWIG follows %include
> directives but it ignores #include directives. %{ ... %}
> blocks are inserted verbatim into the .cxx wrapper file, but
> they are otherwise ignored by SWIG.
So, is it correct that anything found between the %{ ... %} will be
included verbatim ?
Are you saying then that the percent-include is using the specified file
as if it were providing the signature of the functions (as an include
file is used) to be wrapped by SWIG, instead of requiring the developer
to duplicate that information within the module definition file ?
That makes a bit of sense now, this is not at all clear from the
documentation.
>
> > Where is the definitive list of swig reserved words and
> their meanings ?
> > This does not seem to appear anywhere in any documentation
> I can find
> > on swig.
>
> All SWIG-specific reserved words start with %...
Yes, I think that is documented, but a list of the available reserved
words are (e.g., the 'commands' available to me as a developer) is
missing. This is a pretty significant deficite in the SWIG
documentation, and I am amazed nobody has bothered to construct some
kind of index.
> the ones
> that I can think of are
>
> %module : first line of your .i file
Great (no offence), but what is it doing ?? What is the scope ? what
'arguments' does it take ?
I keep seeing this type of construct:
%module(directors="1")
But I've yet to find any documentation which discusses what the
'directors' part means or why the number is "1" (why the quotes, anyway
?).
> %include : include a file
> %feature : modifies some aspect of SWIG's behavior %typemap :
> see chapter 10
> %apply : copy typemaps from one type to another,
> unless the target type already has typemaps defined
> %rename : change name of something in target language
> %ignore : do not create a wrapper for a specific type
> %template: instantiate a C++ template and wrap it
> %insert : insert code in .cxx wrapper file
> %fragment: define a piece of shared code in .cxx wrapper file that
> is inserted only if it is requested by a typemap
> %define...%enddef: multi-line #define
Note to SWIG developers or contributors: Any chance of putting together
a list like that above with some more thorough explanations, or at least
a hyperlink to where the topic is discussed within the documentation
>
> I think most other terms such as %newobject are not keywords,
> but aliases for features, e.g. in Lib/swig.swg you'll see
>
> #define %newobject %feature("new")
>
So, here we have what looks like C/C++ syntax being used to control the
behaviour of SWIG, even though all SWIG 'commands' or reserved words are
suppsoed to begin with %. How inconsistant is that !
> C/C++ reserved words are also reserved and have the same
> meaning as they do in C/C++.
What ???? How would that affect SWIGs behaviour,
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects_______________________________________________
Swig-user mailing list
Swig-user@...
https://lists.sourceforge.net/lists/listinfo/swig-user