X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/afea2e3d16f6311659578efe73fee155a0afb53a..e23b481e91e2c7020856a88e25cb6f4fe1358e1f:/src/bindings/ruby/rb_msg_process.c diff --git a/src/bindings/ruby/rb_msg_process.c b/src/bindings/ruby/rb_msg_process.c index b4fa038599..0820151f34 100644 --- a/src/bindings/ruby/rb_msg_process.c +++ b/src/bindings/ruby/rb_msg_process.c @@ -1,10 +1,8 @@ -/* - * Copyright 2010, The SimGrid Team. All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - *(GNU LGPL) which comes with this package. - */ +/* Copyright (c) 2010. The SimGrid Team. + * All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ #include "msg/private.h" /* s_simdata_process_t */ #include "bindings/ruby_bindings.h" @@ -30,7 +28,6 @@ VALUE rb_process_getBind(VALUE ruby_process) { return rb_funcall(ruby_process,rb_intern("getBind"),0); } - // Set Bind void rb_process_setBind(VALUE ruby_process,long bind) { VALUE r_bind = LONG2FIX(bind); @@ -52,6 +49,7 @@ void rb_process_join( VALUE ruby_process ) { rb_funcall(ruby_process,rb_intern("join"),0); } +// FIXME: all this calls must be manually inlined I guess // unschedule Process void rb_process_unschedule( VALUE ruby_process ) { rb_funcall(ruby_process,rb_intern("unschedule"),0); @@ -63,12 +61,10 @@ void rb_process_schedule( VALUE ruby_process ) { } /*************************************************** - Function for Native Process ( Bound ) Management Methods Belong to MSG Module - - ****************************************************/ +****************************************************/ // Process To Native m_process_t rb_process_to_native(VALUE ruby_process) { @@ -122,7 +118,6 @@ VALUE rb_process_isSuspended(VALUE class,VALUE ruby_process) { rb_raise (rb_eRuntimeError,"Process not Bound...while testing if suspended"); return Qfalse; } - if(MSG_process_is_suspended(process)) return Qtrue; return Qfalse; @@ -144,20 +139,24 @@ void rb_process_kill_down(VALUE class,VALUE ruby_process) { VALUE rb_process_getHost(VALUE class,VALUE ruby_process) { m_process_t process = rb_process_to_native(ruby_process); m_host_t host; + if (!process) { rb_raise(rb_eRuntimeError,"Process Not Bound...while getting Host"); return Qnil; // NULL } - + host = MSG_process_get_host(process); - + + return Data_Wrap_Struct(class, 0, rb_host_free, host); + /*if(host->data) printf("Ok\n"); + if(!host->data) { rb_raise (rb_eRuntimeError,"MSG_process_get_host() failed"); return Qnil; } - - return Data_Wrap_Struct(class, 0, rb_host_free, host); + printf("Houuuuuuuuuuuuuuna3!!\n"); + return Data_Wrap_Struct(class, 0, rb_host_free, host);*/ } void rb_process_exit(VALUE class,VALUE ruby_process) {