Rename 'proxy' to 'ctype' as it's the typemap used for the C API.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-c@13679 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
fcecbf17a2
commit
a894545c9a
3 changed files with 29 additions and 29 deletions
44
Lib/c/c.swg
44
Lib/c/c.swg
|
|
@ -62,7 +62,7 @@ macro_name(TM, size_t);
|
|||
same_macro_all_primitive_types_but_void(explicit_same_type_unconsted,TM);
|
||||
%enddef
|
||||
|
||||
//used by 'proxy', 'proxycouttype'
|
||||
//used by 'ctype', 'proxycouttype'
|
||||
%define explicit_same_type(TM, T)
|
||||
%typemap(TM) T, const T "T"
|
||||
%typemap(TM) T*, T&, T[ANY], T[] "T *"
|
||||
|
|
@ -113,32 +113,32 @@ same_action(TM, size_t, ACTION);
|
|||
// typemaps for proxy function parameters
|
||||
|
||||
// void
|
||||
%typemap(proxy) void "void"
|
||||
%typemap(proxy) void*, void& "void *"
|
||||
%typemap(proxy) const void&, const void* "const void *"
|
||||
%typemap(proxy) void**, void*& "void **"
|
||||
%typemap(proxy) const void**, const void*& "const void **"
|
||||
%typemap(ctype) void "void"
|
||||
%typemap(ctype) void*, void& "void *"
|
||||
%typemap(ctype) const void&, const void* "const void *"
|
||||
%typemap(ctype) void**, void*& "void **"
|
||||
%typemap(ctype) const void**, const void*& "const void **"
|
||||
// constant pointers
|
||||
%typemap(proxy) void* * const "void* * const"
|
||||
%typemap(proxy) const void* * const "const void* * const"
|
||||
%typemap(ctype) void* * const "void* * const"
|
||||
%typemap(ctype) const void* * const "const void* * const"
|
||||
|
||||
explicit_same_type_all_primitive_types_but_void(proxy);
|
||||
explicit_same_type_all_primitive_types_but_void(ctype);
|
||||
|
||||
// objects
|
||||
%typemap(proxy) SWIGTYPE "$&resolved_type*"
|
||||
%typemap(proxy) SWIGTYPE * "$resolved_type*"
|
||||
%typemap(proxy) SWIGTYPE & "$*resolved_type*"
|
||||
%typemap(proxy) SWIGTYPE *& "$resolved_type**"
|
||||
%typemap(proxy) SWIGTYPE [ANY] "/*SWIGTYPE [ANY]*/ $1_ltype **"
|
||||
%typemap(proxy) SWIGTYPE * [ANY] "/*SWIGTYPE *[ANY] */ $1_ltype **"
|
||||
%typemap(proxy) SWIGTYPE ** "/*SWIGTYPE ** */ $1_ltype **"
|
||||
%typemap(proxy) enum SWIGTYPE "int"
|
||||
%typemap(proxy) enum SWIGTYPE &, enum SWIGTYPE * "int *"
|
||||
%typemap(proxy, fragment="fptr_decl") SWIGTYPE (CLASS::*) "SWIG_CPP_FP"
|
||||
%typemap(ctype) SWIGTYPE "$&resolved_type*"
|
||||
%typemap(ctype) SWIGTYPE * "$resolved_type*"
|
||||
%typemap(ctype) SWIGTYPE & "$*resolved_type*"
|
||||
%typemap(ctype) SWIGTYPE *& "$resolved_type**"
|
||||
%typemap(ctype) SWIGTYPE [ANY] "/*SWIGTYPE [ANY]*/ $1_ltype **"
|
||||
%typemap(ctype) SWIGTYPE * [ANY] "/*SWIGTYPE *[ANY] */ $1_ltype **"
|
||||
%typemap(ctype) SWIGTYPE ** "/*SWIGTYPE ** */ $1_ltype **"
|
||||
%typemap(ctype) enum SWIGTYPE "int"
|
||||
%typemap(ctype) enum SWIGTYPE &, enum SWIGTYPE * "int *"
|
||||
%typemap(ctype, fragment="fptr_decl") SWIGTYPE (CLASS::*) "SWIG_CPP_FP"
|
||||
|
||||
%typemap(proxy, fragment="stdbool_inc") bool, bool *, const bool, const bool * "$1_ltype"
|
||||
%typemap(proxy, fragment="stdbool_inc") bool & "$1_basetype*"
|
||||
%typemap(proxy, fragment="stdbool_inc") const bool & "$1_basetype const *"
|
||||
%typemap(ctype, fragment="stdbool_inc") bool, bool *, const bool, const bool * "$1_ltype"
|
||||
%typemap(ctype, fragment="stdbool_inc") bool & "$1_basetype*"
|
||||
%typemap(ctype, fragment="stdbool_inc") const bool & "$1_basetype const *"
|
||||
|
||||
// typemaps for function parameters
|
||||
// void
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@ class string;
|
|||
%typemap(cmodtype) string * "char *"
|
||||
%typemap(cmodtype) string & "char *"
|
||||
%typemap(cmodtype) const string & "char *"
|
||||
%typemap(proxy) string "char *"
|
||||
%typemap(proxy) string * "char *"
|
||||
%typemap(proxy) string & "char *"
|
||||
%typemap(proxy) const string & "char *"
|
||||
%typemap(ctype) string "char *"
|
||||
%typemap(ctype) string * "char *"
|
||||
%typemap(ctype) string & "char *"
|
||||
%typemap(ctype) const string & "char *"
|
||||
%typemap(couttype) string "char *"
|
||||
%typemap(couttype) string * "char *"
|
||||
%typemap(couttype) string & "char *"
|
||||
|
|
|
|||
|
|
@ -826,7 +826,7 @@ ready:
|
|||
Swig_typemap_attach_parms("in", parms, 0);
|
||||
|
||||
// attach 'ctype' typemaps
|
||||
Swig_typemap_attach_parms("proxy", parms, 0);
|
||||
Swig_typemap_attach_parms("ctype", parms, 0);
|
||||
|
||||
|
||||
// prepare function definition
|
||||
|
|
@ -855,11 +855,11 @@ ready:
|
|||
|
||||
Printf(arg_name, "c%s", lname);
|
||||
|
||||
if ((tm = Getattr(p, "tmap:proxy"))) { // set the appropriate type for parameter
|
||||
if ((tm = Getattr(p, "tmap:ctype"))) { // set the appropriate type for parameter
|
||||
tm = Copy(tm);
|
||||
}
|
||||
else {
|
||||
Swig_warning(WARN_C_TYPEMAP_CTYPE_UNDEF, input_file, line_number, "No proxy typemap defined for %s\n", SwigType_str(type, 0));
|
||||
Swig_warning(WARN_C_TYPEMAP_CTYPE_UNDEF, input_file, line_number, "No ctype typemap defined for %s\n", SwigType_str(type, 0));
|
||||
}
|
||||
// use proxy-type for parameter if supplied
|
||||
if ((stype = Getattr(p, "c:stype"))) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue