aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-02-08 17:56:05 +0100
committerThomas White <taw@physics.org>2021-02-08 17:56:05 +0100
commit21f7896cc23ff79fa1e4cb593f8685bdb5c7a082 (patch)
tree221740739f9f279394dd3aeac3825edb3c30e361
parent636784eadce6a322ea6b626ae6b711e53ad36462 (diff)
Add find_merge_result_by_name()
-rw-r--r--src/gui_project.c14
-rw-r--r--src/gui_project.h3
2 files changed, 17 insertions, 0 deletions
diff --git a/src/gui_project.c b/src/gui_project.c
index 3e8eb970..c8257d49 100644
--- a/src/gui_project.c
+++ b/src/gui_project.c
@@ -1077,6 +1077,20 @@ int add_merge_result(struct crystfelproject *proj,
}
+struct gui_merge_result *find_merge_result_by_name(struct crystfelproject *proj,
+ const char *name)
+{
+ int i;
+
+ for ( i=0; i<proj->n_merge_results; i++ ) {
+ if ( strcmp(proj->merge_results[i].name, name) == 0 ) {
+ return &proj->merge_results[i];
+ }
+ }
+ return NULL;
+}
+
+
static void update_result_index(struct gui_indexing_result *result)
{
int i;
diff --git a/src/gui_project.h b/src/gui_project.h
index 81bf3884..f9f34194 100644
--- a/src/gui_project.h
+++ b/src/gui_project.h
@@ -306,6 +306,9 @@ extern int add_merge_result(struct crystfelproject *proj,
char *name,
char *hkl);
+extern struct gui_merge_result *find_merge_result_by_name(struct crystfelproject *proj,
+ const char *name);
+
extern const char *selected_result(struct crystfelproject *proj);
#endif