Fixed naming convention issues (internal Swig variables, shadow -> proxy, test.c -> runme.c, etc.), modified Makefiles, bugfixes ("name" -> "sym:name"). Started C test-suite.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-maciekd@10655 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
f585c69d02
commit
a13c5976b5
35 changed files with 925 additions and 639 deletions
165
Lib/c/c.swg
165
Lib/c/c.swg
|
|
@ -1,80 +1,85 @@
|
|||
/* -----------------------------------------------------------------------------
|
||||
* See the LICENSE file for information on copyright, usage and redistribution
|
||||
* of SWIG, and the README file for authors - http://www.swig.org/release.html.
|
||||
*
|
||||
* c.swg
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
%insert("runtime") "clabels.swg"
|
||||
%insert("shadow_header") "cproxy.swg"
|
||||
|
||||
// typemaps for function parameters
|
||||
|
||||
%typemap(ctype) void, short, int, long, char, float, double "$1_type"
|
||||
%typemap(ctype) void*, short*, int*, long*, char*, float*, double* "$1_type"
|
||||
%typemap(ctype) short&, int&, long&, char&, float&, double& "$1_basetype *"
|
||||
%typemap(ctype) const short, const int, const long, const char, const float, const double "$1_basetype"
|
||||
%typemap(ctype) bool "_Bool"
|
||||
%typemap(ctype) SWIGTYPE "$1_type"
|
||||
%typemap(ctype) SWIGTYPE * "$1_type"
|
||||
%typemap(ctype) SWIGTYPE & "$1_type"
|
||||
%typemap(ctype) SWIGTYPE * [ANY] "$1_basetype*"
|
||||
%typemap(ctype) SWIGCLASSTYPE "struct Obj$1_type *"
|
||||
%typemap(ctype) SWIGCLASSTYPE * "struct Obj$1_type"
|
||||
%typemap(ctype) SWIGCLASSTYPE & "struct Obj$*1_ltype *"
|
||||
%typemap(ctype) SWIGCLASSTYPE * [ANY] "struct Obj$1_basetype*"
|
||||
|
||||
%typemap(in) short, int, long, char, float, double, bool "$1 = ($1_basetype) $input;"
|
||||
%typemap(in) void*, short*, int*, long*, char*, float*, double*, bool* "$1 = ($1_basetype *) $input;"
|
||||
%typemap(in) short&, int&, long&, char&, float&, double&, bool& "$1 = ($1_basetype *) $input;"
|
||||
%typemap(in) SWIGTYPE "$1 = ($1_type) $input;"
|
||||
%typemap(in) SWIGTYPE * "$1 = ($1_type) $input;"
|
||||
%typemap(in) SWIGTYPE & "$1 = ($1_type) $input;"
|
||||
%typemap(in) SWIGTYPE * [ANY] "$1 = ($1_basetype*) $input;"
|
||||
%typemap(in) SWIGCLASSTYPE {
|
||||
$1 = * ($1_type *) ($input->obj);
|
||||
}
|
||||
|
||||
%typemap(in) SWIGCLASSTYPE * {
|
||||
$1 = ($1_type) $input->obj;
|
||||
}
|
||||
|
||||
%typemap(in) SWIGCLASSTYPE * [ANY] {
|
||||
$1 = ($1_basetype*) malloc($1_dim0 * sizeof($1_basetype));
|
||||
int i;
|
||||
for (i = 0; i < $1_dim0; ++i)
|
||||
if ($input[i])
|
||||
$1[i] = ($1_basetype) $input[i]->obj;
|
||||
else
|
||||
$1[i] = ($1_basetype) 0;
|
||||
}
|
||||
|
||||
%typemap(in) SWIGCLASSTYPE & {
|
||||
$1 = ($*1_ltype *) $input->obj;
|
||||
}
|
||||
|
||||
// typemaps for return values
|
||||
|
||||
%typemap(couttype) void, short, int, long, char, float, double "$1_type"
|
||||
%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) bool "_Bool"
|
||||
%typemap(couttype) SWIGTYPE "struct Obj$1_type"
|
||||
%typemap(couttype) SWIGTYPE * "struct Obj$*1_type *"
|
||||
|
||||
%typemap(out) short, int, long, char, float, double, bool "$result = $1;"
|
||||
%typemap(out) void*, short*, int*, long*, char*, float*, double*, bool* "$result = $1;"
|
||||
%typemap(out) void ""
|
||||
|
||||
%typemap(out) SWIGTYPE {
|
||||
$result.obj = (void*) &$1;
|
||||
}
|
||||
|
||||
%typemap(out) SWIGTYPE * {
|
||||
$result->obj = (void*) $1;
|
||||
}
|
||||
|
||||
%typemap(out) SWIGTYPE & {
|
||||
// return by reference
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* See the LICENSE file for information on copyright, usage and redistribution
|
||||
* of SWIG, and the README file for authors - http://www.swig.org/release.html.
|
||||
*
|
||||
* c.swg
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
%insert("runtime") "clabels.swg"
|
||||
%insert("proxy_header") "cproxy.swg"
|
||||
|
||||
// typemaps for function parameters
|
||||
|
||||
%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) void*, short*, int*, long*, char*, float*, double* "$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) 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 unsigned short, const unsigned int, const unsigned long, const unsigned char "$1_basetype"
|
||||
%typemap(ctype) bool "_Bool"
|
||||
%typemap(ctype) SWIGTYPE "$1_type"
|
||||
%typemap(ctype) SWIGTYPE * "$1_type"
|
||||
%typemap(ctype) SWIGTYPE & "$1_type"
|
||||
%typemap(ctype) SWIGTYPE * [ANY] "$1_basetype*"
|
||||
%typemap(ctype) SWIGCLASSTYPE "struct SwigObj$1_type *"
|
||||
%typemap(ctype) SWIGCLASSTYPE * "struct SwigObj$1_type"
|
||||
%typemap(ctype) SWIGCLASSTYPE & "struct SwigObj$*1_ltype *"
|
||||
%typemap(ctype) SWIGCLASSTYPE * [ANY] "struct SwigObj$1_basetype *"
|
||||
|
||||
%typemap(in) short, int, long, char, float, double, bool "$1 = ($1_basetype) $input;"
|
||||
%typemap(in) void*, short*, int*, long*, char*, float*, double*, bool* "$1 = ($1_basetype *) $input;"
|
||||
%typemap(in) short&, int&, long&, char&, float&, double&, bool& "$1 = ($1_basetype *) $input;"
|
||||
|
||||
%typemap(in) SWIGTYPE "$1 = ($1_type) $input;"
|
||||
%typemap(in) SWIGTYPE * "$1 = ($1_type) $input;"
|
||||
%typemap(in) SWIGTYPE & "$1 = ($1_type) $input;"
|
||||
%typemap(in) SWIGTYPE * [ANY] "$1 = ($1_basetype*) $input;"
|
||||
%typemap(in) SWIGCLASSTYPE {
|
||||
$1 = * ($1_type *) ($input->obj);
|
||||
}
|
||||
|
||||
%typemap(in) SWIGCLASSTYPE * {
|
||||
$1 = ($1_type) $input->obj;
|
||||
}
|
||||
|
||||
%typemap(in) SWIGCLASSTYPE * [ANY] {
|
||||
$1 = ($1_basetype*) malloc($1_dim0 * sizeof($1_basetype));
|
||||
int i;
|
||||
for (i = 0; i < $1_dim0; ++i)
|
||||
if ($input[i])
|
||||
$1[i] = ($1_basetype) $input[i]->obj;
|
||||
else
|
||||
$1[i] = ($1_basetype) 0;
|
||||
}
|
||||
|
||||
%typemap(in) SWIGCLASSTYPE & {
|
||||
$1 = ($*1_ltype *) $input->obj;
|
||||
}
|
||||
|
||||
// typemaps for return values
|
||||
|
||||
%typemap(couttype) void, short, int, long, char, float, double "$1_type"
|
||||
%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) bool "_Bool"
|
||||
%typemap(couttype) SWIGTYPE "struct SwigObj$1_type"
|
||||
%typemap(couttype) SWIGTYPE * "struct SwigObj$*1_type *"
|
||||
|
||||
%typemap(out) short, int, long, char, float, double, bool "$result = $1;"
|
||||
%typemap(out) void*, short*, int*, long*, char*, float*, double*, bool* "$result = $1;"
|
||||
%typemap(out) void ""
|
||||
|
||||
%typemap(out) SWIGTYPE {
|
||||
$result.obj = (void*) &$1;
|
||||
}
|
||||
|
||||
%typemap(out) SWIGTYPE * {
|
||||
$result->obj = (void*) $1;
|
||||
}
|
||||
|
||||
%typemap(out) SWIGTYPE & {
|
||||
// return by reference
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,32 +1,32 @@
|
|||
/* -----------------------------------------------------------------------------
|
||||
* clabels.swg
|
||||
*
|
||||
* Definitions of C specific preprocessor symbols.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
// this is used instead of default SWIGEXPORT symbol
|
||||
|
||||
#ifndef SWIGEXPORTC
|
||||
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
|
||||
# define SWIGEXPORTC
|
||||
# else
|
||||
# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
|
||||
# define SWIGEXPORTC __attribute__ ((visibility("default")))
|
||||
# else
|
||||
# define SWIGEXPORTC
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef SWIGPROTECT
|
||||
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
|
||||
# define SWIGPROTECT(x)
|
||||
# else
|
||||
# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
|
||||
# define SWIGPROTECT(x) __attribute__ ((visibility("protected"))) x
|
||||
# else
|
||||
# define SWIGPROTECT(x)
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* clabels.swg
|
||||
*
|
||||
* Definitions of C specific preprocessor symbols.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
// this is used instead of default SWIGEXPORT symbol
|
||||
|
||||
#ifndef SWIGEXPORTC
|
||||
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
|
||||
# define SWIGEXPORTC
|
||||
# else
|
||||
# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
|
||||
# define SWIGEXPORTC __attribute__ ((visibility("default")))
|
||||
# else
|
||||
# define SWIGEXPORTC
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef SWIGPROTECT
|
||||
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
|
||||
# define SWIGPROTECT(x)
|
||||
# else
|
||||
# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
|
||||
# define SWIGPROTECT(x) __attribute__ ((visibility("protected"))) x
|
||||
# else
|
||||
# define SWIGPROTECT(x)
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
/* -----------------------------------------------------------------------------
|
||||
* cproxy.swg
|
||||
*
|
||||
* Definitions of C specific preprocessor symbols for proxies.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
#ifndef SWIGIMPORT
|
||||
# ifndef __GNUC__
|
||||
# define __DLL_IMPORT __declspec(dllimport)
|
||||
# else
|
||||
# define __DLL_IMPORT __attribute__((dllimport)) extern
|
||||
# endif
|
||||
# if !defined (__WIN32__)
|
||||
# define SWIGIMPORT extern
|
||||
# else
|
||||
# define SWIGIMPORT __DLL_IMPORT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* cproxy.swg
|
||||
*
|
||||
* Definitions of C specific preprocessor symbols for proxies.
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
#ifndef SWIGIMPORT
|
||||
# ifndef __GNUC__
|
||||
# define __DLL_IMPORT __declspec(dllimport)
|
||||
# else
|
||||
# define __DLL_IMPORT __attribute__((dllimport)) extern
|
||||
# endif
|
||||
# if !defined (__WIN32__)
|
||||
# define SWIGIMPORT extern
|
||||
# else
|
||||
# define SWIGIMPORT __DLL_IMPORT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue