r22686 - gnucash/trunk/src - Normalize naming convention for guile convenience functions

Geert Janssens gjanssens at code.gnucash.org
Sat Dec 22 13:20:53 EST 2012


Author: gjanssens
Date: 2012-12-22 13:20:53 -0500 (Sat, 22 Dec 2012)
New Revision: 22686
Trac: http://svn.gnucash.org/trac/changeset/22686

Modified:
   gnucash/trunk/src/app-utils/option-util.c
   gnucash/trunk/src/core-utils/gnc-guile-utils.c
   gnucash/trunk/src/core-utils/gnc-guile-utils.h
   gnucash/trunk/src/gnome-utils/gnc-menu-extensions.c
   gnucash/trunk/src/import-export/qif-import/assistant-qif-import.c
   gnucash/trunk/src/report/report-gnome/dialog-report-style-sheet.c
   gnucash/trunk/src/report/report-system/gnc-report.c
Log:
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

Modified: gnucash/trunk/src/app-utils/option-util.c
===================================================================
--- gnucash/trunk/src/app-utils/option-util.c	2012-12-22 18:20:39 UTC (rev 22685)
+++ gnucash/trunk/src/app-utils/option-util.c	2012-12-22 18:20:53 UTC (rev 22686)
@@ -594,7 +594,7 @@
 {
     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 @@
 {
     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 @@
 {
     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 @@
 {
     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 @@
 {
     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 @@
 {
     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 @@
 {
     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 @@
 {
     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 @@
 {
     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 @@
 
     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 @@
 
     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);
 }
 
 /*******************************************************************\

Modified: gnucash/trunk/src/core-utils/gnc-guile-utils.c
===================================================================
--- gnucash/trunk/src/core-utils/gnc-guile-utils.c	2012-12-22 18:20:39 UTC (rev 22685)
+++ gnucash/trunk/src/core-utils/gnc-guile-utils.c	2012-12-22 18:20:53 UTC (rev 22686)
@@ -91,7 +91,7 @@
 
 
 /********************************************************************\
- * 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 @@
  * 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_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 @@
  * 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_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 @@
  * 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_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 @@
  * 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_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 @@
  * 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;
 

Modified: gnucash/trunk/src/core-utils/gnc-guile-utils.h
===================================================================
--- gnucash/trunk/src/core-utils/gnc-guile-utils.h	2012-12-22 18:20:39 UTC (rev 22685)
+++ gnucash/trunk/src/core-utils/gnc-guile-utils.h	2012-12-22 18:20:53 UTC (rev 22686)
@@ -42,10 +42,17 @@
 /* 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

Modified: gnucash/trunk/src/gnome-utils/gnc-menu-extensions.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-menu-extensions.c	2012-12-22 18:20:39 UTC (rev 22685)
+++ gnucash/trunk/src/gnome-utils/gnc-menu-extensions.c	2012-12-22 18:20:53 UTC (rev 22686)
@@ -80,7 +80,7 @@
 
     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 @@
 {
     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 @@
 {
     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 @@
 {
     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 @@
 
     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 @@
 
     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.");

Modified: gnucash/trunk/src/import-export/qif-import/assistant-qif-import.c
===================================================================
--- gnucash/trunk/src/import-export/qif-import/assistant-qif-import.c	2012-12-22 18:20:39 UTC (rev 22685)
+++ gnucash/trunk/src/import-export/qif-import/assistant-qif-import.c	2012-12-22 18:20:53 UTC (rev 22686)
@@ -303,8 +303,8 @@
 
     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 @@
         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 @@
         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,

Modified: gnucash/trunk/src/report/report-gnome/dialog-report-style-sheet.c
===================================================================
--- gnucash/trunk/src/report/report-gnome/dialog-report-style-sheet.c	2012-12-22 18:20:39 UTC (rev 22685)
+++ gnucash/trunk/src/report/report-gnome/dialog-report-style-sheet.c	2012-12-22 18:20:53 UTC (rev 22686)
@@ -209,7 +209,7 @@
         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 @@
     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;
 

Modified: gnucash/trunk/src/report/report-system/gnc-report.c
===================================================================
--- gnucash/trunk/src/report/report-system/gnc-report.c	2012-12-22 18:20:39 UTC (rev 22685)
+++ gnucash/trunk/src/report/report-system/gnc-report.c	2012-12-22 18:20:53 UTC (rev 22686)
@@ -188,7 +188,7 @@
     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*



More information about the gnucash-changes mailing list