From 16d605d60a11b8513bb19829a6e3e851fa46c26a Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 21 Aug 2020 16:30:09 +0200 Subject: Redefine backend interface functions --- src/gui_project.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'src/gui_project.c') diff --git a/src/gui_project.c b/src/gui_project.c index c10d9a99..f383f77b 100644 --- a/src/gui_project.c +++ b/src/gui_project.c @@ -66,17 +66,6 @@ static int parse_int(const char *val) } -static struct crystfel_backend *parse_backend(const char *val) -{ - if ( strcmp(val, "local") == 0 ) { - return backend_local; - } - - ERROR("Invalid backend '%s'\n", val); - return NULL; -} - - static const char *str_matchtype(enum match_type_id mt) { switch ( mt ) { @@ -274,7 +263,7 @@ static void handle_var(const char *key, const char *val, } if ( strcmp(key, "backend") == 0 ) { - proj->backend = parse_backend(val); + proj->backend_name = strdup(val); } if ( strcmp(key, "geom") == 0 ) { @@ -485,7 +474,7 @@ int save_project(struct crystfelproject *proj) fprintf(fh, "show_peaks %i\n", proj->show_peaks); fprintf(fh, "show_refls %i\n", proj->show_refls); - fprintf(fh, "backend %s\n", proj->backend->name); + fprintf(fh, "backend %s\n", proj->backend_name); fprintf(fh, "-----\n"); if ( proj->stream == NULL ) { @@ -514,7 +503,7 @@ void default_project(struct crystfelproject *proj) proj->events = NULL; proj->peak_params = NULL; proj->info_bar = NULL; - proj->backend_private = NULL; + proj->backend_name = strdup("local"); proj->data_top_folder = NULL; proj->data_search_pattern = 0; proj->stream_filename = NULL; @@ -563,6 +552,4 @@ void default_project(struct crystfelproject *proj) proj->indexing_params.integration_method = strdup("rings"); proj->indexing_params.overpredict = 0; proj->indexing_params.push_res = INFINITY; - - proj->backend = backend_local; } -- cgit v1.2.3