diff options
author | Dave Beazley <dave-swig@dabeaz.com> | 2000-09-02 16:50:02 +0000 |
---|---|---|
committer | Dave Beazley <dave-swig@dabeaz.com> | 2000-09-02 16:50:02 +0000 |
commit | cf624fe14aec9cebcbceb7c5e694ac71ded693e0 (patch) | |
tree | cbfb1f6c6f76742367226536b990b61e263ce9d1 /Lib | |
parent | 74f12225d35455c4172e490d648326ea37b8f680 (diff) | |
download | swig-cf624fe14aec9cebcbceb7c5e694ac71ded693e0.tar.gz |
Updated for new type handling.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@803 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/python/ptrlang.i | 61 |
1 files changed, 22 insertions, 39 deletions
diff --git a/Lib/python/ptrlang.i b/Lib/python/ptrlang.i index fb2c9405e..5a92e10d7 100644 --- a/Lib/python/ptrlang.i +++ b/Lib/python/ptrlang.i @@ -7,37 +7,31 @@ // Python specific implementation. This file is included // by the file ../pointer.i + %{ #include <ctype.h> -/* Pointer library specific types */ - -static swig_type_info _swig_pointer_int_p[] = {{"_int_p",0},{"_int_p",0},{0}}; -static swig_type_info _swig_pointer_short_p[] = {{"_short_p",0},{"_short_p",0},{0}}; -static swig_type_info _swig_pointer_long_p[] = {{"_long_p",0},{"_long_p",0},{0}}; -static swig_type_info _swig_pointer_float_p[] = {{"_float_p",0},{"_float_p",0},{0}}; -static swig_type_info _swig_pointer_double_p[] = {{"_double_p",0},{"_double_p",0},{0}}; -static swig_type_info _swig_pointer_char_p[] = {{"_char_p",0},{"_char_p",0},{0}}; -static swig_type_info _swig_pointer_char_pp[] = {{"_char_pp",0},{"_char_pp",0},{0}}; - -static swig_type_info *_swig_pointer_types[] = { - _swig_pointer_int_p, - _swig_pointer_short_p, - _swig_pointer_long_p, - _swig_pointer_float_p, - _swig_pointer_double_p, - _swig_pointer_char_p, - _swig_pointer_char_pp, - 0 -}; - -#define SWIG_POINTER_int_p _swig_pointer_types[0] -#define SWIG_POINTER_short_p _swig_pointer_types[1] -#define SWIG_POINTER_long_p _swig_pointer_types[2] -#define SWIG_POINTER_float_p _swig_pointer_types[3] -#define SWIG_POINTER_double_p _swig_pointer_types[4] -#define SWIG_POINTER_char_p _swig_pointer_types[5] -#define SWIG_POINTER_char_pp _swig_pointer_types[6] +/* Types used by the library */ +static swig_type_info *SWIG_POINTER_int_p = 0; +static swig_type_info *SWIG_POINTER_short_p =0; +static swig_type_info *SWIG_POINTER_long_p = 0; +static swig_type_info *SWIG_POINTER_float_p = 0; +static swig_type_info *SWIG_POINTER_double_p = 0; +static swig_type_info *SWIG_POINTER_char_p = 0; +static swig_type_info *SWIG_POINTER_char_pp = 0; +%} + +%init %{ + SWIG_POINTER_int_p = SWIG_TypeQuery("int *"); + SWIG_POINTER_short_p = SWIG_TypeQuery("short *"); + SWIG_POINTER_long_p = SWIG_TypeQuery("long *"); + SWIG_POINTER_float_p = SWIG_TypeQuery("float *"); + SWIG_POINTER_double_p = SWIG_TypeQuery("double *"); + SWIG_POINTER_char_p = SWIG_TypeQuery("char *"); + SWIG_POINTER_char_pp = SWIG_TypeQuery("char **"); +%} + +%{ /*------------------------------------------------------------------ ptrcast(value,type) @@ -620,17 +614,6 @@ void ptrmap(char *type1, char *type2); // Normally this function is not needed, but it can be used to // circumvent SWIG's normal type-checking behavior or to work around // weird type-handling problems. - - -%init %{ - { - int i; - for (i = 0; _swig_pointer_types[i]; i++) { - _swig_pointer_types[i] = SWIG_TypeRegister(_swig_pointer_types[i]); - } - } - - %} |