Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
enabling gras_stub_generator to take more than one deployment file as an
authoralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 17 May 2006 12:17:27 +0000 (12:17 +0000)
committeralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 17 May 2006 12:17:27 +0000 (12:17 +0000)
argument.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2237 48e7efb5-ca39-0410-a469-dd3cf9ba447f

tools/gras/stub_generator.c

index b602aed..cf06ee1 100644 (file)
@@ -560,13 +560,13 @@ int main(int argc, char *argv[])
 {
   char *project_name = NULL;
   char *deployment_file = NULL;
-
+  int i;
+   
   surf_init(&argc, argv);
 
-  xbt_assert1((argc ==3),"Usage: %s project_name deployment_file\n",argv[0]);
+  xbt_assert1((argc >= 3),"Usage: %s project_name deployment_file [deployment_file...]\n",argv[0]);
 
   project_name = argv[1];
-  deployment_file = argv[2];
 
   process_function_set = xbt_dict_new();
   process_list = xbt_dynar_new(sizeof(s_process_t),s_process_free);
@@ -575,9 +575,13 @@ int main(int argc, char *argv[])
   STag_surfxml_process_fun = parse_process_init;
   ETag_surfxml_argument_fun = parse_argument;
   ETag_surfxml_process_fun = parse_process_finalize;
-  surf_parse_open(deployment_file);
-  if(surf_parse()) xbt_assert1(0,"Parse error in %s",deployment_file);
-  surf_parse_close();
+  for(i=2; i<argc; i++) {
+     deployment_file = argv[i];
+     surf_parse_open(deployment_file);
+     if(surf_parse()) xbt_assert1(0,"Parse error in %s",deployment_file);
+     surf_parse_close();
+  }
+
 
   warning = xbt_new(char,strlen(WARN)+strlen(deployment_file)+10);
   sprintf(warning,WARN,deployment_file);