From b86edb609f916af353666b6783ca398e39d1cdf1 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 12 Oct 2009 18:07:01 +0200 Subject: Initial import of template_index --- src/main.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 src/main.c (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c new file mode 100644 index 00000000..ffb269e4 --- /dev/null +++ b/src/main.c @@ -0,0 +1,69 @@ +/* + * main.c + * + * "Main" + * + * (c) 2006-2009 Thomas White + * + * template_index - Indexing diffraction patterns by template matching + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include + + +static void main_show_help(const char *s) +{ + printf("Syntax: %s [...]\n\n", s); + printf("Index diffraction patterns\n\n"); + printf(" -h Display this help message\n"); +} + + +int main(int argc, char *argv[]) +{ + int c; + char **in_files; + size_t nin; + size_t i; + + while ((c = getopt(argc, argv, "h")) != -1) { + + switch ( c ) { + + case 'h' : { + main_show_help(argv[0]); + return 0; + } + + } + + } + + if ( optind < argc ) { + nin = argc-optind; + in_files = malloc(nin*sizeof(char *)); + for ( i=0; i