Some function return cases fixed.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-maciekd@10748 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
83d60a1d36
commit
ea556b565d
3 changed files with 91 additions and 55 deletions
43
Lib/c/c.swg
43
Lib/c/c.swg
|
|
@ -28,14 +28,14 @@ typedef struct {
|
|||
%typemap(ctype) void **, short **, int **, long **, char **, float **, double ** "$1_type"
|
||||
%typemap(ctype) unsigned short *, unsigned int *, unsigned long *, unsigned char * "$1_type"
|
||||
%typemap(ctype) unsigned short **, unsigned int **, unsigned long **, unsigned char ** "$1_type"
|
||||
%typemap(ctype) short &, int &, long &, char &, float &, double & "$1_basetype *"
|
||||
%typemap(ctype) short &, int &, long &, char &, float &, double & "$1_basetype *"
|
||||
%typemap(ctype) unsigned short &, unsigned int &, unsigned long &, unsigned char & "$1_basetype *"
|
||||
%typemap(ctype) const short &, const int &, const long &, const char &, const float &, const double & "$1_basetype *"
|
||||
%typemap(ctype) const short, const int, const long, const char, const float, const double "$1_type"
|
||||
%typemap(ctype) const short &, const int &, const long &, const char &, const float &, const double & "$1_basetype const *"
|
||||
%typemap(ctype) const short, const int, const long, const char, const float, const double "$1_type"
|
||||
%typemap(ctype) const unsigned short, const unsigned int, const unsigned long, const unsigned char "$1_type"
|
||||
%typemap(ctype) const void *, const short *, const int *, const long *, const char *, const float *, const double *, const bool * "$1_type"
|
||||
%typemap(ctype) short [ANY], int [ANY], long [ANY], char [ANY], float [ANY], double [ANY], bool [ANY] "$1_basetype *"
|
||||
%typemap(ctype) void * [ANY], short * [ANY], int * [ANY], long * [ANY], char * [ANY], float * [ANY], double * [ANY], bool * [ANY] "$1_basetype **"
|
||||
%typemap(ctype) const void *, const short *, const int *, const long *, const char *, const float *, const double * "$1_type"
|
||||
%typemap(ctype) short [ANY], int [ANY], long [ANY], char [ANY], float [ANY], double [ANY] "$1_basetype *"
|
||||
%typemap(ctype) void * [ANY], short * [ANY], int * [ANY], long * [ANY], char * [ANY], float * [ANY], double * [ANY] "$1_basetype **"
|
||||
%typemap(ctype) SWIGTYPE "SwigObj *"
|
||||
%typemap(ctype) SWIGTYPE * "SwigObj *"
|
||||
%typemap(ctype) SWIGTYPE & "SwigObj *"
|
||||
|
|
@ -44,25 +44,27 @@ typedef struct {
|
|||
|
||||
%fragment("stdbool_inc", "proxy_header") {#include <stdbool.h>}
|
||||
%typemap(ctype, fragment="stdbool_inc") bool, bool *, bool **, const bool, const bool *, bool * [ANY] "$1_type"
|
||||
%typemap(ctype, fragment="stdbool_inc") bool &, const bool & "$1_basetype *"
|
||||
%typemap(ctype, fragment="stdbool_inc") bool & "$1_basetype *"
|
||||
%typemap(ctype, fragment="stdbool_inc") const bool & "$1_basetype const *"
|
||||
|
||||
%typemap(in) short, int, long, char, float, double, bool "$1 = ($1_type) $input;"
|
||||
%typemap(in) void *, short *, int *, long *, char *, float *, double *, bool * "$1 = ($1_type) $input;"
|
||||
%typemap(in) void **, short **, int **, long **, char **, float **, double **, bool * "$1 = ($1_basetype **) $input;"
|
||||
%typemap(in) short, int, long, char, float, double "$1 = ($1_type) $input;"
|
||||
%typemap(in) void *, short *, int *, long *, char *, float *, double * "$1 = ($1_type) $input;"
|
||||
%typemap(in) void **, short **, int **, long **, char **, float **, double ** "$1 = ($1_basetype **) $input;"
|
||||
%typemap(in) unsigned short *, unsigned int *, unsigned long *, unsigned char * "$1 = ($1_type) $input;"
|
||||
%typemap(in) unsigned short **, unsigned int **, unsigned long **, unsigned char ** "$1 = ($1_type) $input;"
|
||||
%typemap(in) const void *, const short *, const int *, const long *, const char *, const float *, const double *, const bool * "$1 = ($1_basetype *) $input;"
|
||||
%typemap(in) const void *, const short *, const int *, const long *, const char *, const float *, const double * "$1 = ($1_basetype *) $input;"
|
||||
%typemap(in) const unsigned short *, const unsigned int *, const unsigned long *, const unsigned char * "$1 = ($1_type) $input;"
|
||||
%typemap(in) unsigned short, unsigned int, unsigned long, unsigned char "$1 = ($1_type) $input;"
|
||||
%typemap(in) short &, int &, long &, char &, float &, double &, bool & "$1 = ($1_basetype *) $input;"
|
||||
%typemap(in) const short &, const int &, const long &, const char &, const float &, const double &, const bool & "$1 = ($1_basetype *) $input;"
|
||||
%typemap(in) const short &, const int &, const long &, const char &, const float &, const double & "$1 = ($1_basetype *) $input;"
|
||||
%typemap(in) unsigned short &, unsigned int &, unsigned long &, unsigned char & "$1 = ($1_basetype *) $input;"
|
||||
%typemap(in) const unsigned short &, const unsigned int &, const unsigned long &, const unsigned char & "$1 = ($1_basetype *) $input;"
|
||||
%typemap(in) short [ANY], int [ANY], long [ANY], char [ANY], float [ANY], double [ANY], bool [ANY] "$1 = ($1_basetype *) $input;"
|
||||
%typemap(in) void * [ANY], short * [ANY], int * [ANY], long * [ANY], char * [ANY], float * [ANY], double * [ANY], bool * [ANY] "$1 = ($1_basetype *) $input;"
|
||||
%typemap(in) short [ANY], int [ANY], long [ANY], char [ANY], float [ANY], double [ANY] "$1 = ($1_basetype *) $input;"
|
||||
%typemap(in) void * [ANY], short * [ANY], int * [ANY], long * [ANY], char * [ANY], float * [ANY], double * [ANY] "$1 = ($1_basetype *) $input;"
|
||||
|
||||
%typemap(in, fragment="stdbool_inc") bool, bool *, bool **, const bool, const bool *, bool * [ANY] "$1 = ($1_type) $input;"
|
||||
%typemap(in, fragment="stdbool_inc") bool &, const bool & "$1 = ($1_basetype *) $input;"
|
||||
%typemap(in, fragment="stdbool_inc") bool, bool *, bool **, const bool, const bool * "$1 = ($1_type) $input;"
|
||||
%typemap(in, fragment="stdbool_inc") bool & "$1 = ($1_basetype *) $input;"
|
||||
%typemap(in, fragment="stdbool_inc") const bool &, const bool * "$1 = ($1_basetype *) $input;"
|
||||
|
||||
%typemap(in) enum SWIGTYPE "$1 = ($1_type) $input;"
|
||||
|
||||
|
|
@ -102,16 +104,17 @@ typedef struct {
|
|||
%typemap(couttype) void *, short *, int *, long *, char *, float *, double* "$1_type"
|
||||
%typemap(couttype) const short, const int, const long, const char, const float, const double "$1_basetype"
|
||||
%typemap(couttype) const void *, const short *, const int *, const long *, const char *, const float *, const double * "$1_type"
|
||||
%typemap(couttype) short &, int &, long &, char &, float &, double &, bool & "$1_basetype *"
|
||||
%typemap(couttype) short &, int &, long &, char &, float &, double & "$1_basetype *"
|
||||
%typemap(couttype) const short &, const int &, const long &, const char &, const float &, const double & "$1_basetype const *"
|
||||
%typemap(couttype) short [ANY], int [ANY], long [ANY], char [ANY], float [ANY], double [ANY], bool [ANY] "$1_basetype *"
|
||||
%typemap(couttype) short [ANY], int [ANY], long [ANY], char [ANY], float [ANY], double [ANY] "$1_basetype *"
|
||||
%typemap(couttype) SWIGTYPE "SwigObj *"
|
||||
%typemap(couttype) SWIGTYPE * "SwigObj *"
|
||||
%typemap(couttype) SWIGTYPE & "SwigObj *"
|
||||
%typemap(couttype) enum SWIGTYPE "$1_type"
|
||||
|
||||
%typemap(couttype, fragment="stdbool_inc") bool, bool *, const bool, const bool * "$1_type"
|
||||
%typemap(couttype, fragment="stdbool_inc") bool &, const bool & "$1_basetype *"
|
||||
%typemap(couttype, fragment="stdbool_inc") bool & "$1_basetype*"
|
||||
%typemap(couttype, fragment="stdbool_inc") const bool & "$1_basetype const *"
|
||||
|
||||
%typemap(out) short, int, long, char, float, double "$result = $1;"
|
||||
%typemap(out) void*, short*, int*, long*, char*, float*, double* "$result = $1;"
|
||||
|
|
@ -123,7 +126,7 @@ typedef struct {
|
|||
%typemap(out) unsigned short &, unsigned int &, unsigned long &, unsigned char & "$result = $1;"
|
||||
%typemap(out) const short &, const int &, const long &, const char &, const float &, const double & "$result = $1;"
|
||||
%typemap(out) const unsigned short &, const unsigned int &, const unsigned long &, const unsigned char & "$result = $1;"
|
||||
%typemap(out) short [ANY], int [ANY], long [ANY], char [ANY], float [ANY], double [ANY], bool [ANY] "$result = $1;"
|
||||
%typemap(out) short [ANY], int [ANY], long [ANY], char [ANY], float [ANY], double [ANY] "$result = $1;"
|
||||
%typemap(out) void ""
|
||||
|
||||
%typemap(out, fragment="stdbool_inc") bool, bool *, const bool, const bool * "$result = $1;"
|
||||
|
|
|
|||
|
|
@ -38,8 +38,8 @@ class string;
|
|||
delete $1;
|
||||
}
|
||||
|
||||
%typemap(out) string, const string & {
|
||||
const char *str = cppresult.c_str();
|
||||
%typemap(out) string, const string &, string * {
|
||||
const char *str = cppresult->c_str();
|
||||
size_t len = strlen(str);
|
||||
$result = (char *) malloc(len + 1);
|
||||
memcpy($result, str, len);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue