From 48daaeb56d995f2db90c056c403ca3d00a181184 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 18 May 2015 14:44:59 +0200 Subject: Add {get,set}_flag() --- libcrystfel/src/reflist.c | 32 ++++++++++++++++++++++++++++++++ libcrystfel/src/reflist.h | 2 ++ 2 files changed, 34 insertions(+) diff --git a/libcrystfel/src/reflist.c b/libcrystfel/src/reflist.c index 795894a1..ccc421f3 100644 --- a/libcrystfel/src/reflist.c +++ b/libcrystfel/src/reflist.c @@ -102,6 +102,7 @@ struct _refldata { /* User-specified temporary values */ double temp1; double temp2; + int flag; }; @@ -546,6 +547,22 @@ double get_temp2(const Reflection *refl) } +/** + * get_flag: + * @refl: A %Reflection + * + * The integer flag value can be used according to the needs of the calling + * program. + * + * Returns: the flag for this reflection. + * + **/ +int get_flag(const Reflection *refl) +{ + return refl->data.flag; +} + + /********************************** Setters ***********************************/ /** @@ -772,6 +789,21 @@ void set_temp2(Reflection *refl, double temp) } +/** + * set_flag + * @refl: A %Reflection + * @flag: New flag value + * + * @flag is an integer value which can be used according to the needs of the + * calling program. + * + **/ +void set_flag(Reflection *refl, int flag) +{ + refl->data.flag = flag; +} + + /********************************* Insertion **********************************/ static Reflection *rotate_once(Reflection *refl, int dir) diff --git a/libcrystfel/src/reflist.h b/libcrystfel/src/reflist.h index 8b0d8e04..dac313a4 100644 --- a/libcrystfel/src/reflist.h +++ b/libcrystfel/src/reflist.h @@ -103,6 +103,7 @@ extern double get_esd_intensity(const Reflection *refl); extern double get_phase(const Reflection *refl, int *have_phase); extern double get_peak(const Reflection *refl); extern double get_mean_bg(const Reflection *refl); +extern int get_flag(const Reflection *refl); /* Set */ extern void copy_data(Reflection *to, const Reflection *from); @@ -121,6 +122,7 @@ extern void set_peak(Reflection *refl, double peak); extern void set_mean_bg(Reflection *refl, double mean_bg); extern void set_symmetric_indices(Reflection *refl, signed int hs, signed int ks, signed int ls); +extern void set_flag(Reflection *refl, int flag); /* Insertion */ extern Reflection *add_refl(RefList *list, -- cgit v1.2.3