X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/448ad19d8c3c74cd936e01c659256f3d3fc19308..5d6e2b005da294874b8cf58e7766c9d8138b7aaf:/src/surf/surf_config.c
diff --git a/src/surf/surf_config.c b/src/surf/surf_config.c
index 72ec71f5af..28f00ec597 100644
--- a/src/surf/surf_config.c
+++ b/src/surf/surf_config.c
@@ -7,81 +7,80 @@
/* surf_config: configuration infrastructure for the simulation world */
#include "xbt/config.h"
+#include "xbt/log.h"
#include "xbt/str.h"
#include "surf/surf_private.h"
-#include "surf/surf_routing.h" /* COORD_HOST_LEVEL and COORD_ASR_LEVEL */
-#include "simix/context.h"
+#include "surf/surf_routing.h" /* COORD_HOST_LEVEL and COORD_ASR_LEVEL */
+#include "simgrid/simix.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_config, surf,
"About the configuration of surf (and the rest of the simulation)");
xbt_cfg_t _surf_cfg_set = NULL;
-static void LOG_help(void)
-{
- printf("Description of the logging output:\n");
- printf("\tIn your command line use option: --log=CATEGORY_NAME.thres:PRIORITY_LEVEL\n");
- printf("\t\tCATEGORY_NAME: defined in code with function 'XBT_LOG_NEW_CATEGORY'\n");
- printf("\t\tPRIORITY_LEVEL: the level to print (trace,debug,verbose,info,warning,error,critical)\n");
- printf("\n");
-}
-
/* Parse the command line, looking for options */
static void surf_config_cmd_line(int *argc, char **argv)
{
+ int shall_exit = 0;
int i, j;
char *opt;
- for (i = 1; i < *argc; i++) {
- int remove_it = 0;
+ for (j = i = 1; i < *argc; i++) {
if (!strncmp(argv[i], "--cfg=", strlen("--cfg="))) {
opt = strchr(argv[i], '=');
opt++;
xbt_cfg_set_parse(_surf_cfg_set, opt);
XBT_DEBUG("Did apply '%s' as config setting", opt);
- remove_it = 1;
- } else if (!strncmp(argv[i], "--cfg-help", strlen("--cfg-help") + 1) ||
- !strncmp(argv[i], "--help", strlen("--help") + 1)) {
+ } else if (!strcmp(argv[i], "--cfg-help") || !strcmp(argv[i], "--help")) {
printf
("Description of the configuration accepted by this simulator:\n");
xbt_cfg_help(_surf_cfg_set);
- printf("\nYou can also use --help-models to see the details of all models known by this simulator.\n");
+ printf(
+"\n"
+"Each of these configurations can be used by adding\n"
+" --cfg=