diff options
author | Derrick <a11426@users.sourceforge.net> | 2010-07-21 16:32:43 +0000 |
---|---|---|
committer | Derrick <a11426@users.sourceforge.net> | 2010-07-21 16:32:43 +0000 |
commit | 3e1af1f698d5d02d7905431bcb3549c0f7bc9aa7 (patch) | |
tree | 6c0c05fd1035a43fc6408785a6b039274caa525a /Examples/go/enum | |
parent | cf0008835580f07ca06529b74df0728cdb13a8fe (diff) | |
download | swig-3e1af1f698d5d02d7905431bcb3549c0f7bc9aa7.tar.gz |
Adding support for new typemap attributes extraparm and replaceparm. The
extraparm attribute is used in the fortran bindings to handle passing of
fortran strings to C. When passing strings, fortran compilers add an additional
parameter to the argument list representing the length of the string. The
extraparms attribute can be added to a typemap, specifying the type and name of
the extra parameter that should be added to wrapper function interfaces. The
replaceparm attribute is used for passing integers, doubles, floats and other
numeric values that fortran passes by address, but the c interface expects to
receive by value. An example of this can be seen in the simple example.
There are still a few problems with the new attributes. For example, once I get
the typemap:in:extraparm attribute, I have a string with a type and variable
name that represents the new extra parameter. The string may look like this:
"size_t $1_len". If I want the name of the parameter, I have to manually parse
it out of the string. The currently implementation, in the emit.cxx function
named parse_name_from_arg, seems like a hack, but I think it will work. I would
like to figure out if there is a way I can throw the string back through the
swig parser and get let it parse the variable name from the type.
Added the swig license header to fortran.cxx and incorporated the use of new
typemap attributes extraparms and replaceparms to handle the currently
supported datatypes during wrapper function generation.
Added extraparm and replaceparm attributes to the fortran.swg. Updated
namespace of the fortranify and null_terminate functions in fortran.swg.
Separated out the string, simple, and array examples. Array example does not
work yet.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/a11426-fortran@12165 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Examples/go/enum')
0 files changed, 0 insertions, 0 deletions