diff options
author | taw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1> | 2007-04-01 17:42:13 +0000 |
---|---|---|
committer | taw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1> | 2007-04-01 17:42:13 +0000 |
commit | 63affa283744195cd6bd3de6b9c45b2362b8b1b9 (patch) | |
tree | 07485f750f11a1d03db81b43b265fd596a376046 /src/main.c | |
parent | 3a6347591e01e019d25df3faf274152cb97edb1d (diff) |
(Slightly) More advanced detection of input file type
git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@21 bf6ca9ba-c028-0410-8290-897cf20841d1
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -175,6 +175,21 @@ int main(int argc, char *argv[]) { ctx = malloc(sizeof(ControlContext)); type = INPUT_NONE; + if ( qdrp_is_qdrprc(filename) ) { + printf("QDRP input file detected.\n"); + ctx->inputfiletype = INPUT_QDRP; + } else if ( mrc_is_mrcfile(filename) ) { + printf("MRC tomography file detected.\n"); + ctx->inputfiletype = INPUT_MRC; + } else if ( cache_is_cachefile(filename) ) { + printf("reflect.cache detected.\n"); + ctx->inputfiletype = INPUT_CACHE; + } else { + fprintf(stderr, "Unrecognised input file type\n"); + return 1; + } + + #if 0 if ( strcmp(filename, "qdrp.rc") == 0 ) { printf("QDRP input file detected.\n"); ctx->inputfiletype = INPUT_QDRP; @@ -188,6 +203,8 @@ int main(int argc, char *argv[]) { fprintf(stderr, "Unrecognised input file type\n"); return 1; } + #endif + ctx->filename = strdup(argv[1]); ctx->max_d = 0; |