From 168f6d6740348f41db7867497933e2c0cea9db44 Mon Sep 17 00:00:00 2001 From: lmat Date: Mon, 13 Nov 2017 14:40:48 -0500 Subject: [PATCH] Removing unused timespec function --- libgnucash/app-utils/option-util.c | 106 ----------------------------- libgnucash/app-utils/option-util.h | 8 --- 2 files changed, 114 deletions(-) diff --git a/libgnucash/app-utils/option-util.c b/libgnucash/app-utils/option-util.c index ad84b7f3f9..a62046071f 100644 --- a/libgnucash/app-utils/option-util.c +++ b/libgnucash/app-utils/option-util.c @@ -2085,112 +2085,6 @@ gnc_option_db_lookup_multichoice_option(GNCOptionDB *odb, return strdup(default_value); } - -/********************************************************************\ - * gnc_option_db_lookup_date_option * - * looks up a date option. If present, returns the absolute date * - * represented in the set_ab_value argument provided, otherwise * - * copies the default_value argument (if non-NULL) to the * - * set_ab_value argument. If the default_value argument is NULL, * - * copies the current date to set_ab_value. Whatever value is * - * stored in set_ab_value is returned as an approximate (no * - * nanoseconds) time64 value. set_ab_value may be NULL, in which * - * case only the return value can be used. If is_relative is * - * non-NULL, it is set to whether the date option is currently * - * storing a relative date. If it is, and set_rel_value * - * is non-NULL, it returns a newly allocated string * - * representing the scheme symbol for that relative date * - * * - * Args: odb - option database to search in * - * section - section name of option * - * name - name of option * - * is_relative - location to store boolean value * - * set_ab_value - location to store absolute option value * - * set_rel_value - location to store relative option value * - * default - default value if not found * - * Return: time64 approximation of set_value * -\********************************************************************/ -time64 -gnc_option_db_lookup_date_option(GNCOptionDB *odb, - const char *section, - const char *name, - gboolean *is_relative, - Timespec *set_ab_value, - char **set_rel_value, - Timespec *default_value) -{ - GNCOption *option; - Timespec temp = {0, 0}; - char *symbol; - SCM getter; - SCM value; - - initialize_getters(); - - if (set_ab_value == NULL) - { - set_ab_value = &temp; - } - - if (set_rel_value != NULL) - { - *set_rel_value = NULL; - } - - if (is_relative != NULL) - { - *is_relative = FALSE; - } - - option = gnc_option_db_get_option_by_name(odb, section, name); - - if (option != NULL) - { - getter = gnc_option_getter(option); - if (getter != SCM_UNDEFINED) - { - value = scm_call_0(getter); - - if (scm_is_pair(value)) - { - Timespec absolute; - - absolute = gnc_date_option_value_get_absolute (value); - - *set_ab_value = absolute; - - symbol = gnc_date_option_value_get_type (value); - - if (g_strcmp0(symbol, "relative") == 0) - { - SCM relative = gnc_date_option_value_get_relative (value); - - if (is_relative != NULL) - *is_relative = TRUE; - - if (set_rel_value != NULL) - *set_rel_value = gnc_scm_symbol_to_locale_string (relative); - } - - g_free (symbol); - } - } - } - else - { - if (default_value == NULL) - { - set_ab_value->tv_sec = gnc_time (NULL); - set_ab_value->tv_nsec = 0; - } - else - *set_ab_value = *default_value; - } - - return set_ab_value->tv_sec; -} - - /********************************************************************\ * gnc_option_db_lookup_number_option * * looks up a number option. If present, returns its value * diff --git a/libgnucash/app-utils/option-util.h b/libgnucash/app-utils/option-util.h index 32e1080daf..b4cea26b64 100644 --- a/libgnucash/app-utils/option-util.h +++ b/libgnucash/app-utils/option-util.h @@ -182,14 +182,6 @@ char * gnc_option_db_lookup_multichoice_option(GNCOptionDB *odb, const char *name, const char *default_value); -time64 gnc_option_db_lookup_date_option(GNCOptionDB *odb, - const char *section, - const char *name, - gboolean *is_relative, - Timespec *set_ab_value, - char **set_rel_value, - Timespec *default_value); - gdouble gnc_option_db_lookup_number_option(GNCOptionDB *odb, const char *section, const char *name,