-"\n"
-" gras_launch_application(argv[2]);\n"
-"\n"
-" /* Run the simulation */\n"
-" gras_main();\n"
-"\n"
-" /* cleanup the place */\n"
-" gras_clean();\n"
-" if (gras_log)\n"
-" free(gras_log);\n"
-" return 0;\n"
-"}\n";
-
-
-
-
-void generate_sim(char *project) {
- xbt_dict_cursor_t cursor=NULL;
- char *key = NULL;
- void *data = NULL;
- char *filename = NULL;
- FILE *OUT = NULL;
-
- /* Output file: <projet>_simulator.c */
- filename = xbt_new(char,strlen(project) + strlen(SIM_SOURCENAME));
- sprintf(filename,SIM_SOURCENAME,project);
-
- OUT=fopen(filename,"w");
-
- xbt_assert1(OUT, "Unable to open %s for writing",filename);
-
- fprintf(OUT, "%s\n",warning);
- fprintf(OUT, "%s", SIM_PREEMBULE);
-
- xbt_dict_foreach(process_function_set,cursor,key,data) {
- fprintf(OUT,"int %s(int argc,char *argv[]);\n",key);
- }
-
- fprintf(OUT,"\n");
-
- xbt_dict_foreach(process_function_set,cursor,key,data) {
- fprintf(OUT,"int launch_%s(int argc,char *argv[]);\n",key);
- }
-
- fprintf(OUT, "\n%s\n",warning);
-
- xbt_dict_foreach(process_function_set,cursor,key,data) {
- fprintf(OUT,SIM_LAUNCH_FUNC,key,key);
- }
- fprintf(OUT, "\n%s\n",warning);
-
- fprintf(OUT,"%s", "/* specific to Borland Compiler */\n"
- "#ifdef __BORLANDDC__\n"
- "#pragma argsused\n"
- "#endif\n\n");
-
- fprintf(OUT, "%s", "int main (int argc,char *argv[]) {\n"
- "\n"
- " /* Simulation setup */\n"
- " gras_global_init(&argc,argv);\n"
- " if (argc != 3) {\n"
- " fprintf(stderr, \"Usage: %s platform.xml deployment.xml [--log=...]\\n\",argv[0]);\n"
- " exit(1);\n"
- " }\n"
- "\n");
- fprintf(OUT,
- " gras_create_environment(argv[1]);\n"
- "\n"
- " /* Application deployment */\n"
- );
- xbt_dict_foreach(process_function_set,cursor,key,data) {
- fprintf(OUT," gras_function_register(\"%s\", launch_%s);\n",key,key);
- }
- fprintf(OUT, "%s", SIM_MAIN_POSTEMBULE);
- fclose(OUT);
- free(filename);
+ "\n"
+ " gras_launch_application(argv[2]);\n"
+ "\n"
+ " /* Run the simulation */\n"
+ " gras_main();\n"
+ "\n"
+ " /* cleanup the place */\n"
+ " gras_clean();\n"
+ " if (gras_log)\n" " free(gras_log);\n" " return 0;\n" "}\n";
+
+
+
+
+void generate_sim(char *project)
+{
+ xbt_dict_cursor_t cursor = NULL;
+ char *key = NULL;
+ void *data = NULL;
+ char *filename = NULL;
+ FILE *FICOUT = NULL;
+
+ /* Output file: <projet>_simulator.c */
+ filename = xbt_new(char, strlen(project) + strlen(SIM_SOURCENAME));
+ sprintf(filename, SIM_SOURCENAME, project);
+
+ FICOUT = fopen(filename, "w");
+
+ xbt_assert(FICOUT, "Unable to open %s for writing", filename);
+
+ fprintf(FICOUT, "%s\n", warning);
+ fprintf(FICOUT, "%s", SIM_PREEMBULE);
+
+ xbt_dict_foreach(process_function_set, cursor, key, data) {
+ fprintf(FICOUT, "int %s(int argc,char *argv[]);\n", key);
+ }
+
+ fprintf(FICOUT, "\n");
+
+ xbt_dict_foreach(process_function_set, cursor, key, data) {
+ fprintf(FICOUT, "int launch_%s(int argc,char *argv[]);\n", key);
+ }
+
+ fprintf(FICOUT, "\n%s\n", warning);
+
+ xbt_dict_foreach(process_function_set, cursor, key, data) {
+ fprintf(FICOUT, SIM_LAUNCH_FUNC, key, key);
+ }
+ fprintf(FICOUT, "\n%s\n", warning);
+
+ fprintf(FICOUT, "%s", "/* specific to Borland Compiler */\n"
+ "#ifdef __BORLANDDC__\n" "#pragma argsused\n" "#endif\n\n");
+
+ fprintf(FICOUT, "%s", "int main (int argc,char *argv[]) {\n"
+ "\n"
+ " /* Simulation setup */\n"
+ " gras_global_init(&argc,argv);\n"
+ " if (argc != 3) {\n"
+ " fprintf(stderr, \"Usage: %s platform.xml deployment.xml [--log=...]\\n\",argv[0]);\n"
+ " exit(1);\n" " }\n" "\n");
+ fprintf(FICOUT,
+ " gras_create_environment(argv[1]);\n"
+ "\n" " /* Application deployment */\n");
+ xbt_dict_foreach(process_function_set, cursor, key, data) {
+ fprintf(FICOUT, " gras_function_register(\"%s\", launch_%s);\n", key,
+ key);
+ }
+ fprintf(FICOUT, "%s", SIM_MAIN_POSTEMBULE);
+ fclose(FICOUT);
+ free(filename);