summaryrefslogtreecommitdiff
path: root/libgpython/include/gpython
diff options
context:
space:
mode:
Diffstat (limited to 'libgpython/include/gpython')
-rw-r--r--libgpython/include/gpython/objects.h14
-rw-r--r--libgpython/include/gpython/vectors.h39
2 files changed, 22 insertions, 31 deletions
diff --git a/libgpython/include/gpython/objects.h b/libgpython/include/gpython/objects.h
index a51547fad15..90320740154 100644
--- a/libgpython/include/gpython/objects.h
+++ b/libgpython/include/gpython/objects.h
@@ -29,7 +29,8 @@ enum GPY_LIT_T {
enum GPY_OBJECT_T {
TYPE_OBJECT_STATE,
TYPE_OBJECT_LIT,
- TYPE_NULL
+ TYPE_CALLABLE,
+ TYPE_NULL,
};
typedef struct gpy_rr_literal_t {
@@ -58,6 +59,7 @@ typedef struct gpy_object_t {
enum GPY_OBJECT_T T;
union{
gpy_object_state_t * object_state;
+ struct gpy_callable__t * call;
gpy_literal_t * literal;
} o ;
} gpy_object_t ;
@@ -118,16 +120,6 @@ typedef struct gpy_typedef_t {
struct gpy_builtin_method_def_t * methods;
} gpy_typedef_t ;
-#define Gpy_Object_State_Init( x ) \
- x = gpy_malloc( sizeof(struct gpy_rr_object_state_t) ); \
- debug("object created at <%p>!\n", (void*)x ); \
- x->obj_t_ident = NULL; x->ref_count = 0; \
- x->self = NULL; x->definition = NULL;
-
-#define Gpy_Object_Init_Ctx( x,y ) \
- Gpy_Object_State_Init( x ); \
- gpy_vec_push (((gpy_context_t*)(y->vector[y->length-1]))->symbols, x);
-
#define NULL_OBJ_STATE (gpy_object_state_t *) NULL
#define NULL_OBJECT (gpy_object_t *) NULL
diff --git a/libgpython/include/gpython/vectors.h b/libgpython/include/gpython/vectors.h
index ec1a1201b6d..a275aa13402 100644
--- a/libgpython/include/gpython/vectors.h
+++ b/libgpython/include/gpython/vectors.h
@@ -37,39 +37,38 @@ typedef struct gpy_hash_table_t {
gpy_hash_entry_t * array;
} gpy_hash_tab_t ;
-typedef struct gpy_rr_context_t {
- gpy_vector_t * symbols;
- /* ... maybe more things later date! */
-} gpy_context_t ;
-typedef gpy_context_t * gpy_ctx_t;
-
#define Gpy_Vec_Head( V,T ) \
(T)(V->vector[V->length-1])
-#define Gpy_Namespace_Head \
- Gpy_Vec_Head(gpy_namespace_vec,gpy_ctx_t)
+extern gpy_hashval_t gpy_dd_hash_string (const char *);
+
+extern gpy_hash_entry_t * gpy_dd_hash_lookup_table (gpy_hash_tab_t *, gpy_hashval_t);
+
+extern void ** gpy_dd_hash_insert (const gpy_hashval_t , void * const ,
+ gpy_hash_tab_t * const);
+
+extern void gpy_dd_hash_grow_table (gpy_hash_tab_t *);
-extern gpy_hashval_t gpy_dd_hash_string( const char * );
+extern void gpy_dd_hash_init_table (gpy_hash_tab_t **);
-extern gpy_hash_entry_t * gpy_dd_hash_lookup_table( gpy_hash_tab_t *, gpy_hashval_t );
+extern void gpy_vec_init (gpy_vector_t * const);
-extern void ** gpy_dd_hash_insert( const gpy_hashval_t , void * const ,
- gpy_hash_tab_t * const );
+extern void gpy_vec_push (gpy_vector_t * const, void * const);
-extern void gpy_dd_hash_grow_table( gpy_hash_tab_t * );
+extern void * gpy_vec_pop (gpy_vector_t * const);
-extern void gpy_dd_hash_init_table( gpy_hash_tab_t ** );
+extern void gpy_vec_free (gpy_vector_t *);
-extern void gpy_vec_init( gpy_vector_t * const );
+extern void gpy_vec_frees (gpy_vector_t *, ...);
-extern void gpy_vec_push( gpy_vector_t * const, void * const );
+extern void gpy_obj_integer_mod_init (gpy_vector_t * const);
-extern void * gpy_vec_pop( gpy_vector_t * const );
+extern gpy_hash_entry_t * gpy_rr_lookup_decl (gpy_hashval_t, gpy_vector_t *);
-extern void gpy_vec_free( gpy_vector_t * );
+extern gpy_vector_t * gpy_primitives;
-extern void gpy_vec_frees( gpy_vector_t *, ... );
+extern gpy_vector_t * gpy_namespace_vec;
-extern void gpy_obj_integer_mod_init( gpy_vector_t * const );
+extern gpy_vector_t * gpy_call_stack;
#endif //__GCC_VECTORS_H__