/* main.c *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% * * Part of: SExtractor * * Author: E.BERTIN (IAP) * * Contents: Command-line parsing. * * Last modify: 29/05/2009 * *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include "define.h" #include "globals.h" #include "prefs.h" #include "pattern.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" \ "> to dump a full list of measurement parameters: " EXECUTABLE " -dp \n" extern const char notokstr[]; extern keystruct objkey[]; /********************************** main ************************************/ int main(int argc, char *argv[]) { double tdiff, lines, dets; int a, narg, nim, opt, opt2; char **argkey, **argval, *str; setlinebuf(stdout); 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; a0.0? prefs.time_diff : 1.0; lines = (double)thefield1.height/tdiff; dets = (double)thecat.ntotal/tdiff; NPRINTF(OUTPUT, "> All done (in %.0f s: %.1f line%s/s , %.1f detection%s/s)\n", prefs.time_diff, lines, lines>1.0? "s":"", dets, dets>1.0? "s":""); return EXIT_SUCCESS; }