1 /* Copyright (c) 2010. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #include "rb_SD_workstation.h"
9 static void SD_workstation_free(SD_workstation_t wrk)
14 static VALUE rb_SD_workstation_list(VALUE class)
18 nb = SD_workstation_get_number();
19 VALUE workstation_list = rb_ary_new2(nb);
23 wrk = Data_Wrap_Struct(class, 0, SD_workstation_free, SD_workstation_get_list()[i]);
24 rb_ary_push(workstation_list,wrk);
27 return workstation_list;
31 static VALUE rb_SD_workstation_number(VALUE class)
33 int nb = SD_workstation_get_number();
38 static VALUE rb_SD_workstation_name(VALUE class,VALUE workstation)
41 Data_Get_Struct(workstation, SD_workstation_t, wk);
42 return rb_str_new2(SD_workstation_get_name(wk));