Add string & length typemap for Go.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12394 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
ef865e06d5
commit
ef3644f052
2 changed files with 48 additions and 0 deletions
|
|
@ -333,6 +333,28 @@
|
|||
unsigned char *, unsigned char *&, unsigned char[ANY], unsigned char[]
|
||||
%{ $result = ($1_ltype)$input.p; %}
|
||||
|
||||
/* String & length */
|
||||
|
||||
%typemap(gotype) (char *STRING, size_t LENGTH) "string"
|
||||
|
||||
%typemap(in) (char *STRING, size_t LENGTH)
|
||||
%{
|
||||
$1 = ($1_ltype)$input.p;
|
||||
$2 = ($2_ltype)$input.n;
|
||||
%}
|
||||
|
||||
%typemap(out) (char *STRING, size_t LENGTH)
|
||||
%{ $result = _swig_makegostring((char*)$1, (size_t)$2); %}
|
||||
|
||||
%typemap(directorin) (char *STRING, size_t LENGTH)
|
||||
%{ $input = _swig_makegostring((char*)$1_name, $2_name); %}
|
||||
|
||||
%typemap(directorout) (char *STRING, size_t LENGTH)
|
||||
%{
|
||||
$1 = ($1_ltype)$input.p;
|
||||
$2 = ($2_ltype)$input.n;
|
||||
%}
|
||||
|
||||
/* Enums. We can't do the right thing for enums in typemap(gotype) so
|
||||
we deliberately don't define them. The right thing would be to
|
||||
capitalize the name. This is instead done in go.cxx. */
|
||||
|
|
@ -500,6 +522,7 @@
|
|||
SWIGTYPE [],
|
||||
SWIGTYPE (CLASS::*)
|
||||
""
|
||||
|
||||
/* Go keywords. */
|
||||
%include <gokw.swg>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue