Rename "go" typemap to "gotype".

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12129 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Ian Lance Taylor 2010-06-15 19:40:34 +00:00
commit da5e02f81c
9 changed files with 50 additions and 50 deletions

View file

@ -454,7 +454,7 @@ value.
</p> </p>
<p> <p>
These type mappings are defined by the "go" typemap. You may change These type mappings are defined by the "gotype" typemap. You may change
that typemap, or add new values, to control how C/C++ types are mapped that typemap, or add new values, to control how C/C++ types are mapped
into Go types. into Go types.
</p> </p>

View file

@ -12,7 +12,7 @@ extern int squareCubed (int n, int *OUTPUT);
extern int gcd(int x, int y); extern int gcd(int x, int y);
%typemap(go) (int argc, char *argv[]) "[]string" %typemap(gotype) (int argc, char *argv[]) "[]string"
%typemap(in) (int argc, char *argv[]) %typemap(in) (int argc, char *argv[])
%{ %{
@ -40,7 +40,7 @@ extern int gcd(int x, int y);
extern int gcdmain(int argc, char *argv[]); extern int gcdmain(int argc, char *argv[]);
%typemap(go) (char *bytes, int len) "string" %typemap(gotype) (char *bytes, int len) "string"
%typemap(in) (char *bytes, int len) %typemap(in) (char *bytes, int len)
%{ %{
@ -55,7 +55,7 @@ extern int count(char *bytes, int len, char c);
* modified. * modified.
*/ */
%typemap(go) (char *str, int len) "[]string" %typemap(gotype) (char *str, int len) "[]string"
%typemap(in) (char *str, int len) %typemap(in) (char *str, int len)
%{ %{

View file

@ -71,7 +71,7 @@ namespace test {
} }
#endif #endif
#ifdef SWIGGO #ifdef SWIGGO
%typemap(go) test::test_complex * "complex128" %typemap(gotype) test::test_complex * "complex128"
%typemap(in) test::test_complex * { %typemap(in) test::test_complex * {
$1 = new test_complex(__real__ $input, __imag__ $input); $1 = new test_complex(__real__ $input, __imag__ $input);
} }
@ -107,7 +107,7 @@ namespace test {
} }
#endif #endif
#ifdef SWIGGO #ifdef SWIGGO
%typemap(go) string_class * "string" %typemap(gotype) string_class * "string"
%typemap(in) string_class * { %typemap(in) string_class * {
$1 = new string_class($input.p); $1 = new string_class($input.p);
} }

View file

@ -27,7 +27,7 @@ namespace Foo {
%typemap(javaout) Str1 * = char *; %typemap(javaout) Str1 * = char *;
#endif #endif
#ifdef SWIGGO #ifdef SWIGGO
%typemap(go) Str1 * = char *; %typemap(gotype) Str1 * = char *;
#endif #endif
%typemap(in) Str1 * = char *; %typemap(in) Str1 * = char *;
#if !(defined(SWIGCSHARP) || defined(SWIGLUA) || defined(SWIGPHP) || defined(SWIGMZSCHEME) || defined(SWIGOCAML) || defined(SWIGGO)) #if !(defined(SWIGCSHARP) || defined(SWIGLUA) || defined(SWIGPHP) || defined(SWIGMZSCHEME) || defined(SWIGOCAML) || defined(SWIGGO))

View file

@ -11,7 +11,7 @@ typedef struct SWIGCDATA {
} SWIGCDATA; } SWIGCDATA;
%} %}
%typemap(go) SWIGCDATA %{ []byte %} %typemap(gotype) SWIGCDATA %{ []byte %}
%typemap(out) SWIGCDATA (swigcdata argp) { %typemap(out) SWIGCDATA (swigcdata argp) {
argp = _swig_makegobyteslice($1.data, $1.len); argp = _swig_makegobyteslice($1.data, $1.len);
$result.data = (char*)argp.data; $result.data = (char*)argp.data;

View file

@ -6,27 +6,27 @@
/* Basic types */ /* Basic types */
%typemap(go) bool, const bool & "bool" %typemap(gotype) bool, const bool & "bool"
%typemap(go) char, const char & "byte" %typemap(gotype) char, const char & "byte"
%typemap(go) signed char, const signed char & "int8" %typemap(gotype) signed char, const signed char & "int8"
%typemap(go) unsigned char, const unsigned char & "byte" %typemap(gotype) unsigned char, const unsigned char & "byte"
%typemap(go) short, const short & "int16" %typemap(gotype) short, const short & "int16"
%typemap(go) unsigned short, const unsigned short & "uint16" %typemap(gotype) unsigned short, const unsigned short & "uint16"
%typemap(go) int, const int & "int" %typemap(gotype) int, const int & "int"
%typemap(go) unsigned int, const unsigned int & "uint" %typemap(gotype) unsigned int, const unsigned int & "uint"
#if SWIGGO_LONG_TYPE_SIZE == 32 #if SWIGGO_LONG_TYPE_SIZE == 32
%typemap(go) long, const long & "int32" %typemap(gotype) long, const long & "int32"
%typemap(go) unsigned long, const unsigned long & "uint32" %typemap(gotype) unsigned long, const unsigned long & "uint32"
#elif SWIGGO_LONG_TYPE_SIZE == 64 #elif SWIGGO_LONG_TYPE_SIZE == 64
%typemap(go) long, const long & "int64" %typemap(gotype) long, const long & "int64"
%typemap(go) unsigned long, const unsigned long & "uint64" %typemap(gotype) unsigned long, const unsigned long & "uint64"
#else #else
#error "SWIGGO_LONG_TYPE_SIZE not 32 or 64" #error "SWIGGO_LONG_TYPE_SIZE not 32 or 64"
#endif #endif
%typemap(go) long long, const long long & "int64" %typemap(gotype) long long, const long long & "int64"
%typemap(go) unsigned long long, const unsigned long long & "uint64" %typemap(gotype) unsigned long long, const unsigned long long & "uint64"
%typemap(go) float, const float & "float32" %typemap(gotype) float, const float & "float32"
%typemap(go) double, const double & "float64" %typemap(gotype) double, const double & "float64"
%typemap(in) bool, %typemap(in) bool,
char, char,
@ -164,9 +164,9 @@
/* The size_t type. */ /* The size_t type. */
#if SWIGGO_LONG_TYPE_SIZE == 32 #if SWIGGO_LONG_TYPE_SIZE == 32
%typemap(go) size_t, const size_t & %{int%} %typemap(gotype) size_t, const size_t & %{int%}
#else #else
%typemap(go) size_t, const size_t & %{int64%} %typemap(gotype) size_t, const size_t & %{int64%}
#endif #endif
%typemap(in) size_t %typemap(in) size_t
@ -198,7 +198,7 @@
/* Member pointers. */ /* Member pointers. */
%typemap(go) SWIGTYPE (CLASS::*) %typemap(gotype) SWIGTYPE (CLASS::*)
%{$gotypename%} %{$gotypename%}
%typemap(in) SWIGTYPE (CLASS::*) %typemap(in) SWIGTYPE (CLASS::*)
@ -223,7 +223,7 @@
/* We can't translate pointers using a typemap, so that is handled in /* We can't translate pointers using a typemap, so that is handled in
the C++ code. */ the C++ code. */
%typemap(go) SWIGTYPE * %typemap(gotype) SWIGTYPE *
%{$gotypename%} %{$gotypename%}
%typemap(in) SWIGTYPE * %typemap(in) SWIGTYPE *
@ -242,7 +242,7 @@
/* Pointer references. */ /* Pointer references. */
%typemap(go) SWIGTYPE *const& %typemap(gotype) SWIGTYPE *const&
%{$gotypename%} %{$gotypename%}
%typemap(in) SWIGTYPE *const& ($*1_ltype temp = 0) %typemap(in) SWIGTYPE *const& ($*1_ltype temp = 0)
@ -266,7 +266,7 @@ type _swig_memberptr *byte
/* Converting a C++ reference to Go has to be handled in the C++ /* Converting a C++ reference to Go has to be handled in the C++
code. */ code. */
%typemap(go) SWIGTYPE & %typemap(gotype) SWIGTYPE &
%{$gotypename%} %{$gotypename%}
%typemap(in) SWIGTYPE & %typemap(in) SWIGTYPE &
@ -284,7 +284,7 @@ type _swig_memberptr *byte
/* C arrays turn into Go pointers. If we know the length we can use a /* C arrays turn into Go pointers. If we know the length we can use a
slice. */ slice. */
%typemap(go) SWIGTYPE [] %typemap(gotype) SWIGTYPE []
%{$gotypename%} %{$gotypename%}
%typemap(in) SWIGTYPE [] %typemap(in) SWIGTYPE []
@ -301,7 +301,7 @@ type _swig_memberptr *byte
/* Strings. */ /* Strings. */
%typemap(go) %typemap(gotype)
char *, char *&, char[ANY], char[], char *, char *&, char[ANY], char[],
signed char *, signed char *&, signed char[ANY], signed char[], signed char *, signed char *&, signed char[ANY], signed char[],
unsigned char *, unsigned char *&, unsigned char[ANY], unsigned char[] unsigned char *, unsigned char *&, unsigned char[ANY], unsigned char[]
@ -309,8 +309,8 @@ type _swig_memberptr *byte
/* Needed to avoid confusion with the way the go module handles /* Needed to avoid confusion with the way the go module handles
references. */ references. */
%typemap(go) char&, unsigned char& "*byte" %typemap(gotype) char&, unsigned char& "*byte"
%typemap(go) signed char& "*int8" %typemap(gotype) signed char& "*int8"
%typemap(in) %typemap(in)
char *, char[ANY], char[], char *, char[ANY], char[],
@ -341,11 +341,11 @@ type _swig_memberptr *byte
unsigned char *, unsigned char *&, unsigned char[ANY], unsigned char[] unsigned char *, unsigned char *&, unsigned char[ANY], unsigned char[]
%{ $result = ($1_ltype)$input.p; %} %{ $result = ($1_ltype)$input.p; %}
/* Enums. We can't do the right thing for enums in typemap(go) so we /* Enums. We can't do the right thing for enums in typemap(gotype) so
deliberately don't define them. The right thing would be to we deliberately don't define them. The right thing would be to
capitalize the name. This is instead done in go.cxx. */ capitalize the name. This is instead done in go.cxx. */
%typemap(go) enum SWIGTYPE %typemap(gotype) enum SWIGTYPE
%{$gotypename%} %{$gotypename%}
%typemap(in) enum SWIGTYPE %typemap(in) enum SWIGTYPE
@ -364,7 +364,7 @@ type _swig_memberptr *byte
We convert it to a pointer for the Go code. Note that all basic We convert it to a pointer for the Go code. Note that all basic
types are explicitly handled above. */ types are explicitly handled above. */
%typemap(go) SWIGTYPE %typemap(gotype) SWIGTYPE
%{$gotypename%} %{$gotypename%}
%typemap(in) SWIGTYPE ($&1_type argp) %typemap(in) SWIGTYPE ($&1_type argp)

View file

@ -19,7 +19,7 @@ namespace std {
class string; class string;
%typemap(go) string, const string & "string" %typemap(gotype) string, const string & "string"
%typemap(in) string %typemap(in) string
%{ $1.assign($input.p, $input.n); %} %{ $1.assign($input.p, $input.n); %}

View file

@ -60,7 +60,7 @@ char * typemaps instead:
*/ */
%define INPUT_TYPEMAP(TYPE, GOTYPE) %define INPUT_TYPEMAP(TYPE, GOTYPE)
%typemap(go) TYPE *INPUT, TYPE &INPUT "GOTYPE" %typemap(gotype) TYPE *INPUT, TYPE &INPUT "GOTYPE"
%typemap(in) TYPE *INPUT %typemap(in) TYPE *INPUT
%{ $1 = ($1_ltype)&$input; %} %{ $1 = ($1_ltype)&$input; %}
@ -163,7 +163,7 @@ char * typemaps instead:
*/ */
%define OUTPUT_TYPEMAP(TYPE, GOTYPE) %define OUTPUT_TYPEMAP(TYPE, GOTYPE)
%typemap(go) TYPE *OUTPUT, TYPE &OUTPUT %{[]GOTYPE%} %typemap(gotype) TYPE *OUTPUT, TYPE &OUTPUT %{[]GOTYPE%}
%typemap(in) TYPE *OUTPUT($*1_ltype temp) %typemap(in) TYPE *OUTPUT($*1_ltype temp)
{ {
@ -287,7 +287,7 @@ char * typemaps instead:
*/ */
%define INOUT_TYPEMAP(TYPE, GOTYPE) %define INOUT_TYPEMAP(TYPE, GOTYPE)
%typemap(go) TYPE *INOUT, TYPE &INOUT %{[]GOTYPE%} %typemap(gotype) TYPE *INOUT, TYPE &INOUT %{[]GOTYPE%}
%typemap(in) TYPE *INOUT { %typemap(in) TYPE *INOUT {
if ($input.len == 0) { if ($input.len == 0) {

View file

@ -751,7 +751,7 @@ private:
Wrapper *dummy = NewWrapper(); Wrapper *dummy = NewWrapper();
emit_attach_parmmaps(parms, dummy); emit_attach_parmmaps(parms, dummy);
Swig_typemap_attach_parms("default", parms, dummy); Swig_typemap_attach_parms("default", parms, dummy);
Swig_typemap_attach_parms("go", parms, dummy); Swig_typemap_attach_parms("gotype", parms, dummy);
int parm_count = emit_num_arguments(parms); int parm_count = emit_num_arguments(parms);
int required_count = emit_num_required(parms); int required_count = emit_num_required(parms);
@ -2473,7 +2473,7 @@ private:
emit_attach_parmmaps(parms, dummy); emit_attach_parmmaps(parms, dummy);
DelWrapper(dummy); DelWrapper(dummy);
Swig_typemap_attach_parms("go", parms, NULL); Swig_typemap_attach_parms("gotype", parms, NULL);
int parm_count = emit_num_arguments(parms); int parm_count = emit_num_arguments(parms);
String *func_name = NewString("NewDirector"); String *func_name = NewString("NewDirector");
@ -2900,7 +2900,7 @@ private:
emit_attach_parmmaps(parms, dummy); emit_attach_parmmaps(parms, dummy);
DelWrapper(dummy); DelWrapper(dummy);
Swig_typemap_attach_parms("go", parms, NULL); Swig_typemap_attach_parms("gotype", parms, NULL);
int parm_count = emit_num_arguments(parms); int parm_count = emit_num_arguments(parms);
SwigType *result = Getattr(n, "returntype"); SwigType *result = Getattr(n, "returntype");
@ -4151,14 +4151,14 @@ private:
if (n != NULL && Cmp(type, Getattr(n, "type")) == 0) { if (n != NULL && Cmp(type, Getattr(n, "type")) == 0) {
ret = NULL; ret = NULL;
if (Strcmp(Getattr(n, "nodeType"), "parm") == 0) { if (Strcmp(Getattr(n, "nodeType"), "parm") == 0) {
ret = Getattr(n, "tmap:go"); ret = Getattr(n, "tmap:gotype");
} }
if (ret == NULL) { if (ret == NULL) {
ret = Swig_typemap_lookup("go", n, "", NULL); ret = Swig_typemap_lookup("gotype", n, "", NULL);
} }
} else { } else {
Parm *p = NewParmWithoutFileLineInfo(type, "goType"); Parm *p = NewParmWithoutFileLineInfo(type, "goType");
ret = Swig_typemap_lookup("go", p, "", NULL); ret = Swig_typemap_lookup("gotype", p, "", NULL);
Delete(p); Delete(p);
} }
@ -4497,12 +4497,12 @@ private:
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
* hasGoTypemap * hasGoTypemap
* *
* Return whether a type has a "go" typemap entry. * Return whether a type has a "gotype" typemap entry.
* ---------------------------------------------------------------------- */ * ---------------------------------------------------------------------- */
bool hasGoTypemap(SwigType *type) { bool hasGoTypemap(SwigType *type) {
Parm *p = NewParmWithoutFileLineInfo(type, "test"); Parm *p = NewParmWithoutFileLineInfo(type, "test");
SwigType *tm = Swig_typemap_lookup("go", p, "", NULL); SwigType *tm = Swig_typemap_lookup("gotype", p, "", NULL);
Delete(p); Delete(p);
if (tm != NULL && Strstr(tm, "$gotypename") == NULL) { if (tm != NULL && Strstr(tm, "$gotypename") == NULL) {
Delete(tm); Delete(tm);