- Timestamp:
- 09/12/08 20:17:52 (3 months ago)
- Location:
- v6/smop
- Files:
-
- 1 added
- 11 modified
-
CMakeLists.txt (modified) (1 diff)
-
include/smop_lowlevel.h (modified) (3 diffs)
-
include/smop_s1p.h (modified) (2 diffs)
-
src/smop.c (modified) (1 diff)
-
src/smop_internal.h (modified) (2 diffs)
-
src/smop_lowlevel.sm0p (modified) (1 diff)
-
src/smop_ri.c (added)
-
src/smop_s1p_io.c (modified) (4 diffs)
-
src/smop_s1p_root_namespace.c (modified) (1 diff)
-
test/16_labels.sm0p (modified) (1 diff)
-
test/17_sm0p.sm0p (modified) (1 diff)
-
test/23_mold.sm0p (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
v6/smop/CMakeLists.txt
r22187 r22230 111 111 src/smop_slime_frame.c 112 112 src/smop_slime_node.c 113 src/smop_ri.c 113 114 ) 114 115 -
v6/smop/include/smop_lowlevel.h
r22017 r22230 5 5 #include <smop.h> 6 6 #include <smop_slime.h> 7 #include <pthread.h> 7 8 8 9 /* The lowlevel SMOP API is an additional API that is not included by … … 21 22 extern void smop_lowlevel_destr(); 22 23 24 typedef struct SMOP_LOWLEVEL_INTERNAL { 25 int ref_cnt; 26 pthread_rwlock_t* rwlock; 27 } SMOP_LOWLEVEL_INTERNAL; 28 23 29 /* This function is the place from where every allocation should 24 30 * happen. … … 36 42 */ 37 43 extern SMOP__Object* smop_lowlevel_refcnt_inc(SMOP__Object* interpreter, SMOP__ResponderInterface* ri, SMOP__Object* value); 44 45 SMOP__Object* SMOP__RI__create( 46 SMOP__Object* (*MESSAGE) (SMOP__Object* interpreter, 47 SMOP__ResponderInterface* self, 48 SMOP__Object* identifier, 49 SMOP__Object* capture), 50 SMOP__Object* (*REFERENCE)(SMOP__Object* interpreter, 51 SMOP__ResponderInterface* self, 52 SMOP__Object* object), 53 SMOP__Object* (*RELEASE) (SMOP__Object* interpreter, 54 SMOP__ResponderInterface* self, 55 SMOP__Object* object), 56 char *id 57 ); 38 58 39 59 /* This functions decrements the reference count of a value, it should -
v6/smop/include/smop_s1p.h
r22183 r22230 6 6 extern SMOP__Object* SMOP__S1P__Array; 7 7 extern SMOP__Object* SMOP__S1P__Array_Iterator; 8 extern SMOP__Object* SMOP__S1P__IO;9 8 extern SMOP__Object* SMOP__S1P__Str; 10 9 extern SMOP__Object* SMOP__S1P__Hash; … … 42 41 SMOP__Object* SMOP__S1P__Scalar_FETCH(SMOP__Object* object); 43 42 SMOP__Object* SMOP__S1P__Scalar_STORE(SMOP__Object* object, SMOP__Object* new_value); 44 SMOP__Object* SMOP__S1P__IO_create( void);43 SMOP__Object* SMOP__S1P__IO_create(SMOP__Object* interpreter); 45 44 SMOP__Object* SMOP__S1P__Hash_create(void); 46 45 SMOP__Object* SMOP__S1P__Array_create(void); -
v6/smop/src/smop.c
r22017 r22230 37 37 NULL, NULL)); 38 38 39 SMOP_INTERNAL_DESTROY_SEQUENCE; 39 40 SMOP_RELEASE(SMOP__INTPTR__InterpreterInstance,SMOP__GlobalInterpreter); 40 SMOP_INTERNAL_DESTROY_SEQUENCE;41 41 SMOP_INTERNAL_SHUTDOWN_SEQUENCE; 42 42 } -
v6/smop/src/smop_internal.h
r22183 r22230 21 21 smop_native_int_init(); \ 22 22 smop_native_bool_init(); \ 23 smop_ri_init(); \ 23 24 smop_slime_frame_init(); \ 24 25 smop_slime_currentframe_init(); \ 25 26 smop_slime_node_init(); \ 26 smop_slime_capturize_init(); 27 smop_slime_capturize_init(); 27 28 #define SMOP_INTERNAL_SHUTDOWN_SEQUENCE \ 28 29 smop_slime_capturize_destr(); \ … … 35 36 smop_interpreter_destr(); \ 36 37 smop_lowlevel_destr(); \ 38 smop_ri_destr(); \ 37 39 smop_idconst_destr(); 38 40 -
v6/smop/src/smop_lowlevel.sm0p
r22017 r22230 79 79 #endif 80 80 81 typedef struct SMOP_LOWLEVEL_INTERNAL {82 int ref_cnt;83 pthread_rwlock_t* rwlock;84 } SMOP_LOWLEVEL_INTERNAL;85 81 86 82 -
v6/smop/src/smop_s1p_io.c
r22017 r22230 5 5 #include <smop_s1p.h> 6 6 7 SMOP__Object* SMOP__S1P__IO;7 static SMOP__Object* SMOP__S1P__IO; 8 8 9 9 typedef struct smop_s1p_io_struct { … … 11 11 } smop_s1p_io_struct; 12 12 13 SMOP__Object* SMOP__S1P__IO_create(void) { 13 SMOP__Object* SMOP__S1P__IO_create(SMOP__Object* interpreter) { 14 SMOP_REFERENCE(interpreter,SMOP__S1P__IO); 14 15 SMOP__Object* ret = smop_lowlevel_alloc(sizeof(smop_s1p_io_struct)); 15 16 ret->RI = (SMOP__ResponderInterface*)SMOP__S1P__IO; … … 46 47 } 47 48 48 SMOP_RELEASE(interpreter,obj); 49 } 49 SMOP_RELEASE(interpreter,obj); } 50 50 } else if (identifier == SMOP__ID__new) { 51 SMOP__S1P__IO_create( );51 SMOP__S1P__IO_create(interpreter); 52 52 } else if (identifier == SMOP__ID__DESTROYALL) { 53 SMOP_RELEASE(interpreter,SMOP__S1P__IO); 53 54 } else { 54 55 fprintf(stderr,"unkown method at S1P::IO\n"); … … 62 63 63 64 void smop_s1p_io_init() { 64 SMOP__S1P__IO = calloc(1,sizeof(SMOP__ResponderInterface));65 ((SMOP__ResponderInterface*)SMOP__S1P__IO)->MESSAGE = smop_s1p_io_message;66 ((SMOP__ResponderInterface*)SMOP__S1P__IO)->REFERENCE = smop_lowlevel_generic_reference;67 ((SMOP__ResponderInterface*)SMOP__S1P__IO)->RELEASE = smop_lowlevel_generic_release;68 ((SMOP__ResponderInterface*)SMOP__S1P__IO)->id = "Lowlevel io";65 SMOP__S1P__IO = SMOP__RI__create( 66 smop_s1p_io_message, 67 smop_lowlevel_generic_reference, 68 smop_lowlevel_generic_release, 69 "Lowlevel io"); 69 70 } 70 71 71 72 void smop_s1p_io_destr() { 72 free(SMOP__S1P__IO); 73 SMOP__ResponderInterface* ri = (SMOP__ResponderInterface*) SMOP__S1P__IO; 74 SMOP_RELEASE(SMOP__GlobalInterpreter,SMOP__S1P__IO); 73 75 } 74 76 -
v6/smop/src/smop_s1p_root_namespace.c
r22017 r22230 26 26 smop_s1p_root_namespace_insert(SMOP__GlobalInterpreter,"::Hash",SMOP__S1P__Hash_create()); 27 27 smop_s1p_root_namespace_insert(SMOP__GlobalInterpreter,"::Array",SMOP__S1P__Array_create()); 28 smop_s1p_root_namespace_insert(SMOP__GlobalInterpreter,"$*OUT",SMOP__S1P__IO_create( ));28 smop_s1p_root_namespace_insert(SMOP__GlobalInterpreter,"$*OUT",SMOP__S1P__IO_create(SMOP__GlobalInterpreter)); 29 29 //smop_s1p_root_namespace_insert(SMOP__GlobalInterpreter,"::Code",SMOP__S1P__Code_create(SMOP__NATIVE__bool_false)); 30 30 SMOP__Object* mold = SMOP__Mold_create(0,(SMOP__Object*[]) { NULL },1,(int[]) { 0 }); -
v6/smop/test/16_labels.sm0p
r21324 r22230 19 19 SMOP__Object* node = NULL; 20 20 21 SMOP__Object* io = SMOP__S1P__IO_create( );21 SMOP__Object* io = SMOP__S1P__IO_create(interpreter); 22 22 node = q:sm0p { 23 23 ; -
v6/smop/test/17_sm0p.sm0p
r21915 r22230 19 19 SMOP__Object* node = NULL; 20 20 21 SMOP__Object* io = SMOP__S1P__IO_create( );21 SMOP__Object* io = SMOP__S1P__IO_create(interpreter); 22 22 node = q:sm0p { 23 23 ; -
v6/smop/test/23_mold.sm0p
r21892 r22230 20 20 SMOP__Object* mold = SMOP__Mold_create(1, 21 21 (SMOP__Object*[]) { /* constants */ 22 SMOP__S1P__IO_create( ),22 SMOP__S1P__IO_create(interpreter), 23 23 SMOP__NATIVE__idconst_create("print"), 24 24 SMOP__S1P__Str_create("ok 2 - simple method call works\n"),
