From 9530a39509e7ff61ba091766978b0e201f88c993 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 23 Sep 2019 15:17:25 +0200 Subject: Remove private option structures from iargs --- libcrystfel/src/index.c | 18 ++++++------------ libcrystfel/src/taketwo.c | 9 +++++---- libcrystfel/src/taketwo.h | 6 +++--- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c index 049c3ba0..016767a9 100644 --- a/libcrystfel/src/index.c +++ b/libcrystfel/src/index.c @@ -70,10 +70,6 @@ struct _indexingprivate UnitCell *target_cell; double tolerance[6]; - struct taketwo_options *ttopts; - struct xgandalf_options *xgandalf_opts; - struct pinkIndexer_options *pinkIndexer_opts; - int n_methods; IndexingMethod *methods; void **engine_private; @@ -241,7 +237,8 @@ static void *prepare_method(IndexingMethod *m, UnitCell *cell, struct detector *det, struct beam_params *beam, struct xgandalf_options *xgandalf_opts, struct pinkIndexer_options* pinkIndexer_opts, - struct felix_options *felix_opts) + struct felix_options *felix_opts, + struct taketwo_options *taketwo_opts) { char *str; IndexingMethod in = *m; @@ -278,7 +275,7 @@ static void *prepare_method(IndexingMethod *m, UnitCell *cell, break; case INDEXING_TAKETWO : - priv = taketwo_prepare(m, cell); + priv = taketwo_prepare(m, taketwo_opts, cell); break; case INDEXING_XGANDALF : @@ -419,7 +416,8 @@ IndexingPrivate *setup_indexing(const char *method_list, UnitCell *cell, det, beam, xgandalf_opts, pinkIndexer_opts, - felix_opts); + felix_opts, + ttopts); if ( ipriv->engine_private[i] == NULL ) return NULL; @@ -466,10 +464,6 @@ IndexingPrivate *setup_indexing(const char *method_list, UnitCell *cell, } for ( i=0; i<6; i++ ) ipriv->tolerance[i] = tols[i]; - ipriv->ttopts = ttopts; - ipriv->xgandalf_opts = xgandalf_opts; - ipriv->pinkIndexer_opts = pinkIndexer_opts; - STATUS("List of indexing methods:\n"); for ( i=0; ittopts, mpriv); + r = taketwo_index(image, mpriv); break; case INDEXING_PINKINDEXER : diff --git a/libcrystfel/src/taketwo.c b/libcrystfel/src/taketwo.c index 893791e4..63840d2b 100644 --- a/libcrystfel/src/taketwo.c +++ b/libcrystfel/src/taketwo.c @@ -159,6 +159,7 @@ struct Seed struct taketwo_private { IndexingMethod indm; + struct taketwo_options *opts; UnitCell *cell; int serial_num; /**< Serial of last image, -1 if unassigned */ unsigned int xtal_num; /**< last number of crystals recorded */ @@ -2121,8 +2122,7 @@ static void partial_taketwo_cleanup(struct taketwo_private *tp) /* CrystFEL interface hooks */ -int taketwo_index(struct image *image, const struct taketwo_options *opts, - void *priv) +int taketwo_index(struct image *image, void *priv) { Crystal *cr; UnitCell *cell; @@ -2172,7 +2172,7 @@ int taketwo_index(struct image *image, const struct taketwo_options *opts, rlps[n_rlps].v = 0.0; rlps[n_rlps++].w = 0.0; - cell = run_taketwo(tp->cell, opts, rlps, n_rlps, tp); + cell = run_taketwo(tp->cell, tp->opts, rlps, n_rlps, tp); free(rlps); if ( cell == NULL ) return 0; @@ -2190,7 +2190,8 @@ int taketwo_index(struct image *image, const struct taketwo_options *opts, } -void *taketwo_prepare(IndexingMethod *indm, UnitCell *cell) +void *taketwo_prepare(IndexingMethod *indm, struct taketwo_options *opts, + UnitCell *cell) { struct taketwo_private *tp; diff --git a/libcrystfel/src/taketwo.h b/libcrystfel/src/taketwo.h index c489228f..b1479faa 100644 --- a/libcrystfel/src/taketwo.h +++ b/libcrystfel/src/taketwo.h @@ -41,10 +41,10 @@ typedef struct taketwo_options TakeTwoOptions; extern struct argp taketwo_argp; -extern void *taketwo_prepare(IndexingMethod *indm, UnitCell *cell); +extern void *taketwo_prepare(IndexingMethod *indm, struct taketwo_options *opts, + UnitCell *cell); extern const char *taketwo_probe(UnitCell *cell); -extern int taketwo_index(struct image *image, - const struct taketwo_options *opts, void *priv); +extern int taketwo_index(struct image *image, void *priv); extern void taketwo_cleanup(IndexingPrivate *pp); #endif /* TAKETWO_H */ -- cgit v1.2.3