diff --git a/.gitignore b/.gitignore index 248a728..487c453 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ voz1b1 jozov vozinit voztie +.mydepend diff --git a/mytools/Makefile b/mytools/Makefile index 8eb4fef..092bc67 100644 --- a/mytools/Makefile +++ b/mytools/Makefile @@ -13,6 +13,8 @@ all: $(PROGS) showZobov: showZobov.o loadZobov.o zobovConf.o +testZobov: testZobov.o loadZobov.o + depend: $(SOURCES) @echo "[DEPENDS] $^" @$(CC) $(CPPFLAGS) -M -MM $^ > .mydepends diff --git a/mytools/zobovConf.c b/mytools/zobovConf.c index 3019686..aee1f28 100644 --- a/mytools/zobovConf.c +++ b/mytools/zobovConf.c @@ -44,6 +44,7 @@ const char *zobovConf_info_help[] = { " -p, --move=STRING Move the center by (x,y,z) (default=`(0,0,0)')", " --galax Output is galax particles (default=off)", " -o, --output=STRING Output file (default=`voidDesc')", + " --interactive Go in interactive mode (default=off)", 0 }; @@ -112,6 +113,7 @@ void clear_given (struct zobovConf_info *args_info) args_info->move_given = 0 ; args_info->galax_given = 0 ; args_info->output_given = 0 ; + args_info->interactive_given = 0 ; } static @@ -139,6 +141,7 @@ void clear_args (struct zobovConf_info *args_info) args_info->galax_flag = 0; args_info->output_arg = gengetopt_strdup ("voidDesc"); args_info->output_orig = NULL; + args_info->interactive_flag = 0; } @@ -163,6 +166,7 @@ void init_args_info(struct zobovConf_info *args_info) args_info->move_help = zobovConf_info_help[13] ; args_info->galax_help = zobovConf_info_help[14] ; args_info->output_help = zobovConf_info_help[15] ; + args_info->interactive_help = zobovConf_info_help[16] ; } @@ -319,6 +323,8 @@ zobovConf_dump(FILE *outfile, struct zobovConf_info *args_info) write_into_file(outfile, "galax", 0, 0 ); if (args_info->output_given) write_into_file(outfile, "output", args_info->output_orig, 0); + if (args_info->interactive_given) + write_into_file(outfile, "interactive", 0, 0 ); i = EXIT_SUCCESS; @@ -640,6 +646,7 @@ zobovConf_internal (int argc, char * const *argv, struct zobovConf_info *args_in { "move", 1, NULL, 'p' }, { "galax", 0, NULL, 0 }, { "output", 1, NULL, 'o' }, + { "interactive", 0, NULL, 0 }, { NULL, 0, NULL, 0 } }; @@ -822,6 +829,18 @@ zobovConf_internal (int argc, char * const *argv, struct zobovConf_info *args_in additional_error)) goto failure; + } + /* Go in interactive mode. */ + else if (strcmp (long_options[option_index].name, "interactive") == 0) + { + + + if (update_arg((void *)&(args_info->interactive_flag), 0, &(args_info->interactive_given), + &(local_args_info.interactive_given), optarg, 0, 0, ARG_FLAG, + check_ambiguity, override, 1, 0, "interactive", '-', + additional_error)) + goto failure; + } break; diff --git a/mytools/zobovConf.h b/mytools/zobovConf.h index 82245be..fc9e7e9 100644 --- a/mytools/zobovConf.h +++ b/mytools/zobovConf.h @@ -72,6 +72,8 @@ struct zobovConf_info char * output_arg; /**< @brief Output file (default='voidDesc'). */ char * output_orig; /**< @brief Output file original value given at command line. */ const char *output_help; /**< @brief Output file help description. */ + int interactive_flag; /**< @brief Go in interactive mode (default=off). */ + const char *interactive_help; /**< @brief Go in interactive mode help description. */ unsigned int help_given ; /**< @brief Whether help was given. */ unsigned int version_given ; /**< @brief Whether version was given. */ @@ -89,6 +91,7 @@ struct zobovConf_info unsigned int move_given ; /**< @brief Whether move was given. */ unsigned int galax_given ; /**< @brief Whether galax was given. */ unsigned int output_given ; /**< @brief Whether output was given. */ + unsigned int interactive_given ; /**< @brief Whether interactive was given. */ } ;