r15369 - gnucash/branches/sx-cleanup/src - rename publically-exposed utility functions.

Josh Sled jsled at cvs.gnucash.org
Sat Jan 13 21:07:53 EST 2007


Author: jsled
Date: 2007-01-13 21:07:52 -0500 (Sat, 13 Jan 2007)
New Revision: 15369
Trac: http://svn.gnucash.org/trac/changeset/15369

Modified:
   gnucash/branches/sx-cleanup/src/app-utils/gnc-sx-instance-model.c
   gnucash/branches/sx-cleanup/src/app-utils/gnc-sx-instance-model.h
   gnucash/branches/sx-cleanup/src/doc/sx.rst
   gnucash/branches/sx-cleanup/src/gnome/dialog-sx-editor.c
Log:
rename publically-exposed utility functions.

Modified: gnucash/branches/sx-cleanup/src/app-utils/gnc-sx-instance-model.c
===================================================================
--- gnucash/branches/sx-cleanup/src/app-utils/gnc-sx-instance-model.c	2007-01-14 01:49:01 UTC (rev 15368)
+++ gnucash/branches/sx-cleanup/src/app-utils/gnc-sx-instance-model.c	2007-01-14 02:07:52 UTC (rev 15369)
@@ -95,9 +95,9 @@
 }
 
 int
-parse_vars_from_formula(const char *formula,
-                        GHashTable *var_hash,
-                        gnc_numeric *result)
+gnc_sx_parse_vars_from_formula(const char *formula,
+                               GHashTable *var_hash,
+                               gnc_numeric *result)
 {
      gnc_numeric num;
      char *errLoc = NULL;
@@ -205,7 +205,7 @@
                str = kvp_value_get_string(kvp_val);
                if (str && strlen(str) != 0)
                {
-                    parse_vars_from_formula(str, var_hash, NULL);
+                    gnc_sx_parse_vars_from_formula(str, var_hash, NULL);
                }
           }
 
@@ -218,7 +218,7 @@
                str = kvp_value_get_string(kvp_val);
                if (str && strlen(str) != 0)
                {
-                    parse_vars_from_formula(str, var_hash, NULL);
+                    gnc_sx_parse_vars_from_formula(str, var_hash, NULL);
                }
           }
      }
@@ -241,7 +241,7 @@
 }
 
 void
-sxsl_get_sx_vars(SchedXaction *sx, GHashTable *var_hash)
+gnc_sx_get_variables(SchedXaction *sx, GHashTable *var_hash)
 {
      Account *sx_template_acct;
      sx_template_acct = gnc_sx_get_template_transaction_account(sx);
@@ -264,7 +264,7 @@
 }
 
 void
-randomize_variables(GHashTable *vars)
+gnc_sx_randomize_variables(GHashTable *vars)
 {
      g_hash_table_foreach(vars, (GHFunc)_set_var_to_random_value, NULL);
 }
@@ -294,7 +294,7 @@
      if (! parent->variable_names_parsed)
      {
           parent->variable_names = g_hash_table_new(g_str_hash, g_str_equal);
-          sxsl_get_sx_vars(parent->sx, parent->variable_names);
+          gnc_sx_get_variables(parent->sx, parent->variable_names);
           g_hash_table_foreach(parent->variable_names, (GHFunc)_wipe_parsed_sx_var, NULL);
           parent->variable_names_parsed = TRUE;
      }

Modified: gnucash/branches/sx-cleanup/src/app-utils/gnc-sx-instance-model.h
===================================================================
--- gnucash/branches/sx-cleanup/src/app-utils/gnc-sx-instance-model.h	2007-01-14 01:49:01 UTC (rev 15368)
+++ gnucash/branches/sx-cleanup/src/app-utils/gnc-sx-instance-model.h	2007-01-14 02:07:52 UTC (rev 15369)
@@ -175,10 +175,9 @@
 void gnc_sx_instance_model_summarize(GncSxInstanceModel *model, GncSxSummary *summary);
 void gnc_sx_summary_print(GncSxSummary *summary);
 
-/* @@fixme names. */
-void sxsl_get_sx_vars(SchedXaction *sx, GHashTable *var_hash);
-int parse_vars_from_formula(const char *formula, GHashTable *var_hash, gnc_numeric *result);
-void randomize_variables(GHashTable *vars);
+void gnc_sx_get_variables(SchedXaction *sx, GHashTable *var_hash);
+int gnc_sx_parse_vars_from_formula(const char *formula, GHashTable *var_hash, gnc_numeric *result);
+void gnc_sx_randomize_variables(GHashTable *vars);
 
 G_END_DECLS
 

Modified: gnucash/branches/sx-cleanup/src/doc/sx.rst
===================================================================
--- gnucash/branches/sx-cleanup/src/doc/sx.rst	2007-01-14 01:49:01 UTC (rev 15368)
+++ gnucash/branches/sx-cleanup/src/doc/sx.rst	2007-01-14 02:07:52 UTC (rev 15369)
@@ -34,8 +34,8 @@
     - [x] open SLR dialog, create new SX, see it populated
     - [x] open SX editor dialog, run SLR, see next-instance update
     - [/] unit testing
-  - [ ] rename, re-home gnc-sx-instance-model:sxsl_get_sx_vars
-  - [ ] rename, re-home gnc-sx-instance-model:parse_vars_from_formula
+  - [x] rename, re-home gnc-sx-instance-model:sxsl_get_sx_vars
+  - [x] rename, re-home gnc-sx-instance-model:parse_vars_from_formula
 
 - sx list page
   - [ ] make into split panel

Modified: gnucash/branches/sx-cleanup/src/gnome/dialog-sx-editor.c
===================================================================
--- gnucash/branches/sx-cleanup/src/gnome/dialog-sx-editor.c	2007-01-14 01:49:01 UTC (rev 15368)
+++ gnucash/branches/sx-cleanup/src/gnome/dialog-sx-editor.c	2007-01-14 02:07:52 UTC (rev 15369)
@@ -555,7 +555,7 @@
                 gnc_split_register_save ( gnc_ledger_display_get_split_register(sxed->ledger),
                                           FALSE );
                 /* numeric-formulas-get-balanced determination */
-                sxsl_get_sx_vars( sxed->sx, vars );
+                gnc_sx_get_variables( sxed->sx, vars );
 
                 ttVarCount = g_hash_table_size( vars );
                 if ( ttVarCount != 0 ) {
@@ -573,7 +573,7 @@
 
                 srand(time(NULL));
                 for ( i=0; i < numIters && !unbalanceable; i++ ) {
-                        randomize_variables(vars);
+                        gnc_sx_randomize_variables(vars);
                         g_hash_table_foreach( txns, set_sums_to_zero, NULL );
                         tmp = gnc_numeric_zero();
 
@@ -623,7 +623,7 @@
                                 if ( v
                                      && (str = kvp_value_get_string(v))
                                      && strlen( str ) != 0 ) {
-                                        if ( parse_vars_from_formula( str, vars, &tmp ) < 0 ) {
+                                        if ( gnc_sx_parse_vars_from_formula( str, vars, &tmp ) < 0 ) {
                                                 GString *errStr;
 
                                                 errStr = g_string_sized_new( 32 );
@@ -649,7 +649,7 @@
                                 if ( v
                                      && (str = kvp_value_get_string(v))
                                      && strlen(str) != 0 ) {
-                                        if ( parse_vars_from_formula( str, vars, &tmp ) < 0 ) {
+                                        if ( gnc_sx_parse_vars_from_formula( str, vars, &tmp ) < 0 ) {
                                                 GString *errStr;
 
                                                 errStr = g_string_sized_new( 32 );



More information about the gnucash-changes mailing list