diff options
| author | redbrain <redbrain@crules.org> | 2010-07-23 04:03:37 +0100 |
|---|---|---|
| committer | redbrain <redbrain@crules.org> | 2010-07-23 04:03:37 +0100 |
| commit | 58ee7be4dd051fed3077cc18f210af53ce8348cc (patch) | |
| tree | 65181e8c1503ff8e5d1a4f7e350e71983c4daf2c /libgpython/include/gpython | |
| parent | dfe504177c3c2c42c6a2144957bbcee3cf77bbca (diff) | |
| download | gcc-58ee7be4dd051fed3077cc18f210af53ce8348cc.tar.gz | |
adding in member function support for builtin modules
Diffstat (limited to 'libgpython/include/gpython')
| -rw-r--r-- | libgpython/include/gpython/gpython.h | 3 | ||||
| -rw-r--r-- | libgpython/include/gpython/objects.h | 13 |
2 files changed, 16 insertions, 0 deletions
diff --git a/libgpython/include/gpython/gpython.h b/libgpython/include/gpython/gpython.h index b53290b6077..961ae1a801e 100644 --- a/libgpython/include/gpython/gpython.h +++ b/libgpython/include/gpython/gpython.h @@ -17,6 +17,9 @@ along with GCC; see the file COPYING3. If not see #ifndef __GCC_GPYTHON_H__ #define __GCC_GPYTHON_H__ +#undef DEBUG +#define DEBUG 1 + #if __STDC_VERSION__ < 199901L # if __GNUC__ >= 2 # define __func__ __FUNCTION__ diff --git a/libgpython/include/gpython/objects.h b/libgpython/include/gpython/objects.h index 0b81726b3bd..59de6cb80be 100644 --- a/libgpython/include/gpython/objects.h +++ b/libgpython/include/gpython/objects.h @@ -40,9 +40,21 @@ typedef struct gpy_rr_object_state_t { struct gpy_type_obj_def_t * definition; } gpy_object_state_t ; +#define METH_NOARGS (1 << 0) /* 0x01 */ +#define METH_VARARGS (1 << 1) /* 0x02 */ +#define METH_KEYWORDS (1 << 2) /* 0x03 */ + typedef gpy_object_state_t * (*binary_op)( gpy_object_state_t *, gpy_object_state_t * ); +typedef gpy_object_state_t * (*gpy_builtin_callback__)( gpy_object_state_t * ); + +typedef struct gpy_builtin_method_def_t { + char * identifer; + gpy_builtin_callback__ callback; + unsigned char args_type; +} gpy_method_def_t ; + typedef struct gpy_number_prot_t { bool init; @@ -71,6 +83,7 @@ typedef struct gpy_type_obj_def_t { void (*destroy_hook)( void * ); void (*print_hook)( void * , FILE * , bool ); struct gpy_number_prot_t * binary_protocol; + struct gpy_builtin_method_def_t * methods; } gpy_type_obj_def_t ; |
