diff options
author | Thomas White <taw@physics.org> | 2018-12-18 15:22:49 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2018-12-18 15:38:13 +0100 |
commit | b78860efdda0d5963b75b84925840c947e48609e (patch) | |
tree | 457d3590a26529544d2b14db3b82c9bf55db49ca /libcrystfel | |
parent | 33d20aa3ea505e214fdcfc2c532b6bda28df7979 (diff) |
make_pixelmap: Use <input>.h5 as default output filename
Diffstat (limited to 'libcrystfel')
-rw-r--r-- | libcrystfel/src/utils.c | 13 | ||||
-rw-r--r-- | libcrystfel/src/utils.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/libcrystfel/src/utils.c b/libcrystfel/src/utils.c index 90d81a71..1b2ebad3 100644 --- a/libcrystfel/src/utils.c +++ b/libcrystfel/src/utils.c @@ -548,6 +548,19 @@ char *safe_basename(const char *in) } +void strip_extension(char *bfn) +{ + size_t r = strlen(bfn)-1; + while ( r > 0 ) { + if ( bfn[r] == '.') { + bfn[r] = '\0'; + return; + } + r--; + } +} + + /* Force the linker to bring in CBLAS to make GSL happy */ void utils_fudge_gslcblas() { diff --git a/libcrystfel/src/utils.h b/libcrystfel/src/utils.h index 2c756ad7..65ab9b00 100644 --- a/libcrystfel/src/utils.h +++ b/libcrystfel/src/utils.h @@ -218,6 +218,7 @@ extern pthread_mutex_t stderr_lock; extern char *check_prefix(char *prefix); extern char *safe_basename(const char *in); +extern void strip_extension(char *bfn); /* ------------------------------ Useful stuff ------------------------------ */ |