/* main.c *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% * * Part of: SExtractor * * Author: E.BERTIN (IAP) * * Contents: Command-line parsing. * * Last modify: 07/07/2006 * *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "define.h" #include "globals.h" #include "prefs.h" #define SYNTAX \ EXECUTABLE " [][-c ][- ]\n" \ "> to dump a default configuration file: " EXECUTABLE " -d \n" \ "> to dump a default extended configuration file: " EXECUTABLE " -dd \n" extern const char notokstr[]; /********************************** main ************************************/ int main(int argc, char *argv[]) { int a, narg, nim, opt, opt2; char **argkey, **argval, *str; if (argc<2) { fprintf(OUTPUT, "\n %s version %s (%s)\n", BANNER,MYVERSION,DATE); fprintf(OUTPUT, "\nby %s\n", COPYRIGHT); fprintf(OUTPUT, "visit %s\n", WEBSITE); error(EXIT_SUCCESS, "SYNTAX: ", SYNTAX); } QMALLOC(argkey, char *, argc); QMALLOC(argval, char *, argc); /*default parameters */ prefs.command_line = argv; prefs.ncommand_line = argc; prefs.pipe_flag = 0; prefs.nimage_name = 1; prefs.image_name[0] = "image"; strcpy(prefs.prefs_name, "default.sex"); narg = nim = 0; for (a=1; a All done (in %.0f s)\n", prefs.time_diff); return EXIT_SUCCESS; }