r21571 - gnucash/trunk/src/app-utils - [Cruft Reduction] Remove unused functions from src/app-utils

John Ralls jralls at code.gnucash.org
Thu Nov 17 16:27:56 EST 2011


Author: jralls
Date: 2011-11-17 16:27:56 -0500 (Thu, 17 Nov 2011)
New Revision: 21571
Trac: http://svn.gnucash.org/trac/changeset/21571

Modified:
   gnucash/trunk/src/app-utils/gnc-component-manager.c
   gnucash/trunk/src/app-utils/gnc-component-manager.h
   gnucash/trunk/src/app-utils/gnc-euro.c
   gnucash/trunk/src/app-utils/gnc-euro.h
   gnucash/trunk/src/app-utils/gnc-exp-parser.c
   gnucash/trunk/src/app-utils/gnc-exp-parser.h
   gnucash/trunk/src/app-utils/gnc-helpers.c
   gnucash/trunk/src/app-utils/gnc-helpers.h
   gnucash/trunk/src/app-utils/gnc-sx-instance-model.c
   gnucash/trunk/src/app-utils/gnc-sx-instance-model.h
   gnucash/trunk/src/app-utils/gnc-ui-balances.c
   gnucash/trunk/src/app-utils/gnc-ui-balances.h
   gnucash/trunk/src/app-utils/gnc-ui-util.c
   gnucash/trunk/src/app-utils/gnc-ui-util.h
   gnucash/trunk/src/app-utils/option-util.c
   gnucash/trunk/src/app-utils/option-util.h
Log:
[Cruft Reduction] Remove unused functions from src/app-utils

Modified: gnucash/trunk/src/app-utils/gnc-component-manager.c
===================================================================
--- gnucash/trunk/src/app-utils/gnc-component-manager.c	2011-11-17 21:27:40 UTC (rev 21570)
+++ gnucash/trunk/src/app-utils/gnc-component-manager.c	2011-11-17 21:27:56 UTC (rev 21571)
@@ -467,14 +467,6 @@
 }
 
 void
-gnc_gui_component_watch_entity_direct (gint component_id,
-                                       GncGUID entity,
-                                       QofEventId event_mask)
-{
-    gnc_gui_component_watch_entity (component_id, &entity, event_mask);
-}
-
-void
 gnc_gui_component_watch_entity_type (gint component_id,
                                      QofIdTypeConst entity_type,
                                      QofEventId event_mask)

Modified: gnucash/trunk/src/app-utils/gnc-component-manager.h
===================================================================
--- gnucash/trunk/src/app-utils/gnc-component-manager.h	2011-11-17 21:27:40 UTC (rev 21570)
+++ gnucash/trunk/src/app-utils/gnc-component-manager.h	2011-11-17 21:27:56 UTC (rev 21571)
@@ -173,19 +173,6 @@
                                      const GncGUID *entity,
                                      QofEventId event_mask);
 
-/* gnc_gui_component_watch_entity_direct
- *   Add an entity to the list of those being watched by the component.
- *   Only entities with refresh handlers should add watches.
- *
- * component_id: id of component which is watching the entity
- * entity:       id of entity to watch
- * event_mask:   mask which determines which kinds of events are watched
- *               setting the mask to 0 turns off watching for the entity.
- */
-void gnc_gui_component_watch_entity_direct (gint component_id,
-        GncGUID entity,
-        QofEventId event_mask);
-
 /* gnc_gui_component_watch_entity_type
  *   Watch all entities of a particular type.
  *

Modified: gnucash/trunk/src/app-utils/gnc-euro.c
===================================================================
--- gnucash/trunk/src/app-utils/gnc-euro.c	2011-11-17 21:27:40 UTC (rev 21570)
+++ gnucash/trunk/src/app-utils/gnc-euro.c	2011-11-17 21:27:56 UTC (rev 21571)
@@ -101,22 +101,6 @@
 /* ------------------------------------------------------ */
 
 gboolean
-gnc_is_euro_currency_code (const char *code)
-{
-    gnc_euro_rate_struct *result;
-
-    if (!code) return FALSE;
-
-    result = bsearch (code,
-                      gnc_euro_rates,
-                      sizeof(gnc_euro_rates) / sizeof(gnc_euro_rate_struct),
-                      sizeof(gnc_euro_rate_struct),
-                      gnc_euro_rate_compare_code);
-
-    return result != NULL;
-}
-
-gboolean
 gnc_is_euro_currency(const gnc_commodity * currency)
 {
     gnc_euro_rate_struct *result;

Modified: gnucash/trunk/src/app-utils/gnc-euro.h
===================================================================
--- gnucash/trunk/src/app-utils/gnc-euro.h	2011-11-17 21:27:40 UTC (rev 21570)
+++ gnucash/trunk/src/app-utils/gnc-euro.h	2011-11-17 21:27:56 UTC (rev 21571)
@@ -28,7 +28,6 @@
 #include "qof.h"
 
 gboolean    gnc_is_euro_currency (const gnc_commodity * currency);
-gboolean    gnc_is_euro_currency_code (const char *code);
 gnc_numeric gnc_convert_to_euro (const gnc_commodity * currency,
                                  gnc_numeric value);
 gnc_numeric gnc_convert_from_euro (const gnc_commodity * currency,

Modified: gnucash/trunk/src/app-utils/gnc-exp-parser.c
===================================================================
--- gnucash/trunk/src/app-utils/gnc-exp-parser.c	2011-11-17 21:27:40 UTC (rev 21570)
+++ gnucash/trunk/src/app-utils/gnc-exp-parser.c	2011-11-17 21:27:56 UTC (rev 21571)
@@ -165,19 +165,6 @@
     *list = g_list_prepend (*list, key);
 }
 
-GList *
-gnc_exp_parser_get_variable_names (void)
-{
-    GList *names = NULL;
-
-    if (!parser_inited)
-        return NULL;
-
-    g_hash_table_foreach (variable_bindings, prepend_name, &names);
-
-    return names;
-}
-
 void
 gnc_exp_parser_remove_variable (const char *variable_name)
 {
@@ -200,40 +187,6 @@
 }
 
 void
-gnc_exp_parser_remove_variable_names (GList * variable_names)
-{
-    if (!parser_inited)
-        return;
-
-    while (variable_names != NULL)
-    {
-        gnc_exp_parser_remove_variable (variable_names->data);
-        variable_names = variable_names->next;
-    }
-}
-
-gboolean
-gnc_exp_parser_get_value (const char * variable_name, gnc_numeric *value_p)
-{
-    ParserNum *pnum;
-
-    if (!parser_inited)
-        return FALSE;
-
-    if (variable_name == NULL)
-        return FALSE;
-
-    pnum = g_hash_table_lookup (variable_bindings, variable_name);
-    if (pnum == NULL)
-        return FALSE;
-
-    if (value_p != NULL)
-        *value_p = pnum->value;
-
-    return TRUE;
-}
-
-void
 gnc_exp_parser_set_value (const char * variable_name, gnc_numeric value)
 {
     char *key;

Modified: gnucash/trunk/src/app-utils/gnc-exp-parser.h
===================================================================
--- gnucash/trunk/src/app-utils/gnc-exp-parser.h	2011-11-17 21:27:40 UTC (rev 21570)
+++ gnucash/trunk/src/app-utils/gnc-exp-parser.h	2011-11-17 21:27:56 UTC (rev 21571)
@@ -52,23 +52,9 @@
 /* Shutdown the expression parser and free any associated memory in the ParserState. */
 void gnc_exp_parser_shutdown (void);
 
-/* Return a list of variable names which are currently defined
- * in the parser. The names should not be modified or freed. */
-GList * gnc_exp_parser_get_variable_names (void);
-
 /* Undefine the variable name if it is already defined. */
 void gnc_exp_parser_remove_variable (const char *variable_name);
 
-/* Undefine every variable name appearing in the list. Variables in
- * the list which are not defined are ignored. */
-void gnc_exp_parser_remove_variable_names (GList * variable_names);
-
-/* Return TRUE if the variable is defined, FALSE otherwise. If defined
- * and value_p != NULL, return the value in *value_p, otherwise, *value_p
- * is unchanged. */
-gboolean gnc_exp_parser_get_value (const char * variable_name,
-                                   gnc_numeric *value_p);
-
 /* Set the value of the variable to the given value. If the variable is
  * not already defined, it will be after the call. */
 void gnc_exp_parser_set_value (const char * variable_name,

Modified: gnucash/trunk/src/app-utils/gnc-helpers.c
===================================================================
--- gnucash/trunk/src/app-utils/gnc-helpers.c	2011-11-17 21:27:40 UTC (rev 21570)
+++ gnucash/trunk/src/app-utils/gnc-helpers.c	2011-11-17 21:27:56 UTC (rev 21571)
@@ -95,25 +95,6 @@
     return info;
 }
 
-int
-gnc_printinfo_p(SCM info_scm)
-{
-    const gchar *symbol;
-
-    if (!scm_is_list(info_scm) || scm_is_null(info_scm))
-        return 0;
-
-    info_scm = SCM_CAR (info_scm);
-    if (!scm_is_symbol (info_scm))
-        return 0;
-
-    symbol = SCM_SYMBOL_CHARS (info_scm);
-    if (symbol == NULL)
-        return 0;
-
-    return (strcmp (symbol, "print-info") == 0);
-}
-
 /* This is a scaled down version of the routine that would be needed
  * to fully convert a gnc-commodity to a scheme data structure.  In an
  * attempt to optimize the speed of price quote retrieval, this
@@ -154,18 +135,3 @@
     info_scm = scm_cons (scm_makfrom0str (name), info_scm);
     return info_scm;
 }
-
-SCM
-gnc_parse_amount_helper (const char * string, gboolean monetary)
-{
-    gnc_numeric result;
-    gboolean ok;
-
-    g_return_val_if_fail (string, SCM_BOOL_F);
-
-    ok = xaccParseAmount (string, monetary, &result, NULL);
-    if (!ok)
-        return SCM_BOOL_F;
-
-    return gnc_numeric_to_scm (result);
-}

Modified: gnucash/trunk/src/app-utils/gnc-helpers.h
===================================================================
--- gnucash/trunk/src/app-utils/gnc-helpers.h	2011-11-17 21:27:40 UTC (rev 21570)
+++ gnucash/trunk/src/app-utils/gnc-helpers.h	2011-11-17 21:27:56 UTC (rev 21571)
@@ -30,7 +30,6 @@
 
 SCM  gnc_printinfo2scm(GNCPrintAmountInfo info);
 GNCPrintAmountInfo gnc_scm2printinfo(SCM info_scm);
-int  gnc_printinfo_p(SCM info_scm);
 
 /** Given a pointer to a gnc-commodity data structure, build a Scheme
  *  list containing the data needed by the code in price-quotes.scm.
@@ -43,6 +42,5 @@
  */
 SCM  gnc_quoteinfo2scm(gnc_commodity *com);
 
-SCM gnc_parse_amount_helper (const char * string, gboolean monetary);
 
 #endif

Modified: gnucash/trunk/src/app-utils/gnc-sx-instance-model.c
===================================================================
--- gnucash/trunk/src/app-utils/gnc-sx-instance-model.c	2011-11-17 21:27:40 UTC (rev 21570)
+++ gnucash/trunk/src/app-utils/gnc-sx-instance-model.c	2011-11-17 21:27:56 UTC (rev 21571)
@@ -1685,14 +1685,6 @@
                                   &create_cashflow_data);
 }
 
-void gnc_sx_instantiate_cashflow(const SchedXaction* sx,
-                                 GHashTable* map, GList **creation_errors)
-{
-    /* Calculate ("Instantiate") the cash flow for exactly one
-     * occurrence */
-    instantiate_cashflow_internal(sx, map, creation_errors, 1);
-}
-
 typedef struct
 {
     GHashTable *hash;
@@ -1739,6 +1731,7 @@
     g_list_foreach(all_sxes, instantiate_cashflow_cb, &userdata);
 }
 
+
 GHashTable* gnc_sx_all_instantiate_cashflow_all(GDate range_start, GDate range_end)
 {
     GHashTable *result_map = gnc_g_hash_new_guid_numeric();

Modified: gnucash/trunk/src/app-utils/gnc-sx-instance-model.h
===================================================================
--- gnucash/trunk/src/app-utils/gnc-sx-instance-model.h	2011-11-17 21:27:40 UTC (rev 21570)
+++ gnucash/trunk/src/app-utils/gnc-sx-instance-model.h	2011-11-17 21:27:56 UTC (rev 21571)
@@ -228,20 +228,6 @@
  * g_hash_table_unref. */
 GHashTable* gnc_g_hash_new_guid_numeric(void);
 
-/** Calculates the cash flow of one single instance of the given SX
- * into the GHashTable<GUID*, gnc_numeric*> such that the cash flow on
- * each account is added to the given hash under the GUID of that
- * account.
- *
- * Exactly one instance of the SX is calculated, regardless of its
- * start date, recurrence, or end date.
- *
- * The creation_errors list, if non-NULL, receive any errors that
- * occurred during creation, similar as in
- * gnc_sx_instance_model_effect_change(). */
-void gnc_sx_instantiate_cashflow(const SchedXaction* sx,
-                                 GHashTable* map, GList **creation_errors);
-
 /** Instantiates the cash flow of all given SXs (in the given
  * GList<SchedXAction*>) into the GHashTable<GUID*, gnc_numeric*> for the
  * given date range. Each SX is counted with multiplicity as it has

Modified: gnucash/trunk/src/app-utils/gnc-ui-balances.c
===================================================================
--- gnucash/trunk/src/app-utils/gnc-ui-balances.c	2011-11-17 21:27:40 UTC (rev 21570)
+++ gnucash/trunk/src/app-utils/gnc-ui-balances.c	2011-11-17 21:27:56 UTC (rev 21571)
@@ -95,7 +95,7 @@
  * This routine retrieves the total balance in an account converted to
  * a given currency, possibly including all sub-accounts under the
  * specified account.
- */
+ *
 gnc_numeric
 gnc_ui_account_get_balance_in_currency (const Account *account,
                                         const gnc_commodity *currency,
@@ -104,7 +104,7 @@
     return gnc_ui_account_get_balance_full (xaccAccountGetBalanceInCurrency,
                                             account, recurse, NULL, currency);
 }
-
+*/
 /*
  * This routine retrieves the reconciled balance in an account,
  * possibly including all sub-accounts under the specified account.

Modified: gnucash/trunk/src/app-utils/gnc-ui-balances.h
===================================================================
--- gnucash/trunk/src/app-utils/gnc-ui-balances.h	2011-11-17 21:27:40 UTC (rev 21570)
+++ gnucash/trunk/src/app-utils/gnc-ui-balances.h	2011-11-17 21:27:56 UTC (rev 21571)
@@ -55,9 +55,9 @@
 gnc_numeric gnc_ui_account_get_balance (const Account *account,
                                         gboolean include_children);
 
-gnc_numeric gnc_ui_account_get_balance_in_currency (const Account *account,
-        const gnc_commodity *currency,
-        gboolean recurse);
+// gnc_numeric gnc_ui_account_get_balance_in_currency (const Account *account,
+//         const gnc_commodity *currency,
+//         gboolean recurse);
 /**
  * This routine retrieves the reconciled balance in an account,
  * possibly including all sub-accounts under the specified account.

Modified: gnucash/trunk/src/app-utils/gnc-ui-util.c
===================================================================
--- gnucash/trunk/src/app-utils/gnc-ui-util.c	2011-11-17 21:27:40 UTC (rev 21570)
+++ gnucash/trunk/src/app-utils/gnc-ui-util.c	2011-11-17 21:27:56 UTC (rev 21571)
@@ -147,18 +147,6 @@
 }
 
 gboolean
-gnc_reverse_balance_type (GNCAccountType type)
-{
-    if ((type < 0) || (type >= NUM_ACCOUNT_TYPES))
-        return FALSE;
-
-    if (!reverse_balance_inited)
-        gnc_reverse_balance_init ();
-
-    return reverse_type[type];
-}
-
-gboolean
 gnc_reverse_balance (const Account *account)
 {
     int type;
@@ -2260,24 +2248,3 @@
                                   NULL);
 
 }
-
-/* These implementations are rather lame. */
-#ifndef HAVE_TOWUPPER
-gint32
-towupper (gint32 wc)
-{
-    if (wc > 127)
-        return wc;
-
-    return toupper ((int) wc);
-}
-
-int
-iswlower (gint32 wc)
-{
-    if (wc > 127)
-        return 1;
-
-    return islower ((int) wc);
-}
-#endif

Modified: gnucash/trunk/src/app-utils/gnc-ui-util.h
===================================================================
--- gnucash/trunk/src/app-utils/gnc-ui-util.h	2011-11-17 21:27:40 UTC (rev 21570)
+++ gnucash/trunk/src/app-utils/gnc-ui-util.h	2011-11-17 21:27:56 UTC (rev 21571)
@@ -44,7 +44,6 @@
 
 
 gboolean gnc_reverse_balance(const Account *account);
-gboolean gnc_reverse_balance_type(GNCAccountType type);
 
 /* Default directory sections ***************************************/
 #define GCONF_DIR_OPEN_SAVE "dialogs/open_save"
@@ -254,13 +253,6 @@
 
 void gnc_ui_util_init (void);
 
-/* Missing functions ************************************************/
-
-#ifndef HAVE_TOWUPPER
-gint32 towupper (gint32 wc);
-int iswlower (gint32 wc);
 #endif
-
-#endif
 /** @} */
 /** @} */

Modified: gnucash/trunk/src/app-utils/option-util.c
===================================================================
--- gnucash/trunk/src/app-utils/option-util.c	2011-11-17 21:27:40 UTC (rev 21570)
+++ gnucash/trunk/src/app-utils/option-util.c	2011-11-17 21:27:56 UTC (rev 21571)
@@ -125,14 +125,6 @@
 
 
 /*******************************************************************/
-
-gboolean
-gnc_option_get_changed (GNCOption *option)
-{
-    if (!option) return FALSE;
-    return option->changed;
-}
-
 void
 gnc_option_set_changed (GNCOption *option, gboolean changed)
 {
@@ -313,42 +305,6 @@
 
     scm_call_3 (kvp_to_scm, odb->guile_options, scm_slots, kvp_option_path);
 }
-
-void
-gnc_option_db_save_to_kvp(GNCOptionDB* odb, kvp_frame *slots)
-{
-    static SCM scm_to_kvp = SCM_UNDEFINED;
-    static SCM kvp_option_path = SCM_UNDEFINED;
-    SCM scm_slots;
-
-    if (!odb || !slots) return;
-
-    if (scm_to_kvp == SCM_UNDEFINED)
-    {
-        scm_to_kvp = scm_c_eval_string("gnc:options-scm->kvp");
-        if (!scm_is_procedure (scm_to_kvp))
-        {
-            PERR ("not a procedure\n");
-            scm_to_kvp = SCM_UNDEFINED;
-            return;
-        }
-    }
-
-    if (kvp_option_path == SCM_UNDEFINED)
-    {
-        kvp_option_path = scm_c_eval_string("gnc:*kvp-option-path*");
-        if (kvp_option_path == SCM_UNDEFINED)
-        {
-            PERR ("can't find the option path");
-            return;
-        }
-    }
-
-    scm_slots = SWIG_NewPointerObj(slots, SWIG_TypeQuery("p_KvpFrame"), 0);
-
-    scm_call_3 (scm_to_kvp, odb->guile_options, scm_slots, kvp_option_path);
-}
-
 /********************************************************************\
  * gnc_option_db_destroy                                            *
  *   unregister the scheme options and free all the memory          *
@@ -1386,29 +1342,6 @@
     return result;
 }
 
-#if 0
-static gint
-compare_option_names(gconstpointer a, gconstpointer b)
-{
-    GNCOption *oa = (GNCOption *) a;
-    GNCOption *ob = (GNCOption *) b;
-    char *name_a = gnc_option_name(oa);
-    char *name_b = gnc_option_name(ob);
-    gint result;
-
-    result = safe_strcmp(name_a, name_b);
-
-    if (name_a != NULL)
-        free(name_a);
-
-    if (name_b != NULL)
-        free(name_b);
-
-    return result;
-}
-#endif
-
-
 /********************************************************************\
  * gnc_option_db_dirty                                              *
  *   returns true if guile has registered more options into the     *

Modified: gnucash/trunk/src/app-utils/option-util.h
===================================================================
--- gnucash/trunk/src/app-utils/option-util.h	2011-11-17 21:27:40 UTC (rev 21570)
+++ gnucash/trunk/src/app-utils/option-util.h	2011-11-17 21:27:56 UTC (rev 21571)
@@ -47,7 +47,6 @@
 
 /***** Prototypes ********************************************************/
 
-gboolean gnc_option_get_changed (GNCOption *option);
 void gnc_option_set_changed (GNCOption *option, gboolean changed);
 
 /** Returns an opaque pointer to the widget of this option. The actual
@@ -73,7 +72,6 @@
  */
 GNCOptionDB * gnc_option_db_new_for_type(QofIdType id_type);
 void gnc_option_db_load_from_kvp(GNCOptionDB* odb, kvp_frame *slots);
-void gnc_option_db_save_to_kvp(GNCOptionDB* odb, kvp_frame *slots);
 
 void gnc_register_kvp_option_generator(QofIdType id_type, SCM generator);
 SCM gnc_make_kvp_options(QofIdType id_type);



More information about the gnucash-changes mailing list