Normalize naming convention for guile convenience functions

Let them all start with gnc_scm_*
Copy the guile naming convention as close as possible for the remainder

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22686 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Geert Janssens 2012-12-22 18:20:53 +00:00
parent 5666e5bd6d
commit feb2eac9e4
7 changed files with 46 additions and 39 deletions

View File

@ -594,7 +594,7 @@ gnc_option_section(GNCOption *option)
{
initialize_getters();
return gnc_guile_call1_to_string(getters.section, option->guile_option);
return gnc_scm_call_1_to_string(getters.section, option->guile_option);
}
@ -611,7 +611,7 @@ gnc_option_name(GNCOption *option)
{
initialize_getters();
return gnc_guile_call1_to_string(getters.name, option->guile_option);
return gnc_scm_call_1_to_string(getters.name, option->guile_option);
}
@ -628,7 +628,7 @@ gnc_option_type(GNCOption *option)
{
initialize_getters();
return gnc_guile_call1_symbol_to_string(getters.type,
return gnc_scm_call_1_symbol_to_string(getters.type,
option->guile_option);
}
@ -646,7 +646,7 @@ gnc_option_sort_tag(GNCOption *option)
{
initialize_getters();
return gnc_guile_call1_to_string(getters.sort_tag, option->guile_option);
return gnc_scm_call_1_to_string(getters.sort_tag, option->guile_option);
}
@ -663,7 +663,7 @@ gnc_option_documentation(GNCOption *option)
{
initialize_getters();
return gnc_guile_call1_to_string(getters.documentation,
return gnc_scm_call_1_to_string(getters.documentation,
option->guile_option);
}
@ -681,7 +681,7 @@ gnc_option_getter(GNCOption *option)
{
initialize_getters();
return gnc_guile_call1_to_procedure(getters.getter,
return gnc_scm_call_1_to_procedure(getters.getter,
option->guile_option);
}
@ -699,7 +699,7 @@ gnc_option_setter(GNCOption *option)
{
initialize_getters();
return gnc_guile_call1_to_procedure(getters.setter,
return gnc_scm_call_1_to_procedure(getters.setter,
option->guile_option);
}
@ -717,7 +717,7 @@ gnc_option_default_getter(GNCOption *option)
{
initialize_getters();
return gnc_guile_call1_to_procedure(getters.default_getter,
return gnc_scm_call_1_to_procedure(getters.default_getter,
option->guile_option);
}
@ -735,7 +735,7 @@ gnc_option_value_validator(GNCOption *option)
{
initialize_getters();
return gnc_guile_call1_to_procedure(getters.value_validator,
return gnc_scm_call_1_to_procedure(getters.value_validator,
option->guile_option);
}
@ -2579,7 +2579,7 @@ gnc_option_date_option_get_subtype(GNCOption *option)
initialize_getters();
return gnc_guile_call1_symbol_to_string(getters.date_option_subtype, option->guile_option);
return gnc_scm_call_1_symbol_to_string(getters.date_option_subtype, option->guile_option);
}
/*******************************************************************\
@ -2596,7 +2596,7 @@ gnc_date_option_value_get_type (SCM option_value)
initialize_getters();
return gnc_guile_call1_symbol_to_string (getters.date_option_value_type, option_value);
return gnc_scm_call_1_symbol_to_string (getters.date_option_value_type, option_value);
}
/*******************************************************************\

View File

@ -91,7 +91,7 @@ gnc_scm_symbol_to_locale_string(SCM symbol_value)
/********************************************************************\
* gnc_guile_call1_to_string *
* gnc_scm_call_1_to_string *
* returns the malloc'ed string returned by the guile function *
* or NULL if it can't be retrieved *
* *
@ -100,7 +100,7 @@ gnc_scm_symbol_to_locale_string(SCM symbol_value)
* Returns: g_malloc'ed char * or NULL must be freed with g_free *
\********************************************************************/
char *
gnc_guile_call1_to_string(SCM func, SCM arg)
gnc_scm_call_1_to_string(SCM func, SCM arg)
{
SCM value;
@ -127,7 +127,7 @@ gnc_guile_call1_to_string(SCM func, SCM arg)
/********************************************************************\
* gnc_guile_call1_symbol_to_string *
* gnc_scm_call_1_symbol_to_string *
* returns the malloc'ed string returned by the guile function *
* or NULL if it can't be retrieved. The return value of the *
* function should be a symbol. *
@ -137,7 +137,7 @@ gnc_guile_call1_to_string(SCM func, SCM arg)
* Returns: malloc'ed char * or NULL *
\********************************************************************/
char *
gnc_guile_call1_symbol_to_string(SCM func, SCM arg)
gnc_scm_call_1_symbol_to_string(SCM func, SCM arg)
{
SCM symbol_value;
@ -156,7 +156,7 @@ gnc_guile_call1_symbol_to_string(SCM func, SCM arg)
/********************************************************************\
* gnc_guile_call1_to_procedure *
* gnc_scm_call_1_to_procedure *
* returns the SCM handle to the procedure returned by the guile *
* function, or SCM_UNDEFINED if it couldn't be retrieved. *
* *
@ -165,7 +165,7 @@ gnc_guile_call1_symbol_to_string(SCM func, SCM arg)
* Returns: SCM function handle or SCM_UNDEFINED *
\********************************************************************/
SCM
gnc_guile_call1_to_procedure(SCM func, SCM arg)
gnc_scm_call_1_to_procedure(SCM func, SCM arg)
{
SCM value;
@ -190,7 +190,7 @@ gnc_guile_call1_to_procedure(SCM func, SCM arg)
/********************************************************************\
* gnc_guile_call1_to_list *
* gnc_scm_call_1_to_list *
* returns the SCM handle to the list returned by the guile *
* function, or SCM_UNDEFINED if it couldn't be retrieved. *
* *
@ -199,7 +199,7 @@ gnc_guile_call1_to_procedure(SCM func, SCM arg)
* Returns: SCM list handle or SCM_UNDEFINED *
\********************************************************************/
SCM
gnc_guile_call1_to_list(SCM func, SCM arg)
gnc_scm_call_1_to_list(SCM func, SCM arg)
{
SCM value;
@ -224,7 +224,7 @@ gnc_guile_call1_to_list(SCM func, SCM arg)
/********************************************************************\
* gnc_guile_call1_to_vector *
* gnc_scm_call_1_to_vector *
* returns the SCM handle to the vector returned by the guile *
* function, or SCM_UNDEFINED if it couldn't be retrieved. *
* *
@ -233,7 +233,7 @@ gnc_guile_call1_to_list(SCM func, SCM arg)
* Returns: SCM vector handle or SCM_UNDEFINED *
\********************************************************************/
SCM
gnc_guile_call1_to_vector(SCM func, SCM arg)
gnc_scm_call_1_to_vector(SCM func, SCM arg)
{
SCM value;

View File

@ -42,10 +42,17 @@ gchar * gnc_scm_symbol_to_locale_string(SCM scm_string);
/* Helpful functions for calling functions that return
* specific kinds of values. These functions do error
* checking to verify the result is of the correct type. */
char * gnc_guile_call1_to_string(SCM func, SCM arg);
char * gnc_guile_call1_symbol_to_string(SCM func, SCM arg);
SCM gnc_guile_call1_to_procedure(SCM func, SCM arg);
SCM gnc_guile_call1_to_list(SCM func, SCM arg);
SCM gnc_guile_call1_to_vector(SCM func, SCM arg);
char * gnc_scm_call_1_to_string(SCM func, SCM arg);
char * gnc_scm_call_1_symbol_to_string(SCM func, SCM arg);
SCM gnc_scm_call_1_to_procedure(SCM func, SCM arg);
SCM gnc_scm_call_1_to_list(SCM func, SCM arg);
SCM gnc_scm_call_1_to_vector(SCM func, SCM arg);
/* Deprectated functions, will be removed soon */
#define gnc_guile_call1_to_string gnc_scm_call_1_to_string
#define gnc_guile_call1_symbol_to_string gnc_scm_call_1_symbol_to_string
#define gnc_guile_call1_to_procedure gnc_scm_call_1_to_procedure
#define gnc_guile_call1_to_list gnc_scm_call_1_to_list
#define gnc_guile_call1_to_vector gnc_scm_call_1_to_vector
#endif

View File

@ -80,7 +80,7 @@ gnc_extension_type (SCM extension, GtkUIManagerItemType *type)
initialize_getters();
string = gnc_guile_call1_symbol_to_string(getters.type, extension);
string = gnc_scm_call_1_symbol_to_string(getters.type, extension);
if (string == NULL)
{
PERR("bad type");
@ -116,7 +116,7 @@ gnc_extension_name (SCM extension)
{
initialize_getters();
return gnc_guile_call1_to_string(getters.name, extension);
return gnc_scm_call_1_to_string(getters.name, extension);
}
@ -126,7 +126,7 @@ gnc_extension_guid (SCM extension)
{
initialize_getters();
return gnc_guile_call1_to_string(getters.guid, extension);
return gnc_scm_call_1_to_string(getters.guid, extension);
}
@ -136,7 +136,7 @@ gnc_extension_documentation (SCM extension)
{
initialize_getters();
return gnc_guile_call1_to_string(getters.documentation, extension);
return gnc_scm_call_1_to_string(getters.documentation, extension);
}
/* returns g_malloc'd path */
@ -150,7 +150,7 @@ gnc_extension_path (SCM extension, char **fullpath)
initialize_getters();
path = gnc_guile_call1_to_list(getters.path, extension);
path = gnc_scm_call_1_to_list(getters.path, extension);
if ((path == SCM_UNDEFINED) || scm_is_null(path))
{
*fullpath = g_strdup("");
@ -241,7 +241,7 @@ gnc_extension_invoke_cb (SCM extension, SCM window)
initialize_getters();
script = gnc_guile_call1_to_procedure(getters.script, extension);
script = gnc_scm_call_1_to_procedure(getters.script, extension);
if (script == SCM_UNDEFINED)
{
PERR("not a procedure.");

View File

@ -303,8 +303,8 @@ update_account_picker_page(QIFImportWindow * wind, SCM make_display,
while (!scm_is_null(accts_left))
{
qif_name = gnc_guile_call1_to_string(get_qif_name, SCM_CAR(accts_left));
gnc_name = gnc_guile_call1_to_string(get_gnc_name, SCM_CAR(accts_left));
qif_name = gnc_scm_call_1_to_string(get_qif_name, SCM_CAR(accts_left));
gnc_name = gnc_scm_call_1_to_string(get_gnc_name, SCM_CAR(accts_left));
checked = (scm_call_1(get_new, SCM_CAR(accts_left)) == SCM_BOOL_T);
gtk_list_store_append(store, &iter);
@ -2055,7 +2055,7 @@ gnc_ui_qif_import_account_prepare (GtkAssistant *assistant, gpointer user_data)
SCM default_acct = scm_c_eval_string("qif-file:path-to-accountname");
gchar * default_acctname = NULL;
default_acctname = gnc_guile_call1_to_string(default_acct, wind->selected_file);
default_acctname = gnc_scm_call_1_to_string(default_acct, wind->selected_file);
gtk_entry_set_text(GTK_ENTRY(wind->acct_entry), default_acctname);
g_free (default_acctname);
}
@ -2206,7 +2206,7 @@ update_file_page(QIFImportWindow * wind)
SCM scm_qiffile = SCM_BOOL_F;
scm_qiffile = SCM_CAR(loaded_file_list);
row_text = gnc_guile_call1_to_string(qif_file_path, scm_qiffile);
row_text = gnc_scm_call_1_to_string(qif_file_path, scm_qiffile);
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,

View File

@ -209,7 +209,7 @@ gnc_style_sheet_new (StyleSheetDialog * ssd)
gchar* orig_name;
SCM t = SCM_CAR(templates);
orig_name = gnc_guile_call1_to_string(t_name, t);
orig_name = gnc_scm_call_1_to_string(t_name, t);
/* Store the untranslated names for lookup later */
template_names = g_list_prepend (template_names, (gpointer)orig_name);
@ -269,7 +269,7 @@ gnc_style_sheet_select_dialog_add_one(StyleSheetDialog * ss,
GtkTreeIter iter;
get_name = scm_c_eval_string ("gnc:html-style-sheet-name");
c_name = gnc_guile_call1_to_string (get_name, sheet_info);
c_name = gnc_scm_call_1_to_string (get_name, sheet_info);
if (!c_name)
return;

View File

@ -188,7 +188,7 @@ gnc_report_name( SCM report )
if (report == SCM_BOOL_F)
return NULL;
return gnc_guile_call1_to_string(get_name, report);
return gnc_scm_call_1_to_string(get_name, report);
}
gchar*