Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7083 48e7efb5...
[simgrid.git] / src / bindings / ruby / rb_application_handler.c
index 8404a25..11b5ce3 100644 (file)
@@ -2,6 +2,8 @@
 #include "surf/surfxml_parse.h"
 #include <stdio.h>
 
+// #define DEBUG 
+
 static void  r_init()
 {
   
@@ -14,11 +16,14 @@ static void  r_init()
 static void  application_handler_on_start_document(void)
 {
   
+   
    r_init();
    //current One
    current = rb_funcall3(rb_const_get(rb_cObject, rb_intern("ApplicationHandler")),  rb_intern("new"), 0, 0);
    rb_funcall(current,rb_intern("onStartDocument"),0);
-  
+ #ifdef DEBUG
+   printf ("application_handler_on_start_document ...Done\n" );
+ #endif
   
 }
 
@@ -32,28 +37,23 @@ static void  application_handler_on_end_document(void)
 
 static void application_handler_on_begin_process(void) 
 {
-  
   //r_init();
-  
   VALUE hostName = rb_str_new2(A_surfxml_process_host);
   VALUE function = rb_str_new2(A_surfxml_process_function);
-  
+#ifdef DEBUG
+   printf ("On_Begin_Process: %s : %s \n",RSTRING(hostName)->ptr,RSTRING(function)->ptr);
+#endif 
    rb_funcall(current,rb_intern("onBeginProcess"),2,hostName,function); 
-  
-  
 }
 
 static void  application_handler_on_process_arg(void)
 {
-
   //r_init();
-  
    VALUE arg = rb_str_new2(A_surfxml_argument_value);
-  
-   rb_funcall(current,rb_intern("onProcessArg"),1,arg);
-  
-  
+#ifdef DEBUG
+   printf ("On_Process_Args >> Sufxml argument value : %s\n",RSTRING(arg)->ptr);
+#endif
+   rb_funcall(current,rb_intern("onProcessArg"),1,arg); 
 }
 
 static void  application_handler_on_property(void)