Support for enums and typedefs.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-maciekd@10691 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
e90a0692c7
commit
9c5ef7558c
4 changed files with 190 additions and 42 deletions
12
Lib/c/c.swg
12
Lib/c/c.swg
|
|
@ -39,6 +39,7 @@ typedef struct {
|
|||
%typemap(ctype) SWIGTYPE * "SwigObj *"
|
||||
%typemap(ctype) SWIGTYPE & "SwigObj *"
|
||||
%typemap(ctype) SWIGTYPE * [ANY] "SwigObj *"
|
||||
%typemap(ctype) enum SWIGTYPE "$1_type"
|
||||
|
||||
%fragment("stdbool_inc", "proxy_header") {#include <stdbool.h>}
|
||||
%typemap(ctype, fragment="stdbool_inc") bool, bool *, bool **, const bool, const bool *, bool * [ANY] "$1_type"
|
||||
|
|
@ -60,6 +61,8 @@ typedef struct {
|
|||
%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) enum SWIGTYPE "$1 = ($1_type) $input;"
|
||||
|
||||
%typemap(in) SWIGTYPE {
|
||||
$1 = * ($1_type *) ($input->obj);
|
||||
}
|
||||
|
|
@ -98,9 +101,10 @@ typedef struct {
|
|||
%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) const short &, const int &, const long &, const char &, const float &, const double & "$1_basetype const *"
|
||||
%typemap(couttype) SWIGTYPE "SwigObj *"
|
||||
%typemap(couttype) SWIGTYPE * "SwigObj *"
|
||||
%typemap(couttype) SWIGTYPE & "SwigObj *"
|
||||
%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 *"
|
||||
|
|
@ -120,6 +124,8 @@ typedef struct {
|
|||
%typemap(out, fragment="stdbool_inc") bool, bool *, const bool, const bool * "$result = $1;"
|
||||
%typemap(out, fragment="stdbool_inc") bool &, const bool & "$result = $1;"
|
||||
|
||||
%typemap(out) enum SWIGTYPE "$result = ($1_type) $1;"
|
||||
|
||||
// allocate new "object-struct" by default
|
||||
|
||||
%typemap(out) SWIGTYPE {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue