X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1f494d5b035cbdb6e62f6d2575f8d55282ccac8e..307483ac1553316bf842eddd87031a3d6da30c2b:/src/bindings/lua/lua_stub_generator.c?ds=inline diff --git a/src/bindings/lua/lua_stub_generator.c b/src/bindings/lua/lua_stub_generator.c index 2508247078..87e2c8ce2a 100644 --- a/src/bindings/lua/lua_stub_generator.c +++ b/src/bindings/lua/lua_stub_generator.c @@ -6,21 +6,7 @@ /* 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 "lua_stub_generator.h" - -#include -#include "xbt/sysdep.h" -#include "xbt/function_types.h" -#include "xbt/log.h" -#include "surf/surfxml_parse.h" -#include "surf/surf.h" -#include "portable.h" /* Needed for the time of the SIMIX convertion */ -#include - -#include -#include -#include - +#include "simgrid_lua.h" #define WARN "/***********\n * DO NOT EDIT! THIS FILE HAS BEEN AUTOMATICALLY GENERATED FROM %s BY gras_stub_generator\n ***********/\n" #define SIM_SOURCENAME "_%s_simulator.c" @@ -38,21 +24,19 @@ #define MAKEFILE_FILENAME_REMOTE "%s.Makefile.remote" #define DEPLOYMENT "%s.deploy.sh" -char *warning = NULL; - /**********************************************/ /**** Generate the file for the simulator *****/ /**********************************************/ const char *SIM_PREEMBULE = - "/* specific to Borland Compiler */\n" - "#ifdef __BORLANDC__\n" - "#pragma hdrstop\n" - "#endif\n\n" - "#include \n" - "#include \n" - "#include \"msg/msg.h\"\n" - "#include \n" "\n" "char *gras_log=NULL;\n"; + "/* specific to Borland Compiler */\n" + "#ifdef __BORLANDC__\n" + "#pragma hdrstop\n" + "#endif\n\n" + "#include \n" + "#include \n" + "#include \"msg/msg.h\"\n" + "#include \n" "\n" "char *gras_log=NULL;\n"; #define SIM_LAUNCH_FUNC \ @@ -75,15 +59,15 @@ const char *SIM_PREEMBULE = "}\n" const char *SIM_MAIN_POSTEMBULE = "\n" - "\n" - " gras_load_environment_script(argv[1]);\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"; + "\n" + " gras_load_environment_script(argv[1]);\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"; /*************************************** @@ -104,7 +88,7 @@ void generate_sim(const char *project) OUT = fopen(filename, "w"); - xbt_assert1(OUT, "Unable to open %s for writing", filename); + xbt_assert(OUT, "Unable to open %s for writing", filename); fprintf(OUT, "%s", SIM_PREEMBULE); @@ -133,10 +117,10 @@ void generate_sim(const char *project) " if (argc != 2) {\n" " fprintf(stderr, \"Usage: lua platform_script.lua [--log=...]\\n\");\n" " exit(1);\n" " }\n" "\n"); - fprintf(OUT, - "\n" " /* Application deployment */\n"); + fprintf(OUT, "\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, " gras_function_register(\"%s\", launch_%s);\n", key, + key); } fprintf(OUT, "%s", SIM_MAIN_POSTEMBULE); fclose(OUT); @@ -157,12 +141,13 @@ void generate_rl(const char *project) xbt_dict_foreach(process_function_set, cursor, key, data) { filename = - xbt_new(char, strlen(project) + strlen(RL_SOURCENAME) + strlen(key)); + xbt_new(char, + strlen(project) + strlen(RL_SOURCENAME) + strlen(key)); sprintf(filename, RL_SOURCENAME, project, key); OUT = fopen(filename, "w"); - xbt_assert1(OUT, "Unable to open %s for writing", filename); + xbt_assert(OUT, "Unable to open %s for writing", filename); fprintf(OUT, "/* specific to Borland Compiler */\n" "#ifdef __BORLANDC__\n" @@ -203,7 +188,7 @@ void generate_makefile_am(const char *project) sprintf(filename, MAKEFILE_FILENAME_AM, project); OUT = fopen(filename, "w"); - xbt_assert1(OUT, "Unable to open %s for writing", filename); + xbt_assert(OUT, "Unable to open %s for writing", filename); fprintf(OUT, "# AUTOMAKE variable definition\n"); fprintf(OUT, "INCLUDES= @CFLAGS_SimGrid@\n\n"); @@ -264,11 +249,12 @@ void generate_makefile_local(const char *project) char *filename = NULL; FILE *OUT = NULL; - filename = xbt_new(char, strlen(project) + strlen(MAKEFILE_FILENAME_LOCAL)); + filename = + xbt_new(char, strlen(project) + strlen(MAKEFILE_FILENAME_LOCAL)); sprintf(filename, MAKEFILE_FILENAME_LOCAL, project); OUT = fopen(filename, "w"); - xbt_assert1(OUT, "Unable to open %s for writing", filename); + xbt_assert(OUT, "Unable to open %s for writing", filename); free(filename); fprintf(OUT,