Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
More ruby cleanups: stop defining everything static, and prefix functions with rb_...
[simgrid.git] / src / bindings / ruby / rb_msg_host.c
index 68b888a..cae895f 100644 (file)
@@ -1,23 +1,19 @@
 /*
 /*
- * $Id$
- *
- * Copyright 2010 Martin Quinson, Mehdi Fekari           
- * All right reserved. 
+ * 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. 
  */
  *
  * 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 "rb_msg_host.h"
+#include "bindings/ruby_bindings.h"
 
 // Free Method
 
 // Free Method
-static void host_free(m_host_t ht) {
+void rb_host_free(m_host_t ht) {
   //Nothing to do !!?
 }
 
 // New Method : return a Host
   //Nothing to do !!?
 }
 
 // New Method : return a Host
-static VALUE host_get_by_name(VALUE class, VALUE name)
-{
+VALUE rb_host_get_by_name(VALUE class, VALUE name) {
   
   const char * h_name = RSTRING(name)->ptr;
   m_host_t host = MSG_get_host_by_name(h_name);
   
   const char * h_name = RSTRING(name)->ptr;
   m_host_t host = MSG_get_host_by_name(h_name);
@@ -29,8 +25,7 @@ static VALUE host_get_by_name(VALUE class, VALUE name)
 }
 
 //Get Name
 }
 
 //Get Name
-static VALUE host_name(VALUE class,VALUE host)
-{
+VALUE rb_host_name(VALUE class,VALUE host) {
   
   // Wrap Ruby Value to m_host_t struct
   m_host_t ht;
   
   // Wrap Ruby Value to m_host_t struct
   m_host_t ht;
@@ -40,16 +35,14 @@ static VALUE host_name(VALUE class,VALUE host)
 }
 
 // Get Number
 }
 
 // Get Number
-static VALUE host_number(VALUE class)
-{
+VALUE rb_host_number(VALUE class) {
   
   return INT2NUM(MSG_get_host_number());
   
 }
 
 // Host Speed ( Double )
   
   return INT2NUM(MSG_get_host_number());
   
 }
 
 // Host Speed ( Double )
-static VALUE host_speed(VALUE class,VALUE host)
-{
+VALUE rb_host_speed(VALUE class,VALUE host) {
   m_host_t ht ;
   Data_Get_Struct(host,m_host_t,ht);
   return MSG_get_host_speed(ht);
   m_host_t ht ;
   Data_Get_Struct(host,m_host_t,ht);
   return MSG_get_host_speed(ht);
@@ -57,26 +50,21 @@ static VALUE host_speed(VALUE class,VALUE host)
 }
 
 // Host Set Data
 }
 
 // Host Set Data
-static void host_set_data(VALUE class,VALUE host,VALUE data)
-{
+void rb_host_set_data(VALUE class,VALUE host,VALUE data) {
   //...
 }
 
 // Host Get Data
   //...
 }
 
 // Host Get Data
-static VALUE host_get_data(VALUE class,VALUE host)
-{
+VALUE rb_host_get_data(VALUE class,VALUE host) {
   //...
   return Qnil;
 }
 
 // Host is Avail
   //...
   return Qnil;
 }
 
 // Host is Avail
-static VALUE host_is_avail(VALUE class,VALUE host)
-{
+VALUE rb_host_is_avail(VALUE class,VALUE host) {
   m_host_t ht;
   Data_Get_Struct(host,m_host_t,ht);
   m_host_t ht;
   Data_Get_Struct(host,m_host_t,ht);
-  if (!ht)
-  {
+  if (!ht) {
     rb_raise(rb_eRuntimeError,"Host not Bound");
     return Qnil;
   }
     rb_raise(rb_eRuntimeError,"Host not Bound");
     return Qnil;
   }