aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/reflist-utils.c28
-rw-r--r--libcrystfel/src/reflist-utils.h6
2 files changed, 30 insertions, 4 deletions
diff --git a/libcrystfel/src/reflist-utils.c b/libcrystfel/src/reflist-utils.c
index 54c467b3..70548994 100644
--- a/libcrystfel/src/reflist-utils.c
+++ b/libcrystfel/src/reflist-utils.c
@@ -3,11 +3,11 @@
*
* Utilities to complement the core reflist.c
*
- * Copyright © 2012-2017 Deutsches Elektronen-Synchrotron DESY,
+ * Copyright © 2012-2018 Deutsches Elektronen-Synchrotron DESY,
* a research centre of the Helmholtz Association.
*
* Authors:
- * 2011-2017 Thomas White <taw@physics.org>
+ * 2011-2018 Thomas White <taw@physics.org>
* 2014 Valerio Mariani
*
* This file is part of CrystFEL.
@@ -648,6 +648,30 @@ RefList *copy_reflist(RefList *list)
}
+/**
+ * free_contribs:
+ * @list: A %RefList
+ *
+ * Goes through @list and frees all the reflection contribution structures.
+ **/
+void free_contribs(RefList *list)
+{
+ Reflection *refl;
+ RefListIterator *iter;
+
+ for ( refl = first_refl(list, &iter);
+ refl != NULL;
+ refl = next_refl(refl, iter) )
+ {
+ struct reflection_contributions *c;
+ c = get_contributions(refl);
+ free(c->contribs);
+ free(c->contrib_crystals);
+ free(c);
+ }
+}
+
+
static char *full_command_line(int argc, char *argv[])
{
int i;
diff --git a/libcrystfel/src/reflist-utils.h b/libcrystfel/src/reflist-utils.h
index f64e9f51..c955491a 100644
--- a/libcrystfel/src/reflist-utils.h
+++ b/libcrystfel/src/reflist-utils.h
@@ -3,11 +3,11 @@
*
* Utilities to complement the core reflist.c
*
- * Copyright © 2012-2017 Deutsches Elektronen-Synchrotron DESY,
+ * Copyright © 2012-2018 Deutsches Elektronen-Synchrotron DESY,
* a research centre of the Helmholtz Association.
*
* Authors:
- * 2011-2017 Thomas White <taw@physics.org>
+ * 2011-2018 Thomas White <taw@physics.org>
* 2014 Valerio Mariani
*
* This file is part of CrystFEL.
@@ -69,6 +69,8 @@ extern RefList *res_cutoff(RefList *list, UnitCell *cell,
extern RefList *copy_reflist(RefList *list);
+extern void free_contribs(RefList *list);
+
extern void reflist_add_command_and_version(RefList *list,
int argcv, char *argv[]);