From 21f7896cc23ff79fa1e4cb593f8685bdb5c7a082 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 8 Feb 2021 17:56:05 +0100 Subject: Add find_merge_result_by_name() --- src/gui_project.c | 14 ++++++++++++++ src/gui_project.h | 3 +++ 2 files changed, 17 insertions(+) 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; in_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 -- cgit v1.2.3