X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/fe1f35a08a06923fe38c33f3299ac89e56f50998..6760cb07d6b57be16928d95339d71e57c4e24f36:/src/bindings/ruby/rb_msg_host.c diff --git a/src/bindings/ruby/rb_msg_host.c b/src/bindings/ruby/rb_msg_host.c index 5320265791..53b5d8d7e2 100644 --- a/src/bindings/ruby/rb_msg_host.c +++ b/src/bindings/ruby/rb_msg_host.c @@ -1,6 +1,7 @@ /* Host-related bindings to ruby */ -/* Copyright 2010. The SimGrid Team. All right reserved. */ +/* 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. */ @@ -76,6 +77,22 @@ VALUE rb_host_process(VALUE class,VALUE ruby_process) host = MSG_process_get_host(process); return Data_Wrap_Struct(class, 0, rb_host_free, host); - - -} \ No newline at end of file + +} + +// get all hosts +VALUE rb_host_get_all_hosts(VALUE class) +{ + int nb,index; + m_host_t *hosts; + VALUE rb_hosts; + nb = MSG_get_host_number(); + hosts = MSG_get_host_table(); + rb_hosts = rb_ary_new2(nb); + + for(index=0 ; index