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

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21571 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
John Ralls committed 2011-11-17 21:27:56 +00:00
1 parent a2cd913a5c
commit f4749ef3ed
16 files changed
+6 -272

No files matched your search

-8
View File
@@ -466,14 +466,6 @@ gnc_gui_component_watch_entity (gint component_id,
add_event (&ci->watch_info, entity, event_mask, FALSE);
}
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,
-13
View File
@@ -173,19 +173,6 @@ void gnc_gui_component_watch_entity (gint component_id,
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.
*
-16
View File
@@ -100,22 +100,6 @@ gnc_euro_rate_compare_code (const void * key, const void * value)
/* ------------------------------------------------------ */
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)
{
-1
View File
@@ -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,
-47
View File
@@ -165,19 +165,6 @@ prepend_name (gpointer key, gpointer value, gpointer data)
*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)
{
@@ -199,40 +186,6 @@ gnc_exp_parser_remove_variable (const char *variable_name)
}
}
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)
{
-14
View File
@@ -52,23 +52,9 @@ void gnc_exp_parser_real_init( gboolean addPredefined );
/* 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,
-34
View File
@@ -95,25 +95,6 @@ gnc_scm2printinfo(SCM info_scm)
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 @@ gnc_quoteinfo2scm(gnc_commodity *comm)
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);
}
-2
View File
@@ -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 @@ int gnc_printinfo_p(SCM info_scm);
*/
SCM gnc_quoteinfo2scm(gnc_commodity *com);
SCM gnc_parse_amount_helper (const char * string, gboolean monetary);
#endif
+1 -8
View File
@@ -1685,14 +1685,6 @@ instantiate_cashflow_internal(const SchedXaction* sx,
&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 @@ void gnc_sx_all_instantiate_cashflow(GList *all_sxes,
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();
-14
View File
@@ -228,20 +228,6 @@ void gnc_sx_randomize_variables(GHashTable *vars);
* 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
+2 -2
View File
@@ -95,7 +95,7 @@ gnc_ui_account_get_balance (const Account *account, gboolean recurse)
* 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 @@ gnc_ui_account_get_balance_in_currency (const Account *account,
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.
+3 -3
View File
@@ -55,9 +55,9 @@ gnc_ui_account_get_balance_full (xaccGetBalanceInCurrencyFn fn,
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.
-33
View File
@@ -146,18 +146,6 @@ gnc_reverse_balance_init (void)
reverse_balance_inited = TRUE;
}
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)
{
@@ -2260,24 +2248,3 @@ gnc_ui_util_init (void)
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
-8
View File
@@ -44,7 +44,6 @@ typedef QofSession * (*QofSessionCB) (void);
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 @@ xaccParseAmountExtended (const char * in_str, gboolean monetary,
void gnc_ui_util_init (void);
/* Missing functions ************************************************/
#ifndef HAVE_TOWUPPER
gint32 towupper (gint32 wc);
int iswlower (gint32 wc);
#endif
#endif
/** @} */
/** @} */
-67
View File
@@ -125,14 +125,6 @@ static int last_db_handle = 0;
/*******************************************************************/
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 @@ gnc_option_db_load_from_kvp(GNCOptionDB* odb, kvp_frame *slots)
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 @@ compare_option_tags(gconstpointer a, gconstpointer b)
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 *
-2
View File
@@ -47,7 +47,6 @@ typedef void (*GNCOptionChangeCallback) (gpointer user_data);
/***** 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 @@ void gnc_option_db_destroy(GNCOptionDB *odb);
*/
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);