r18541 - gnucash/trunk/src - Fix bug #582325 by refactoring some deprecated guile functions:
Geert Janssens
gjanssens at code.gnucash.org
Thu Dec 31 09:41:12 EST 2009
Author: gjanssens
Date: 2009-12-31 09:41:12 -0500 (Thu, 31 Dec 2009)
New Revision: 18541
Trac: http://svn.gnucash.org/trac/changeset/18541
Modified:
gnucash/trunk/src/app-utils/app-utils.i
gnucash/trunk/src/app-utils/file-utils.c
gnucash/trunk/src/app-utils/gfec.c
gnucash/trunk/src/app-utils/gnc-exp-parser.c
gnucash/trunk/src/app-utils/gnc-helpers.c
gnucash/trunk/src/app-utils/gnc-ui-util.c
gnucash/trunk/src/app-utils/guile-util.c
gnucash/trunk/src/app-utils/option-util.c
gnucash/trunk/src/app-utils/test/test-print-queries.c
gnucash/trunk/src/app-utils/test/test-scm-query-string.c
gnucash/trunk/src/base-typemaps.i
gnucash/trunk/src/bin/gnucash-bin.c
gnucash/trunk/src/business/business-core/business-core.i
gnucash/trunk/src/business/business-core/gncBusGuile.c
gnucash/trunk/src/business/business-gnome/dialog-invoice.c
gnucash/trunk/src/engine/engine-helpers.c
gnucash/trunk/src/engine/engine.i
gnucash/trunk/src/engine/glib-helpers.c
gnucash/trunk/src/engine/gnc-hooks.c
gnucash/trunk/src/engine/kvp-scm.c
gnucash/trunk/src/gnome-utils/dialog-options.c
gnucash/trunk/src/gnome-utils/dialog-transfer.c
gnucash/trunk/src/gnome-utils/gnc-main-window.c
gnucash/trunk/src/gnome-utils/gnc-menu-extensions.c
gnucash/trunk/src/gnome/dialog-price-edit-db.c
gnucash/trunk/src/gnome/dialog-progress.c
gnucash/trunk/src/gnome/dialog-tax-info.c
gnucash/trunk/src/gnome/gnc-plugin-page-register.c
gnucash/trunk/src/guile-mappings.h
gnucash/trunk/src/import-export/qif-import/dialog-account-picker.c
gnucash/trunk/src/import-export/qif-import/druid-qif-import.c
gnucash/trunk/src/report/report-gnome/dialog-column-view.c
gnucash/trunk/src/report/report-gnome/dialog-custom-report.c
gnucash/trunk/src/report/report-gnome/dialog-style-sheet.c
gnucash/trunk/src/report/report-gnome/gnc-plugin-page-report.c
gnucash/trunk/src/report/report-gnome/window-report.c
gnucash/trunk/src/report/report-system/gnc-report.c
Log:
Fix bug #582325 by refactoring some deprecated guile functions:
SCM_BOOLP -> scm_is_bool
SCM_NULLP -> scm_is_null
SCM_FALSEP -> scm_is_false
SCM_NFALSEP -> scm_is_true
SCM_VECTORP -> scm_is_vector
SCM_NUMBERP -> scm_is_number
SCM_CONSP -> scm_is_pair
SCM_STRING_CHARS -> scm_to_locale_string
Specifically the replacement of SCM_STRING_CHARS with scm_to_locale_string fixes Bug #582325
Additionally, I have renamed these internal functions for global consistency:
SCM_PROCEDUREP -> scm_is_procedure
SCM_LISTP -> scm_is_list
SCM_EXACTP -> scm_is_exact
SCM_EQUALP -> scm_is_equal
Modified: gnucash/trunk/src/app-utils/app-utils.i
===================================================================
--- gnucash/trunk/src/app-utils/app-utils.i 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/app-utils/app-utils.i 2009-12-31 14:41:12 UTC (rev 18541)
@@ -91,13 +91,13 @@
%typemap(in) GList * {
SCM path_scm = $input;
GList *path = NULL;
- while (!SCM_NULLP (path_scm))
+ while (!scm_is_null (path_scm))
{
SCM key_scm = SCM_CAR (path_scm);
char *key;
- if (!SCM_STRINGP (key_scm))
+ if (!scm_is_string (key_scm))
break;
- key = g_strdup (SCM_STRING_CHARS (key_scm));
+ key = g_strdup (scm_to_locale_string (key_scm));
path = g_list_prepend (path, key);
path_scm = SCM_CDR (path_scm);
}
Modified: gnucash/trunk/src/app-utils/file-utils.c
===================================================================
--- gnucash/trunk/src/app-utils/file-utils.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/app-utils/file-utils.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -60,8 +60,8 @@
scm_filename = scm_makfrom0str ((char *) filename);
scm_result = scm_call_1(find_doc_file, scm_filename);
- if (SCM_STRINGP(scm_result))
- full_filename = SCM_STRING_CHARS(scm_result);
+ if (scm_is_string(scm_result))
+ full_filename = scm_to_locale_string(scm_result);
return g_strdup (full_filename);
}
Modified: gnucash/trunk/src/app-utils/gfec.c
===================================================================
--- gnucash/trunk/src/app-utils/gfec.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/app-utils/gfec.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -25,14 +25,14 @@
{
SCM func;
SCM result;
- char *msg = NULL;
+ const char *msg = NULL;
func = scm_c_eval_string("gnc:error->string");
- if (SCM_PROCEDUREP(func))
+ if (scm_is_procedure(func))
{
result = scm_call_2(func, tag, throw_args);
- if (SCM_STRINGP(result))
- msg = SCM_STRING_CHARS(result);
+ if (scm_is_string(result))
+ msg = scm_to_locale_string(result);
}
if (msg == NULL)
Modified: gnucash/trunk/src/app-utils/gnc-exp-parser.c
===================================================================
--- gnucash/trunk/src/app-utils/gnc-exp-parser.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/app-utils/gnc-exp-parser.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -350,7 +350,7 @@
(scm_t_catch_body)scm_c_eval_string, realFnName->str,
scm_handle_by_message_noexit, NULL);
g_string_free( realFnName, TRUE );
- if (!SCM_PROCEDUREP(scmFn))
+ if (!scm_is_procedure(scmFn))
{
/* FIXME: handle errors correctly. */
printf( "gnc:\"%s\" is not a scm procedure\n", fname );
Modified: gnucash/trunk/src/app-utils/gnc-helpers.c
===================================================================
--- gnucash/trunk/src/app-utils/gnc-helpers.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/app-utils/gnc-helpers.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -75,22 +75,22 @@
G_STRFUNC);
info_scm = SCM_CDR (info_scm);
- info.use_separators = SCM_NFALSEP (SCM_CAR (info_scm));
+ info.use_separators = scm_is_true (SCM_CAR (info_scm));
info_scm = SCM_CDR (info_scm);
- info.use_symbol = SCM_NFALSEP (SCM_CAR (info_scm));
+ info.use_symbol = scm_is_true (SCM_CAR (info_scm));
info_scm = SCM_CDR (info_scm);
- info.use_locale = SCM_NFALSEP (SCM_CAR (info_scm));
+ info.use_locale = scm_is_true (SCM_CAR (info_scm));
info_scm = SCM_CDR (info_scm);
- info.monetary = SCM_NFALSEP (SCM_CAR (info_scm));
+ info.monetary = scm_is_true (SCM_CAR (info_scm));
info_scm = SCM_CDR (info_scm);
- info.force_fit = SCM_NFALSEP (SCM_CAR (info_scm));
+ info.force_fit = scm_is_true (SCM_CAR (info_scm));
info_scm = SCM_CDR (info_scm);
- info.round = SCM_NFALSEP (SCM_CAR (info_scm));
+ info.round = scm_is_true (SCM_CAR (info_scm));
return info;
}
@@ -100,11 +100,11 @@
{
const gchar *symbol;
- if (!SCM_LISTP(info_scm) || SCM_NULLP(info_scm))
+ if (!scm_is_list(info_scm) || scm_is_null(info_scm))
return 0;
info_scm = SCM_CAR (info_scm);
- if (!SCM_SYMBOLP (info_scm))
+ if (!scm_is_symbol (info_scm))
return 0;
symbol = SCM_SYMBOL_CHARS (info_scm);
Modified: gnucash/trunk/src/app-utils/gnc-ui-util.c
===================================================================
--- gnucash/trunk/src/app-utils/gnc-ui-util.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/app-utils/gnc-ui-util.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -526,8 +526,8 @@
("(false-if-exception gnc:txf-get-description)");
}
- g_return_val_if_fail (SCM_PROCEDUREP (get_form), NULL);
- g_return_val_if_fail (SCM_PROCEDUREP (get_desc), NULL);
+ g_return_val_if_fail (scm_is_procedure (get_form), NULL);
+ g_return_val_if_fail (scm_is_procedure (get_desc), NULL);
category = scm_c_eval_string (atype == ACCT_TYPE_INCOME ?
"txf-income-categories" :
@@ -559,7 +559,7 @@
code_scm = scm_str2symbol (code);
scm = scm_call_3 (get_form, category, code_scm, tax_entity_type);
- if (!SCM_STRINGP (scm))
+ if (!scm_is_string (scm))
{
if (tax_related)
return g_strdup_printf
@@ -569,7 +569,7 @@
(_("Not tax-related; invalid code %s for tax type %s"), code, tax_type);
}
- form = SCM_STRING_CHARS (scm);
+ form = scm_to_locale_string (scm);
if (!form)
{
if (tax_related)
@@ -581,7 +581,7 @@
}
scm = scm_call_3 (get_desc, category, code_scm, tax_entity_type);
- if (!SCM_STRINGP (scm))
+ if (!scm_is_string (scm))
{
if (tax_related)
return g_strdup_printf
@@ -593,7 +593,7 @@
form, code, tax_type);
}
- desc = SCM_STRING_CHARS (scm);
+ desc = scm_to_locale_string (scm);
if (!desc)
{
if (tax_related)
Modified: gnucash/trunk/src/app-utils/guile-util.c
===================================================================
--- gnucash/trunk/src/app-utils/guile-util.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/app-utils/guile-util.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -154,12 +154,12 @@
{
SCM value;
- if (SCM_PROCEDUREP(func))
+ if (scm_is_procedure(func))
{
value = scm_call_1(func, arg);
- if (SCM_STRINGP(value))
- return g_strdup(SCM_STRING_CHARS(value));
+ if (scm_is_string(value))
+ return g_strdup(scm_to_locale_string(value));
else
{
PERR("bad value\n");
@@ -189,11 +189,11 @@
{
SCM value;
- if (SCM_PROCEDUREP(func))
+ if (scm_is_procedure(func))
{
value = scm_call_1(func, arg);
- if (SCM_SYMBOLP(value))
+ if (scm_is_symbol(value))
return g_strdup(SCM_SYMBOL_CHARS(value));
else
{
@@ -223,11 +223,11 @@
{
SCM value;
- if (SCM_PROCEDUREP(func))
+ if (scm_is_procedure(func))
{
value = scm_call_1(func, arg);
- if (SCM_PROCEDUREP(value))
+ if (scm_is_procedure(value))
return value;
else
{
@@ -257,11 +257,11 @@
{
SCM value;
- if (SCM_PROCEDUREP(func))
+ if (scm_is_procedure(func))
{
value = scm_call_1(func, arg);
- if (SCM_LISTP(value))
+ if (scm_is_list(value))
return value;
else
{
@@ -291,11 +291,11 @@
{
SCM value;
- if (SCM_PROCEDUREP(func))
+ if (scm_is_procedure(func))
{
value = scm_call_1(func, arg);
- if (SCM_VECTORP(value))
+ if (scm_is_vector(value))
return value;
else
{
@@ -393,7 +393,7 @@
return SCM_UNDEFINED;
func = scm_c_eval_string("gnc:split->split-scm");
- if (!SCM_PROCEDUREP(func))
+ if (!scm_is_procedure(func))
return SCM_UNDEFINED;
if (!split_type)
@@ -431,15 +431,15 @@
g_return_if_fail (book);
func = scm_c_eval_string("gnc:split-scm?");
- if (!SCM_PROCEDUREP(func))
+ if (!scm_is_procedure(func))
return;
result = scm_call_1(func, split_scm);
- if (!SCM_NFALSEP(result))
+ if (!scm_is_true(result))
return;
func = scm_c_eval_string("gnc:split-scm-onto-split");
- if (!SCM_PROCEDUREP(func))
+ if (!scm_is_procedure(func))
return;
if (!split_type)
@@ -463,7 +463,7 @@
{
initialize_scm_functions();
- return SCM_NFALSEP(scm_call_1(predicates.is_split_scm, scm));
+ return scm_is_true(scm_call_1(predicates.is_split_scm, scm));
}
@@ -479,7 +479,7 @@
{
initialize_scm_functions();
- return SCM_NFALSEP(scm_call_1(predicates.is_trans_scm, scm));
+ return scm_is_true(scm_call_1(predicates.is_trans_scm, scm));
}
@@ -654,10 +654,10 @@
return NULL;
result = scm_call_1(getters.split_scm_memo, split_scm);
- if (!SCM_STRINGP(result))
+ if (!scm_is_string(result))
return NULL;
- return g_strdup(SCM_STRING_CHARS(result));
+ return g_strdup(scm_to_locale_string(result));
}
@@ -679,10 +679,10 @@
return NULL;
result = scm_call_1(getters.split_scm_action, split_scm);
- if (!SCM_STRINGP(result))
+ if (!scm_is_string(result))
return NULL;
- return g_strdup(SCM_STRING_CHARS(result));
+ return g_strdup(scm_to_locale_string(result));
}
@@ -756,7 +756,7 @@
return SCM_UNDEFINED;
func = scm_c_eval_string("gnc:transaction->transaction-scm");
- if (!SCM_PROCEDUREP(func))
+ if (!scm_is_procedure(func))
return SCM_UNDEFINED;
if (!trans_type)
@@ -821,15 +821,15 @@
g_return_if_fail (book);
func = scm_c_eval_string("gnc:transaction-scm?");
- if (!SCM_PROCEDUREP(func))
+ if (!scm_is_procedure(func))
return;
result = scm_call_1(func, trans_scm);
- if (!SCM_NFALSEP(result))
+ if (!scm_is_true(result))
return;
func = scm_c_eval_string("gnc:transaction-scm-onto-transaction");
- if (!SCM_PROCEDUREP(func))
+ if (!scm_is_procedure(func))
return;
if (!trans_type)
@@ -1077,7 +1077,7 @@
result = scm_call_1(getters.trans_scm_split_scms, trans_scm);
- if (!SCM_LISTP(result))
+ if (!scm_is_list(result))
return 0;
return SCM_LENGTH(result);
@@ -1109,10 +1109,10 @@
arg = scm_long2num(account_type);
result = scm_call_1(getters.debit_string, arg);
- if (!SCM_STRINGP(result))
+ if (!scm_is_string(result))
return NULL;
- string = SCM_STRING_CHARS(result);
+ string = scm_to_locale_string(result);
if (string)
return g_strdup(string);
return NULL;
@@ -1144,10 +1144,10 @@
arg = scm_long2num(account_type);
result = scm_call_1(getters.credit_string, arg);
- if (!SCM_STRINGP(result))
+ if (!scm_is_string(result))
return NULL;
- string = SCM_STRING_CHARS(result);
+ string = scm_to_locale_string(result);
if (string)
return g_strdup(string);
return NULL;
Modified: gnucash/trunk/src/app-utils/option-util.c
===================================================================
--- gnucash/trunk/src/app-utils/option-util.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/app-utils/option-util.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -290,7 +290,7 @@
if (kvp_to_scm == SCM_UNDEFINED)
{
kvp_to_scm = scm_c_eval_string("gnc:options-kvp->scm");
- if (!SCM_PROCEDUREP (kvp_to_scm))
+ if (!scm_is_procedure (kvp_to_scm))
{
PERR ("not a procedure\n");
kvp_to_scm = SCM_UNDEFINED;
@@ -324,7 +324,7 @@
if (scm_to_kvp == SCM_UNDEFINED)
{
scm_to_kvp = scm_c_eval_string("gnc:options-scm->kvp");
- if (!SCM_PROCEDUREP (scm_to_kvp))
+ if (!scm_is_procedure (scm_to_kvp))
{
PERR ("not a procedure\n");
scm_to_kvp = SCM_UNDEFINED;
@@ -450,7 +450,7 @@
/* Get the register procedure */
register_proc = scm_c_eval_string("gnc:options-register-c-callback");
- if (!SCM_PROCEDUREP(register_proc))
+ if (!scm_is_procedure(register_proc))
{
PERR("not a procedure\n");
return SCM_UNDEFINED;
@@ -515,7 +515,7 @@
return;
proc = scm_c_eval_string("gnc:options-unregister-callback-id");
- if (!SCM_PROCEDUREP(proc))
+ if (!scm_is_procedure(proc))
{
PERR("not a procedure\n");
return;
@@ -536,7 +536,7 @@
SCM proc;
proc = scm_c_eval_string("gnc:options-run-callbacks");
- if (!SCM_PROCEDUREP(proc))
+ if (!scm_is_procedure(proc))
{
PERR("not a procedure\n");
return;
@@ -764,12 +764,12 @@
initialize_getters();
- if ( SCM_PROCEDUREP( getters.option_widget_changed_cb ) )
+ if ( scm_is_procedure( getters.option_widget_changed_cb ) )
{
/* call the callback function getter to get the actual callback function */
cb = scm_call_1(getters.option_widget_changed_cb, option->guile_option);
- if ( SCM_PROCEDUREP( cb ) ) /* a callback exists */
+ if ( scm_is_procedure( cb ) ) /* a callback exists */
{
return( cb );
}
@@ -829,7 +829,7 @@
value = scm_call_1(getters.number_of_indices, option->guile_option);
- if (SCM_EXACTP(value))
+ if (scm_is_exact(value))
{
return scm_num2int(value, SCM_ARG1, G_STRFUNC);
}
@@ -916,10 +916,10 @@
scm_int2num(index));
if (name == SCM_UNDEFINED)
return NULL;
- if (!SCM_STRINGP(name))
+ if (!scm_is_string(name))
return NULL;
- return g_strdup(SCM_STRING_CHARS(name));
+ return g_strdup(scm_to_locale_string(name));
}
@@ -947,10 +947,10 @@
scm_int2num(index));
if (help == SCM_UNDEFINED)
return NULL;
- if (!SCM_STRINGP(help))
+ if (!scm_is_string(help))
return NULL;
- return g_strdup(SCM_STRING_CHARS(help));
+ return g_strdup(scm_to_locale_string(help));
}
@@ -971,7 +971,7 @@
value = scm_call_1(getters.date_option_show_time, option->guile_option);
- return SCM_NFALSEP(value);
+ return scm_is_true(value);
}
/********************************************************************\
@@ -1007,7 +1007,7 @@
pair = scm_call_1(getters.option_data, option->guile_option);
- return !SCM_NFALSEP(scm_not(SCM_CAR(pair)));
+ return !scm_is_true(scm_not(SCM_CAR(pair)));
}
/********************************************************************\
@@ -1031,7 +1031,7 @@
pair = scm_call_1(getters.option_data, option->guile_option);
lst = SCM_CDR(pair);
- while (!SCM_NULLP (lst))
+ while (!scm_is_null (lst))
{
GNCAccountType type;
SCM item;
@@ -1040,7 +1040,7 @@
item = SCM_CAR (lst);
lst = SCM_CDR (lst);
- if (SCM_FALSEP (scm_integer_p (item)))
+ if (scm_is_false (scm_integer_p (item)))
{
PERR ("Invalid type");
}
@@ -1077,40 +1077,40 @@
list = scm_call_1(getters.option_data, option->guile_option);
- if (!SCM_LISTP(list) || SCM_NULLP(list))
+ if (!scm_is_list(list) || scm_is_null(list))
return FALSE;
/* lower bound */
value = SCM_CAR(list);
list = SCM_CDR(list);
- if (!SCM_NUMBERP(value))
+ if (!scm_is_number(value))
return FALSE;
if (lower_bound != NULL)
*lower_bound = scm_num2dbl(value, G_STRFUNC);
- if (!SCM_LISTP(list) || SCM_NULLP(list))
+ if (!scm_is_list(list) || scm_is_null(list))
return FALSE;
/* upper bound */
value = SCM_CAR(list);
list = SCM_CDR(list);
- if (!SCM_NUMBERP(value))
+ if (!scm_is_number(value))
return FALSE;
if (upper_bound != NULL)
*upper_bound = scm_num2dbl(value, G_STRFUNC);
- if (!SCM_LISTP(list) || SCM_NULLP(list))
+ if (!scm_is_list(list) || scm_is_null(list))
return FALSE;
/* number of decimals */
value = SCM_CAR(list);
list = SCM_CDR(list);
- if (!SCM_NUMBERP(value))
+ if (!scm_is_number(value))
return FALSE;
/* Guile-1.6 returns this as a double, so let's use that in all cases.
@@ -1122,14 +1122,14 @@
*num_decimals = (int)decimals;
}
- if (!SCM_LISTP(list) || SCM_NULLP(list))
+ if (!scm_is_list(list) || scm_is_null(list))
return FALSE;
/* step size */
value = SCM_CAR(list);
list = SCM_CDR(list);
- if (!SCM_NUMBERP(value))
+ if (!scm_is_number(value))
return FALSE;
if (step_size != NULL)
@@ -1156,11 +1156,11 @@
initialize_getters();
list = scm_call_1(getters.option_data, option->guile_option);
- if (!SCM_LISTP(list) || SCM_NULLP(list))
+ if (!scm_is_list(list) || scm_is_null(list))
return 0.0;
value = SCM_CAR(list);
- if (!SCM_NUMBERP(value))
+ if (!scm_is_number(value))
return 0.0;
return scm_num2dbl(value, G_STRFUNC);
@@ -1184,18 +1184,18 @@
initialize_getters();
list = scm_call_1(getters.option_data, option->guile_option);
- if (!SCM_LISTP(list) || SCM_NULLP(list))
+ if (!scm_is_list(list) || scm_is_null(list))
return FALSE;
list = SCM_CDR(list);
- if (!SCM_LISTP(list) || SCM_NULLP(list))
+ if (!scm_is_list(list) || scm_is_null(list))
return FALSE;
value = SCM_CAR(list);
- if (!SCM_BOOLP(value))
+ if (!scm_is_bool(value))
return FALSE;
- return SCM_NFALSEP(value);
+ return scm_is_true(value);
}
@@ -1267,7 +1267,7 @@
return FALSE;
value = scm_call_0(getter);
- if (!SCM_LISTP(value) || SCM_NULLP(value) || !SCM_NUMBERP(SCM_CAR(value)))
+ if (!scm_is_list(value) || scm_is_null(value) || !scm_is_number(SCM_CAR(value)))
return FALSE;
scale = gnc_option_color_range(option);
@@ -1281,7 +1281,7 @@
*red = MIN(1.0, rgba * scale);
value = SCM_CDR(value);
- if (!SCM_LISTP(value) || SCM_NULLP(value) || !SCM_NUMBERP(SCM_CAR(value)))
+ if (!scm_is_list(value) || scm_is_null(value) || !scm_is_number(SCM_CAR(value)))
return FALSE;
rgba = scm_num2dbl(SCM_CAR(value), G_STRFUNC);
@@ -1289,7 +1289,7 @@
*green = MIN(1.0, rgba * scale);
value = SCM_CDR(value);
- if (!SCM_LISTP(value) || SCM_NULLP(value) || !SCM_NUMBERP(SCM_CAR(value)))
+ if (!scm_is_list(value) || scm_is_null(value) || !scm_is_number(SCM_CAR(value)))
return FALSE;
rgba = scm_num2dbl(SCM_CAR(value), G_STRFUNC);
@@ -1297,7 +1297,7 @@
*blue = MIN(1.0, rgba * scale);
value = SCM_CDR(value);
- if (!SCM_LISTP(value) || SCM_NULLP(value) || !SCM_NUMBERP(SCM_CAR(value)))
+ if (!scm_is_list(value) || scm_is_null(value) || !scm_is_number(SCM_CAR(value)))
return FALSE;
rgba = scm_num2dbl(SCM_CAR(value), G_STRFUNC);
@@ -1649,18 +1649,18 @@
validator = gnc_option_value_validator(option);
result = scm_call_1(validator, value);
- if (!SCM_LISTP(result) || SCM_NULLP(result))
+ if (!scm_is_list(result) || scm_is_null(result))
return SCM_UNDEFINED;
ok = SCM_CAR(result);
- if (!SCM_BOOLP(ok))
+ if (!scm_is_bool(ok))
return SCM_UNDEFINED;
- if (!SCM_NFALSEP(ok))
+ if (!scm_is_true(ok))
return SCM_UNDEFINED;
result = SCM_CDR(result);
- if (!SCM_LISTP(result) || SCM_NULLP(result))
+ if (!scm_is_list(result) || scm_is_null(result))
return SCM_UNDEFINED;
return SCM_CAR(result);
@@ -1681,7 +1681,7 @@
validator = gnc_option_value_validator(option);
result = scm_call_1(validator, value);
- if (!SCM_LISTP(result) || SCM_NULLP(result))
+ if (!scm_is_list(result) || scm_is_null(result))
{
PERR("bad validation result\n");
return;
@@ -1689,13 +1689,13 @@
/* First element determines validity */
ok = SCM_CAR(result);
- if (!SCM_BOOLP(ok))
+ if (!scm_is_bool(ok))
{
PERR("bad validation result\n");
return;
}
- if (SCM_NFALSEP(ok))
+ if (scm_is_true(ok))
{
/* Second element is value to use */
value = SCM_CADR(result);
@@ -1715,13 +1715,13 @@
/* Second element is error message */
oops = SCM_CADR(result);
- if (!SCM_STRINGP(oops))
+ if (!scm_is_string(oops))
{
PERR("bad validation result\n");
return;
}
- message = SCM_STRING_CHARS(oops);
+ message = scm_to_locale_string(oops);
name = gnc_option_name(option);
section = gnc_option_section(option);
@@ -1907,14 +1907,14 @@
return NULL;
getter = scm_c_eval_string("gnc:options-get-default-section");
- if (!SCM_PROCEDUREP(getter))
+ if (!scm_is_procedure(getter))
return NULL;
value = scm_call_1(getter, odb->guile_options);
- if (!SCM_STRINGP(value))
+ if (!scm_is_string(value))
return NULL;
- return g_strdup(SCM_STRING_CHARS(value));
+ return g_strdup(scm_to_locale_string(value));
}
@@ -1982,8 +1982,8 @@
value = scm_call_0(getter);
- if (SCM_BOOLP(value))
- return SCM_NFALSEP(value);
+ if (scm_is_bool(value))
+ return scm_is_true(value);
else
return default_value;
}
@@ -2019,8 +2019,8 @@
if (getter != SCM_UNDEFINED)
{
value = scm_call_0(getter);
- if (SCM_STRINGP(value))
- return g_strdup(SCM_STRING_CHARS(value));
+ if (scm_is_string(value))
+ return g_strdup(scm_to_locale_string(value));
}
}
@@ -2084,7 +2084,7 @@
if (getter != SCM_UNDEFINED)
{
value = scm_call_0(getter);
- if (SCM_SYMBOLP(value))
+ if (scm_is_symbol(value))
return g_strdup(SCM_SYMBOL_CHARS(value));
}
}
@@ -2161,7 +2161,7 @@
{
value = scm_call_0(getter);
- if (SCM_CONSP(value))
+ if (scm_is_pair(value))
{
Timespec absolute;
@@ -2231,7 +2231,7 @@
if (getter != SCM_UNDEFINED)
{
value = scm_call_0(getter);
- if (SCM_NUMBERP(value))
+ if (scm_is_number(value))
return scm_num2dbl(value, G_STRFUNC);
}
}
@@ -2328,12 +2328,12 @@
return default_value;
value = scm_call_0(getter);
- while (SCM_LISTP(value) && !SCM_NULLP(value))
+ while (scm_is_list(value) && !scm_is_null(value))
{
item = SCM_CAR(value);
value = SCM_CDR(value);
- if (!SCM_SYMBOLP(item))
+ if (!scm_is_symbol(item))
{
gnc_free_list_option_value(list);
@@ -2343,7 +2343,7 @@
list = g_slist_prepend(list, g_strdup(SCM_SYMBOL_CHARS(item)));
}
- if (!SCM_LISTP(value) || !SCM_NULLP(value))
+ if (!scm_is_list(value) || !scm_is_null(value))
{
gnc_free_list_option_value(list);
@@ -2601,7 +2601,7 @@
value = scm_call_1(getters.date_option_subtype, option->guile_option);
- if (SCM_SYMBOLP(value))
+ if (scm_is_symbol(value))
return g_strdup(SCM_SYMBOL_CHARS(value));
else
return NULL;
@@ -2622,7 +2622,7 @@
initialize_getters();
value = scm_call_1 (getters.date_option_value_type, option_value);
- if (!SCM_SYMBOLP (value))
+ if (!scm_is_symbol (value))
return NULL;
return g_strdup(SCM_SYMBOL_CHARS (value));
@@ -2703,7 +2703,7 @@
SCM val;
const char *str;
- if (!SCM_LISTP(value) || SCM_NULLP(value))
+ if (!scm_is_list(value) || scm_is_null(value))
return TRUE;
do
@@ -2712,7 +2712,7 @@
/* Parse the format */
val = SCM_CAR(value);
value = SCM_CDR(value);
- if (!SCM_SYMBOLP(val))
+ if (!scm_is_symbol(val))
break;
str = SCM_SYMBOL_CHARS (val);
if (!str)
@@ -2729,7 +2729,7 @@
/* parse the months */
val = SCM_CAR(value);
value = SCM_CDR(value);
- if (!SCM_SYMBOLP(val))
+ if (!scm_is_symbol(val))
break;
str = SCM_SYMBOL_CHARS (val);
if (!str)
@@ -2746,22 +2746,22 @@
/* parse the years */
val = SCM_CAR(value);
value = SCM_CDR(value);
- if (!SCM_BOOLP(val))
+ if (!scm_is_bool(val))
break;
if (years)
- *years = SCM_NFALSEP(val);
+ *years = scm_is_true(val);
/* parse the custom */
val = SCM_CAR(value);
value = SCM_CDR(value);
- if (!SCM_STRINGP(val))
+ if (!scm_is_string(val))
break;
- if (!SCM_NULLP(value))
+ if (!scm_is_null(value))
break;
if (custom)
- *custom = g_strdup(SCM_STRING_CHARS(val));
+ *custom = g_strdup(scm_to_locale_string(val));
return FALSE;
Modified: gnucash/trunk/src/app-utils/test/test-print-queries.c
===================================================================
--- gnucash/trunk/src/app-utils/test/test-print-queries.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/app-utils/test/test-print-queries.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -39,7 +39,7 @@
int i;
val2str = scm_c_eval_string ("gnc:value->string");
- g_return_if_fail (SCM_PROCEDUREP (val2str));
+ g_return_if_fail (scm_is_procedure (val2str));
for (i = 0; i < count; i++)
{
Modified: gnucash/trunk/src/app-utils/test/test-scm-query-string.c
===================================================================
--- gnucash/trunk/src/app-utils/test/test-scm-query-string.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/app-utils/test/test-scm-query-string.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -30,7 +30,7 @@
args = scm_cons (scm_makfrom0str ("'"), scm_cons (str_q, SCM_EOL));
str_q = scm_string_append (args);
- str = SCM_STRING_CHARS (str_q);
+ str = scm_to_locale_string (str_q);
if (str) str2 = g_strdup(str);
if (str2)
{
@@ -69,7 +69,7 @@
int i;
val2str = scm_c_eval_string ("gnc:value->string");
- g_return_if_fail (SCM_PROCEDUREP (val2str));
+ g_return_if_fail (scm_is_procedure (val2str));
for (i = 0; i < 1000; i++)
{
Modified: gnucash/trunk/src/base-typemaps.i
===================================================================
--- gnucash/trunk/src/base-typemaps.i 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/base-typemaps.i 2009-12-31 14:41:12 UTC (rev 18541)
@@ -14,14 +14,14 @@
%typemap (out) char * {
$result = scm_makfrom0str((const char *)$1);
- if (!SCM_NFALSEP($result)) {
+ if (!scm_is_true($result)) {
$result = scm_makstr(0, 0);
}
}
%typemap(in) GNCPrintAmountInfo "$1 = gnc_scm2printinfo($input);"
%typemap(out) GNCPrintAmountInfo "$result = gnc_printinfo2scm($1);"
-%typemap(in) gboolean "$1 = SCM_NFALSEP($input) ? TRUE : FALSE;"
+%typemap(in) gboolean "$1 = scm_is_true($input) ? TRUE : FALSE;"
%typemap(out) gboolean "$result = $1 ? SCM_BOOL_T : SCM_BOOL_F;"
%typemap(in) Timespec "$1 = gnc_timepair2timespec($input);"
@@ -43,11 +43,11 @@
SCM list = $input;
GList *c_list = NULL;
- while (!SCM_NULLP(list)) {
+ while (!scm_is_null(list)) {
void *p;
SCM p_scm = SCM_CAR(list);
- if (SCM_FALSEP(p_scm) || SCM_NULLP(p_scm))
+ if (scm_is_false(p_scm) || scm_is_null(p_scm))
p = NULL;
else
p = SWIG_MustGetPtr(p_scm, ElemSwigType, 1, 0);
Modified: gnucash/trunk/src/bin/gnucash-bin.c
===================================================================
--- gnucash/trunk/src/bin/gnucash-bin.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/bin/gnucash-bin.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -409,7 +409,7 @@
if (qof_session_get_error(session) != ERR_BACKEND_NO_ERR) goto fail;
qof_session_destroy(session);
- if (!SCM_NFALSEP(scm_result)) {
+ if (!scm_is_true(scm_result)) {
g_warning("Failed to add quotes to %s.", add_quotes_file);
goto fail;
}
Modified: gnucash/trunk/src/business/business-core/business-core.i
===================================================================
--- gnucash/trunk/src/business/business-core/business-core.i 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/business/business-core/business-core.i 2009-12-31 14:41:12 UTC (rev 18541)
@@ -81,11 +81,11 @@
SCM list = $input;
GList *c_list = NULL;
- while (!SCM_NULLP(list)) {
+ while (!scm_is_null(list)) {
GncAccountValue *p;
SCM p_scm = SCM_CAR(list);
- if (SCM_FALSEP(p_scm) || SCM_NULLP(p_scm))
+ if (scm_is_false(p_scm) || scm_is_null(p_scm))
p = NULL;
else
p = gnc_scm_to_account_value_ptr(p_scm);
Modified: gnucash/trunk/src/business/business-core/gncBusGuile.c
===================================================================
--- gnucash/trunk/src/business/business-core/gncBusGuile.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/business/business-core/gncBusGuile.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -43,7 +43,7 @@
{
swig_type_info * account_type = get_acct_type();
- return (SCM_CONSP (arg) &&
+ return (scm_is_pair (arg) &&
SWIG_IsPointerOfType(SCM_CAR (arg), account_type) &&
gnc_numeric_p (SCM_CDR (arg)));
}
Modified: gnucash/trunk/src/business/business-gnome/dialog-invoice.c
===================================================================
--- gnucash/trunk/src/business/business-gnome/dialog-invoice.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/business/business-gnome/dialog-invoice.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -580,7 +580,7 @@
g_return_if_fail (invoice);
func = scm_c_eval_string ("gnc:invoice-report-create");
- g_return_if_fail (SCM_PROCEDUREP (func));
+ g_return_if_fail (scm_is_procedure (func));
arg = SWIG_NewPointerObj(invoice, SWIG_TypeQuery("_p__gncInvoice"), 0);
args = scm_cons (arg, args);
@@ -588,7 +588,7 @@
/* scm_gc_protect_object(func); */
arg = scm_apply (func, args, SCM_EOL);
- g_return_if_fail (SCM_EXACTP (arg));
+ g_return_if_fail (scm_is_exact (arg));
report_id = scm_num2int (arg, SCM_ARG1, G_STRFUNC);
/* scm_gc_unprotect_object(func); */
@@ -846,7 +846,7 @@
args = SCM_EOL;
func = scm_c_eval_string ("gnc:owner-report-create");
- g_return_if_fail (SCM_PROCEDUREP (func));
+ g_return_if_fail (scm_is_procedure (func));
if (acc) {
swig_type_info * qtype = SWIG_TypeQuery("_p_Account");
@@ -865,7 +865,7 @@
/* Apply the function to the args */
arg = scm_apply (func, args, SCM_EOL);
- g_return_if_fail (SCM_EXACTP (arg));
+ g_return_if_fail (scm_is_exact (arg));
id = scm_num2int (arg, SCM_ARG1, G_STRFUNC);
if (id >= 0)
Modified: gnucash/trunk/src/engine/engine-helpers.c
===================================================================
--- gnucash/trunk/src/engine/engine-helpers.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/engine/engine-helpers.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -114,7 +114,7 @@
int
gnc_timepair_p(SCM x)
{
- return(SCM_CONSP(x) &&
+ return(scm_is_pair(x) &&
gnc_gh_gint64_p(SCM_CAR(x)) &&
gnc_gh_gint64_p(SCM_CDR(x)));
}
@@ -136,11 +136,11 @@
GUID guid;
const gchar * str;
- if (GUID_ENCODING_LENGTH != SCM_STRING_LENGTH (guid_scm))
+ if (GUID_ENCODING_LENGTH != scm_i_string_length (guid_scm))
{
return *guid_null();
}
- str = SCM_STRING_CHARS (guid_scm);
+ str = scm_to_locale_string (guid_scm);
string_to_guid(str, &guid);
return guid;
}
@@ -151,14 +151,14 @@
GUID guid;
const gchar * str;
- if (!SCM_STRINGP(guid_scm))
+ if (!scm_is_string(guid_scm))
return FALSE;
- if (GUID_ENCODING_LENGTH != SCM_STRING_LENGTH (guid_scm))
+ if (GUID_ENCODING_LENGTH != scm_i_string_length (guid_scm))
{
return FALSE;
}
- str = SCM_STRING_CHARS (guid_scm);
+ str = scm_to_locale_string (guid_scm);
return string_to_guid(str, &guid);
}
@@ -308,10 +308,10 @@
{
int field = 0;
- if (!SCM_LISTP (field_scm))
+ if (!scm_is_list (field_scm))
return 0;
- while (!SCM_NULLP (field_scm))
+ while (!scm_is_null (field_scm))
{
SCM scm;
int bit;
@@ -337,14 +337,14 @@
{
const gchar *how;
- if (!SCM_LISTP (how_scm))
+ if (!scm_is_list (how_scm))
return FALSE;
- if (SCM_NULLP (how_scm))
+ if (scm_is_null (how_scm))
return FALSE;
/* Only allow a single-entry list */
- if (!SCM_NULLP (SCM_CDR (how_scm)))
+ if (!scm_is_null (SCM_CDR (how_scm)))
return FALSE;
how = SCM_SYMBOL_CHARS (SCM_CAR(how_scm));
@@ -363,7 +363,7 @@
QofIdType res;
const gchar *where;
- if (!SCM_LISTP (where_scm))
+ if (!scm_is_list (where_scm))
return NULL;
where = SCM_SYMBOL_CHARS (SCM_CAR(where_scm));
@@ -403,10 +403,10 @@
{
GList *guids = NULL;
- if (!SCM_LISTP (guids_scm))
+ if (!scm_is_list (guids_scm))
return NULL;
- while (!SCM_NULLP (guids_scm))
+ while (!scm_is_null (guids_scm))
{
SCM guid_scm = SCM_CAR (guids_scm);
GUID *guid = NULL;
@@ -446,7 +446,7 @@
static gboolean
gnc_query_numeric_p (SCM pair)
{
- return (SCM_CONSP (pair));
+ return (scm_is_pair (pair));
}
static gnc_numeric
@@ -484,18 +484,18 @@
{
GSList *path = NULL;
- if (!SCM_LISTP (path_scm))
+ if (!scm_is_list (path_scm))
return NULL;
- while (!SCM_NULLP (path_scm))
+ while (!scm_is_null (path_scm))
{
SCM key_scm = SCM_CAR (path_scm);
char *key;
- if (!SCM_STRINGP (key_scm))
+ if (!scm_is_string (key_scm))
break;
- key = g_strdup (SCM_STRING_CHARS (key_scm));
+ key = g_strdup (scm_to_locale_string (key_scm));
path = g_slist_prepend (path, key);
@@ -637,14 +637,14 @@
SCM type_scm;
SCM val_scm;
- if (!SCM_LISTP (value_scm) || SCM_NULLP (value_scm))
+ if (!scm_is_list (value_scm) || scm_is_null (value_scm))
return NULL;
type_scm = SCM_CAR (value_scm);
value_t = gnc_scm2KvpValueTypeype (type_scm);
value_scm = SCM_CDR (value_scm);
- if (!SCM_LISTP (value_scm) || SCM_NULLP (value_scm))
+ if (!scm_is_list (value_scm) || scm_is_null (value_scm))
return NULL;
val_scm = SCM_CAR (value_scm);
@@ -660,7 +660,7 @@
break;
case KVP_TYPE_STRING: {
- const gchar * str = SCM_STRING_CHARS (val_scm);
+ const gchar * str = scm_to_locale_string (val_scm);
value = kvp_value_new_string (str);
break;
}
@@ -702,7 +702,7 @@
GList *list = NULL;
GList *node;
- for (; SCM_LISTP (val_scm) && !SCM_NULLP (val_scm);
+ for (; scm_is_list (val_scm) && !scm_is_null (val_scm);
val_scm = SCM_CDR (val_scm))
{
SCM scm = SCM_CAR (val_scm);
@@ -742,11 +742,11 @@
{
KvpFrame * frame;
- if (!SCM_LISTP (frame_scm)) return NULL;
+ if (!scm_is_list (frame_scm)) return NULL;
frame = kvp_frame_new ();
- for (; SCM_LISTP (frame_scm) && !SCM_NULLP (frame_scm);
+ for (; scm_is_list (frame_scm) && !scm_is_null (frame_scm);
frame_scm = SCM_CDR (frame_scm))
{
SCM pair = SCM_CAR (frame_scm);
@@ -755,16 +755,16 @@
SCM val_scm;
const gchar *key;
- if (!SCM_CONSP (pair))
+ if (!scm_is_pair (pair))
continue;
key_scm = SCM_CAR (pair);
val_scm = SCM_CDR (pair);
- if (!SCM_STRINGP (key_scm))
+ if (!scm_is_string (key_scm))
continue;
- key = SCM_STRING_CHARS (key_scm);
+ key = scm_to_locale_string (key_scm);
if (!key)
continue;
@@ -862,35 +862,35 @@
gboolean inverted = FALSE;
QofQueryCompare compare_how;
- if (!SCM_LISTP (qt_scm) || SCM_NULLP (qt_scm))
+ if (!scm_is_list (qt_scm) || scm_is_null (qt_scm))
return NULL;
do {
/* param path */
scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm);
- if (!SCM_LISTP (scm))
+ if (!scm_is_list (scm))
break;
path = gnc_query_scm2path (scm);
/* inverted */
scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm);
- if (!SCM_BOOLP (scm))
+ if (!scm_is_bool (scm))
break;
- inverted = SCM_NFALSEP (scm);
+ inverted = scm_is_true (scm);
/* type */
scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm);
- if (!SCM_SYMBOLP (scm))
+ if (!scm_is_symbol (scm))
break;
type = SCM_SYMBOL_CHARS (scm);
/* QofCompareFunc */
scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm);
- if (SCM_NULLP (scm))
+ if (scm_is_null (scm))
break;
compare_how = gnc_query_scm2compare (scm);
@@ -904,19 +904,19 @@
scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm);
- if (SCM_NULLP (scm)) break;
+ if (scm_is_null (scm)) break;
options = gnc_query_scm2string (scm);
scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm);
- if (!SCM_BOOLP (scm)) break;
- is_regex = SCM_NFALSEP (scm);
+ if (!scm_is_bool (scm)) break;
+ is_regex = scm_is_true (scm);
scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm);
- if (!SCM_STRINGP (scm)) break;
+ if (!scm_is_string (scm)) break;
- matchstring = SCM_STRING_CHARS (scm);
+ matchstring = scm_to_locale_string (scm);
pd = qof_query_string_predicate (compare_how, matchstring,
options, is_regex);
@@ -928,13 +928,13 @@
scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm);
- if (SCM_NULLP (scm))
+ if (scm_is_null (scm))
break;
options = gnc_query_scm2date (scm);
scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm);
- if (SCM_NULLP (scm))
+ if (scm_is_null (scm))
break;
date = gnc_timepair2timespec (scm);
@@ -946,7 +946,7 @@
scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm);
- if (SCM_NULLP (scm))
+ if (scm_is_null (scm))
break;
options = gnc_query_scm2numericop (scm);
@@ -964,13 +964,13 @@
scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm);
- if (SCM_NULLP (scm))
+ if (scm_is_null (scm))
break;
options = gnc_query_scm2guid (scm);
scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm);
- if (!SCM_LISTP (scm))
+ if (!scm_is_list (scm))
break;
guids = gnc_scm2guid_glist (scm);
@@ -983,7 +983,7 @@
scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm);
- if (SCM_NULLP (scm))
+ if (scm_is_null (scm))
break;
val = gnc_scm_to_gint64 (scm);
@@ -994,7 +994,7 @@
scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm);
- if (!SCM_NUMBERP (scm))
+ if (!scm_is_number (scm))
break;
val = scm_num2dbl (scm, G_STRFUNC);
@@ -1005,9 +1005,9 @@
scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm);
- if (!SCM_BOOLP (scm))
+ if (!scm_is_bool (scm))
break;
- val = SCM_NFALSEP (scm);
+ val = scm_is_true (scm);
pd = qof_query_boolean_predicate (compare_how, val);
@@ -1017,15 +1017,15 @@
scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm);
- if (SCM_NULLP (scm))
+ if (scm_is_null (scm))
break;
options = gnc_query_scm2char (scm);
scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm);
- if (!SCM_STRINGP (scm))
+ if (!scm_is_string (scm))
break;
- char_list = SCM_STRING_CHARS (scm);
+ char_list = scm_to_locale_string (scm);
pd = qof_query_char_predicate (options, char_list);
}
@@ -1036,13 +1036,13 @@
scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm);
- if (!SCM_LISTP (scm))
+ if (!scm_is_list (scm))
break;
kvp_path = gnc_query_scm2path (scm);
scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm);
- if (SCM_NULLP (scm)) {
+ if (scm_is_null (scm)) {
gnc_query_path_free (kvp_path);
break;
}
@@ -1084,8 +1084,8 @@
QofQuery *q = NULL;
SCM scm;
- if (!SCM_LISTP (query_term_scm) ||
- SCM_NULLP (query_term_scm)) {
+ if (!scm_is_list (query_term_scm) ||
+ scm_is_null (query_term_scm)) {
PINFO ("null term");
return NULL;
}
@@ -1097,7 +1097,7 @@
pd_type = SCM_SYMBOL_CHARS (scm);
/* pr_type */
- if (SCM_NULLP (query_term_scm)) {
+ if (scm_is_null (query_term_scm)) {
PINFO ("null pr_type");
break;
}
@@ -1106,13 +1106,13 @@
pr_type = SCM_SYMBOL_CHARS (scm);
/* sense */
- if (SCM_NULLP (query_term_scm)) {
+ if (scm_is_null (query_term_scm)) {
PINFO ("null sense");
break;
}
scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (query_term_scm);
- sense = SCM_NFALSEP (scm);
+ sense = scm_is_true (scm);
q = xaccMallocQuery ();
@@ -1123,17 +1123,17 @@
Timespec end;
/* use_start */
- if (SCM_NULLP (query_term_scm)) {
+ if (scm_is_null (query_term_scm)) {
PINFO ("null use_start");
break;
}
scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (query_term_scm);
- use_start = SCM_NFALSEP (scm);
+ use_start = scm_is_true (scm);
/* start */
- if (SCM_NULLP (query_term_scm))
+ if (scm_is_null (query_term_scm))
break;
scm = SCM_CAR (query_term_scm);
@@ -1141,15 +1141,15 @@
start = gnc_timepair2timespec (scm);
/* use_end */
- if (SCM_NULLP (query_term_scm))
+ if (scm_is_null (query_term_scm))
break;
scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (query_term_scm);
- use_end = SCM_NFALSEP (scm);
+ use_end = scm_is_true (scm);
/* end */
- if (SCM_NULLP (query_term_scm))
+ if (scm_is_null (query_term_scm))
break;
scm = SCM_CAR (query_term_scm);
@@ -1169,21 +1169,21 @@
gnc_numeric val;
/* how */
- if (SCM_NULLP (query_term_scm))
+ if (scm_is_null (query_term_scm))
break;
scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (query_term_scm);
how = gnc_scm2amt_match_how (scm);
/* amt_sgn */
- if (SCM_NULLP (query_term_scm))
+ if (scm_is_null (query_term_scm))
break;
scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (query_term_scm);
amt_sgn = gnc_query_scm2numericop (scm);
/* amount */
- if (SCM_NULLP (query_term_scm))
+ if (scm_is_null (query_term_scm))
break;
scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (query_term_scm);
@@ -1215,7 +1215,7 @@
GList *account_guids;
/* how */
- if (SCM_NULLP (query_term_scm)) {
+ if (scm_is_null (query_term_scm)) {
PINFO ("pd-account: null how");
break;
}
@@ -1225,7 +1225,7 @@
how = gnc_scm2acct_match_how (scm);
/* account guids */
- if (SCM_NULLP (query_term_scm)) {
+ if (scm_is_null (query_term_scm)) {
PINFO ("pd-account: null guids");
break;
}
@@ -1247,28 +1247,28 @@
const gchar *matchstring;
/* case_sens */
- if (SCM_NULLP (query_term_scm))
+ if (scm_is_null (query_term_scm))
break;
scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (query_term_scm);
- case_sens = SCM_NFALSEP (scm);
+ case_sens = scm_is_true (scm);
/* use_regexp */
- if (SCM_NULLP (query_term_scm))
+ if (scm_is_null (query_term_scm))
break;
scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (query_term_scm);
- use_regexp = SCM_NFALSEP (scm);
+ use_regexp = scm_is_true (scm);
/* matchstring */
- if (SCM_NULLP (query_term_scm))
+ if (scm_is_null (query_term_scm))
break;
scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (query_term_scm);
- matchstring = SCM_STRING_CHARS (scm);
+ matchstring = scm_to_locale_string (scm);
if (!safe_strcmp (pr_type, "pr-action")) {
xaccQueryAddActionMatch (q, matchstring, case_sens, use_regexp,
@@ -1298,7 +1298,7 @@
cleared_match_t how;
/* how */
- if (SCM_NULLP (query_term_scm))
+ if (scm_is_null (query_term_scm))
break;
scm = SCM_CAR (query_term_scm);
@@ -1312,7 +1312,7 @@
gboolean how;
/* how */
- if (SCM_NULLP (query_term_scm))
+ if (scm_is_null (query_term_scm))
break;
scm = SCM_CAR (query_term_scm);
@@ -1328,7 +1328,7 @@
QofIdType id_type;
/* guid */
- if (SCM_NULLP (query_term_scm))
+ if (scm_is_null (query_term_scm))
break;
scm = SCM_CAR (query_term_scm);
@@ -1338,7 +1338,7 @@
/* id type */
scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (query_term_scm);
- id_type = g_strdup (SCM_STRING_CHARS (scm));
+ id_type = g_strdup (scm_to_locale_string (scm));
xaccQueryAddGUIDMatch (q, &guid, id_type, QOF_QUERY_OR);
ok = TRUE;
@@ -1350,28 +1350,28 @@
QofIdType where;
/* how */
- if (SCM_NULLP (query_term_scm))
+ if (scm_is_null (query_term_scm))
break;
scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (query_term_scm);
how = gnc_scm2kvp_match_how (scm);
/* where */
- if (SCM_NULLP (query_term_scm))
+ if (scm_is_null (query_term_scm))
break;
scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (query_term_scm);
where = gnc_scm2kvp_match_where (scm);
/* path */
- if (SCM_NULLP (query_term_scm))
+ if (scm_is_null (query_term_scm))
break;
scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (query_term_scm);
path = gnc_query_scm2path (scm);
/* value */
- if (SCM_NULLP (query_term_scm))
+ if (scm_is_null (query_term_scm))
break;
scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (query_term_scm);
@@ -1454,10 +1454,10 @@
{
Query *q = NULL;
- if (!SCM_LISTP (and_terms))
+ if (!scm_is_list (and_terms))
return NULL;
- while (!SCM_NULLP (and_terms))
+ while (!scm_is_null (and_terms))
{
SCM term;
@@ -1494,12 +1494,12 @@
{
Query *q = NULL;
- if (!SCM_LISTP (or_terms))
+ if (!scm_is_list (or_terms))
return NULL;
q = xaccMallocQuery ();
- while (!SCM_NULLP (or_terms))
+ while (!scm_is_null (or_terms))
{
SCM and_terms;
@@ -1560,24 +1560,24 @@
g_return_val_if_fail (*path == NULL, FALSE);
/* This is ok -- it means we have an empty sort. Don't do anything */
- if (SCM_BOOLP (sort_scm))
+ if (scm_is_bool (sort_scm))
return TRUE;
/* Ok, this had better be a list */
- if (!SCM_LISTP (sort_scm))
+ if (!scm_is_list (sort_scm))
return FALSE;
/* Parse the path, options, and increasing */
val = SCM_CAR (sort_scm);
sort_scm = SCM_CDR (sort_scm);
- if (!SCM_LISTP (val))
+ if (!scm_is_list (val))
return FALSE;
p = gnc_query_scm2path (val);
/* options */
val = SCM_CAR (sort_scm);
sort_scm = SCM_CDR (sort_scm);
- if (!SCM_NUMBERP (val)) {
+ if (!scm_is_number (val)) {
gnc_query_path_free (p);
return FALSE;
}
@@ -1586,14 +1586,14 @@
/* increasing */
val = SCM_CAR (sort_scm);
sort_scm = SCM_CDR (sort_scm);
- if (!SCM_BOOLP (val)) {
+ if (!scm_is_bool (val)) {
gnc_query_path_free (p);
return FALSE;
}
- i = SCM_NFALSEP (val);
+ i = scm_is_true (val);
/* EOL */
- if (!SCM_NULLP (sort_scm)) {
+ if (!scm_is_null (sort_scm)) {
gnc_query_path_free (p);
return FALSE;
}
@@ -1735,7 +1735,7 @@
gboolean tertiary_increasing = TRUE;
int max_splits = -1;
- while (!SCM_NULLP (query_scm))
+ while (!scm_is_null (query_scm))
{
const gchar *symbol;
SCM sym_scm;
@@ -1745,7 +1745,7 @@
pair = SCM_CAR (query_scm);
query_scm = SCM_CDR (query_scm);
- if (!SCM_CONSP (pair)) {
+ if (!scm_is_pair (pair)) {
PERR ("Not a Pair");
ok = FALSE;
break;
@@ -1754,7 +1754,7 @@
sym_scm = SCM_CAR (pair);
value = SCM_CADR (pair);
- if (!SCM_SYMBOLP (sym_scm)) {
+ if (!scm_is_symbol (sym_scm)) {
PERR ("Not a symbol");
ok = FALSE;
break;
@@ -1779,7 +1779,7 @@
}
} else if (safe_strcmp ("primary-sort", symbol) == 0) {
- if (!SCM_SYMBOLP (value)) {
+ if (!scm_is_symbol (value)) {
PINFO ("Invalid primary sort");
ok = FALSE;
break;
@@ -1788,7 +1788,7 @@
primary_sort = SCM_SYMBOL_CHARS (value);
} else if (safe_strcmp ("secondary-sort", symbol) == 0) {
- if (!SCM_SYMBOLP (value)) {
+ if (!scm_is_symbol (value)) {
PINFO ("Invalid secondary sort");
ok = FALSE;
break;
@@ -1797,7 +1797,7 @@
secondary_sort = SCM_SYMBOL_CHARS (value);
} else if (safe_strcmp ("tertiary-sort", symbol) == 0) {
- if (!SCM_SYMBOLP (value)) {
+ if (!scm_is_symbol (value)) {
PINFO ("Invalid tertiary sort");
ok = FALSE;
break;
@@ -1806,16 +1806,16 @@
tertiary_sort = SCM_SYMBOL_CHARS (value);
} else if (safe_strcmp ("primary-increasing", symbol) == 0) {
- primary_increasing = SCM_NFALSEP (value);
+ primary_increasing = scm_is_true (value);
} else if (safe_strcmp ("secondary-increasing", symbol) == 0) {
- secondary_increasing = SCM_NFALSEP (value);
+ secondary_increasing = scm_is_true (value);
} else if (safe_strcmp ("tertiary-increasing", symbol) == 0) {
- tertiary_increasing = SCM_NFALSEP (value);
+ tertiary_increasing = scm_is_true (value);
} else if (safe_strcmp ("max-splits", symbol) == 0) {
- if (!SCM_NUMBERP (value)) {
+ if (!scm_is_number (value)) {
PERR ("invalid max-splits");
ok = FALSE;
break;
@@ -1863,7 +1863,7 @@
++scm_block_gc;
#endif
- while (!SCM_NULLP (query_scm))
+ while (!scm_is_null (query_scm))
{
const gchar *symbol;
SCM sym_scm;
@@ -1873,7 +1873,7 @@
pair = SCM_CAR (query_scm);
query_scm = SCM_CDR (query_scm);
- if (!SCM_CONSP (pair)) {
+ if (!scm_is_pair (pair)) {
ok = FALSE;
break;
}
@@ -1881,7 +1881,7 @@
sym_scm = SCM_CAR (pair);
value = SCM_CADR (pair);
- if (!SCM_SYMBOLP (sym_scm)) {
+ if (!scm_is_symbol (sym_scm)) {
ok = FALSE;
break;
}
@@ -1903,7 +1903,7 @@
}
} else if (!safe_strcmp ("search-for", symbol)) {
- if (!SCM_SYMBOLP (value)) {
+ if (!scm_is_symbol (value)) {
ok = FALSE;
break;
}
@@ -1928,7 +1928,7 @@
}
} else if (!safe_strcmp ("max-results", symbol)) {
- if (!SCM_NUMBERP (value)) {
+ if (!scm_is_number (value)) {
ok = FALSE;
break;
}
@@ -1967,14 +1967,14 @@
Query *q = NULL;
/* Not a list or NULL? No need to go further */
- if (!SCM_LISTP (query_scm) || SCM_NULLP (query_scm))
+ if (!scm_is_list (query_scm) || scm_is_null (query_scm))
return NULL;
/* Grab the 'type' (for v2 and above) */
q_type = SCM_CAR (query_scm);
- if (!SCM_SYMBOLP (q_type)) {
- if (SCM_CONSP (q_type)) {
+ if (!scm_is_symbol (q_type)) {
+ if (scm_is_pair (q_type)) {
/* Version-1 queries are just a list */
return gnc_scm2query_v1 (query_scm);
} else {
@@ -2098,7 +2098,7 @@
initialized = 1;
}
- return (SCM_EXACTP(num) &&
+ return (scm_is_exact(num) &&
(scm_geq_p(num, minval) != SCM_BOOL_F) &&
(scm_leq_p(num, maxval) != SCM_BOOL_F));
}
Modified: gnucash/trunk/src/engine/engine.i
===================================================================
--- gnucash/trunk/src/engine/engine.i 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/engine/engine.i 2009-12-31 14:41:12 UTC (rev 18541)
@@ -153,15 +153,15 @@
SCM path_scm = $input;
GList *path = NULL;
- while (!SCM_NULLP (path_scm))
+ while (!scm_is_null (path_scm))
{
SCM key_scm = SCM_CAR (path_scm);
char *key;
- if (!SCM_STRINGP (key_scm))
+ if (!scm_is_string (key_scm))
break;
- key = g_strdup (SCM_STRING_CHARS (key_scm));
+ key = g_strdup (scm_to_locale_string (key_scm));
path = g_list_prepend (path, key);
Modified: gnucash/trunk/src/engine/glib-helpers.c
===================================================================
--- gnucash/trunk/src/engine/glib-helpers.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/engine/glib-helpers.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -59,9 +59,9 @@
SCM scm_item;
SWIG_GetModule(NULL); /* Work-around for SWIG bug. */
- SCM_ASSERT(SCM_LISTP(rest), rest, SCM_ARG1, "gnc_scm_list_to_glist");
+ SCM_ASSERT(scm_is_list(rest), rest, SCM_ARG1, "gnc_scm_list_to_glist");
- while(!SCM_NULLP(rest))
+ while(!scm_is_null(rest))
{
void *item;
@@ -119,9 +119,9 @@
{
GList *glist = NULL;
- while (!SCM_NULLP (list))
+ while (!scm_is_null (list))
{
- const gchar * str = SCM_STRING_CHARS (SCM_CAR(list));
+ const gchar * str = scm_to_locale_string (SCM_CAR(list));
if (str)
glist = g_list_prepend (glist, g_strdup (str));
list = SCM_CDR (list);
@@ -135,9 +135,9 @@
{
GSList *gslist = NULL;
- while (!SCM_NULLP (list))
+ while (!scm_is_null (list))
{
- const gchar * str = SCM_STRING_CHARS (SCM_CAR(list));
+ const gchar * str = scm_to_locale_string (SCM_CAR(list));
if (str)
gslist = g_slist_prepend (gslist, g_strdup (str));
list = SCM_CDR (list);
@@ -152,5 +152,5 @@
int
gnc_glist_string_p(SCM list) {
- return SCM_LISTP(list);
+ return scm_is_list(list);
}
Modified: gnucash/trunk/src/engine/gnc-hooks.c
===================================================================
--- gnucash/trunk/src/engine/gnc-hooks.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/engine/gnc-hooks.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -225,7 +225,7 @@
SCM res;
res = scm_equal_p(scm1->proc, scm2->proc);
- return(SCM_NFALSEP(res));
+ return(scm_is_true(res));
}
void
Modified: gnucash/trunk/src/engine/kvp-scm.c
===================================================================
--- gnucash/trunk/src/engine/kvp-scm.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/engine/kvp-scm.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -23,10 +23,10 @@
KvpValue *
gnc_scm_to_kvp_value_ptr(SCM val)
{
- if(SCM_NUMBERP(val))
+ if(scm_is_number(val))
{
/* in guile 1.8 (exact? ) only works on numbers */
- if(SCM_EXACTP (val) && gnc_gh_gint64_p(val))
+ if(scm_is_exact (val) && gnc_gh_gint64_p(val))
{
return kvp_value_new_gint64(gnc_scm_to_gint64(val));
}
@@ -49,11 +49,11 @@
Timespec ts = gnc_timepair2timespec(val);
return kvp_value_new_timespec(ts);
}
- else if(SCM_STRINGP(val))
+ else if(scm_is_string(val))
{
const gchar *newstr;
KvpValue *ret;
- newstr = SCM_STRING_CHARS (val);
+ newstr = scm_to_locale_string (val);
ret = kvp_value_new_string(newstr);
return ret;
}
Modified: gnucash/trunk/src/gnome/dialog-price-edit-db.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-price-edit-db.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/gnome/dialog-price-edit-db.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -267,13 +267,13 @@
ENTER(" ");
quotes_func = scm_c_eval_string ("gnc:book-add-quotes");
- if (!SCM_PROCEDUREP (quotes_func)) {
+ if (!scm_is_procedure (quotes_func)) {
LEAVE(" no procedure");
return;
}
book_scm = gnc_book_to_scm (pdb_dialog->book);
- if (SCM_NFALSEP (scm_not (book_scm))) {
+ if (scm_is_true (scm_not (book_scm))) {
LEAVE("no book");
return;
}
Modified: gnucash/trunk/src/gnome/dialog-progress.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-progress.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/gnome/dialog-progress.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -115,7 +115,7 @@
result = scm_call_0(progress->cancel_scm_func);
- if (!SCM_NFALSEP(result))
+ if (!scm_is_true(result))
return;
}
@@ -160,7 +160,7 @@
result = scm_call_0(progress->cancel_scm_func);
- if (SCM_NFALSEP(result))
+ if (scm_is_true(result))
{
if (progress->dialog != NULL)
gtk_widget_hide(progress->dialog);
@@ -601,7 +601,7 @@
if (progress->cancel_scm_func != SCM_UNDEFINED)
scm_gc_unprotect_object(progress->cancel_scm_func);
- if (SCM_PROCEDUREP(cancel_scm_func))
+ if (scm_is_procedure(cancel_scm_func))
{
progress->cancel_scm_func = cancel_scm_func;
scm_gc_protect_object(cancel_scm_func);
Modified: gnucash/trunk/src/gnome/dialog-tax-info.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-tax-info.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/gnome/dialog-tax-info.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -265,13 +265,13 @@
}
codes = scm_call_2 (getters.codes, category, tax_entity_type);
- if (!SCM_LISTP (codes))
+ if (!scm_is_list (codes))
{
destroy_txf_infos (infos);
return NULL;
}
- while (!SCM_NULLP (codes))
+ while (!scm_is_null (codes))
{
TXFInfo *txf_info;
SCM code_scm;
@@ -301,31 +301,31 @@
else
txf_info->payer_name_source = g_strdup (str);
- str = SCM_SYMBOLP(code_scm) ? SCM_SYMBOL_CHARS(code_scm) : "";
+ str = scm_is_symbol(code_scm) ? SCM_SYMBOL_CHARS(code_scm) : "";
txf_info->code = g_strdup (str);
scm = scm_call_3 (getters.form, category, code_scm, tax_entity_type);
- str = SCM_STRINGP(scm) ? SCM_STRING_CHARS(scm) : "";
+ str = scm_is_string(scm) ? scm_to_locale_string(scm) : "";
txf_info->form = g_strdup (str);
scm = scm_call_3 (getters.description, category, code_scm, tax_entity_type);
- str = SCM_STRINGP(scm) ? SCM_STRING_CHARS(scm) : "";
+ str = scm_is_string(scm) ? scm_to_locale_string(scm) : "";
txf_info->description = g_strdup (str);
scm = scm_call_2 (getters.help, category, code_scm);
- str = SCM_STRINGP(scm) ? SCM_STRING_CHARS(scm) : "";
+ str = scm_is_string(scm) ? scm_to_locale_string(scm) : "";
scm = scm_call_3 (getters.last_year, category, code_scm, tax_entity_type);
/* year = scm_is_bool (scm) ? 0 : scm_to_int(scm); <- Req's guile 1.8 */
- year = SCM_BOOLP (scm) ? 0 : SCM_INUM(scm); /* <-guile 1.6 */
+ year = scm_is_bool (scm) ? 0 : SCM_INUM(scm); /* <-guile 1.6 */
scm = scm_call_3 (getters.line_data, category, code_scm, tax_entity_type);
- if (SCM_LISTP (scm))
+ if (scm_is_list (scm))
{
const gchar *until = _("now");
if (year != 0)
until = g_strdup_printf ("%d", year);
form_line_data = g_strconcat ("\n", "\n", form_line, NULL);
- while (!SCM_NULLP (scm))
+ while (!scm_is_null (scm))
{
SCM year_scm;
gint line_year;
@@ -337,10 +337,10 @@
/* line_year = scm_is_bool (SCM_CAR (year_scm)) ? 0 :
scm_to_int (SCM_CAR (year_scm)); <- Req's guile 1.8 */
- line_year = SCM_BOOLP (SCM_CAR (year_scm)) ? 0 :
+ line_year = scm_is_bool (SCM_CAR (year_scm)) ? 0 :
SCM_INUM (SCM_CAR (year_scm)); /* <-guile 1.6 */
- line = SCM_STRINGP((SCM_CAR (SCM_CDR (year_scm))))
- ? SCM_STRING_CHARS((SCM_CAR (SCM_CDR (year_scm)))) : "";
+ line = scm_is_string((SCM_CAR (SCM_CDR (year_scm))))
+ ? scm_to_locale_string((SCM_CAR (SCM_CDR (year_scm)))) : "";
temp = g_strconcat (form_line_data, "\n",
g_strdup_printf ("%d", line_year), " - ", until,
" ", line, NULL);
@@ -372,7 +372,7 @@
scm = scm_call_3 (getters.copy, category, code_scm, tax_entity_type);
/* cpy = scm_is_bool (scm) ? (scm_is_false (scm) ? FALSE : TRUE): FALSE; <- Req's guile 1.8 */
- cpy = SCM_BOOLP (scm) ? (SCM_FALSEP (scm) ? FALSE : TRUE): FALSE; /* <-guile 1.6 */
+ cpy = scm_is_bool (scm) ? (scm_is_false (scm) ? FALSE : TRUE): FALSE; /* <-guile 1.6 */
txf_info->copy = cpy;
infos = g_list_prepend (infos, txf_info);
@@ -402,13 +402,13 @@
ti_dialog->tax_type_combo_text = NULL;
tax_types = scm_call_0 (getters.tax_entity_types);
- if (!SCM_LISTP (tax_types))
+ if (!scm_is_list (tax_types))
{
destroy_tax_type_infos (types);
return;
}
- while (!SCM_NULLP (tax_types))
+ while (!scm_is_null (tax_types))
{
TaxTypeInfo *tax_type_info;
SCM type_scm;
@@ -422,15 +422,15 @@
tax_type_info = g_new0 (TaxTypeInfo, 1);
- str = SCM_SYMBOLP(type_scm) ? SCM_SYMBOL_CHARS(type_scm) : "";
+ str = scm_is_symbol(type_scm) ? SCM_SYMBOL_CHARS(type_scm) : "";
tax_type_info->type_code = g_strdup (str);
scm = scm_call_1 (getters.tax_entity_type, type_scm);
- str = SCM_STRINGP(scm) ? SCM_STRING_CHARS (scm) : "";
+ str = scm_is_string(scm) ? scm_to_locale_string (scm) : "";
tax_type_info->type = g_strdup (str);
scm = scm_call_1 (getters.tax_entity_desc, type_scm);
- str = SCM_STRINGP(scm) ? SCM_STRING_CHARS (scm) : "";
+ str = scm_is_string(scm) ? scm_to_locale_string (scm) : "";
tax_type_info->description = g_strdup (str);
tax_type_info->combo_box_entry = g_strconcat(tax_type_info->type, " - ",
Modified: gnucash/trunk/src/gnome/gnc-plugin-page-register.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-page-register.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/gnome/gnc-plugin-page-register.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -1820,7 +1820,7 @@
args = SCM_EOL;
func = scm_c_eval_string ("gnc:register-report-create");
- g_return_val_if_fail (SCM_PROCEDUREP (func), -1);
+ g_return_val_if_fail (scm_is_procedure (func), -1);
arg = scm_makfrom0str (gnc_split_register_get_credit_string (reg));
args = scm_cons (arg, args);
@@ -1878,7 +1878,7 @@
/* Apply the function to the args */
arg = scm_apply (func, args, SCM_EOL);
- g_return_val_if_fail (SCM_EXACTP (arg), -1);
+ g_return_val_if_fail (scm_is_exact (arg), -1);
return scm_num2int (arg, SCM_ARG1, G_STRFUNC);
}
Modified: gnucash/trunk/src/gnome-utils/dialog-options.c
===================================================================
--- gnucash/trunk/src/gnome-utils/dialog-options.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/gnome-utils/dialog-options.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -2183,10 +2183,10 @@
gnc_option_set_ui_value_boolean (GNCOption *option, gboolean use_default,
GtkWidget *widget, SCM value)
{
- if (SCM_BOOLP(value))
+ if (scm_is_bool(value))
{
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget),
- SCM_NFALSEP(value));
+ scm_is_true(value));
return FALSE;
}
else
@@ -2197,9 +2197,9 @@
gnc_option_set_ui_value_string (GNCOption *option, gboolean use_default,
GtkWidget *widget, SCM value)
{
- if (SCM_STRINGP(value))
+ if (scm_is_string(value))
{
- const gchar *string = SCM_STRING_CHARS(value);
+ const gchar *string = scm_to_locale_string(value);
gtk_entry_set_text(GTK_ENTRY(widget), string);
return FALSE;
}
@@ -2218,10 +2218,10 @@
else
buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(object));
- if (SCM_STRINGP(value))
+ if (scm_is_string(value))
{
- const gchar *string = SCM_STRING_CHARS(value);
- gtk_text_buffer_set_text (buffer, string, strlen (string));
+ const gchar *string = scm_to_locale_string(value);
+ gtk_text_buffer_set_text (buffer, string, scm_i_string_length(value));
return FALSE;
}
else
@@ -2293,7 +2293,7 @@
date_option_type = gnc_option_date_option_get_subtype(option);
- if (SCM_CONSP(value))
+ if (scm_is_pair(value))
{
symbol_str = gnc_date_option_value_get_type (value);
if (symbol_str)
@@ -2432,7 +2432,7 @@
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widget));
gtk_tree_selection_unselect_all(selection);
- while (SCM_LISTP(value) && !SCM_NULLP(value))
+ while (scm_is_list(value) && !scm_is_null(value))
{
SCM item;
@@ -2450,7 +2450,7 @@
gtk_tree_path_free(path);
}
- if (!SCM_LISTP(value) || !SCM_NULLP(value))
+ if (!scm_is_list(value) || !scm_is_null(value))
return TRUE;
return FALSE;
@@ -2465,7 +2465,7 @@
spinner = GTK_SPIN_BUTTON(widget);
- if (SCM_NUMBERP(value))
+ if (scm_is_number(value))
{
d_value = scm_num2dbl(value, G_STRFUNC);
gtk_spin_button_set_value(spinner, d_value);
@@ -2506,9 +2506,9 @@
gnc_option_set_ui_value_font (GNCOption *option, gboolean use_default,
GtkWidget *widget, SCM value)
{
- if (SCM_STRINGP(value))
+ if (scm_is_string(value))
{
- const gchar *string = SCM_STRING_CHARS(value);
+ const gchar *string = scm_to_locale_string(value);
if ((string != NULL) && (*string != '\0'))
{
GtkFontButton *font_button = GTK_FONT_BUTTON(widget);
@@ -2525,9 +2525,9 @@
GtkWidget *widget, SCM value)
{
ENTER("option %p(%s)", option, gnc_option_name(option));
- if (SCM_STRINGP(value))
+ if (scm_is_string(value))
{
- const gchar *string = SCM_STRING_CHARS(value);
+ const gchar *string = scm_to_locale_string(value);
if (string && *string)
{
@@ -2556,7 +2556,7 @@
GtkTreeModel *tm;
GtkTreeIter iter;
-// if (!SCM_NULLP(value)) {
+// if (!scm_is_null(value)) {
if (value != SCM_BOOL_F) {
if (!SWIG_IsPointer(value))
scm_misc_error("gnc_option_set_ui_value_budget",
Modified: gnucash/trunk/src/gnome-utils/dialog-transfer.c
===================================================================
--- gnucash/trunk/src/gnome-utils/dialog-transfer.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/gnome-utils/dialog-transfer.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -1583,13 +1583,13 @@
quotes_func = scm_c_eval_string ("gnc:book-add-quotes");
- if (!SCM_PROCEDUREP (quotes_func)) {
+ if (!scm_is_procedure (quotes_func)) {
LEAVE("quote retrieval failed");
return;
}
book_scm = gnc_book_to_scm (xferData->book);
- if (SCM_NFALSEP (scm_not (book_scm))) {
+ if (scm_is_true (scm_not (book_scm))) {
LEAVE("no book");
return;
}
@@ -1597,7 +1597,7 @@
scm_window = SWIG_NewPointerObj(xferData->dialog,
SWIG_TypeQuery("_p_GtkWidget"), 0);
- if (SCM_NFALSEP (scm_not (book_scm))) {
+ if (scm_is_true (scm_not (book_scm))) {
LEAVE("no scm window");
return;
}
Modified: gnucash/trunk/src/gnome-utils/gnc-main-window.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-main-window.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/gnome-utils/gnc-main-window.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -3286,7 +3286,7 @@
gnc_main_window_cmd_file_properties (GtkAction *action, GncMainWindow *window)
{
SCM func = scm_c_eval_string("gnc:main-window-properties-cb");
- if (!SCM_PROCEDUREP (func)) {
+ if (!scm_is_procedure (func)) {
PERR ("not a procedure\n");
return;
}
Modified: gnucash/trunk/src/gnome-utils/gnc-menu-extensions.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-menu-extensions.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/gnome-utils/gnc-menu-extensions.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -132,7 +132,7 @@
initialize_getters();
path = gnc_guile_call1_to_list(getters.path, extension);
- if ((path == SCM_UNDEFINED) || SCM_NULLP(path)) {
+ if ((path == SCM_UNDEFINED) || scm_is_null(path)) {
*fullpath = g_strdup("");
return;
}
@@ -142,19 +142,19 @@
strings[0] = "/menubar";
i = 1;
- while (!SCM_NULLP(path))
+ while (!scm_is_null(path))
{
SCM item;
item = SCM_CAR(path);
path = SCM_CDR(path);
- if (SCM_STRINGP(item))
+ if (scm_is_string(item))
{
if (i == 1)
- strings[i] = g_strdup(SCM_STRING_CHARS(item));
+ strings[i] = g_strdup(scm_to_locale_string(item));
else
- strings[i] = g_strdup(gettext(SCM_STRING_CHARS(item)));
+ strings[i] = g_strdup(gettext(scm_to_locale_string(item)));
}
else
{
Modified: gnucash/trunk/src/guile-mappings.h
===================================================================
--- gnucash/trunk/src/guile-mappings.h 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/guile-mappings.h 2009-12-31 14:41:12 UTC (rev 18541)
@@ -19,7 +19,7 @@
/* Convenience macros */
-#define SCM_EQUALP(obj1,obj2) SCM_NFALSEP(scm_equal_p(obj1,obj2))
-#define SCM_EXACTP(obj) SCM_NFALSEP(scm_exact_p(obj))
-#define SCM_LISTP(obj) SCM_NFALSEP(scm_list_p(obj))
-#define SCM_PROCEDUREP(obj) SCM_NFALSEP(scm_procedure_p(obj))
+#define scm_is_equal(obj1,obj2) scm_is_true(scm_equal_p(obj1,obj2))
+#define scm_is_exact(obj) scm_is_true(scm_exact_p(obj))
+#define scm_is_list(obj) scm_is_true(scm_list_p(obj))
+#define scm_is_procedure(obj) scm_is_true(scm_procedure_p(obj))
Modified: gnucash/trunk/src/import-export/qif-import/dialog-account-picker.c
===================================================================
--- gnucash/trunk/src/import-export/qif-import/dialog-account-picker.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/import-export/qif-import/dialog-account-picker.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -70,27 +70,27 @@
GtkTreeRowReference **reference)
{
GtkTreeIter iter;
- char * compname;
+ const char * compname;
char * acctname;
gboolean leafnode;
SCM current;
gboolean checked;
- while(!SCM_NULLP(accts)) {
+ while(!scm_is_null(accts)) {
current = SCM_CAR(accts);
- if(SCM_NULLP(current)) {
+ if(scm_is_null(current)) {
g_critical("QIF import: BUG DETECTED in acct_tree_add_accts!");
accts = SCM_CDR(accts);
continue;
}
- if (SCM_STRINGP(SCM_CAR(current)))
- compname = SCM_STRING_CHARS(SCM_CAR(current));
+ if (scm_is_string(SCM_CAR(current)))
+ compname = scm_to_locale_string(SCM_CAR(current));
else
compname = "";
- if (!SCM_NULLP(SCM_CADDR(current))) {
+ if (!scm_is_null(SCM_CADDR(current))) {
leafnode = FALSE;
}
else {
@@ -309,7 +309,7 @@
scm_gc_protect_object(wind->map_entry);
/* Set the initial account to be selected. */
- wind->selected_name = g_strdup(SCM_STRING_CHARS(orig_acct));
+ wind->selected_name = g_strdup(scm_to_locale_string(orig_acct));
xml = gnc_glade_xml_new("qif.glade", "QIF Import Account Picker");
Modified: gnucash/trunk/src/import-export/qif-import/druid-qif-import.c
===================================================================
--- gnucash/trunk/src/import-export/qif-import/druid-qif-import.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/import-export/qif-import/druid-qif-import.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -236,9 +236,9 @@
/* clear the list */
gtk_list_store_clear(store);
- while(!SCM_NULLP(accts_left)) {
- qif_name = SCM_STRING_CHARS(scm_call_1(get_qif_name, SCM_CAR(accts_left)));
- gnc_name = SCM_STRING_CHARS(scm_call_1(get_gnc_name, SCM_CAR(accts_left)));
+ while(!scm_is_null(accts_left)) {
+ qif_name = scm_to_locale_string(scm_call_1(get_qif_name, SCM_CAR(accts_left)));
+ gnc_name = scm_to_locale_string(scm_call_1(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);
@@ -489,7 +489,7 @@
}
/* If no duplicates were found, skip all post-conversion pages. */
- if (where == 3 && SCM_NULLP(wind->match_transactions))
+ if (where == 3 && scm_is_null(wind->match_transactions))
prev = NULL;
else
prev = current->prev;
@@ -651,7 +651,7 @@
{
QIFImportWindow * wind = user_data;
- if (SCM_LISTP(wind->imported_files) &&
+ if (scm_is_list(wind->imported_files) &&
(scm_ilength(wind->imported_files) > 0)) {
gnome_druid_set_page(GNOME_DRUID(wind->druid),
get_named_page(wind, "loaded_files_page"));
@@ -828,7 +828,7 @@
wind->busy = FALSE;
return;
}
- else if (load_return == SCM_BOOL_F || !SCM_LISTP(load_return))
+ else if (load_return == SCM_BOOL_F || !scm_is_list(load_return))
{
/* A bug was detected. */
@@ -847,9 +847,9 @@
wind->busy = FALSE;
return;
}
- else if (!SCM_NULLP(load_return))
+ else if (!scm_is_null(load_return))
{
- const gchar *str = SCM_STRING_CHARS(SCM_CADR(load_return));
+ const gchar *str = scm_to_locale_string(SCM_CADR(load_return));
if (SCM_CAR(load_return) == SCM_BOOL_F)
{
@@ -901,7 +901,7 @@
wind->busy = FALSE;
return;
}
- else if (parse_return == SCM_BOOL_F || !SCM_LISTP(parse_return))
+ else if (parse_return == SCM_BOOL_F || !scm_is_list(parse_return))
{
/* A bug was detected. */
@@ -924,7 +924,7 @@
wind->busy = FALSE;
return;
}
- else if (!SCM_NULLP(parse_return))
+ else if (!scm_is_null(parse_return))
{
/* Are there only warnings? */
if (SCM_CAR(parse_return) == SCM_BOOL_T)
@@ -949,7 +949,7 @@
gtk_combo_box_remove_text(GTK_COMBO_BOX(wind->date_format_combo), 0);
/* Add the formats for the user to select from. */
- while(SCM_LISTP(date_formats) && !SCM_NULLP(date_formats))
+ while(scm_is_list(date_formats) && !scm_is_null(date_formats))
{
gtk_combo_box_append_text(GTK_COMBO_BOX(wind->date_format_combo),
SCM_SYMBOL_CHARS(SCM_CAR(date_formats)));
@@ -1061,7 +1061,7 @@
const gchar * default_acctname;
/* Go to the "ask account name" page. */
- default_acctname = SCM_STRING_CHARS(scm_call_1(default_acct,
+ default_acctname = scm_to_locale_string(scm_call_1(default_acct,
wind->selected_file));
gtk_entry_set_text(GTK_ENTRY(wind->acct_entry), default_acctname);
@@ -1162,7 +1162,7 @@
SCM default_acct = scm_c_eval_string("qif-file:path-to-accountname");
const gchar * default_acctname;
- default_acctname = SCM_STRING_CHARS(scm_call_1(default_acct,
+ default_acctname = scm_to_locale_string(scm_call_1(default_acct,
wind->selected_file));
gtk_entry_set_text(GTK_ENTRY(wind->acct_entry), default_acctname);
@@ -1193,7 +1193,7 @@
SCM scm_qiffile = SCM_BOOL_F;
SCM qif_file_path;
int row = 0;
- char * row_text;
+ const char * row_text;
GtkTreeView *view;
GtkListStore *store;
GtkTreeIter iter;
@@ -1206,9 +1206,9 @@
gtk_list_store_clear(store);
qif_file_path = scm_c_eval_string("qif-file:path");
- while(!SCM_NULLP(loaded_file_list)) {
+ while(!scm_is_null(loaded_file_list)) {
scm_qiffile = SCM_CAR(loaded_file_list);
- row_text = SCM_STRING_CHARS(scm_call_1(qif_file_path, scm_qiffile));
+ row_text = scm_to_locale_string(scm_call_1(qif_file_path, scm_qiffile));
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
@@ -1254,7 +1254,7 @@
button = gnc_glade_lookup_widget(wind->window, "unload_file_button");
if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
gtk_tree_model_get(model, &iter, FILENAME_COL_INDEX, &row, -1);
- if (SCM_LISTP(wind->imported_files) &&
+ if (scm_is_list(wind->imported_files) &&
(scm_ilength(wind->imported_files) > row)) {
scm_gc_unprotect_object(wind->selected_file);
wind->selected_file = scm_list_ref(wind->imported_files,
@@ -1799,11 +1799,11 @@
QIFImportWindow * wind = user_data;
/* If there are category mappings then proceed as usual. */
- if (SCM_LISTP(wind->cat_display_info) && !SCM_NULLP(wind->cat_display_info))
+ if (scm_is_list(wind->cat_display_info) && !scm_is_null(wind->cat_display_info))
return gnc_ui_qif_import_generic_next_cb(page, arg1, user_data);
/* If there are memo mappings then skip to that step. */
- if (SCM_LISTP(wind->memo_display_info) && !SCM_NULLP(wind->memo_display_info))
+ if (scm_is_list(wind->memo_display_info) && !scm_is_null(wind->memo_display_info))
{
if (wind->show_doc_pages)
gnome_druid_set_page(GNOME_DRUID(wind->druid),
@@ -1859,7 +1859,7 @@
QIFImportWindow * wind = user_data;
/* If there aren't any payee/memo mappings then skip that step. */
- if (!SCM_LISTP(wind->memo_display_info) || SCM_NULLP(wind->memo_display_info))
+ if (!scm_is_list(wind->memo_display_info) || scm_is_null(wind->memo_display_info))
{
gnome_druid_set_page(GNOME_DRUID(wind->druid),
get_named_page(wind, "currency_page"));
@@ -1906,7 +1906,7 @@
QIFImportWindow * wind = user_data;
/* If there are no categories to show, go to account matching. */
- if (!SCM_LISTP(wind->cat_display_info) || SCM_NULLP(wind->cat_display_info))
+ if (!scm_is_list(wind->cat_display_info) || scm_is_null(wind->cat_display_info))
{
gnome_druid_set_page(GNOME_DRUID(wind->druid),
@@ -1933,7 +1933,7 @@
/* If documentation is off and there are no categories to show,
* skip directly to account matching. */
if (!wind->show_doc_pages &&
- (!SCM_LISTP(wind->cat_display_info) || SCM_NULLP(wind->cat_display_info)))
+ (!scm_is_list(wind->cat_display_info) || scm_is_null(wind->cat_display_info)))
{
gnome_druid_set_page(GNOME_DRUID(wind->druid),
@@ -2003,7 +2003,7 @@
QIFImportWindow * wind = user_data;
/* If there are payee/memo mappings to display, go there. */
- if (SCM_LISTP(wind->memo_display_info) && !SCM_NULLP(wind->memo_display_info))
+ if (scm_is_list(wind->memo_display_info) && !scm_is_null(wind->memo_display_info))
{
gnome_druid_set_page(GNOME_DRUID(wind->druid),
get_named_page(wind, "memo_match_page"));
@@ -2011,7 +2011,7 @@
}
/* If there are category mappings to display, go there. */
- if (SCM_LISTP(wind->cat_display_info) && !SCM_NULLP(wind->cat_display_info))
+ if (scm_is_list(wind->cat_display_info) && !scm_is_null(wind->cat_display_info))
{
gnome_druid_set_page(GNOME_DRUID(wind->druid),
get_named_page(wind, "category_match_page"));
@@ -2279,7 +2279,7 @@
gnc_set_busy_cursor(NULL, TRUE);
securities = wind->new_securities;
current = wind->commodity_pages;
- while (!SCM_NULLP(securities) && (securities != SCM_BOOL_F))
+ while (!scm_is_null(securities) && (securities != SCM_BOOL_F))
{
if (current)
{
@@ -2430,12 +2430,12 @@
store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
gtk_list_store_clear(store);
- if (!SCM_LISTP(wind->match_transactions))
+ if (!scm_is_list(wind->match_transactions))
return;
/* Loop through the list of new, potentially duplicate transactions. */
duplicates = wind->match_transactions;
- while (!SCM_NULLP(duplicates))
+ while (!scm_is_null(duplicates))
{
current_xtn = SCM_CAAR(duplicates);
#define FUNC_NAME "xaccTransCountSplits"
@@ -2643,7 +2643,7 @@
wind->busy = FALSE;
return;
}
- else if (SCM_SYMBOLP(retval))
+ else if (scm_is_symbol(retval))
{
/* An error was encountered during conversion. */
@@ -2789,7 +2789,7 @@
{
QIFImportWindow *wind = user_data;
- if (SCM_NULLP(wind->match_transactions))
+ if (scm_is_null(wind->match_transactions))
{
/* No potential duplicates, so skip to the last page. */
gnome_druid_set_page(GNOME_DRUID(wind->druid),
@@ -2881,7 +2881,7 @@
scm_call_2(scm_c_eval_string("qif-import:refresh-match-selection"),
possible_matches, scm_int2num(selection));
- while(!SCM_NULLP(possible_matches)) {
+ while(!scm_is_null(possible_matches)) {
current_xtn = SCM_CAR(possible_matches);
#define FUNC_NAME "xaccTransCountSplits"
gnc_xtn = SWIG_MustGetPtr(SCM_CAR(current_xtn),
Modified: gnucash/trunk/src/report/report-gnome/dialog-column-view.c
===================================================================
--- gnucash/trunk/src/report/report-gnome/dialog-column-view.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/report/report-gnome/dialog-column-view.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -126,7 +126,7 @@
/* Update the list of available reports (left selection box). */
row = view->available_selected;
- if(SCM_LISTP(view->available_list) && !SCM_NULLP (view->available_list)) {
+ if(scm_is_list(view->available_list) && !scm_is_null (view->available_list)) {
row = MIN (row, scm_ilength (view->available_list) - 1);
selection = scm_list_ref (view->available_list, scm_int2num (row));
}
@@ -141,11 +141,11 @@
store = GTK_LIST_STORE(gtk_tree_view_get_model(view->available));
gtk_list_store_clear(store);
- if(SCM_LISTP(names)) {
- for(i = 0; !SCM_NULLP(names); names = SCM_CDR(names), i++) {
- if (SCM_EQUALP (SCM_CAR(names), selection))
+ if(scm_is_list(names)) {
+ for(i = 0; !scm_is_null(names); names = SCM_CDR(names), i++) {
+ if (scm_is_equal (SCM_CAR(names), selection))
row = i;
- name = _(SCM_STRING_CHARS(scm_call_2(template_menu_name, SCM_CAR(names),
+ name = _(scm_to_locale_string(scm_call_2(template_menu_name, SCM_CAR(names),
SCM_BOOL_F)));
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
@@ -165,7 +165,7 @@
/* Update the list of selected reports (right selection box). */
row = view->contents_selected;
- if(SCM_LISTP(view->contents_list) && !SCM_NULLP (view->contents_list)) {
+ if(scm_is_list(view->contents_list) && !scm_is_null (view->contents_list)) {
row = MIN (row, scm_ilength (view->contents_list) - 1);
selection = scm_list_ref (view->contents_list, scm_int2num (row));
}
@@ -179,14 +179,14 @@
store = GTK_LIST_STORE(gtk_tree_view_get_model(view->contents));
gtk_list_store_clear(store);
- if(SCM_LISTP(contents)) {
- for(i = 0; !SCM_NULLP(contents); contents = SCM_CDR(contents), i++) {
- if (SCM_EQUALP (SCM_CAR(contents), selection))
+ if(scm_is_list(contents)) {
+ for(i = 0; !scm_is_null(contents); contents = SCM_CDR(contents), i++) {
+ if (scm_is_equal (SCM_CAR(contents), selection))
row = i;
id = scm_num2int(SCM_CAAR(contents), SCM_ARG1, G_STRFUNC);
this_report = gnc_report_find(id);
- name = _(SCM_STRING_CHARS(scm_call_1(report_menu_name, this_report)));
+ name = _(scm_to_locale_string(scm_call_1(report_menu_name, this_report)));
gtk_list_store_append(store, &iter);
gtk_list_store_set
@@ -409,7 +409,7 @@
int count;
int oldlength, id;
- if(SCM_LISTP(r->available_list) &&
+ if(scm_is_list(r->available_list) &&
(scm_ilength(r->available_list) > r->available_selected)) {
template_name = scm_list_ref(r->available_list,
scm_int2num(r->available_selected));
@@ -464,7 +464,7 @@
int count;
int oldlength;
- if(SCM_LISTP(r->contents_list)) {
+ if(scm_is_list(r->contents_list)) {
oldlength = scm_ilength(r->contents_list);
if(oldlength > r->contents_selected) {
for(count=0; count < r->contents_selected; count++) {
Modified: gnucash/trunk/src/report/report-gnome/dialog-custom-report.c
===================================================================
--- gnucash/trunk/src/report/report-gnome/dialog-custom-report.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/report/report-gnome/dialog-custom-report.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -112,13 +112,13 @@
gtk_list_store_clear(store);
- if(SCM_LISTP(names)) {
+ if(scm_is_list(names)) {
/* for all the names in the list, store them, with a reference,
in the gtkliststore */
- for (i=0; !SCM_NULLP(names); i++) {
+ for (i=0; !scm_is_null(names); i++) {
- name = SCM_STRING_CHARS(scm_call_2(template_menu_name, SCM_CAR(names), SCM_BOOL_F));
+ name = scm_to_locale_string(scm_call_2(template_menu_name, SCM_CAR(names), SCM_BOOL_F));
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
@@ -184,7 +184,7 @@
int report_id;
GncMainWindow *window = crd->window;
- if(!SCM_NULLP(guid))
+ if(!scm_is_null(guid))
{
/* this runs the report */
@@ -295,15 +295,15 @@
SCM template_menu_name = scm_c_eval_string("gnc:report-template-menu-name/report-guid");
SCM guid;
- gchar* report_name;
+ const gchar* report_name;
sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(crd->reportview));
guid = get_custom_report_selection(crd, _("You must select a report to delete."));
- report_name = SCM_STRING_CHARS(scm_call_2(template_menu_name, guid, SCM_BOOL_F));
+ report_name = scm_to_locale_string(scm_call_2(template_menu_name, guid, SCM_BOOL_F));
/* we must confirm the user wants to delete their precious custom report! */
- if (!SCM_NULLP(guid)
+ if (!scm_is_null(guid)
&& gnc_verify_dialog(crd->dialog, FALSE, "Are you sure you want to delete %s?", report_name))
{
SCM del_report = scm_c_eval_string("gnc:delete-report");
Modified: gnucash/trunk/src/report/report-gnome/dialog-style-sheet.c
===================================================================
--- gnucash/trunk/src/report/report-gnome/dialog-style-sheet.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/report/report-gnome/dialog-style-sheet.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -71,15 +71,15 @@
SCM func = NULL;
func = scm_c_eval_string("gnc:report-stylesheet");
- if (SCM_PROCEDUREP(func))
+ if (scm_is_procedure(func))
rep_ss = scm_call_1(func, report);
else
return;
- if (SCM_NFALSEP(scm_eq_p(rep_ss, dirty_ss))) {
+ if (scm_is_true(scm_eq_p(rep_ss, dirty_ss))) {
func = scm_c_eval_string("gnc:report-set-dirty?!");
/* This makes _me_ feel dirty! */
- if (SCM_PROCEDUREP(func))
+ if (scm_is_procedure(func))
scm_call_2(func, report, SCM_BOOL_T);
}
}
@@ -191,10 +191,10 @@
gtk_list_store_clear(GTK_LIST_STORE(template_model));
/* put in the list of style sheet type names */
- for(; !SCM_NULLP(templates); templates=SCM_CDR(templates)) {
+ for(; !scm_is_null(templates); templates=SCM_CDR(templates)) {
SCM t = SCM_CAR(templates);
gtk_combo_box_append_text(GTK_COMBO_BOX(template_combo),
- SCM_STRING_CHARS(scm_call_1(t_name, t)));
+ scm_to_locale_string(scm_call_1(t_name, t)));
}
gtk_combo_box_set_active(GTK_COMBO_BOX(template_combo), 0);
@@ -233,7 +233,7 @@
get_name = scm_c_eval_string("gnc:html-style-sheet-name");
scm_name = scm_call_1(get_name, sheet_info);
- c_name = SCM_STRING_CHARS(scm_name);
+ c_name = scm_to_locale_string(scm_name);
if (!c_name)
return;
@@ -258,7 +258,7 @@
SCM sheet_info;
/* pack it full of content */
- for(; !SCM_NULLP(stylesheets); stylesheets=SCM_CDR(stylesheets)) {
+ for(; !scm_is_null(stylesheets); stylesheets=SCM_CDR(stylesheets)) {
sheet_info = SCM_CAR(stylesheets);
gnc_style_sheet_select_dialog_add_one(ss, sheet_info, FALSE);
}
Modified: gnucash/trunk/src/report/report-gnome/gnc-plugin-page-report.c
===================================================================
--- gnucash/trunk/src/report/report-gnome/gnc-plugin-page-report.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/report/report-gnome/gnc-plugin-page-report.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -705,7 +705,7 @@
report = GNC_PLUGIN_PAGE_REPORT(plugin_page);
priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
- if (!priv || !priv->cur_report || SCM_NULLP(priv->cur_report) ||
+ if (!priv || !priv->cur_report || scm_is_null(priv->cur_report) ||
SCM_UNBNDP(priv->cur_report) || SCM_BOOL_F == priv->cur_report) {
LEAVE("not saving invalid report");
return;
@@ -718,30 +718,30 @@
while (count-- > 0) {
item = SCM_CAR(embedded);
embedded = SCM_CDR(embedded);
- if (!SCM_NUMBERP(item))
+ if (!scm_is_number(item))
continue;
id = SCM_INUM(item);
tmp_report = gnc_report_find(id);
scm_text = scm_call_1(gen_save_text, tmp_report);
- if (!SCM_STRINGP (scm_text)) {
+ if (!scm_is_string (scm_text)) {
DEBUG("child report %d: nothing to save", id);
continue;
}
key_name = g_strdup_printf(SCHEME_OPTIONS_N, id);
- text = gnc_guile_strip_comments(SCM_STRING_CHARS(scm_text));
+ text = gnc_guile_strip_comments(scm_to_locale_string(scm_text));
g_key_file_set_string(key_file, group_name, key_name, text);
g_free(text);
g_free(key_name);
}
scm_text = scm_call_1(gen_save_text, priv->cur_report);
- if (!SCM_STRINGP (scm_text)) {
+ if (!scm_is_string (scm_text)) {
LEAVE("nothing to save");
return;
}
- text = gnc_guile_strip_comments(SCM_STRING_CHARS(scm_text));
+ text = gnc_guile_strip_comments(scm_to_locale_string(scm_text));
g_key_file_set_string(key_file, group_name, SCHEME_OPTIONS, text);
g_free(text);
LEAVE(" ");
@@ -924,7 +924,7 @@
SCM edited, editor;
/* close any open editors */
- for (edited = scm_list_copy(priv->edited_reports); !SCM_NULLP(edited);
+ for (edited = scm_list_copy(priv->edited_reports); !scm_is_null(edited);
edited = SCM_CDR(edited)) {
editor = scm_call_1(get_editor, SCM_CAR(edited));
scm_call_2(set_editor, SCM_CAR(edited), SCM_BOOL_F);
@@ -1251,16 +1251,16 @@
int choice;
SCM tail;
- if (!SCM_LISTP (export_types))
+ if (!scm_is_list (export_types))
return SCM_BOOL_F;
- for (tail = export_types; !SCM_NULLP (tail); tail = SCM_CDR (tail))
+ for (tail = export_types; !scm_is_null (tail); tail = SCM_CDR (tail))
{
SCM pair = SCM_CAR (tail);
const gchar * name;
SCM scm;
- if (!SCM_CONSP (pair))
+ if (!scm_is_pair (pair))
{
g_warning ("unexpected list element");
bad = TRUE;
@@ -1268,14 +1268,14 @@
}
scm = SCM_CAR (pair);
- if (!SCM_STRINGP (scm))
+ if (!scm_is_string (scm))
{
g_warning ("unexpected pair element");
bad = TRUE;
break;
}
- name = SCM_STRING_CHARS (scm);
+ name = scm_to_locale_string (scm);
choices = g_list_prepend (choices, g_strdup (name));
}
@@ -1323,7 +1323,7 @@
type = _("HTML");
else
{
- type = SCM_STRING_CHARS(SCM_CAR (choice));
+ type = scm_to_locale_string(SCM_CAR (choice));
}
/* %s is the type of what is about to be saved, e.g. "HTML". */
@@ -1412,7 +1412,7 @@
export_thunk = scm_call_1 (scm_c_eval_string ("gnc:report-export-thunk"),
priv->cur_report);
- if (SCM_LISTP (export_types) && SCM_PROCEDUREP (export_thunk))
+ if (scm_is_list (export_types) && scm_is_procedure (export_thunk))
choice = gnc_get_export_type_choice (export_types);
else
choice = SCM_BOOL_T;
@@ -1424,7 +1424,7 @@
if (!filepath)
return;
- if (SCM_CONSP (choice))
+ if (scm_is_pair (choice))
{
SCM file_scm;
SCM res;
Modified: gnucash/trunk/src/report/report-gnome/window-report.c
===================================================================
--- gnucash/trunk/src/report/report-gnome/window-report.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/report/report-gnome/window-report.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -153,8 +153,8 @@
ptr = scm_call_1(get_template, ptr);
if (ptr != SCM_BOOL_F) {
ptr = scm_call_1(get_template_name, ptr);
- if (SCM_STRINGP(ptr))
- title = SCM_STRING_CHARS(ptr);
+ if (scm_is_string(ptr))
+ title = scm_to_locale_string(ptr);
}
}
Modified: gnucash/trunk/src/report/report-system/gnc-report.c
===================================================================
--- gnucash/trunk/src/report/report-system/gnc-report.c 2009-12-30 16:49:30 UTC (rev 18540)
+++ gnucash/trunk/src/report/report-system/gnc-report.c 2009-12-31 14:41:12 UTC (rev 18541)
@@ -76,7 +76,7 @@
gnc_report_init_table();
value = scm_call_1(get_id, report);
- if (SCM_NUMBERP(value)) {
+ if (scm_is_number(value)) {
id = scm_num2int(value, SCM_ARG1, G_STRFUNC);
if (!g_hash_table_lookup(reports, &id)) {
key = g_new(gint, 1);
@@ -146,10 +146,10 @@
scm_text = gfec_eval_string(str, error_handler);
g_free(str);
- if (scm_text == SCM_UNDEFINED || !SCM_STRINGP (scm_text))
+ if (scm_text == SCM_UNDEFINED || !scm_is_string (scm_text))
return FALSE;
- free_data = SCM_STRING_CHARS (scm_text);
+ free_data = scm_to_locale_string (scm_text);
*data = g_strdup (free_data);
return TRUE;
@@ -183,9 +183,9 @@
return NULL;
value = scm_call_1(get_name, report);
- if (!SCM_STRINGP(value))
+ if (!scm_is_string(value))
return NULL;
- return g_strdup(SCM_STRING_CHARS(value));
+ return g_strdup(scm_to_locale_string(value));
}
More information about the gnucash-changes
mailing list