X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9e3250f2231eb0fdff16629d7b344070d7c3bace..f0858849f7b5fb066a76711a2fa710c2942affbc:/src/bindings/ruby_bindings.h diff --git a/src/bindings/ruby_bindings.h b/src/bindings/ruby_bindings.h index e62264e41d..04b93c23c8 100644 --- a/src/bindings/ruby_bindings.h +++ b/src/bindings/ruby_bindings.h @@ -19,15 +19,12 @@ #include "msg/msg.h" #include "msg/datatypes.h" -//#include "msg/private.h" -//#include "msg/mailbox.h" #include "surf/surfxml_parse.h" #include "simix/simix.h" #include "simix/private.h" #include "xbt/sysdep.h" #include "xbt/log.h" #include "xbt/asserts.h" -//#include "rb_msg_host.h" /* Damn Ruby. They load their full config.h, which breaks since we also load ours. * So, we undef the offending defines @@ -40,8 +37,6 @@ #undef _GNU_SOURCE #include - - /* ********************* * * Context related stuff * * ********************* */ @@ -52,7 +47,7 @@ typedef struct s_smx_ctx_ruby { }s_smx_ctx_ruby_t,*smx_ctx_ruby_t; void SIMIX_ctx_ruby_factory_init(smx_context_factory_t *factory); - +void Init_simgrid_ruby(void); /* Load the bindings */ void initRuby(void); // Mandatory to call Ruby methods from C /* *********************************************** * @@ -66,12 +61,11 @@ VALUE rb_process_getID(VALUE ruby_process); VALUE rb_process_getBind(VALUE ruby_class); void rb_process_setBind(VALUE ruby_class,long bind); VALUE rb_process_isAlive(VALUE ruby_process); -void rb_process_kill(VALUE ruby_process); +void rb_process_kill_up(VALUE ruby_process); void rb_process_join( VALUE ruby_process ); void rb_process_unschedule( VALUE ruby_process ); void rb_process_schedule( VALUE ruby_process ); - /* ********************************************** * * Function for Native Process (Bound) Management * * * @@ -82,29 +76,53 @@ void rb_process_schedule( VALUE ruby_process ); //friend Method // Not belong to the Class but Called within !! m_process_t rb_process_to_native(VALUE ruby_process); - // Binding Process >> Friend Method -void rb_processBind(VALUE ruby_class,m_process_t process); - -// CreateProcess Method -void rb_processCreate(VALUE Class,VALUE rb_process,VALUE host); - -// ProcessSuspend -void rb_processSuspend(VALUE Class,VALUE ruby_process); - -// ProcessResume -void rb_processResume(VALUE Class,VALUE ruby_process); - -//ProcessIsSuspend return Boolean ( Qtrue / Qfalse ) -VALUE rb_processIsSuspend(VALUE Class,VALUE ruby_process); - -//Processkill -void rb_processKill(VALUE Class,VALUE ruby_process); - -//ProcessGetHost -VALUE rb_processGetHost(VALUE Class,VALUE ruby_process); - -//ProcessExit -void rb_processExit(VALUE Class,VALUE ruby_process); +void rb_process_bind(VALUE ruby_class,m_process_t process); +void rb_process_create(VALUE Class,VALUE rb_process,VALUE host); +void rb_process_suspend(VALUE Class,VALUE ruby_process); +void rb_process_resume(VALUE Class,VALUE ruby_process); +// Returns Boolean ( Qtrue / Qfalse ) +VALUE rb_process_isSuspended(VALUE Class,VALUE ruby_process); +void rb_process_kill_down(VALUE Class,VALUE ruby_process); +VALUE rb_process_getHost(VALUE Class,VALUE ruby_process); +void rb_process_exit(VALUE Class,VALUE ruby_process); + +/* Functions related to hosts */ +void rb_host_free(m_host_t ht); +VALUE rb_host_get_by_name(VALUE Class, VALUE name); +VALUE rb_host_name(VALUE Class,VALUE host); +VALUE rb_host_number(VALUE Class); +VALUE rb_host_speed(VALUE Class,VALUE host); +void rb_host_set_data(VALUE Class,VALUE host,VALUE data); +VALUE rb_host_get_data(VALUE Class,VALUE host); +VALUE rb_host_is_avail(VALUE Class,VALUE host); +VALUE rb_host_process(VALUE Class,VALUE process); + +/* Functions related to tasks */ +void rb_task_free(m_task_t tk); +// New Method >>> Data NULL +VALUE rb_task_new(VALUE Class, VALUE name,VALUE comp_size,VALUE comm_size); +void rb_task_set_data(VALUE Class,VALUE task,VALUE data); // Data as a String +VALUE rb_task_get_data(VALUE Class,VALUE task); +VALUE rb_task_comp(VALUE Class,VALUE task); // Get Computation Size +VALUE rb_task_name(VALUE Class,VALUE task); +VALUE rb_task_execute(VALUE Class,VALUE task); +void rb_task_send(VALUE Class,VALUE task,VALUE mailbox); +VALUE rb_task_receive(VALUE Class,VALUE mailbox);// Receive : return a task +void rb_task_receive2(VALUE Class,VALUE task,VALUE mailbox);// Receive Task 2 << Not Appreciated +VALUE rb_task_sender(VALUE Class,VALUE task); +VALUE rb_task_source(VALUE Class,VALUE task); +VALUE rb_task_listen(VALUE Class,VALUE task,VALUE alias); //Listen From Alias (=mailbox) +VALUE rb_task_listen_host(VALUE Class,VALUE task,VALUE alias,VALUE host); //Listen from Host +void rb_task_set_priority(VALUE Class,VALUE task,VALUE priority); // Set Priority +void rb_task_cancel(VALUE Class,VALUE task); // Cancel + +/* Upcalls for the application handler */ +void rb_application_handler_on_start_document(void); +void rb_application_handler_on_end_document(void); +void rb_application_handler_on_begin_process(void); +void rb_application_handler_on_process_arg(void); +void rb_application_handler_on_property(void); +void rb_application_handler_on_end_process(void); #endif /* RB_SG_BINDINGS */