1 #include "rb_msg_host.h"
4 static void host_free(m_host_t ht) {
9 // New Method : return a Host
10 static VALUE host_get_by_name(VALUE class, VALUE name)
13 m_host_t host = MSG_get_host_by_name(RSTRING(name)->ptr);
16 rb_raise(rb_eRuntimeError,"MSG_get_host_by_name() failled");
18 return Data_Wrap_Struct(class, 0, host_free, host);
25 static VALUE host_name(VALUE class,VALUE host)
28 // Wrap Ruby Value to m_host_t struct
31 Data_Get_Struct(host, m_host_t, ht);
32 return rb_str_new2(MSG_host_get_name(ht));
37 static VALUE host_number(VALUE class)
40 return MSG_get_host_number();
44 // Host Speed ( Double )
45 static VALUE host_speed(VALUE class,VALUE host)
48 Data_Get_Struct(host,m_host_t,ht);
49 return MSG_get_host_speed(ht);
55 static void host_set_data(VALUE class,VALUE host,VALUE data)
61 static VALUE host_get_data(VALUE class,VALUE host)
71 static VALUE host_is_avail(VALUE class,VALUE host)
75 Data_Get_Struct(host,m_host_t,ht);
78 rb_raise(rb_eRuntimeError,"Host not Bound");
82 if(MSG_host_is_avail(ht))