aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2013-11-26 05:14:57 -0800
committerThomas White <taw@physics.org>2014-05-08 17:52:02 +0200
commit1bc44dd21dc49a3920431cfee4495a28a45df622 (patch)
tree951831597e5a1503f4e83eaf4a363bac41528056
parent2400441598cd7876949f6b1ed52c14b6e469368c (diff)
Strip out the "prepare_filename" rubbish
-rw-r--r--libcrystfel/src/dirax.c2
-rw-r--r--libcrystfel/src/dirax.h3
-rw-r--r--libcrystfel/src/grainspotter.c1
-rw-r--r--libcrystfel/src/grainspotter.h1
-rw-r--r--libcrystfel/src/index.c14
-rw-r--r--libcrystfel/src/index.h1
-rw-r--r--libcrystfel/src/mosflm.c4
-rw-r--r--libcrystfel/src/mosflm.h1
-rw-r--r--libcrystfel/src/reax.c4
-rw-r--r--libcrystfel/src/reax.h4
-rw-r--r--libcrystfel/src/xds.c5
-rw-r--r--libcrystfel/src/xds.h2
-rw-r--r--src/im-sandbox.c29
-rw-r--r--src/im-sandbox.h3
-rw-r--r--src/indexamajig.c28
15 files changed, 30 insertions, 72 deletions
diff --git a/libcrystfel/src/dirax.c b/libcrystfel/src/dirax.c
index 55e65fd1..ac12b57d 100644
--- a/libcrystfel/src/dirax.c
+++ b/libcrystfel/src/dirax.c
@@ -629,7 +629,7 @@ int run_dirax(struct image *image, IndexingPrivate *ipriv)
IndexingPrivate *dirax_prepare(IndexingMethod *indm, UnitCell *cell,
- const char *filename, struct detector *det,
+ struct detector *det,
struct beam_params *beam, float *ltl)
{
struct dirax_private *dp;
diff --git a/libcrystfel/src/dirax.h b/libcrystfel/src/dirax.h
index 6be8451a..1ac2f456 100644
--- a/libcrystfel/src/dirax.h
+++ b/libcrystfel/src/dirax.h
@@ -38,8 +38,7 @@
extern int run_dirax(struct image *image, IndexingPrivate *ipriv);
extern IndexingPrivate *dirax_prepare(IndexingMethod *indm,
- UnitCell *cell, const char *filename,
- struct detector *det,
+ UnitCell *cell, struct detector *det,
struct beam_params *beam, float *ltl);
extern void dirax_cleanup(IndexingPrivate *pp);
diff --git a/libcrystfel/src/grainspotter.c b/libcrystfel/src/grainspotter.c
index 79cf1078..cebfb160 100644
--- a/libcrystfel/src/grainspotter.c
+++ b/libcrystfel/src/grainspotter.c
@@ -468,7 +468,6 @@ int grainspotter_index(struct image *image, IndexingPrivate *ipriv)
IndexingPrivate *grainspotter_prepare(IndexingMethod *indm, UnitCell *cell,
- const char *filename,
struct detector *det,
struct beam_params *beam, float *ltl)
{
diff --git a/libcrystfel/src/grainspotter.h b/libcrystfel/src/grainspotter.h
index 720fc486..2e308a1c 100644
--- a/libcrystfel/src/grainspotter.h
+++ b/libcrystfel/src/grainspotter.h
@@ -37,7 +37,6 @@
extern IndexingPrivate *grainspotter_prepare(IndexingMethod *indm,
UnitCell *cell,
- const char *filename,
struct detector *det,
struct beam_params *beam,
float *ltl);
diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c
index c1897d1f..68b4c38e 100644
--- a/libcrystfel/src/index.c
+++ b/libcrystfel/src/index.c
@@ -56,7 +56,7 @@
IndexingPrivate **prepare_indexing(IndexingMethod *indm, UnitCell *cell,
- const char *filename, struct detector *det,
+ struct detector *det,
struct beam_params *beam, float *ltl)
{
int n;
@@ -77,29 +77,27 @@ IndexingPrivate **prepare_indexing(IndexingMethod *indm, UnitCell *cell,
switch ( indm[n] & INDEXING_METHOD_MASK ) {
case INDEXING_DIRAX :
- iprivs[n] = dirax_prepare(&indm[n], cell, filename,
+ iprivs[n] = dirax_prepare(&indm[n], cell,
det, beam, ltl);
break;
case INDEXING_MOSFLM :
- iprivs[n] = mosflm_prepare(&indm[n], cell, filename,
+ iprivs[n] = mosflm_prepare(&indm[n], cell,
det, beam, ltl);
break;
case INDEXING_XDS :
- iprivs[n] = xds_prepare(&indm[n], cell, filename,
- det, beam, ltl);
+ iprivs[n] = xds_prepare(&indm[n], cell, det, beam, ltl);
break;
case INDEXING_REAX :
- iprivs[n] = reax_prepare(&indm[n], cell, filename,
+ iprivs[n] = reax_prepare(&indm[n], cell,
det, beam, ltl);
break;
case INDEXING_GRAINSPOTTER :
iprivs[n] = grainspotter_prepare(&indm[n], cell,
- filename, det, beam,
- ltl);
+ det, beam, ltl);
break;
default :
diff --git a/libcrystfel/src/index.h b/libcrystfel/src/index.h
index e36e531c..2d3a500b 100644
--- a/libcrystfel/src/index.h
+++ b/libcrystfel/src/index.h
@@ -128,7 +128,6 @@ extern char *indexer_str(IndexingMethod indm);
#include "image.h"
extern IndexingPrivate **prepare_indexing(IndexingMethod *indm, UnitCell *cell,
- const char *filename,
struct detector *det,
struct beam_params *beam, float *ltl);
diff --git a/libcrystfel/src/mosflm.c b/libcrystfel/src/mosflm.c
index fbd14e37..95b868bc 100644
--- a/libcrystfel/src/mosflm.c
+++ b/libcrystfel/src/mosflm.c
@@ -831,8 +831,8 @@ int run_mosflm(struct image *image, IndexingPrivate *ipriv)
IndexingPrivate *mosflm_prepare(IndexingMethod *indm, UnitCell *cell,
- const char *filename, struct detector *det,
- struct beam_params *beam, float *ltl)
+ struct detector *det, struct beam_params *beam,
+ float *ltl)
{
struct mosflm_private *mp;
int need_cell = 0;
diff --git a/libcrystfel/src/mosflm.h b/libcrystfel/src/mosflm.h
index a87232b6..1288b131 100644
--- a/libcrystfel/src/mosflm.h
+++ b/libcrystfel/src/mosflm.h
@@ -41,7 +41,6 @@
extern int run_mosflm(struct image *image, IndexingPrivate *ipriv);
extern IndexingPrivate *mosflm_prepare(IndexingMethod *indm, UnitCell *cell,
- const char *filename,
struct detector *det,
struct beam_params *beam, float *ltl);
diff --git a/libcrystfel/src/reax.c b/libcrystfel/src/reax.c
index 110d8701..1ff61a59 100644
--- a/libcrystfel/src/reax.c
+++ b/libcrystfel/src/reax.c
@@ -1096,8 +1096,8 @@ int reax_index(IndexingPrivate *pp, struct image *image)
IndexingPrivate *reax_prepare(IndexingMethod *indm, UnitCell *cell,
- const char *filename, struct detector *det,
- struct beam_params *beam, float *ltl)
+ struct detector *det, struct beam_params *beam,
+ float *ltl)
{
struct reax_private *p;
int samp;
diff --git a/libcrystfel/src/reax.h b/libcrystfel/src/reax.h
index 1c10a96a..4720709e 100644
--- a/libcrystfel/src/reax.h
+++ b/libcrystfel/src/reax.h
@@ -41,7 +41,7 @@
#ifdef HAVE_FFTW
extern IndexingPrivate *reax_prepare(IndexingMethod *indm, UnitCell *cell,
- const char *filename, struct detector *det,
+ struct detector *det,
struct beam_params *beam, float *ltl);
extern void reax_cleanup(IndexingPrivate *pp);
@@ -51,7 +51,7 @@ extern int reax_index(IndexingPrivate *pp, struct image *image);
#else /* HAVE_FFTW */
static IndexingPrivate *reax_prepare(IndexingMethod *indm, UnitCell *cell,
- const char *filename, struct detector *det,
+ struct detector *det,
struct beam_params *beam, float *ltl)
{
return NULL;
diff --git a/libcrystfel/src/xds.c b/libcrystfel/src/xds.c
index 0683e0ad..6162394c 100644
--- a/libcrystfel/src/xds.c
+++ b/libcrystfel/src/xds.c
@@ -618,9 +618,8 @@ int run_xds(struct image *image, IndexingPrivate *priv)
IndexingPrivate *xds_prepare(IndexingMethod *indm, UnitCell *cell,
- const char *filename,
- struct detector *det,
- struct beam_params *beam, float *ltl)
+ struct detector *det, struct beam_params *beam,
+ float *ltl)
{
struct xds_private *xp;
diff --git a/libcrystfel/src/xds.h b/libcrystfel/src/xds.h
index 7dd7c6a8..dd0c3298 100644
--- a/libcrystfel/src/xds.h
+++ b/libcrystfel/src/xds.h
@@ -42,7 +42,7 @@
extern int run_xds(struct image *image, IndexingPrivate *ipriv);
extern IndexingPrivate *xds_prepare(IndexingMethod *indm, UnitCell *cell,
- const char *filename, struct detector *det,
+ struct detector *det,
struct beam_params *beam, float *ltl);
extern void xds_cleanup(IndexingPrivate *pp);
diff --git a/src/im-sandbox.c b/src/im-sandbox.c
index 2c6e44ee..3558c8ea 100644
--- a/src/im-sandbox.c
+++ b/src/im-sandbox.c
@@ -124,8 +124,7 @@ static void unlock_sandbox(struct sandbox *sb)
}
-static char *get_pattern(FILE *fh, char **use_this_one_instead,
- int config_basename, const char *prefix)
+static char *get_pattern(FILE *fh, int config_basename, const char *prefix)
{
char *line;
char *filename;
@@ -134,22 +133,13 @@ static char *get_pattern(FILE *fh, char **use_this_one_instead,
do {
/* Get the next filename */
- if ( *use_this_one_instead != NULL ) {
-
- line = *use_this_one_instead;
- *use_this_one_instead = NULL;
-
- } else {
-
- char *rval;
-
- line = malloc(1024*sizeof(char));
- rval = fgets(line, 1023, fh);
- if ( rval == NULL ) {
- free(line);
- return NULL;
- }
+ char *rval;
+ line = malloc(1024*sizeof(char));
+ rval = fgets(line, 1023, fh);
+ if ( rval == NULL ) {
+ free(line);
+ return NULL;
}
chomp(line);
@@ -627,7 +617,7 @@ static void handle_zombie(struct sandbox *sb)
void create_sandbox(struct index_args *iargs, int n_proc, char *prefix,
- int config_basename, FILE *fh, char *use_this_one_instead,
+ int config_basename, FILE *fh,
int ofd, int argc, char *argv[], const char *tempdir)
{
int i;
@@ -853,8 +843,7 @@ void create_sandbox(struct index_args *iargs, int n_proc, char *prefix,
}
/* Send next filename */
- nextImage = get_pattern(fh, &use_this_one_instead,
- config_basename, prefix);
+ nextImage = get_pattern(fh, config_basename, prefix);
free(sb->last_filename[i]);
sb->last_filename[i] = nextImage;
diff --git a/src/im-sandbox.h b/src/im-sandbox.h
index c0c8eba4..71af5052 100644
--- a/src/im-sandbox.h
+++ b/src/im-sandbox.h
@@ -37,6 +37,5 @@
#include "process_image.h"
extern void create_sandbox(struct index_args *iargs, int n_proc, char *prefix,
- int config_basename, FILE *fh,
- char *use_this_one_instead, int streamfd,
+ int config_basename, FILE *fh, int streamfd,
int argc, char *argv[], const char *tempdir);
diff --git a/src/indexamajig.c b/src/indexamajig.c
index ab148a0b..c41b1487 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -177,7 +177,6 @@ int main(int argc, char *argv[])
char *outfile = NULL;
FILE *fh;
int ofd;
- char *rval = NULL;
int config_checkprefix = 1;
int config_basename = 0;
int integrate_saturated = 0;
@@ -189,9 +188,6 @@ int main(int argc, char *argv[])
char *speaks = NULL;
char *toler = NULL;
int n_proc = 1;
- char *prepare_line;
- char prepare_filename[1024];
- char *use_this_one_instead;
struct index_args iargs;
char *intrad = NULL;
char *int_str = NULL;
@@ -630,28 +626,10 @@ int main(int argc, char *argv[])
}
free(outfile);
- /* Get first filename and use it to set up the indexing */
- prepare_line = malloc(1024);
- rval = fgets(prepare_line, 1023, fh);
- if ( rval == NULL ) {
- ERROR("Failed to get filename to prepare indexing.\n");
- return 1;
- }
- use_this_one_instead = strdup(prepare_line);
- chomp(prepare_line);
- if ( config_basename ) {
- char *tmp;
- tmp = safe_basename(prepare_line);
- free(prepare_line);
- prepare_line = tmp;
- }
- snprintf(prepare_filename, 1023, "%s%s", prefix, prepare_line);
- free(prepare_line);
-
/* Prepare the indexer */
if ( indm != NULL ) {
- ipriv = prepare_indexing(indm, iargs.cell, prepare_filename,
- iargs.det, iargs.beam, iargs.tols);
+ ipriv = prepare_indexing(indm, iargs.cell, iargs.det,
+ iargs.beam, iargs.tols);
if ( ipriv == NULL ) {
ERROR("Failed to prepare indexing.\n");
return 1;
@@ -666,7 +644,7 @@ int main(int argc, char *argv[])
iargs.ipriv = ipriv;
create_sandbox(&iargs, n_proc, prefix, config_basename, fh,
- use_this_one_instead, ofd, argc, argv, tempdir);
+ ofd, argc, argv, tempdir);
free(prefix);
free(tempdir);