Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Help compiling after last xml parsing/dtd modifications.
[simgrid.git] / examples / msg / masterslave / masterslave_bypass.c
index 3e475fc..15f458f 100644 (file)
@@ -8,7 +8,6 @@
 #include <stdio.h>
 #include "msg/msg.h"  /* Yeah! If you want to use msg, you need to include msg/msg.h */
 #include "surf/surfxml_parse.h" /* to override surf_parse and bypass the parser */
-#include "surf/surfxml.h"       /* to hijack surf_parse_lex */
 
 /* Create a log channel to have nice outputs. */
 #include "xbt/log.h"
@@ -23,10 +22,10 @@ static int surf_parse_bypass_platform(void)
   /* allocating memory for the buffer, I think 2kB should be enough */
   surfxml_bufferstack = xbt_new0(char, surfxml_bufferstack_size);
   
-  /* <platform_description> */
-  SURFXML_BUFFER_SET(platform_description_version,"2");
+  /* <platform> */
+  SURFXML_BUFFER_SET(platform_version,"2");
 
-  SURFXML_START_TAG(platform_description);
+  SURFXML_START_TAG(platform);
 
 /*   <host id="host A" power="100000000.00"/> */
   SURFXML_BUFFER_SET(host_id,"host A");
@@ -101,8 +100,8 @@ static int surf_parse_bypass_platform(void)
   SURFXML_END_TAG(link_c_ctn);
 
   SURFXML_END_TAG(route);
-/* </platform_description> */
-  SURFXML_END_TAG(platform_description);
+/* </platform> */
+  SURFXML_END_TAG(platform);
 
   free(surfxml_bufferstack);
   return 0;
@@ -115,10 +114,10 @@ static int surf_parse_bypass_application(void) {
   /* allocating memory to the buffer, I think 2MB should be enough */
   surfxml_bufferstack = xbt_new0(char, surfxml_bufferstack_size);
   
-  /* <platform_description> */
-  SURFXML_BUFFER_SET(platform_description_version,"2");
+  /* <platform> */
+  SURFXML_BUFFER_SET(platform_version,"2");
 
-  SURFXML_START_TAG(platform_description);
+  SURFXML_START_TAG(platform);
    
 /*   <process host="host A" function="master"> */
   SURFXML_BUFFER_SET(process_host, "host A");
@@ -158,8 +157,8 @@ static int surf_parse_bypass_application(void) {
   SURFXML_START_TAG(process);
   SURFXML_END_TAG(process);
 
-/* </platform_description> */
-  SURFXML_END_TAG(platform_description);
+/* </platform> */
+  SURFXML_END_TAG(platform);
 
   free(surfxml_bufferstack);
   return 0;
@@ -197,7 +196,7 @@ int master(int argc, char *argv[])
   {                  /*  Task creation */
     char sprintf_buffer[64];
 
-    todo = calloc(number_of_tasks, sizeof(m_task_t));
+    todo = xbt_new0(m_task_t,number_of_tasks);
 
     for (i = 0; i < number_of_tasks; i++) {
       sprintf(sprintf_buffer, "Task_%d", i);
@@ -207,7 +206,7 @@ int master(int argc, char *argv[])
 
   {                  /* Process organisation */
     slaves_count = argc - 4;
-    slaves = calloc(slaves_count, sizeof(m_host_t));
+    slaves = xbt_new0(m_host_t,slaves_count);
     
     for (i = 4; i < argc; i++) {
       slaves[i-4] = MSG_get_host_by_name(argv[i]);