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

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18541 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Geert Janssens 2009-12-31 14:41:12 +00:00
parent 1f61a5c473
commit 35c352d09b
37 changed files with 402 additions and 402 deletions

View File

@ -91,13 +91,13 @@ void gnc_register_kvp_option_generator(QofIdType id_type, SCM generator);
%typemap(in) GList * { %typemap(in) GList * {
SCM path_scm = $input; SCM path_scm = $input;
GList *path = NULL; GList *path = NULL;
while (!SCM_NULLP (path_scm)) while (!scm_is_null (path_scm))
{ {
SCM key_scm = SCM_CAR (path_scm); SCM key_scm = SCM_CAR (path_scm);
char *key; char *key;
if (!SCM_STRINGP (key_scm)) if (!scm_is_string (key_scm))
break; 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 = g_list_prepend (path, key);
path_scm = SCM_CDR (path_scm); path_scm = SCM_CDR (path_scm);
} }

View File

@ -60,8 +60,8 @@ gncFindFile (const char * filename)
scm_filename = scm_makfrom0str ((char *) filename); scm_filename = scm_makfrom0str ((char *) filename);
scm_result = scm_call_1(find_doc_file, scm_filename); scm_result = scm_call_1(find_doc_file, scm_filename);
if (SCM_STRINGP(scm_result)) if (scm_is_string(scm_result))
full_filename = SCM_STRING_CHARS(scm_result); full_filename = scm_to_locale_string(scm_result);
return g_strdup (full_filename); return g_strdup (full_filename);
} }

View File

@ -25,14 +25,14 @@ gfec_catcher(void *data, SCM tag, SCM throw_args)
{ {
SCM func; SCM func;
SCM result; SCM result;
char *msg = NULL; const char *msg = NULL;
func = scm_c_eval_string("gnc:error->string"); 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); result = scm_call_2(func, tag, throw_args);
if (SCM_STRINGP(result)) if (scm_is_string(result))
msg = SCM_STRING_CHARS(result); msg = scm_to_locale_string(result);
} }
if (msg == NULL) if (msg == NULL)

View File

@ -350,7 +350,7 @@ func_op(const char *fname, int argc, void **argv)
(scm_t_catch_body)scm_c_eval_string, realFnName->str, (scm_t_catch_body)scm_c_eval_string, realFnName->str,
scm_handle_by_message_noexit, NULL); scm_handle_by_message_noexit, NULL);
g_string_free( realFnName, TRUE ); g_string_free( realFnName, TRUE );
if (!SCM_PROCEDUREP(scmFn)) if (!scm_is_procedure(scmFn))
{ {
/* FIXME: handle errors correctly. */ /* FIXME: handle errors correctly. */
printf( "gnc:\"%s\" is not a scm procedure\n", fname ); printf( "gnc:\"%s\" is not a scm procedure\n", fname );

View File

@ -75,22 +75,22 @@ gnc_scm2printinfo(SCM info_scm)
G_STRFUNC); G_STRFUNC);
info_scm = SCM_CDR (info_scm); 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_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_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_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_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_scm = SCM_CDR (info_scm);
info.round = SCM_NFALSEP (SCM_CAR (info_scm)); info.round = scm_is_true (SCM_CAR (info_scm));
return info; return info;
} }
@ -100,11 +100,11 @@ gnc_printinfo_p(SCM info_scm)
{ {
const gchar *symbol; 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; return 0;
info_scm = SCM_CAR (info_scm); info_scm = SCM_CAR (info_scm);
if (!SCM_SYMBOLP (info_scm)) if (!scm_is_symbol (info_scm))
return 0; return 0;
symbol = SCM_SYMBOL_CHARS (info_scm); symbol = SCM_SYMBOL_CHARS (info_scm);

View File

@ -526,8 +526,8 @@ gnc_ui_account_get_tax_info_string (const Account *account)
("(false-if-exception gnc:txf-get-description)"); ("(false-if-exception gnc:txf-get-description)");
} }
g_return_val_if_fail (SCM_PROCEDUREP (get_form), NULL); g_return_val_if_fail (scm_is_procedure (get_form), NULL);
g_return_val_if_fail (SCM_PROCEDUREP (get_desc), NULL); g_return_val_if_fail (scm_is_procedure (get_desc), NULL);
category = scm_c_eval_string (atype == ACCT_TYPE_INCOME ? category = scm_c_eval_string (atype == ACCT_TYPE_INCOME ?
"txf-income-categories" : "txf-income-categories" :
@ -559,7 +559,7 @@ gnc_ui_account_get_tax_info_string (const Account *account)
code_scm = scm_str2symbol (code); code_scm = scm_str2symbol (code);
scm = scm_call_3 (get_form, category, code_scm, tax_entity_type); scm = scm_call_3 (get_form, category, code_scm, tax_entity_type);
if (!SCM_STRINGP (scm)) if (!scm_is_string (scm))
{ {
if (tax_related) if (tax_related)
return g_strdup_printf return g_strdup_printf
@ -569,7 +569,7 @@ gnc_ui_account_get_tax_info_string (const Account *account)
(_("Not tax-related; invalid code %s for tax type %s"), code, tax_type); (_("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 (!form)
{ {
if (tax_related) if (tax_related)
@ -581,7 +581,7 @@ gnc_ui_account_get_tax_info_string (const Account *account)
} }
scm = scm_call_3 (get_desc, category, code_scm, tax_entity_type); scm = scm_call_3 (get_desc, category, code_scm, tax_entity_type);
if (!SCM_STRINGP (scm)) if (!scm_is_string (scm))
{ {
if (tax_related) if (tax_related)
return g_strdup_printf return g_strdup_printf
@ -593,7 +593,7 @@ gnc_ui_account_get_tax_info_string (const Account *account)
form, code, tax_type); form, code, tax_type);
} }
desc = SCM_STRING_CHARS (scm); desc = scm_to_locale_string (scm);
if (!desc) if (!desc)
{ {
if (tax_related) if (tax_related)

View File

@ -154,12 +154,12 @@ gnc_guile_call1_to_string(SCM func, SCM arg)
{ {
SCM value; SCM value;
if (SCM_PROCEDUREP(func)) if (scm_is_procedure(func))
{ {
value = scm_call_1(func, arg); value = scm_call_1(func, arg);
if (SCM_STRINGP(value)) if (scm_is_string(value))
return g_strdup(SCM_STRING_CHARS(value)); return g_strdup(scm_to_locale_string(value));
else else
{ {
PERR("bad value\n"); PERR("bad value\n");
@ -189,11 +189,11 @@ gnc_guile_call1_symbol_to_string(SCM func, SCM arg)
{ {
SCM value; SCM value;
if (SCM_PROCEDUREP(func)) if (scm_is_procedure(func))
{ {
value = scm_call_1(func, arg); value = scm_call_1(func, arg);
if (SCM_SYMBOLP(value)) if (scm_is_symbol(value))
return g_strdup(SCM_SYMBOL_CHARS(value)); return g_strdup(SCM_SYMBOL_CHARS(value));
else else
{ {
@ -223,11 +223,11 @@ gnc_guile_call1_to_procedure(SCM func, SCM arg)
{ {
SCM value; SCM value;
if (SCM_PROCEDUREP(func)) if (scm_is_procedure(func))
{ {
value = scm_call_1(func, arg); value = scm_call_1(func, arg);
if (SCM_PROCEDUREP(value)) if (scm_is_procedure(value))
return value; return value;
else else
{ {
@ -257,11 +257,11 @@ gnc_guile_call1_to_list(SCM func, SCM arg)
{ {
SCM value; SCM value;
if (SCM_PROCEDUREP(func)) if (scm_is_procedure(func))
{ {
value = scm_call_1(func, arg); value = scm_call_1(func, arg);
if (SCM_LISTP(value)) if (scm_is_list(value))
return value; return value;
else else
{ {
@ -291,11 +291,11 @@ gnc_guile_call1_to_vector(SCM func, SCM arg)
{ {
SCM value; SCM value;
if (SCM_PROCEDUREP(func)) if (scm_is_procedure(func))
{ {
value = scm_call_1(func, arg); value = scm_call_1(func, arg);
if (SCM_VECTORP(value)) if (scm_is_vector(value))
return value; return value;
else else
{ {
@ -393,7 +393,7 @@ gnc_copy_split(Split *split, gboolean use_cut_semantics)
return SCM_UNDEFINED; return SCM_UNDEFINED;
func = scm_c_eval_string("gnc:split->split-scm"); func = scm_c_eval_string("gnc:split->split-scm");
if (!SCM_PROCEDUREP(func)) if (!scm_is_procedure(func))
return SCM_UNDEFINED; return SCM_UNDEFINED;
if (!split_type) if (!split_type)
@ -431,15 +431,15 @@ gnc_copy_split_scm_onto_split(SCM split_scm, Split *split,
g_return_if_fail (book); g_return_if_fail (book);
func = scm_c_eval_string("gnc:split-scm?"); func = scm_c_eval_string("gnc:split-scm?");
if (!SCM_PROCEDUREP(func)) if (!scm_is_procedure(func))
return; return;
result = scm_call_1(func, split_scm); result = scm_call_1(func, split_scm);
if (!SCM_NFALSEP(result)) if (!scm_is_true(result))
return; return;
func = scm_c_eval_string("gnc:split-scm-onto-split"); func = scm_c_eval_string("gnc:split-scm-onto-split");
if (!SCM_PROCEDUREP(func)) if (!scm_is_procedure(func))
return; return;
if (!split_type) if (!split_type)
@ -463,7 +463,7 @@ gnc_is_split_scm(SCM scm)
{ {
initialize_scm_functions(); 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 @@ gnc_is_trans_scm(SCM scm)
{ {
initialize_scm_functions(); 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 @@ gnc_split_scm_get_memo(SCM split_scm)
return NULL; return NULL;
result = scm_call_1(getters.split_scm_memo, split_scm); result = scm_call_1(getters.split_scm_memo, split_scm);
if (!SCM_STRINGP(result)) if (!scm_is_string(result))
return NULL; return NULL;
return g_strdup(SCM_STRING_CHARS(result)); return g_strdup(scm_to_locale_string(result));
} }
@ -679,10 +679,10 @@ gnc_split_scm_get_action(SCM split_scm)
return NULL; return NULL;
result = scm_call_1(getters.split_scm_action, split_scm); result = scm_call_1(getters.split_scm_action, split_scm);
if (!SCM_STRINGP(result)) if (!scm_is_string(result))
return NULL; return NULL;
return g_strdup(SCM_STRING_CHARS(result)); return g_strdup(scm_to_locale_string(result));
} }
@ -756,7 +756,7 @@ gnc_copy_trans(Transaction *trans, gboolean use_cut_semantics)
return SCM_UNDEFINED; return SCM_UNDEFINED;
func = scm_c_eval_string("gnc:transaction->transaction-scm"); func = scm_c_eval_string("gnc:transaction->transaction-scm");
if (!SCM_PROCEDUREP(func)) if (!scm_is_procedure(func))
return SCM_UNDEFINED; return SCM_UNDEFINED;
if (!trans_type) if (!trans_type)
@ -821,15 +821,15 @@ gnc_copy_trans_scm_onto_trans_swap_accounts(SCM trans_scm,
g_return_if_fail (book); g_return_if_fail (book);
func = scm_c_eval_string("gnc:transaction-scm?"); func = scm_c_eval_string("gnc:transaction-scm?");
if (!SCM_PROCEDUREP(func)) if (!scm_is_procedure(func))
return; return;
result = scm_call_1(func, trans_scm); result = scm_call_1(func, trans_scm);
if (!SCM_NFALSEP(result)) if (!scm_is_true(result))
return; return;
func = scm_c_eval_string("gnc:transaction-scm-onto-transaction"); func = scm_c_eval_string("gnc:transaction-scm-onto-transaction");
if (!SCM_PROCEDUREP(func)) if (!scm_is_procedure(func))
return; return;
if (!trans_type) if (!trans_type)
@ -1077,7 +1077,7 @@ gnc_trans_scm_get_num_splits(SCM trans_scm)
result = scm_call_1(getters.trans_scm_split_scms, trans_scm); result = scm_call_1(getters.trans_scm_split_scms, trans_scm);
if (!SCM_LISTP(result)) if (!scm_is_list(result))
return 0; return 0;
return SCM_LENGTH(result); return SCM_LENGTH(result);
@ -1109,10 +1109,10 @@ gnc_get_debit_string(GNCAccountType account_type)
arg = scm_long2num(account_type); arg = scm_long2num(account_type);
result = scm_call_1(getters.debit_string, arg); result = scm_call_1(getters.debit_string, arg);
if (!SCM_STRINGP(result)) if (!scm_is_string(result))
return NULL; return NULL;
string = SCM_STRING_CHARS(result); string = scm_to_locale_string(result);
if (string) if (string)
return g_strdup(string); return g_strdup(string);
return NULL; return NULL;
@ -1144,10 +1144,10 @@ gnc_get_credit_string(GNCAccountType account_type)
arg = scm_long2num(account_type); arg = scm_long2num(account_type);
result = scm_call_1(getters.credit_string, arg); result = scm_call_1(getters.credit_string, arg);
if (!SCM_STRINGP(result)) if (!scm_is_string(result))
return NULL; return NULL;
string = SCM_STRING_CHARS(result); string = scm_to_locale_string(result);
if (string) if (string)
return g_strdup(string); return g_strdup(string);
return NULL; return NULL;

View File

@ -290,7 +290,7 @@ gnc_option_db_load_from_kvp(GNCOptionDB* odb, kvp_frame *slots)
if (kvp_to_scm == SCM_UNDEFINED) if (kvp_to_scm == SCM_UNDEFINED)
{ {
kvp_to_scm = scm_c_eval_string("gnc:options-kvp->scm"); 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"); PERR ("not a procedure\n");
kvp_to_scm = SCM_UNDEFINED; kvp_to_scm = SCM_UNDEFINED;
@ -324,7 +324,7 @@ gnc_option_db_save_to_kvp(GNCOptionDB* odb, kvp_frame *slots)
if (scm_to_kvp == SCM_UNDEFINED) if (scm_to_kvp == SCM_UNDEFINED)
{ {
scm_to_kvp = scm_c_eval_string("gnc:options-scm->kvp"); 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"); PERR ("not a procedure\n");
scm_to_kvp = SCM_UNDEFINED; scm_to_kvp = SCM_UNDEFINED;
@ -450,7 +450,7 @@ gnc_option_db_register_change_callback(GNCOptionDB *odb,
/* Get the register procedure */ /* Get the register procedure */
register_proc = scm_c_eval_string("gnc:options-register-c-callback"); 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"); PERR("not a procedure\n");
return SCM_UNDEFINED; return SCM_UNDEFINED;
@ -515,7 +515,7 @@ gnc_option_db_unregister_change_callback_id(GNCOptionDB *odb, SCM callback_id)
return; return;
proc = scm_c_eval_string("gnc:options-unregister-callback-id"); proc = scm_c_eval_string("gnc:options-unregister-callback-id");
if (!SCM_PROCEDUREP(proc)) if (!scm_is_procedure(proc))
{ {
PERR("not a procedure\n"); PERR("not a procedure\n");
return; return;
@ -536,7 +536,7 @@ gnc_call_option_change_callbacks(GNCOptionDB *odb)
SCM proc; SCM proc;
proc = scm_c_eval_string("gnc:options-run-callbacks"); proc = scm_c_eval_string("gnc:options-run-callbacks");
if (!SCM_PROCEDUREP(proc)) if (!scm_is_procedure(proc))
{ {
PERR("not a procedure\n"); PERR("not a procedure\n");
return; return;
@ -764,12 +764,12 @@ gnc_option_widget_changed_proc_getter(GNCOption *option)
initialize_getters(); 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 */ /* call the callback function getter to get the actual callback function */
cb = scm_call_1(getters.option_widget_changed_cb, option->guile_option); 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 ); return( cb );
} }
@ -829,7 +829,7 @@ gnc_option_num_permissible_values(GNCOption *option)
value = scm_call_1(getters.number_of_indices, option->guile_option); 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); return scm_num2int(value, SCM_ARG1, G_STRFUNC);
} }
@ -916,10 +916,10 @@ gnc_option_permissible_value_name(GNCOption *option, int index)
scm_int2num(index)); scm_int2num(index));
if (name == SCM_UNDEFINED) if (name == SCM_UNDEFINED)
return NULL; return NULL;
if (!SCM_STRINGP(name)) if (!scm_is_string(name))
return NULL; return NULL;
return g_strdup(SCM_STRING_CHARS(name)); return g_strdup(scm_to_locale_string(name));
} }
@ -947,10 +947,10 @@ gnc_option_permissible_value_description(GNCOption *option, int index)
scm_int2num(index)); scm_int2num(index));
if (help == SCM_UNDEFINED) if (help == SCM_UNDEFINED)
return NULL; return NULL;
if (!SCM_STRINGP(help)) if (!scm_is_string(help))
return NULL; return NULL;
return g_strdup(SCM_STRING_CHARS(help)); return g_strdup(scm_to_locale_string(help));
} }
@ -971,7 +971,7 @@ gnc_option_show_time(GNCOption *option)
value = scm_call_1(getters.date_option_show_time, option->guile_option); 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 @@ gnc_option_multiple_selection(GNCOption *option)
pair = scm_call_1(getters.option_data, option->guile_option); 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 @@ gnc_option_get_account_type_list(GNCOption *option)
pair = scm_call_1(getters.option_data, option->guile_option); pair = scm_call_1(getters.option_data, option->guile_option);
lst = SCM_CDR(pair); lst = SCM_CDR(pair);
while (!SCM_NULLP (lst)) while (!scm_is_null (lst))
{ {
GNCAccountType type; GNCAccountType type;
SCM item; SCM item;
@ -1040,7 +1040,7 @@ gnc_option_get_account_type_list(GNCOption *option)
item = SCM_CAR (lst); item = SCM_CAR (lst);
lst = SCM_CDR (lst); lst = SCM_CDR (lst);
if (SCM_FALSEP (scm_integer_p (item))) if (scm_is_false (scm_integer_p (item)))
{ {
PERR ("Invalid type"); PERR ("Invalid type");
} }
@ -1077,40 +1077,40 @@ gboolean gnc_option_get_range_info(GNCOption *option,
list = scm_call_1(getters.option_data, option->guile_option); 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; return FALSE;
/* lower bound */ /* lower bound */
value = SCM_CAR(list); value = SCM_CAR(list);
list = SCM_CDR(list); list = SCM_CDR(list);
if (!SCM_NUMBERP(value)) if (!scm_is_number(value))
return FALSE; return FALSE;
if (lower_bound != NULL) if (lower_bound != NULL)
*lower_bound = scm_num2dbl(value, G_STRFUNC); *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; return FALSE;
/* upper bound */ /* upper bound */
value = SCM_CAR(list); value = SCM_CAR(list);
list = SCM_CDR(list); list = SCM_CDR(list);
if (!SCM_NUMBERP(value)) if (!scm_is_number(value))
return FALSE; return FALSE;
if (upper_bound != NULL) if (upper_bound != NULL)
*upper_bound = scm_num2dbl(value, G_STRFUNC); *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; return FALSE;
/* number of decimals */ /* number of decimals */
value = SCM_CAR(list); value = SCM_CAR(list);
list = SCM_CDR(list); list = SCM_CDR(list);
if (!SCM_NUMBERP(value)) if (!scm_is_number(value))
return FALSE; return FALSE;
/* Guile-1.6 returns this as a double, so let's use that in all cases. /* Guile-1.6 returns this as a double, so let's use that in all cases.
@ -1122,14 +1122,14 @@ gboolean gnc_option_get_range_info(GNCOption *option,
*num_decimals = (int)decimals; *num_decimals = (int)decimals;
} }
if (!SCM_LISTP(list) || SCM_NULLP(list)) if (!scm_is_list(list) || scm_is_null(list))
return FALSE; return FALSE;
/* step size */ /* step size */
value = SCM_CAR(list); value = SCM_CAR(list);
list = SCM_CDR(list); list = SCM_CDR(list);
if (!SCM_NUMBERP(value)) if (!scm_is_number(value))
return FALSE; return FALSE;
if (step_size != NULL) if (step_size != NULL)
@ -1156,11 +1156,11 @@ gnc_option_color_range(GNCOption *option)
initialize_getters(); initialize_getters();
list = scm_call_1(getters.option_data, option->guile_option); 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; return 0.0;
value = SCM_CAR(list); value = SCM_CAR(list);
if (!SCM_NUMBERP(value)) if (!scm_is_number(value))
return 0.0; return 0.0;
return scm_num2dbl(value, G_STRFUNC); return scm_num2dbl(value, G_STRFUNC);
@ -1184,18 +1184,18 @@ gnc_option_use_alpha(GNCOption *option)
initialize_getters(); initialize_getters();
list = scm_call_1(getters.option_data, option->guile_option); 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; return FALSE;
list = SCM_CDR(list); list = SCM_CDR(list);
if (!SCM_LISTP(list) || SCM_NULLP(list)) if (!scm_is_list(list) || scm_is_null(list))
return FALSE; return FALSE;
value = SCM_CAR(list); value = SCM_CAR(list);
if (!SCM_BOOLP(value)) if (!scm_is_bool(value))
return FALSE; return FALSE;
return SCM_NFALSEP(value); return scm_is_true(value);
} }
@ -1267,7 +1267,7 @@ gnc_option_get_color_info(GNCOption *option,
return FALSE; return FALSE;
value = scm_call_0(getter); 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; return FALSE;
scale = gnc_option_color_range(option); scale = gnc_option_color_range(option);
@ -1281,7 +1281,7 @@ gnc_option_get_color_info(GNCOption *option,
*red = MIN(1.0, rgba * scale); *red = MIN(1.0, rgba * scale);
value = SCM_CDR(value); 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; return FALSE;
rgba = scm_num2dbl(SCM_CAR(value), G_STRFUNC); rgba = scm_num2dbl(SCM_CAR(value), G_STRFUNC);
@ -1289,7 +1289,7 @@ gnc_option_get_color_info(GNCOption *option,
*green = MIN(1.0, rgba * scale); *green = MIN(1.0, rgba * scale);
value = SCM_CDR(value); 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; return FALSE;
rgba = scm_num2dbl(SCM_CAR(value), G_STRFUNC); rgba = scm_num2dbl(SCM_CAR(value), G_STRFUNC);
@ -1297,7 +1297,7 @@ gnc_option_get_color_info(GNCOption *option,
*blue = MIN(1.0, rgba * scale); *blue = MIN(1.0, rgba * scale);
value = SCM_CDR(value); 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; return FALSE;
rgba = scm_num2dbl(SCM_CAR(value), G_STRFUNC); rgba = scm_num2dbl(SCM_CAR(value), G_STRFUNC);
@ -1649,18 +1649,18 @@ gnc_option_valid_value(GNCOption *option, SCM value)
validator = gnc_option_value_validator(option); validator = gnc_option_value_validator(option);
result = scm_call_1(validator, value); 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; return SCM_UNDEFINED;
ok = SCM_CAR(result); ok = SCM_CAR(result);
if (!SCM_BOOLP(ok)) if (!scm_is_bool(ok))
return SCM_UNDEFINED; return SCM_UNDEFINED;
if (!SCM_NFALSEP(ok)) if (!scm_is_true(ok))
return SCM_UNDEFINED; return SCM_UNDEFINED;
result = SCM_CDR(result); 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_UNDEFINED;
return SCM_CAR(result); return SCM_CAR(result);
@ -1681,7 +1681,7 @@ gnc_commit_option(GNCOption *option)
validator = gnc_option_value_validator(option); validator = gnc_option_value_validator(option);
result = scm_call_1(validator, value); 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"); PERR("bad validation result\n");
return; return;
@ -1689,13 +1689,13 @@ gnc_commit_option(GNCOption *option)
/* First element determines validity */ /* First element determines validity */
ok = SCM_CAR(result); ok = SCM_CAR(result);
if (!SCM_BOOLP(ok)) if (!scm_is_bool(ok))
{ {
PERR("bad validation result\n"); PERR("bad validation result\n");
return; return;
} }
if (SCM_NFALSEP(ok)) if (scm_is_true(ok))
{ {
/* Second element is value to use */ /* Second element is value to use */
value = SCM_CADR(result); value = SCM_CADR(result);
@ -1715,13 +1715,13 @@ gnc_commit_option(GNCOption *option)
/* Second element is error message */ /* Second element is error message */
oops = SCM_CADR(result); oops = SCM_CADR(result);
if (!SCM_STRINGP(oops)) if (!scm_is_string(oops))
{ {
PERR("bad validation result\n"); PERR("bad validation result\n");
return; return;
} }
message = SCM_STRING_CHARS(oops); message = scm_to_locale_string(oops);
name = gnc_option_name(option); name = gnc_option_name(option);
section = gnc_option_section(option); section = gnc_option_section(option);
@ -1907,14 +1907,14 @@ gnc_option_db_get_default_section(GNCOptionDB *odb)
return NULL; return NULL;
getter = scm_c_eval_string("gnc:options-get-default-section"); getter = scm_c_eval_string("gnc:options-get-default-section");
if (!SCM_PROCEDUREP(getter)) if (!scm_is_procedure(getter))
return NULL; return NULL;
value = scm_call_1(getter, odb->guile_options); value = scm_call_1(getter, odb->guile_options);
if (!SCM_STRINGP(value)) if (!scm_is_string(value))
return NULL; return NULL;
return g_strdup(SCM_STRING_CHARS(value)); return g_strdup(scm_to_locale_string(value));
} }
@ -1982,8 +1982,8 @@ gnc_option_db_lookup_boolean_option(GNCOptionDB *odb,
value = scm_call_0(getter); value = scm_call_0(getter);
if (SCM_BOOLP(value)) if (scm_is_bool(value))
return SCM_NFALSEP(value); return scm_is_true(value);
else else
return default_value; return default_value;
} }
@ -2019,8 +2019,8 @@ gnc_option_db_lookup_string_option(GNCOptionDB *odb,
if (getter != SCM_UNDEFINED) if (getter != SCM_UNDEFINED)
{ {
value = scm_call_0(getter); value = scm_call_0(getter);
if (SCM_STRINGP(value)) if (scm_is_string(value))
return g_strdup(SCM_STRING_CHARS(value)); return g_strdup(scm_to_locale_string(value));
} }
} }
@ -2084,7 +2084,7 @@ gnc_option_db_lookup_multichoice_option(GNCOptionDB *odb,
if (getter != SCM_UNDEFINED) if (getter != SCM_UNDEFINED)
{ {
value = scm_call_0(getter); value = scm_call_0(getter);
if (SCM_SYMBOLP(value)) if (scm_is_symbol(value))
return g_strdup(SCM_SYMBOL_CHARS(value)); return g_strdup(SCM_SYMBOL_CHARS(value));
} }
} }
@ -2161,7 +2161,7 @@ gnc_option_db_lookup_date_option(GNCOptionDB *odb,
{ {
value = scm_call_0(getter); value = scm_call_0(getter);
if (SCM_CONSP(value)) if (scm_is_pair(value))
{ {
Timespec absolute; Timespec absolute;
@ -2231,7 +2231,7 @@ gnc_option_db_lookup_number_option(GNCOptionDB *odb,
if (getter != SCM_UNDEFINED) if (getter != SCM_UNDEFINED)
{ {
value = scm_call_0(getter); value = scm_call_0(getter);
if (SCM_NUMBERP(value)) if (scm_is_number(value))
return scm_num2dbl(value, G_STRFUNC); return scm_num2dbl(value, G_STRFUNC);
} }
} }
@ -2328,12 +2328,12 @@ gnc_option_db_lookup_list_option(GNCOptionDB *odb,
return default_value; return default_value;
value = scm_call_0(getter); 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); item = SCM_CAR(value);
value = SCM_CDR(value); value = SCM_CDR(value);
if (!SCM_SYMBOLP(item)) if (!scm_is_symbol(item))
{ {
gnc_free_list_option_value(list); gnc_free_list_option_value(list);
@ -2343,7 +2343,7 @@ gnc_option_db_lookup_list_option(GNCOptionDB *odb,
list = g_slist_prepend(list, g_strdup(SCM_SYMBOL_CHARS(item))); 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); gnc_free_list_option_value(list);
@ -2601,7 +2601,7 @@ gnc_option_date_option_get_subtype(GNCOption *option)
value = scm_call_1(getters.date_option_subtype, option->guile_option); 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)); return g_strdup(SCM_SYMBOL_CHARS(value));
else else
return NULL; return NULL;
@ -2622,7 +2622,7 @@ gnc_date_option_value_get_type (SCM option_value)
initialize_getters(); initialize_getters();
value = scm_call_1 (getters.date_option_value_type, option_value); value = scm_call_1 (getters.date_option_value_type, option_value);
if (!SCM_SYMBOLP (value)) if (!scm_is_symbol (value))
return NULL; return NULL;
return g_strdup(SCM_SYMBOL_CHARS (value)); return g_strdup(SCM_SYMBOL_CHARS (value));
@ -2703,7 +2703,7 @@ gboolean gnc_dateformat_option_value_parse(SCM value, QofDateFormat *format,
SCM val; SCM val;
const char *str; const char *str;
if (!SCM_LISTP(value) || SCM_NULLP(value)) if (!scm_is_list(value) || scm_is_null(value))
return TRUE; return TRUE;
do do
@ -2712,7 +2712,7 @@ gboolean gnc_dateformat_option_value_parse(SCM value, QofDateFormat *format,
/* Parse the format */ /* Parse the format */
val = SCM_CAR(value); val = SCM_CAR(value);
value = SCM_CDR(value); value = SCM_CDR(value);
if (!SCM_SYMBOLP(val)) if (!scm_is_symbol(val))
break; break;
str = SCM_SYMBOL_CHARS (val); str = SCM_SYMBOL_CHARS (val);
if (!str) if (!str)
@ -2729,7 +2729,7 @@ gboolean gnc_dateformat_option_value_parse(SCM value, QofDateFormat *format,
/* parse the months */ /* parse the months */
val = SCM_CAR(value); val = SCM_CAR(value);
value = SCM_CDR(value); value = SCM_CDR(value);
if (!SCM_SYMBOLP(val)) if (!scm_is_symbol(val))
break; break;
str = SCM_SYMBOL_CHARS (val); str = SCM_SYMBOL_CHARS (val);
if (!str) if (!str)
@ -2746,22 +2746,22 @@ gboolean gnc_dateformat_option_value_parse(SCM value, QofDateFormat *format,
/* parse the years */ /* parse the years */
val = SCM_CAR(value); val = SCM_CAR(value);
value = SCM_CDR(value); value = SCM_CDR(value);
if (!SCM_BOOLP(val)) if (!scm_is_bool(val))
break; break;
if (years) if (years)
*years = SCM_NFALSEP(val); *years = scm_is_true(val);
/* parse the custom */ /* parse the custom */
val = SCM_CAR(value); val = SCM_CAR(value);
value = SCM_CDR(value); value = SCM_CDR(value);
if (!SCM_STRINGP(val)) if (!scm_is_string(val))
break; break;
if (!SCM_NULLP(value)) if (!scm_is_null(value))
break; break;
if (custom) if (custom)
*custom = g_strdup(SCM_STRING_CHARS(val)); *custom = g_strdup(scm_to_locale_string(val));
return FALSE; return FALSE;

View File

@ -39,7 +39,7 @@ run_tests (int count)
int i; int i;
val2str = scm_c_eval_string ("gnc:value->string"); 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++) for (i = 0; i < count; i++)
{ {

View File

@ -30,7 +30,7 @@ test_query (Query *q, SCM val2str)
args = scm_cons (scm_makfrom0str ("'"), scm_cons (str_q, SCM_EOL)); args = scm_cons (scm_makfrom0str ("'"), scm_cons (str_q, SCM_EOL));
str_q = scm_string_append (args); 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 (str) str2 = g_strdup(str);
if (str2) if (str2)
{ {
@ -69,7 +69,7 @@ run_tests (void)
int i; int i;
val2str = scm_c_eval_string ("gnc:value->string"); 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++) for (i = 0; i < 1000; i++)
{ {

View File

@ -14,14 +14,14 @@ typedef char gchar;
%typemap (out) char * { %typemap (out) char * {
$result = scm_makfrom0str((const char *)$1); $result = scm_makfrom0str((const char *)$1);
if (!SCM_NFALSEP($result)) { if (!scm_is_true($result)) {
$result = scm_makstr(0, 0); $result = scm_makstr(0, 0);
} }
} }
%typemap(in) GNCPrintAmountInfo "$1 = gnc_scm2printinfo($input);" %typemap(in) GNCPrintAmountInfo "$1 = gnc_scm2printinfo($input);"
%typemap(out) GNCPrintAmountInfo "$result = gnc_printinfo2scm($1);" %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(out) gboolean "$result = $1 ? SCM_BOOL_T : SCM_BOOL_F;"
%typemap(in) Timespec "$1 = gnc_timepair2timespec($input);" %typemap(in) Timespec "$1 = gnc_timepair2timespec($input);"
@ -43,11 +43,11 @@ typedef char gchar;
SCM list = $input; SCM list = $input;
GList *c_list = NULL; GList *c_list = NULL;
while (!SCM_NULLP(list)) { while (!scm_is_null(list)) {
void *p; void *p;
SCM p_scm = SCM_CAR(list); 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; p = NULL;
else else
p = SWIG_MustGetPtr(p_scm, ElemSwigType, 1, 0); p = SWIG_MustGetPtr(p_scm, ElemSwigType, 1, 0);

View File

@ -409,7 +409,7 @@ inner_main_add_price_quotes(void *closure, int argc, char **argv)
if (qof_session_get_error(session) != ERR_BACKEND_NO_ERR) goto fail; if (qof_session_get_error(session) != ERR_BACKEND_NO_ERR) goto fail;
qof_session_destroy(session); 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); g_warning("Failed to add quotes to %s.", add_quotes_file);
goto fail; goto fail;
} }

View File

@ -81,11 +81,11 @@ GLIST_HELPER_INOUT(GncTaxTableEntryList, SWIGTYPE_p__gncTaxTableEntry);
SCM list = $input; SCM list = $input;
GList *c_list = NULL; GList *c_list = NULL;
while (!SCM_NULLP(list)) { while (!scm_is_null(list)) {
GncAccountValue *p; GncAccountValue *p;
SCM p_scm = SCM_CAR(list); 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; p = NULL;
else else
p = gnc_scm_to_account_value_ptr(p_scm); p = gnc_scm_to_account_value_ptr(p_scm);

View File

@ -43,7 +43,7 @@ int gnc_account_value_pointer_p (SCM arg)
{ {
swig_type_info * account_type = get_acct_type(); swig_type_info * account_type = get_acct_type();
return (SCM_CONSP (arg) && return (scm_is_pair (arg) &&
SWIG_IsPointerOfType(SCM_CAR (arg), account_type) && SWIG_IsPointerOfType(SCM_CAR (arg), account_type) &&
gnc_numeric_p (SCM_CDR (arg))); gnc_numeric_p (SCM_CDR (arg)));
} }

View File

@ -580,7 +580,7 @@ gnc_invoice_window_printCB (GtkWidget *widget, gpointer data)
g_return_if_fail (invoice); g_return_if_fail (invoice);
func = scm_c_eval_string ("gnc:invoice-report-create"); 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); arg = SWIG_NewPointerObj(invoice, SWIG_TypeQuery("_p__gncInvoice"), 0);
args = scm_cons (arg, args); args = scm_cons (arg, args);
@ -588,7 +588,7 @@ gnc_invoice_window_printCB (GtkWidget *widget, gpointer data)
/* scm_gc_protect_object(func); */ /* scm_gc_protect_object(func); */
arg = scm_apply (func, args, SCM_EOL); 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); report_id = scm_num2int (arg, SCM_ARG1, G_STRFUNC);
/* scm_gc_unprotect_object(func); */ /* scm_gc_unprotect_object(func); */
@ -846,7 +846,7 @@ void gnc_business_call_owner_report (GncOwner *owner, Account *acc)
args = SCM_EOL; args = SCM_EOL;
func = scm_c_eval_string ("gnc:owner-report-create"); 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) { if (acc) {
swig_type_info * qtype = SWIG_TypeQuery("_p_Account"); swig_type_info * qtype = SWIG_TypeQuery("_p_Account");
@ -865,7 +865,7 @@ void gnc_business_call_owner_report (GncOwner *owner, Account *acc)
/* Apply the function to the args */ /* Apply the function to the args */
arg = scm_apply (func, args, SCM_EOL); 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); id = scm_num2int (arg, SCM_ARG1, G_STRFUNC);
if (id >= 0) if (id >= 0)

View File

@ -114,7 +114,7 @@ gnc_timepair2timespec(SCM x)
int int
gnc_timepair_p(SCM x) 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_CAR(x)) &&
gnc_gh_gint64_p(SCM_CDR(x))); gnc_gh_gint64_p(SCM_CDR(x)));
} }
@ -136,11 +136,11 @@ gnc_scm2guid(SCM guid_scm)
GUID guid; GUID guid;
const gchar * str; 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(); return *guid_null();
} }
str = SCM_STRING_CHARS (guid_scm); str = scm_to_locale_string (guid_scm);
string_to_guid(str, &guid); string_to_guid(str, &guid);
return guid; return guid;
} }
@ -151,14 +151,14 @@ gnc_guid_p(SCM guid_scm)
GUID guid; GUID guid;
const gchar * str; const gchar * str;
if (!SCM_STRINGP(guid_scm)) if (!scm_is_string(guid_scm))
return FALSE; return FALSE;
if (GUID_ENCODING_LENGTH != SCM_STRING_LENGTH (guid_scm)) if (GUID_ENCODING_LENGTH != scm_i_string_length (guid_scm))
{ {
return FALSE; return FALSE;
} }
str = SCM_STRING_CHARS (guid_scm); str = scm_to_locale_string (guid_scm);
return string_to_guid(str, &guid); return string_to_guid(str, &guid);
} }
@ -308,10 +308,10 @@ gnc_scm2bitfield (SCM field_scm)
{ {
int field = 0; int field = 0;
if (!SCM_LISTP (field_scm)) if (!scm_is_list (field_scm))
return 0; return 0;
while (!SCM_NULLP (field_scm)) while (!scm_is_null (field_scm))
{ {
SCM scm; SCM scm;
int bit; int bit;
@ -337,14 +337,14 @@ gnc_scm2balance_match_how (SCM how_scm, gboolean *resp)
{ {
const gchar *how; const gchar *how;
if (!SCM_LISTP (how_scm)) if (!scm_is_list (how_scm))
return FALSE; return FALSE;
if (SCM_NULLP (how_scm)) if (scm_is_null (how_scm))
return FALSE; return FALSE;
/* Only allow a single-entry list */ /* Only allow a single-entry list */
if (!SCM_NULLP (SCM_CDR (how_scm))) if (!scm_is_null (SCM_CDR (how_scm)))
return FALSE; return FALSE;
how = SCM_SYMBOL_CHARS (SCM_CAR(how_scm)); how = SCM_SYMBOL_CHARS (SCM_CAR(how_scm));
@ -363,7 +363,7 @@ gnc_scm2kvp_match_where (SCM where_scm)
QofIdType res; QofIdType res;
const gchar *where; const gchar *where;
if (!SCM_LISTP (where_scm)) if (!scm_is_list (where_scm))
return NULL; return NULL;
where = SCM_SYMBOL_CHARS (SCM_CAR(where_scm)); where = SCM_SYMBOL_CHARS (SCM_CAR(where_scm));
@ -403,10 +403,10 @@ gnc_scm2guid_glist (SCM guids_scm)
{ {
GList *guids = NULL; GList *guids = NULL;
if (!SCM_LISTP (guids_scm)) if (!scm_is_list (guids_scm))
return NULL; return NULL;
while (!SCM_NULLP (guids_scm)) while (!scm_is_null (guids_scm))
{ {
SCM guid_scm = SCM_CAR (guids_scm); SCM guid_scm = SCM_CAR (guids_scm);
GUID *guid = NULL; GUID *guid = NULL;
@ -446,7 +446,7 @@ gnc_query_numeric2scm (gnc_numeric val)
static gboolean static gboolean
gnc_query_numeric_p (SCM pair) gnc_query_numeric_p (SCM pair)
{ {
return (SCM_CONSP (pair)); return (scm_is_pair (pair));
} }
static gnc_numeric static gnc_numeric
@ -484,18 +484,18 @@ gnc_query_scm2path (SCM path_scm)
{ {
GSList *path = NULL; GSList *path = NULL;
if (!SCM_LISTP (path_scm)) if (!scm_is_list (path_scm))
return NULL; return NULL;
while (!SCM_NULLP (path_scm)) while (!scm_is_null (path_scm))
{ {
SCM key_scm = SCM_CAR (path_scm); SCM key_scm = SCM_CAR (path_scm);
char *key; char *key;
if (!SCM_STRINGP (key_scm)) if (!scm_is_string (key_scm))
break; break;
key = g_strdup (SCM_STRING_CHARS (key_scm)); key = g_strdup (scm_to_locale_string (key_scm));
path = g_slist_prepend (path, key); path = g_slist_prepend (path, key);
@ -637,14 +637,14 @@ gnc_scm2KvpValue (SCM value_scm)
SCM type_scm; SCM type_scm;
SCM val_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; return NULL;
type_scm = SCM_CAR (value_scm); type_scm = SCM_CAR (value_scm);
value_t = gnc_scm2KvpValueTypeype (type_scm); value_t = gnc_scm2KvpValueTypeype (type_scm);
value_scm = SCM_CDR (value_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; return NULL;
val_scm = SCM_CAR (value_scm); val_scm = SCM_CAR (value_scm);
@ -660,7 +660,7 @@ gnc_scm2KvpValue (SCM value_scm)
break; break;
case KVP_TYPE_STRING: { 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); value = kvp_value_new_string (str);
break; break;
} }
@ -702,7 +702,7 @@ gnc_scm2KvpValue (SCM value_scm)
GList *list = NULL; GList *list = NULL;
GList *node; 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)) val_scm = SCM_CDR (val_scm))
{ {
SCM scm = SCM_CAR (val_scm); SCM scm = SCM_CAR (val_scm);
@ -742,11 +742,11 @@ gnc_scm2KvpFrame (SCM frame_scm)
{ {
KvpFrame * frame; KvpFrame * frame;
if (!SCM_LISTP (frame_scm)) return NULL; if (!scm_is_list (frame_scm)) return NULL;
frame = kvp_frame_new (); 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)) frame_scm = SCM_CDR (frame_scm))
{ {
SCM pair = SCM_CAR (frame_scm); SCM pair = SCM_CAR (frame_scm);
@ -755,16 +755,16 @@ gnc_scm2KvpFrame (SCM frame_scm)
SCM val_scm; SCM val_scm;
const gchar *key; const gchar *key;
if (!SCM_CONSP (pair)) if (!scm_is_pair (pair))
continue; continue;
key_scm = SCM_CAR (pair); key_scm = SCM_CAR (pair);
val_scm = SCM_CDR (pair); val_scm = SCM_CDR (pair);
if (!SCM_STRINGP (key_scm)) if (!scm_is_string (key_scm))
continue; continue;
key = SCM_STRING_CHARS (key_scm); key = scm_to_locale_string (key_scm);
if (!key) if (!key)
continue; continue;
@ -862,35 +862,35 @@ gnc_scm2query_term_query_v2 (SCM qt_scm)
gboolean inverted = FALSE; gboolean inverted = FALSE;
QofQueryCompare compare_how; 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; return NULL;
do { do {
/* param path */ /* param path */
scm = SCM_CAR (qt_scm); scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm); qt_scm = SCM_CDR (qt_scm);
if (!SCM_LISTP (scm)) if (!scm_is_list (scm))
break; break;
path = gnc_query_scm2path (scm); path = gnc_query_scm2path (scm);
/* inverted */ /* inverted */
scm = SCM_CAR (qt_scm); scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm); qt_scm = SCM_CDR (qt_scm);
if (!SCM_BOOLP (scm)) if (!scm_is_bool (scm))
break; break;
inverted = SCM_NFALSEP (scm); inverted = scm_is_true (scm);
/* type */ /* type */
scm = SCM_CAR (qt_scm); scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm); qt_scm = SCM_CDR (qt_scm);
if (!SCM_SYMBOLP (scm)) if (!scm_is_symbol (scm))
break; break;
type = SCM_SYMBOL_CHARS (scm); type = SCM_SYMBOL_CHARS (scm);
/* QofCompareFunc */ /* QofCompareFunc */
scm = SCM_CAR (qt_scm); scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm); qt_scm = SCM_CDR (qt_scm);
if (SCM_NULLP (scm)) if (scm_is_null (scm))
break; break;
compare_how = gnc_query_scm2compare (scm); compare_how = gnc_query_scm2compare (scm);
@ -904,19 +904,19 @@ gnc_scm2query_term_query_v2 (SCM qt_scm)
scm = SCM_CAR (qt_scm); scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm); qt_scm = SCM_CDR (qt_scm);
if (SCM_NULLP (scm)) break; if (scm_is_null (scm)) break;
options = gnc_query_scm2string (scm); options = gnc_query_scm2string (scm);
scm = SCM_CAR (qt_scm); scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm); qt_scm = SCM_CDR (qt_scm);
if (!SCM_BOOLP (scm)) break; if (!scm_is_bool (scm)) break;
is_regex = SCM_NFALSEP (scm); is_regex = scm_is_true (scm);
scm = SCM_CAR (qt_scm); scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (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, pd = qof_query_string_predicate (compare_how, matchstring,
options, is_regex); options, is_regex);
@ -928,13 +928,13 @@ gnc_scm2query_term_query_v2 (SCM qt_scm)
scm = SCM_CAR (qt_scm); scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm); qt_scm = SCM_CDR (qt_scm);
if (SCM_NULLP (scm)) if (scm_is_null (scm))
break; break;
options = gnc_query_scm2date (scm); options = gnc_query_scm2date (scm);
scm = SCM_CAR (qt_scm); scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm); qt_scm = SCM_CDR (qt_scm);
if (SCM_NULLP (scm)) if (scm_is_null (scm))
break; break;
date = gnc_timepair2timespec (scm); date = gnc_timepair2timespec (scm);
@ -946,7 +946,7 @@ gnc_scm2query_term_query_v2 (SCM qt_scm)
scm = SCM_CAR (qt_scm); scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm); qt_scm = SCM_CDR (qt_scm);
if (SCM_NULLP (scm)) if (scm_is_null (scm))
break; break;
options = gnc_query_scm2numericop (scm); options = gnc_query_scm2numericop (scm);
@ -964,13 +964,13 @@ gnc_scm2query_term_query_v2 (SCM qt_scm)
scm = SCM_CAR (qt_scm); scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm); qt_scm = SCM_CDR (qt_scm);
if (SCM_NULLP (scm)) if (scm_is_null (scm))
break; break;
options = gnc_query_scm2guid (scm); options = gnc_query_scm2guid (scm);
scm = SCM_CAR (qt_scm); scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm); qt_scm = SCM_CDR (qt_scm);
if (!SCM_LISTP (scm)) if (!scm_is_list (scm))
break; break;
guids = gnc_scm2guid_glist (scm); guids = gnc_scm2guid_glist (scm);
@ -983,7 +983,7 @@ gnc_scm2query_term_query_v2 (SCM qt_scm)
scm = SCM_CAR (qt_scm); scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm); qt_scm = SCM_CDR (qt_scm);
if (SCM_NULLP (scm)) if (scm_is_null (scm))
break; break;
val = gnc_scm_to_gint64 (scm); val = gnc_scm_to_gint64 (scm);
@ -994,7 +994,7 @@ gnc_scm2query_term_query_v2 (SCM qt_scm)
scm = SCM_CAR (qt_scm); scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm); qt_scm = SCM_CDR (qt_scm);
if (!SCM_NUMBERP (scm)) if (!scm_is_number (scm))
break; break;
val = scm_num2dbl (scm, G_STRFUNC); val = scm_num2dbl (scm, G_STRFUNC);
@ -1005,9 +1005,9 @@ gnc_scm2query_term_query_v2 (SCM qt_scm)
scm = SCM_CAR (qt_scm); scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm); qt_scm = SCM_CDR (qt_scm);
if (!SCM_BOOLP (scm)) if (!scm_is_bool (scm))
break; break;
val = SCM_NFALSEP (scm); val = scm_is_true (scm);
pd = qof_query_boolean_predicate (compare_how, val); pd = qof_query_boolean_predicate (compare_how, val);
@ -1017,15 +1017,15 @@ gnc_scm2query_term_query_v2 (SCM qt_scm)
scm = SCM_CAR (qt_scm); scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm); qt_scm = SCM_CDR (qt_scm);
if (SCM_NULLP (scm)) if (scm_is_null (scm))
break; break;
options = gnc_query_scm2char (scm); options = gnc_query_scm2char (scm);
scm = SCM_CAR (qt_scm); scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm); qt_scm = SCM_CDR (qt_scm);
if (!SCM_STRINGP (scm)) if (!scm_is_string (scm))
break; break;
char_list = SCM_STRING_CHARS (scm); char_list = scm_to_locale_string (scm);
pd = qof_query_char_predicate (options, char_list); pd = qof_query_char_predicate (options, char_list);
} }
@ -1036,13 +1036,13 @@ gnc_scm2query_term_query_v2 (SCM qt_scm)
scm = SCM_CAR (qt_scm); scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm); qt_scm = SCM_CDR (qt_scm);
if (!SCM_LISTP (scm)) if (!scm_is_list (scm))
break; break;
kvp_path = gnc_query_scm2path (scm); kvp_path = gnc_query_scm2path (scm);
scm = SCM_CAR (qt_scm); scm = SCM_CAR (qt_scm);
qt_scm = SCM_CDR (qt_scm); qt_scm = SCM_CDR (qt_scm);
if (SCM_NULLP (scm)) { if (scm_is_null (scm)) {
gnc_query_path_free (kvp_path); gnc_query_path_free (kvp_path);
break; break;
} }
@ -1084,8 +1084,8 @@ gnc_scm2query_term_query_v1 (SCM query_term_scm)
QofQuery *q = NULL; QofQuery *q = NULL;
SCM scm; SCM scm;
if (!SCM_LISTP (query_term_scm) || if (!scm_is_list (query_term_scm) ||
SCM_NULLP (query_term_scm)) { scm_is_null (query_term_scm)) {
PINFO ("null term"); PINFO ("null term");
return NULL; return NULL;
} }
@ -1097,7 +1097,7 @@ gnc_scm2query_term_query_v1 (SCM query_term_scm)
pd_type = SCM_SYMBOL_CHARS (scm); pd_type = SCM_SYMBOL_CHARS (scm);
/* pr_type */ /* pr_type */
if (SCM_NULLP (query_term_scm)) { if (scm_is_null (query_term_scm)) {
PINFO ("null pr_type"); PINFO ("null pr_type");
break; break;
} }
@ -1106,13 +1106,13 @@ gnc_scm2query_term_query_v1 (SCM query_term_scm)
pr_type = SCM_SYMBOL_CHARS (scm); pr_type = SCM_SYMBOL_CHARS (scm);
/* sense */ /* sense */
if (SCM_NULLP (query_term_scm)) { if (scm_is_null (query_term_scm)) {
PINFO ("null sense"); PINFO ("null sense");
break; break;
} }
scm = SCM_CAR (query_term_scm); scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (query_term_scm); query_term_scm = SCM_CDR (query_term_scm);
sense = SCM_NFALSEP (scm); sense = scm_is_true (scm);
q = xaccMallocQuery (); q = xaccMallocQuery ();
@ -1123,17 +1123,17 @@ gnc_scm2query_term_query_v1 (SCM query_term_scm)
Timespec end; Timespec end;
/* use_start */ /* use_start */
if (SCM_NULLP (query_term_scm)) { if (scm_is_null (query_term_scm)) {
PINFO ("null use_start"); PINFO ("null use_start");
break; break;
} }
scm = SCM_CAR (query_term_scm); scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (query_term_scm); query_term_scm = SCM_CDR (query_term_scm);
use_start = SCM_NFALSEP (scm); use_start = scm_is_true (scm);
/* start */ /* start */
if (SCM_NULLP (query_term_scm)) if (scm_is_null (query_term_scm))
break; break;
scm = SCM_CAR (query_term_scm); scm = SCM_CAR (query_term_scm);
@ -1141,15 +1141,15 @@ gnc_scm2query_term_query_v1 (SCM query_term_scm)
start = gnc_timepair2timespec (scm); start = gnc_timepair2timespec (scm);
/* use_end */ /* use_end */
if (SCM_NULLP (query_term_scm)) if (scm_is_null (query_term_scm))
break; break;
scm = SCM_CAR (query_term_scm); scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (query_term_scm); query_term_scm = SCM_CDR (query_term_scm);
use_end = SCM_NFALSEP (scm); use_end = scm_is_true (scm);
/* end */ /* end */
if (SCM_NULLP (query_term_scm)) if (scm_is_null (query_term_scm))
break; break;
scm = SCM_CAR (query_term_scm); scm = SCM_CAR (query_term_scm);
@ -1169,21 +1169,21 @@ gnc_scm2query_term_query_v1 (SCM query_term_scm)
gnc_numeric val; gnc_numeric val;
/* how */ /* how */
if (SCM_NULLP (query_term_scm)) if (scm_is_null (query_term_scm))
break; break;
scm = SCM_CAR (query_term_scm); scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (query_term_scm); query_term_scm = SCM_CDR (query_term_scm);
how = gnc_scm2amt_match_how (scm); how = gnc_scm2amt_match_how (scm);
/* amt_sgn */ /* amt_sgn */
if (SCM_NULLP (query_term_scm)) if (scm_is_null (query_term_scm))
break; break;
scm = SCM_CAR (query_term_scm); scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (query_term_scm); query_term_scm = SCM_CDR (query_term_scm);
amt_sgn = gnc_query_scm2numericop (scm); amt_sgn = gnc_query_scm2numericop (scm);
/* amount */ /* amount */
if (SCM_NULLP (query_term_scm)) if (scm_is_null (query_term_scm))
break; break;
scm = SCM_CAR (query_term_scm); scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (query_term_scm); query_term_scm = SCM_CDR (query_term_scm);
@ -1215,7 +1215,7 @@ gnc_scm2query_term_query_v1 (SCM query_term_scm)
GList *account_guids; GList *account_guids;
/* how */ /* how */
if (SCM_NULLP (query_term_scm)) { if (scm_is_null (query_term_scm)) {
PINFO ("pd-account: null how"); PINFO ("pd-account: null how");
break; break;
} }
@ -1225,7 +1225,7 @@ gnc_scm2query_term_query_v1 (SCM query_term_scm)
how = gnc_scm2acct_match_how (scm); how = gnc_scm2acct_match_how (scm);
/* account guids */ /* account guids */
if (SCM_NULLP (query_term_scm)) { if (scm_is_null (query_term_scm)) {
PINFO ("pd-account: null guids"); PINFO ("pd-account: null guids");
break; break;
} }
@ -1247,28 +1247,28 @@ gnc_scm2query_term_query_v1 (SCM query_term_scm)
const gchar *matchstring; const gchar *matchstring;
/* case_sens */ /* case_sens */
if (SCM_NULLP (query_term_scm)) if (scm_is_null (query_term_scm))
break; break;
scm = SCM_CAR (query_term_scm); scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (query_term_scm); query_term_scm = SCM_CDR (query_term_scm);
case_sens = SCM_NFALSEP (scm); case_sens = scm_is_true (scm);
/* use_regexp */ /* use_regexp */
if (SCM_NULLP (query_term_scm)) if (scm_is_null (query_term_scm))
break; break;
scm = SCM_CAR (query_term_scm); scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (query_term_scm); query_term_scm = SCM_CDR (query_term_scm);
use_regexp = SCM_NFALSEP (scm); use_regexp = scm_is_true (scm);
/* matchstring */ /* matchstring */
if (SCM_NULLP (query_term_scm)) if (scm_is_null (query_term_scm))
break; break;
scm = SCM_CAR (query_term_scm); scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (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")) { if (!safe_strcmp (pr_type, "pr-action")) {
xaccQueryAddActionMatch (q, matchstring, case_sens, use_regexp, xaccQueryAddActionMatch (q, matchstring, case_sens, use_regexp,
@ -1298,7 +1298,7 @@ gnc_scm2query_term_query_v1 (SCM query_term_scm)
cleared_match_t how; cleared_match_t how;
/* how */ /* how */
if (SCM_NULLP (query_term_scm)) if (scm_is_null (query_term_scm))
break; break;
scm = SCM_CAR (query_term_scm); scm = SCM_CAR (query_term_scm);
@ -1312,7 +1312,7 @@ gnc_scm2query_term_query_v1 (SCM query_term_scm)
gboolean how; gboolean how;
/* how */ /* how */
if (SCM_NULLP (query_term_scm)) if (scm_is_null (query_term_scm))
break; break;
scm = SCM_CAR (query_term_scm); scm = SCM_CAR (query_term_scm);
@ -1328,7 +1328,7 @@ gnc_scm2query_term_query_v1 (SCM query_term_scm)
QofIdType id_type; QofIdType id_type;
/* guid */ /* guid */
if (SCM_NULLP (query_term_scm)) if (scm_is_null (query_term_scm))
break; break;
scm = SCM_CAR (query_term_scm); scm = SCM_CAR (query_term_scm);
@ -1338,7 +1338,7 @@ gnc_scm2query_term_query_v1 (SCM query_term_scm)
/* id type */ /* id type */
scm = SCM_CAR (query_term_scm); scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (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); xaccQueryAddGUIDMatch (q, &guid, id_type, QOF_QUERY_OR);
ok = TRUE; ok = TRUE;
@ -1350,28 +1350,28 @@ gnc_scm2query_term_query_v1 (SCM query_term_scm)
QofIdType where; QofIdType where;
/* how */ /* how */
if (SCM_NULLP (query_term_scm)) if (scm_is_null (query_term_scm))
break; break;
scm = SCM_CAR (query_term_scm); scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (query_term_scm); query_term_scm = SCM_CDR (query_term_scm);
how = gnc_scm2kvp_match_how (scm); how = gnc_scm2kvp_match_how (scm);
/* where */ /* where */
if (SCM_NULLP (query_term_scm)) if (scm_is_null (query_term_scm))
break; break;
scm = SCM_CAR (query_term_scm); scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (query_term_scm); query_term_scm = SCM_CDR (query_term_scm);
where = gnc_scm2kvp_match_where (scm); where = gnc_scm2kvp_match_where (scm);
/* path */ /* path */
if (SCM_NULLP (query_term_scm)) if (scm_is_null (query_term_scm))
break; break;
scm = SCM_CAR (query_term_scm); scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (query_term_scm); query_term_scm = SCM_CDR (query_term_scm);
path = gnc_query_scm2path (scm); path = gnc_query_scm2path (scm);
/* value */ /* value */
if (SCM_NULLP (query_term_scm)) if (scm_is_null (query_term_scm))
break; break;
scm = SCM_CAR (query_term_scm); scm = SCM_CAR (query_term_scm);
query_term_scm = SCM_CDR (query_term_scm); query_term_scm = SCM_CDR (query_term_scm);
@ -1454,10 +1454,10 @@ gnc_scm2query_and_terms (SCM and_terms, query_version_t vers)
{ {
Query *q = NULL; Query *q = NULL;
if (!SCM_LISTP (and_terms)) if (!scm_is_list (and_terms))
return NULL; return NULL;
while (!SCM_NULLP (and_terms)) while (!scm_is_null (and_terms))
{ {
SCM term; SCM term;
@ -1494,12 +1494,12 @@ gnc_scm2query_or_terms (SCM or_terms, query_version_t vers)
{ {
Query *q = NULL; Query *q = NULL;
if (!SCM_LISTP (or_terms)) if (!scm_is_list (or_terms))
return NULL; return NULL;
q = xaccMallocQuery (); q = xaccMallocQuery ();
while (!SCM_NULLP (or_terms)) while (!scm_is_null (or_terms))
{ {
SCM and_terms; SCM and_terms;
@ -1560,24 +1560,24 @@ gnc_query_scm2sort (SCM sort_scm, GSList **path, gint *options, gboolean *inc)
g_return_val_if_fail (*path == NULL, FALSE); g_return_val_if_fail (*path == NULL, FALSE);
/* This is ok -- it means we have an empty sort. Don't do anything */ /* 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; return TRUE;
/* Ok, this had better be a list */ /* Ok, this had better be a list */
if (!SCM_LISTP (sort_scm)) if (!scm_is_list (sort_scm))
return FALSE; return FALSE;
/* Parse the path, options, and increasing */ /* Parse the path, options, and increasing */
val = SCM_CAR (sort_scm); val = SCM_CAR (sort_scm);
sort_scm = SCM_CDR (sort_scm); sort_scm = SCM_CDR (sort_scm);
if (!SCM_LISTP (val)) if (!scm_is_list (val))
return FALSE; return FALSE;
p = gnc_query_scm2path (val); p = gnc_query_scm2path (val);
/* options */ /* options */
val = SCM_CAR (sort_scm); val = SCM_CAR (sort_scm);
sort_scm = SCM_CDR (sort_scm); sort_scm = SCM_CDR (sort_scm);
if (!SCM_NUMBERP (val)) { if (!scm_is_number (val)) {
gnc_query_path_free (p); gnc_query_path_free (p);
return FALSE; return FALSE;
} }
@ -1586,14 +1586,14 @@ gnc_query_scm2sort (SCM sort_scm, GSList **path, gint *options, gboolean *inc)
/* increasing */ /* increasing */
val = SCM_CAR (sort_scm); val = SCM_CAR (sort_scm);
sort_scm = SCM_CDR (sort_scm); sort_scm = SCM_CDR (sort_scm);
if (!SCM_BOOLP (val)) { if (!scm_is_bool (val)) {
gnc_query_path_free (p); gnc_query_path_free (p);
return FALSE; return FALSE;
} }
i = SCM_NFALSEP (val); i = scm_is_true (val);
/* EOL */ /* EOL */
if (!SCM_NULLP (sort_scm)) { if (!scm_is_null (sort_scm)) {
gnc_query_path_free (p); gnc_query_path_free (p);
return FALSE; return FALSE;
} }
@ -1735,7 +1735,7 @@ gnc_scm2query_v1 (SCM query_scm)
gboolean tertiary_increasing = TRUE; gboolean tertiary_increasing = TRUE;
int max_splits = -1; int max_splits = -1;
while (!SCM_NULLP (query_scm)) while (!scm_is_null (query_scm))
{ {
const gchar *symbol; const gchar *symbol;
SCM sym_scm; SCM sym_scm;
@ -1745,7 +1745,7 @@ gnc_scm2query_v1 (SCM query_scm)
pair = SCM_CAR (query_scm); pair = SCM_CAR (query_scm);
query_scm = SCM_CDR (query_scm); query_scm = SCM_CDR (query_scm);
if (!SCM_CONSP (pair)) { if (!scm_is_pair (pair)) {
PERR ("Not a Pair"); PERR ("Not a Pair");
ok = FALSE; ok = FALSE;
break; break;
@ -1754,7 +1754,7 @@ gnc_scm2query_v1 (SCM query_scm)
sym_scm = SCM_CAR (pair); sym_scm = SCM_CAR (pair);
value = SCM_CADR (pair); value = SCM_CADR (pair);
if (!SCM_SYMBOLP (sym_scm)) { if (!scm_is_symbol (sym_scm)) {
PERR ("Not a symbol"); PERR ("Not a symbol");
ok = FALSE; ok = FALSE;
break; break;
@ -1779,7 +1779,7 @@ gnc_scm2query_v1 (SCM query_scm)
} }
} else if (safe_strcmp ("primary-sort", symbol) == 0) { } else if (safe_strcmp ("primary-sort", symbol) == 0) {
if (!SCM_SYMBOLP (value)) { if (!scm_is_symbol (value)) {
PINFO ("Invalid primary sort"); PINFO ("Invalid primary sort");
ok = FALSE; ok = FALSE;
break; break;
@ -1788,7 +1788,7 @@ gnc_scm2query_v1 (SCM query_scm)
primary_sort = SCM_SYMBOL_CHARS (value); primary_sort = SCM_SYMBOL_CHARS (value);
} else if (safe_strcmp ("secondary-sort", symbol) == 0) { } else if (safe_strcmp ("secondary-sort", symbol) == 0) {
if (!SCM_SYMBOLP (value)) { if (!scm_is_symbol (value)) {
PINFO ("Invalid secondary sort"); PINFO ("Invalid secondary sort");
ok = FALSE; ok = FALSE;
break; break;
@ -1797,7 +1797,7 @@ gnc_scm2query_v1 (SCM query_scm)
secondary_sort = SCM_SYMBOL_CHARS (value); secondary_sort = SCM_SYMBOL_CHARS (value);
} else if (safe_strcmp ("tertiary-sort", symbol) == 0) { } else if (safe_strcmp ("tertiary-sort", symbol) == 0) {
if (!SCM_SYMBOLP (value)) { if (!scm_is_symbol (value)) {
PINFO ("Invalid tertiary sort"); PINFO ("Invalid tertiary sort");
ok = FALSE; ok = FALSE;
break; break;
@ -1806,16 +1806,16 @@ gnc_scm2query_v1 (SCM query_scm)
tertiary_sort = SCM_SYMBOL_CHARS (value); tertiary_sort = SCM_SYMBOL_CHARS (value);
} else if (safe_strcmp ("primary-increasing", symbol) == 0) { } 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) { } 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) { } 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) { } else if (safe_strcmp ("max-splits", symbol) == 0) {
if (!SCM_NUMBERP (value)) { if (!scm_is_number (value)) {
PERR ("invalid max-splits"); PERR ("invalid max-splits");
ok = FALSE; ok = FALSE;
break; break;
@ -1863,7 +1863,7 @@ gnc_scm2query_v2 (SCM query_scm)
++scm_block_gc; ++scm_block_gc;
#endif #endif
while (!SCM_NULLP (query_scm)) while (!scm_is_null (query_scm))
{ {
const gchar *symbol; const gchar *symbol;
SCM sym_scm; SCM sym_scm;
@ -1873,7 +1873,7 @@ gnc_scm2query_v2 (SCM query_scm)
pair = SCM_CAR (query_scm); pair = SCM_CAR (query_scm);
query_scm = SCM_CDR (query_scm); query_scm = SCM_CDR (query_scm);
if (!SCM_CONSP (pair)) { if (!scm_is_pair (pair)) {
ok = FALSE; ok = FALSE;
break; break;
} }
@ -1881,7 +1881,7 @@ gnc_scm2query_v2 (SCM query_scm)
sym_scm = SCM_CAR (pair); sym_scm = SCM_CAR (pair);
value = SCM_CADR (pair); value = SCM_CADR (pair);
if (!SCM_SYMBOLP (sym_scm)) { if (!scm_is_symbol (sym_scm)) {
ok = FALSE; ok = FALSE;
break; break;
} }
@ -1903,7 +1903,7 @@ gnc_scm2query_v2 (SCM query_scm)
} }
} else if (!safe_strcmp ("search-for", symbol)) { } else if (!safe_strcmp ("search-for", symbol)) {
if (!SCM_SYMBOLP (value)) { if (!scm_is_symbol (value)) {
ok = FALSE; ok = FALSE;
break; break;
} }
@ -1928,7 +1928,7 @@ gnc_scm2query_v2 (SCM query_scm)
} }
} else if (!safe_strcmp ("max-results", symbol)) { } else if (!safe_strcmp ("max-results", symbol)) {
if (!SCM_NUMBERP (value)) { if (!scm_is_number (value)) {
ok = FALSE; ok = FALSE;
break; break;
} }
@ -1967,14 +1967,14 @@ gnc_scm2query (SCM query_scm)
Query *q = NULL; Query *q = NULL;
/* Not a list or NULL? No need to go further */ /* 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; return NULL;
/* Grab the 'type' (for v2 and above) */ /* Grab the 'type' (for v2 and above) */
q_type = SCM_CAR (query_scm); q_type = SCM_CAR (query_scm);
if (!SCM_SYMBOLP (q_type)) { if (!scm_is_symbol (q_type)) {
if (SCM_CONSP (q_type)) { if (scm_is_pair (q_type)) {
/* Version-1 queries are just a list */ /* Version-1 queries are just a list */
return gnc_scm2query_v1 (query_scm); return gnc_scm2query_v1 (query_scm);
} else { } else {
@ -2098,7 +2098,7 @@ gnc_gh_gint64_p(SCM num)
initialized = 1; initialized = 1;
} }
return (SCM_EXACTP(num) && return (scm_is_exact(num) &&
(scm_geq_p(num, minval) != SCM_BOOL_F) && (scm_geq_p(num, minval) != SCM_BOOL_F) &&
(scm_leq_p(num, maxval) != SCM_BOOL_F)); (scm_leq_p(num, maxval) != SCM_BOOL_F));
} }

View File

@ -153,15 +153,15 @@ gchar * gnc_build_book_path (const gchar *filename);
SCM path_scm = $input; SCM path_scm = $input;
GList *path = NULL; GList *path = NULL;
while (!SCM_NULLP (path_scm)) while (!scm_is_null (path_scm))
{ {
SCM key_scm = SCM_CAR (path_scm); SCM key_scm = SCM_CAR (path_scm);
char *key; char *key;
if (!SCM_STRINGP (key_scm)) if (!scm_is_string (key_scm))
break; 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 = g_list_prepend (path, key);

View File

@ -59,9 +59,9 @@ gnc_scm_list_to_glist(SCM rest)
SCM scm_item; SCM scm_item;
SWIG_GetModule(NULL); /* Work-around for SWIG bug. */ 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; void *item;
@ -119,9 +119,9 @@ gnc_scm_to_glist_string(SCM list)
{ {
GList *glist = NULL; 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) if (str)
glist = g_list_prepend (glist, g_strdup (str)); glist = g_list_prepend (glist, g_strdup (str));
list = SCM_CDR (list); list = SCM_CDR (list);
@ -135,9 +135,9 @@ gnc_scm_to_gslist_string(SCM list)
{ {
GSList *gslist = NULL; 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) if (str)
gslist = g_slist_prepend (gslist, g_strdup (str)); gslist = g_slist_prepend (gslist, g_strdup (str));
list = SCM_CDR (list); list = SCM_CDR (list);
@ -152,5 +152,5 @@ gnc_scm_to_gslist_string(SCM list)
int int
gnc_glist_string_p(SCM list) { gnc_glist_string_p(SCM list) {
return SCM_LISTP(list); return scm_is_list(list);
} }

View File

@ -225,7 +225,7 @@ hook_remove_scm_runner (GHook *hook, gpointer data)
SCM res; SCM res;
res = scm_equal_p(scm1->proc, scm2->proc); res = scm_equal_p(scm1->proc, scm2->proc);
return(SCM_NFALSEP(res)); return(scm_is_true(res));
} }
void void

View File

@ -23,10 +23,10 @@ gnc_kvp_value_ptr_p(SCM arg)
KvpValue * KvpValue *
gnc_scm_to_kvp_value_ptr(SCM val) 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 */ /* 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)); return kvp_value_new_gint64(gnc_scm_to_gint64(val));
} }
@ -49,11 +49,11 @@ gnc_scm_to_kvp_value_ptr(SCM val)
Timespec ts = gnc_timepair2timespec(val); Timespec ts = gnc_timepair2timespec(val);
return kvp_value_new_timespec(ts); return kvp_value_new_timespec(ts);
} }
else if(SCM_STRINGP(val)) else if(scm_is_string(val))
{ {
const gchar *newstr; const gchar *newstr;
KvpValue *ret; KvpValue *ret;
newstr = SCM_STRING_CHARS (val); newstr = scm_to_locale_string (val);
ret = kvp_value_new_string(newstr); ret = kvp_value_new_string(newstr);
return ret; return ret;
} }

View File

@ -2183,10 +2183,10 @@ static gboolean
gnc_option_set_ui_value_boolean (GNCOption *option, gboolean use_default, gnc_option_set_ui_value_boolean (GNCOption *option, gboolean use_default,
GtkWidget *widget, SCM value) GtkWidget *widget, SCM value)
{ {
if (SCM_BOOLP(value)) if (scm_is_bool(value))
{ {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget),
SCM_NFALSEP(value)); scm_is_true(value));
return FALSE; return FALSE;
} }
else else
@ -2197,9 +2197,9 @@ static gboolean
gnc_option_set_ui_value_string (GNCOption *option, gboolean use_default, gnc_option_set_ui_value_string (GNCOption *option, gboolean use_default,
GtkWidget *widget, SCM value) 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); gtk_entry_set_text(GTK_ENTRY(widget), string);
return FALSE; return FALSE;
} }
@ -2218,10 +2218,10 @@ gnc_option_set_ui_value_text (GNCOption *option, gboolean use_default,
else else
buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(object)); 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); const gchar *string = scm_to_locale_string(value);
gtk_text_buffer_set_text (buffer, string, strlen (string)); gtk_text_buffer_set_text (buffer, string, scm_i_string_length(value));
return FALSE; return FALSE;
} }
else else
@ -2293,7 +2293,7 @@ gnc_option_set_ui_value_date (GNCOption *option, gboolean use_default,
date_option_type = gnc_option_date_option_get_subtype(option); 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); symbol_str = gnc_date_option_value_get_type (value);
if (symbol_str) if (symbol_str)
@ -2432,7 +2432,7 @@ gnc_option_set_ui_value_list (GNCOption *option, gboolean use_default,
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widget)); selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widget));
gtk_tree_selection_unselect_all(selection); gtk_tree_selection_unselect_all(selection);
while (SCM_LISTP(value) && !SCM_NULLP(value)) while (scm_is_list(value) && !scm_is_null(value))
{ {
SCM item; SCM item;
@ -2450,7 +2450,7 @@ gnc_option_set_ui_value_list (GNCOption *option, gboolean use_default,
gtk_tree_path_free(path); gtk_tree_path_free(path);
} }
if (!SCM_LISTP(value) || !SCM_NULLP(value)) if (!scm_is_list(value) || !scm_is_null(value))
return TRUE; return TRUE;
return FALSE; return FALSE;
@ -2465,7 +2465,7 @@ gnc_option_set_ui_value_number_range (GNCOption *option, gboolean use_default,
spinner = GTK_SPIN_BUTTON(widget); spinner = GTK_SPIN_BUTTON(widget);
if (SCM_NUMBERP(value)) if (scm_is_number(value))
{ {
d_value = scm_num2dbl(value, G_STRFUNC); d_value = scm_num2dbl(value, G_STRFUNC);
gtk_spin_button_set_value(spinner, d_value); gtk_spin_button_set_value(spinner, d_value);
@ -2506,9 +2506,9 @@ static gboolean
gnc_option_set_ui_value_font (GNCOption *option, gboolean use_default, gnc_option_set_ui_value_font (GNCOption *option, gboolean use_default,
GtkWidget *widget, SCM value) 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')) if ((string != NULL) && (*string != '\0'))
{ {
GtkFontButton *font_button = GTK_FONT_BUTTON(widget); GtkFontButton *font_button = GTK_FONT_BUTTON(widget);
@ -2525,9 +2525,9 @@ gnc_option_set_ui_value_pixmap (GNCOption *option, gboolean use_default,
GtkWidget *widget, SCM value) GtkWidget *widget, SCM value)
{ {
ENTER("option %p(%s)", option, gnc_option_name(option)); 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) if (string && *string)
{ {
@ -2556,7 +2556,7 @@ static gboolean gnc_option_set_ui_value_budget(
GtkTreeModel *tm; GtkTreeModel *tm;
GtkTreeIter iter; GtkTreeIter iter;
// if (!SCM_NULLP(value)) { // if (!scm_is_null(value)) {
if (value != SCM_BOOL_F) { if (value != SCM_BOOL_F) {
if (!SWIG_IsPointer(value)) if (!SWIG_IsPointer(value))
scm_misc_error("gnc_option_set_ui_value_budget", scm_misc_error("gnc_option_set_ui_value_budget",

View File

@ -1583,13 +1583,13 @@ gnc_xfer_dialog_fetch (GtkButton *button, XferDialog *xferData)
quotes_func = scm_c_eval_string ("gnc:book-add-quotes"); 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"); LEAVE("quote retrieval failed");
return; return;
} }
book_scm = gnc_book_to_scm (xferData->book); 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"); LEAVE("no book");
return; return;
} }
@ -1597,7 +1597,7 @@ gnc_xfer_dialog_fetch (GtkButton *button, XferDialog *xferData)
scm_window = SWIG_NewPointerObj(xferData->dialog, scm_window = SWIG_NewPointerObj(xferData->dialog,
SWIG_TypeQuery("_p_GtkWidget"), 0); SWIG_TypeQuery("_p_GtkWidget"), 0);
if (SCM_NFALSEP (scm_not (book_scm))) { if (scm_is_true (scm_not (book_scm))) {
LEAVE("no scm window"); LEAVE("no scm window");
return; return;
} }

View File

@ -3286,7 +3286,7 @@ static void
gnc_main_window_cmd_file_properties (GtkAction *action, GncMainWindow *window) gnc_main_window_cmd_file_properties (GtkAction *action, GncMainWindow *window)
{ {
SCM func = scm_c_eval_string("gnc:main-window-properties-cb"); 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"); PERR ("not a procedure\n");
return; return;
} }

View File

@ -132,7 +132,7 @@ gnc_extension_path (SCM extension, char **fullpath)
initialize_getters(); initialize_getters();
path = gnc_guile_call1_to_list(getters.path, extension); 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(""); *fullpath = g_strdup("");
return; return;
} }
@ -142,19 +142,19 @@ gnc_extension_path (SCM extension, char **fullpath)
strings[0] = "/menubar"; strings[0] = "/menubar";
i = 1; i = 1;
while (!SCM_NULLP(path)) while (!scm_is_null(path))
{ {
SCM item; SCM item;
item = SCM_CAR(path); item = SCM_CAR(path);
path = SCM_CDR(path); path = SCM_CDR(path);
if (SCM_STRINGP(item)) if (scm_is_string(item))
{ {
if (i == 1) if (i == 1)
strings[i] = g_strdup(SCM_STRING_CHARS(item)); strings[i] = g_strdup(scm_to_locale_string(item));
else else
strings[i] = g_strdup(gettext(SCM_STRING_CHARS(item))); strings[i] = g_strdup(gettext(scm_to_locale_string(item)));
} }
else else
{ {

View File

@ -267,13 +267,13 @@ gnc_prices_dialog_get_quotes_clicked (GtkWidget *widget, gpointer data)
ENTER(" "); ENTER(" ");
quotes_func = scm_c_eval_string ("gnc:book-add-quotes"); quotes_func = scm_c_eval_string ("gnc:book-add-quotes");
if (!SCM_PROCEDUREP (quotes_func)) { if (!scm_is_procedure (quotes_func)) {
LEAVE(" no procedure"); LEAVE(" no procedure");
return; return;
} }
book_scm = gnc_book_to_scm (pdb_dialog->book); 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"); LEAVE("no book");
return; return;
} }

View File

@ -115,7 +115,7 @@ cancel_cb(GtkWidget * widget, gpointer data)
result = scm_call_0(progress->cancel_scm_func); result = scm_call_0(progress->cancel_scm_func);
if (!SCM_NFALSEP(result)) if (!scm_is_true(result))
return; return;
} }
@ -160,7 +160,7 @@ delete_cb(GtkWidget *widget, GdkEvent *event, gpointer data)
result = scm_call_0(progress->cancel_scm_func); result = scm_call_0(progress->cancel_scm_func);
if (SCM_NFALSEP(result)) if (scm_is_true(result))
{ {
if (progress->dialog != NULL) if (progress->dialog != NULL)
gtk_widget_hide(progress->dialog); gtk_widget_hide(progress->dialog);
@ -601,7 +601,7 @@ gnc_progress_dialog_set_cancel_scm_func(GNCProgressDialog *progress,
if (progress->cancel_scm_func != SCM_UNDEFINED) if (progress->cancel_scm_func != SCM_UNDEFINED)
scm_gc_unprotect_object(progress->cancel_scm_func); 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; progress->cancel_scm_func = cancel_scm_func;
scm_gc_protect_object(cancel_scm_func); scm_gc_protect_object(cancel_scm_func);

View File

@ -265,13 +265,13 @@ load_txf_info (gint acct_category, TaxInfoDialog *ti_dialog)
} }
codes = scm_call_2 (getters.codes, category, tax_entity_type); codes = scm_call_2 (getters.codes, category, tax_entity_type);
if (!SCM_LISTP (codes)) if (!scm_is_list (codes))
{ {
destroy_txf_infos (infos); destroy_txf_infos (infos);
return NULL; return NULL;
} }
while (!SCM_NULLP (codes)) while (!scm_is_null (codes))
{ {
TXFInfo *txf_info; TXFInfo *txf_info;
SCM code_scm; SCM code_scm;
@ -301,31 +301,31 @@ load_txf_info (gint acct_category, TaxInfoDialog *ti_dialog)
else else
txf_info->payer_name_source = g_strdup (str); 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); txf_info->code = g_strdup (str);
scm = scm_call_3 (getters.form, category, code_scm, tax_entity_type); 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); txf_info->form = g_strdup (str);
scm = scm_call_3 (getters.description, category, code_scm, tax_entity_type); 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); txf_info->description = g_strdup (str);
scm = scm_call_2 (getters.help, category, code_scm); 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); 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_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); 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"); const gchar *until = _("now");
if (year != 0) if (year != 0)
until = g_strdup_printf ("%d", year); until = g_strdup_printf ("%d", year);
form_line_data = g_strconcat ("\n", "\n", form_line, NULL); form_line_data = g_strconcat ("\n", "\n", form_line, NULL);
while (!SCM_NULLP (scm)) while (!scm_is_null (scm))
{ {
SCM year_scm; SCM year_scm;
gint line_year; gint line_year;
@ -337,10 +337,10 @@ load_txf_info (gint acct_category, TaxInfoDialog *ti_dialog)
/* line_year = scm_is_bool (SCM_CAR (year_scm)) ? 0 : /* line_year = scm_is_bool (SCM_CAR (year_scm)) ? 0 :
scm_to_int (SCM_CAR (year_scm)); <- Req's guile 1.8 */ 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 */ SCM_INUM (SCM_CAR (year_scm)); /* <-guile 1.6 */
line = SCM_STRINGP((SCM_CAR (SCM_CDR (year_scm)))) line = scm_is_string((SCM_CAR (SCM_CDR (year_scm))))
? SCM_STRING_CHARS((SCM_CAR (SCM_CDR (year_scm)))) : ""; ? scm_to_locale_string((SCM_CAR (SCM_CDR (year_scm)))) : "";
temp = g_strconcat (form_line_data, "\n", temp = g_strconcat (form_line_data, "\n",
g_strdup_printf ("%d", line_year), " - ", until, g_strdup_printf ("%d", line_year), " - ", until,
" ", line, NULL); " ", line, NULL);
@ -372,7 +372,7 @@ load_txf_info (gint acct_category, TaxInfoDialog *ti_dialog)
scm = scm_call_3 (getters.copy, category, code_scm, tax_entity_type); 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_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; txf_info->copy = cpy;
infos = g_list_prepend (infos, txf_info); infos = g_list_prepend (infos, txf_info);
@ -402,13 +402,13 @@ load_tax_entity_type_list (TaxInfoDialog *ti_dialog)
ti_dialog->tax_type_combo_text = NULL; ti_dialog->tax_type_combo_text = NULL;
tax_types = scm_call_0 (getters.tax_entity_types); 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); destroy_tax_type_infos (types);
return; return;
} }
while (!SCM_NULLP (tax_types)) while (!scm_is_null (tax_types))
{ {
TaxTypeInfo *tax_type_info; TaxTypeInfo *tax_type_info;
SCM type_scm; SCM type_scm;
@ -422,15 +422,15 @@ load_tax_entity_type_list (TaxInfoDialog *ti_dialog)
tax_type_info = g_new0 (TaxTypeInfo, 1); 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); tax_type_info->type_code = g_strdup (str);
scm = scm_call_1 (getters.tax_entity_type, type_scm); 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); tax_type_info->type = g_strdup (str);
scm = scm_call_1 (getters.tax_entity_desc, type_scm); 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->description = g_strdup (str);
tax_type_info->combo_box_entry = g_strconcat(tax_type_info->type, " - ", tax_type_info->combo_box_entry = g_strconcat(tax_type_info->type, " - ",

View File

@ -1820,7 +1820,7 @@ report_helper (GNCLedgerDisplay *ledger, Split *split, Query *query)
args = SCM_EOL; args = SCM_EOL;
func = scm_c_eval_string ("gnc:register-report-create"); 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)); arg = scm_makfrom0str (gnc_split_register_get_credit_string (reg));
args = scm_cons (arg, args); args = scm_cons (arg, args);
@ -1878,7 +1878,7 @@ report_helper (GNCLedgerDisplay *ledger, Split *split, Query *query)
/* Apply the function to the args */ /* Apply the function to the args */
arg = scm_apply (func, args, SCM_EOL); 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); return scm_num2int (arg, SCM_ARG1, G_STRFUNC);
} }

View File

@ -19,7 +19,7 @@
/* Convenience macros */ /* Convenience macros */
#define SCM_EQUALP(obj1,obj2) SCM_NFALSEP(scm_equal_p(obj1,obj2)) #define scm_is_equal(obj1,obj2) scm_is_true(scm_equal_p(obj1,obj2))
#define SCM_EXACTP(obj) SCM_NFALSEP(scm_exact_p(obj)) #define scm_is_exact(obj) scm_is_true(scm_exact_p(obj))
#define SCM_LISTP(obj) SCM_NFALSEP(scm_list_p(obj)) #define scm_is_list(obj) scm_is_true(scm_list_p(obj))
#define SCM_PROCEDUREP(obj) SCM_NFALSEP(scm_procedure_p(obj)) #define scm_is_procedure(obj) scm_is_true(scm_procedure_p(obj))

View File

@ -70,27 +70,27 @@ acct_tree_add_accts(SCM accts,
GtkTreeRowReference **reference) GtkTreeRowReference **reference)
{ {
GtkTreeIter iter; GtkTreeIter iter;
char * compname; const char * compname;
char * acctname; char * acctname;
gboolean leafnode; gboolean leafnode;
SCM current; SCM current;
gboolean checked; gboolean checked;
while(!SCM_NULLP(accts)) { while(!scm_is_null(accts)) {
current = SCM_CAR(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!"); g_critical("QIF import: BUG DETECTED in acct_tree_add_accts!");
accts = SCM_CDR(accts); accts = SCM_CDR(accts);
continue; continue;
} }
if (SCM_STRINGP(SCM_CAR(current))) if (scm_is_string(SCM_CAR(current)))
compname = SCM_STRING_CHARS(SCM_CAR(current)); compname = scm_to_locale_string(SCM_CAR(current));
else else
compname = ""; compname = "";
if (!SCM_NULLP(SCM_CADDR(current))) { if (!scm_is_null(SCM_CADDR(current))) {
leafnode = FALSE; leafnode = FALSE;
} }
else { else {
@ -309,7 +309,7 @@ qif_account_picker_dialog(QIFImportWindow * qif_wind, SCM map_entry)
scm_gc_protect_object(wind->map_entry); scm_gc_protect_object(wind->map_entry);
/* Set the initial account to be selected. */ /* 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"); xml = gnc_glade_xml_new("qif.glade", "QIF Import Account Picker");

View File

@ -236,9 +236,9 @@ update_account_picker_page(QIFImportWindow * wind, SCM make_display,
/* clear the list */ /* clear the list */
gtk_list_store_clear(store); gtk_list_store_clear(store);
while(!SCM_NULLP(accts_left)) { while(!scm_is_null(accts_left)) {
qif_name = SCM_STRING_CHARS(scm_call_1(get_qif_name, SCM_CAR(accts_left))); qif_name = scm_to_locale_string(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))); 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); checked = (scm_call_1(get_new, SCM_CAR(accts_left)) == SCM_BOOL_T);
gtk_list_store_append(store, &iter); gtk_list_store_append(store, &iter);
@ -489,7 +489,7 @@ get_prev_druid_page(QIFImportWindow * wind, GnomeDruidPage * page)
} }
/* If no duplicates were found, skip all post-conversion pages. */ /* 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; prev = NULL;
else else
prev = current->prev; prev = current->prev;
@ -651,7 +651,7 @@ gnc_ui_qif_import_load_file_back_cb(GnomeDruidPage * page, gpointer arg1,
{ {
QIFImportWindow * wind = user_data; QIFImportWindow * wind = user_data;
if (SCM_LISTP(wind->imported_files) && if (scm_is_list(wind->imported_files) &&
(scm_ilength(wind->imported_files) > 0)) { (scm_ilength(wind->imported_files) > 0)) {
gnome_druid_set_page(GNOME_DRUID(wind->druid), gnome_druid_set_page(GNOME_DRUID(wind->druid),
get_named_page(wind, "loaded_files_page")); get_named_page(wind, "loaded_files_page"));
@ -828,7 +828,7 @@ gnc_ui_qif_import_load_progress_show_cb(GtkWidget *widget,
wind->busy = FALSE; wind->busy = FALSE;
return; 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. */ /* A bug was detected. */
@ -847,9 +847,9 @@ gnc_ui_qif_import_load_progress_show_cb(GtkWidget *widget,
wind->busy = FALSE; wind->busy = FALSE;
return; 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) if (SCM_CAR(load_return) == SCM_BOOL_F)
{ {
@ -901,7 +901,7 @@ gnc_ui_qif_import_load_progress_show_cb(GtkWidget *widget,
wind->busy = FALSE; wind->busy = FALSE;
return; 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. */ /* A bug was detected. */
@ -924,7 +924,7 @@ gnc_ui_qif_import_load_progress_show_cb(GtkWidget *widget,
wind->busy = FALSE; wind->busy = FALSE;
return; return;
} }
else if (!SCM_NULLP(parse_return)) else if (!scm_is_null(parse_return))
{ {
/* Are there only warnings? */ /* Are there only warnings? */
if (SCM_CAR(parse_return) == SCM_BOOL_T) if (SCM_CAR(parse_return) == SCM_BOOL_T)
@ -949,7 +949,7 @@ gnc_ui_qif_import_load_progress_show_cb(GtkWidget *widget,
gtk_combo_box_remove_text(GTK_COMBO_BOX(wind->date_format_combo), 0); gtk_combo_box_remove_text(GTK_COMBO_BOX(wind->date_format_combo), 0);
/* Add the formats for the user to select from. */ /* 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), gtk_combo_box_append_text(GTK_COMBO_BOX(wind->date_format_combo),
SCM_SYMBOL_CHARS(SCM_CAR(date_formats))); SCM_SYMBOL_CHARS(SCM_CAR(date_formats)));
@ -1061,7 +1061,7 @@ gnc_ui_qif_import_load_progress_next_cb(GnomeDruidPage * page,
const gchar * default_acctname; const gchar * default_acctname;
/* Go to the "ask account name" page. */ /* 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)); wind->selected_file));
gtk_entry_set_text(GTK_ENTRY(wind->acct_entry), default_acctname); gtk_entry_set_text(GTK_ENTRY(wind->acct_entry), default_acctname);
@ -1162,7 +1162,7 @@ gnc_ui_qif_import_date_format_next_cb(GnomeDruidPage * page,
SCM default_acct = scm_c_eval_string("qif-file:path-to-accountname"); SCM default_acct = scm_c_eval_string("qif-file:path-to-accountname");
const gchar * default_acctname; 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)); wind->selected_file));
gtk_entry_set_text(GTK_ENTRY(wind->acct_entry), default_acctname); gtk_entry_set_text(GTK_ENTRY(wind->acct_entry), default_acctname);
@ -1193,7 +1193,7 @@ update_file_page(QIFImportWindow * wind)
SCM scm_qiffile = SCM_BOOL_F; SCM scm_qiffile = SCM_BOOL_F;
SCM qif_file_path; SCM qif_file_path;
int row = 0; int row = 0;
char * row_text; const char * row_text;
GtkTreeView *view; GtkTreeView *view;
GtkListStore *store; GtkListStore *store;
GtkTreeIter iter; GtkTreeIter iter;
@ -1206,9 +1206,9 @@ update_file_page(QIFImportWindow * wind)
gtk_list_store_clear(store); gtk_list_store_clear(store);
qif_file_path = scm_c_eval_string("qif-file:path"); 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); 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_append(store, &iter);
gtk_list_store_set(store, &iter, gtk_list_store_set(store, &iter,
@ -1254,7 +1254,7 @@ gnc_ui_qif_import_select_loaded_file_cb(GtkTreeSelection *selection,
button = gnc_glade_lookup_widget(wind->window, "unload_file_button"); button = gnc_glade_lookup_widget(wind->window, "unload_file_button");
if (gtk_tree_selection_get_selected(selection, &model, &iter)) { if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
gtk_tree_model_get(model, &iter, FILENAME_COL_INDEX, &row, -1); 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_ilength(wind->imported_files) > row)) {
scm_gc_unprotect_object(wind->selected_file); scm_gc_unprotect_object(wind->selected_file);
wind->selected_file = scm_list_ref(wind->imported_files, wind->selected_file = scm_list_ref(wind->imported_files,
@ -1799,11 +1799,11 @@ gnc_ui_qif_import_account_next_cb(GnomeDruidPage * page,
QIFImportWindow * wind = user_data; QIFImportWindow * wind = user_data;
/* If there are category mappings then proceed as usual. */ /* 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); return gnc_ui_qif_import_generic_next_cb(page, arg1, user_data);
/* If there are memo mappings then skip to that step. */ /* 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) if (wind->show_doc_pages)
gnome_druid_set_page(GNOME_DRUID(wind->druid), gnome_druid_set_page(GNOME_DRUID(wind->druid),
@ -1859,7 +1859,7 @@ gnc_ui_qif_import_category_next_cb(GnomeDruidPage * page,
QIFImportWindow * wind = user_data; QIFImportWindow * wind = user_data;
/* If there aren't any payee/memo mappings then skip that step. */ /* 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), gnome_druid_set_page(GNOME_DRUID(wind->druid),
get_named_page(wind, "currency_page")); get_named_page(wind, "currency_page"));
@ -1906,7 +1906,7 @@ gnc_ui_qif_import_memo_doc_back_cb(GnomeDruidPage * page, gpointer arg1,
QIFImportWindow * wind = user_data; QIFImportWindow * wind = user_data;
/* If there are no categories to show, go to account matching. */ /* 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), gnome_druid_set_page(GNOME_DRUID(wind->druid),
@ -1933,7 +1933,7 @@ gnc_ui_qif_import_memo_back_cb(GnomeDruidPage * page, gpointer arg1,
/* If documentation is off and there are no categories to show, /* If documentation is off and there are no categories to show,
* skip directly to account matching. */ * skip directly to account matching. */
if (!wind->show_doc_pages && 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), gnome_druid_set_page(GNOME_DRUID(wind->druid),
@ -2003,7 +2003,7 @@ gnc_ui_qif_import_currency_back_cb(GnomeDruidPage * page,
QIFImportWindow * wind = user_data; QIFImportWindow * wind = user_data;
/* If there are payee/memo mappings to display, go there. */ /* 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), gnome_druid_set_page(GNOME_DRUID(wind->druid),
get_named_page(wind, "memo_match_page")); get_named_page(wind, "memo_match_page"));
@ -2011,7 +2011,7 @@ gnc_ui_qif_import_currency_back_cb(GnomeDruidPage * page,
} }
/* If there are category mappings to display, go there. */ /* 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), gnome_druid_set_page(GNOME_DRUID(wind->druid),
get_named_page(wind, "category_match_page")); get_named_page(wind, "category_match_page"));
@ -2279,7 +2279,7 @@ prepare_security_pages(QIFImportWindow * wind)
gnc_set_busy_cursor(NULL, TRUE); gnc_set_busy_cursor(NULL, TRUE);
securities = wind->new_securities; securities = wind->new_securities;
current = wind->commodity_pages; current = wind->commodity_pages;
while (!SCM_NULLP(securities) && (securities != SCM_BOOL_F)) while (!scm_is_null(securities) && (securities != SCM_BOOL_F))
{ {
if (current) if (current)
{ {
@ -2430,12 +2430,12 @@ gnc_ui_qif_import_prepare_duplicates(QIFImportWindow * wind)
store = GTK_LIST_STORE(gtk_tree_view_get_model(view)); store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
gtk_list_store_clear(store); gtk_list_store_clear(store);
if (!SCM_LISTP(wind->match_transactions)) if (!scm_is_list(wind->match_transactions))
return; return;
/* Loop through the list of new, potentially duplicate transactions. */ /* Loop through the list of new, potentially duplicate transactions. */
duplicates = wind->match_transactions; duplicates = wind->match_transactions;
while (!SCM_NULLP(duplicates)) while (!scm_is_null(duplicates))
{ {
current_xtn = SCM_CAAR(duplicates); current_xtn = SCM_CAAR(duplicates);
#define FUNC_NAME "xaccTransCountSplits" #define FUNC_NAME "xaccTransCountSplits"
@ -2643,7 +2643,7 @@ gnc_ui_qif_import_convert_progress_show_cb(GtkWidget *widget,
wind->busy = FALSE; wind->busy = FALSE;
return; return;
} }
else if (SCM_SYMBOLP(retval)) else if (scm_is_symbol(retval))
{ {
/* An error was encountered during conversion. */ /* An error was encountered during conversion. */
@ -2789,7 +2789,7 @@ gnc_ui_qif_import_convert_progress_next_cb(GnomeDruidPage * page,
{ {
QIFImportWindow *wind = user_data; 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. */ /* No potential duplicates, so skip to the last page. */
gnome_druid_set_page(GNOME_DRUID(wind->druid), gnome_druid_set_page(GNOME_DRUID(wind->druid),
@ -2881,7 +2881,7 @@ refresh_old_transactions(QIFImportWindow * wind, int selection)
scm_call_2(scm_c_eval_string("qif-import:refresh-match-selection"), scm_call_2(scm_c_eval_string("qif-import:refresh-match-selection"),
possible_matches, scm_int2num(selection)); possible_matches, scm_int2num(selection));
while(!SCM_NULLP(possible_matches)) { while(!scm_is_null(possible_matches)) {
current_xtn = SCM_CAR(possible_matches); current_xtn = SCM_CAR(possible_matches);
#define FUNC_NAME "xaccTransCountSplits" #define FUNC_NAME "xaccTransCountSplits"
gnc_xtn = SWIG_MustGetPtr(SCM_CAR(current_xtn), gnc_xtn = SWIG_MustGetPtr(SCM_CAR(current_xtn),

View File

@ -126,7 +126,7 @@ update_display_lists(gnc_column_view_edit * view)
/* Update the list of available reports (left selection box). */ /* Update the list of available reports (left selection box). */
row = view->available_selected; 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); row = MIN (row, scm_ilength (view->available_list) - 1);
selection = scm_list_ref (view->available_list, scm_int2num (row)); selection = scm_list_ref (view->available_list, scm_int2num (row));
} }
@ -141,11 +141,11 @@ update_display_lists(gnc_column_view_edit * view)
store = GTK_LIST_STORE(gtk_tree_view_get_model(view->available)); store = GTK_LIST_STORE(gtk_tree_view_get_model(view->available));
gtk_list_store_clear(store); gtk_list_store_clear(store);
if(SCM_LISTP(names)) { if(scm_is_list(names)) {
for(i = 0; !SCM_NULLP(names); names = SCM_CDR(names), i++) { for(i = 0; !scm_is_null(names); names = SCM_CDR(names), i++) {
if (SCM_EQUALP (SCM_CAR(names), selection)) if (scm_is_equal (SCM_CAR(names), selection))
row = i; 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))); SCM_BOOL_F)));
gtk_list_store_append(store, &iter); gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter, gtk_list_store_set(store, &iter,
@ -165,7 +165,7 @@ update_display_lists(gnc_column_view_edit * view)
/* Update the list of selected reports (right selection box). */ /* Update the list of selected reports (right selection box). */
row = view->contents_selected; 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); row = MIN (row, scm_ilength (view->contents_list) - 1);
selection = scm_list_ref (view->contents_list, scm_int2num (row)); selection = scm_list_ref (view->contents_list, scm_int2num (row));
} }
@ -179,14 +179,14 @@ update_display_lists(gnc_column_view_edit * view)
store = GTK_LIST_STORE(gtk_tree_view_get_model(view->contents)); store = GTK_LIST_STORE(gtk_tree_view_get_model(view->contents));
gtk_list_store_clear(store); gtk_list_store_clear(store);
if(SCM_LISTP(contents)) { if(scm_is_list(contents)) {
for(i = 0; !SCM_NULLP(contents); contents = SCM_CDR(contents), i++) { for(i = 0; !scm_is_null(contents); contents = SCM_CDR(contents), i++) {
if (SCM_EQUALP (SCM_CAR(contents), selection)) if (scm_is_equal (SCM_CAR(contents), selection))
row = i; row = i;
id = scm_num2int(SCM_CAAR(contents), SCM_ARG1, G_STRFUNC); id = scm_num2int(SCM_CAAR(contents), SCM_ARG1, G_STRFUNC);
this_report = gnc_report_find(id); 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_append(store, &iter);
gtk_list_store_set gtk_list_store_set
@ -409,7 +409,7 @@ gnc_column_view_edit_add_cb(GtkButton * button, gpointer user_data)
int count; int count;
int oldlength, id; int oldlength, id;
if(SCM_LISTP(r->available_list) && if(scm_is_list(r->available_list) &&
(scm_ilength(r->available_list) > r->available_selected)) { (scm_ilength(r->available_list) > r->available_selected)) {
template_name = scm_list_ref(r->available_list, template_name = scm_list_ref(r->available_list,
scm_int2num(r->available_selected)); scm_int2num(r->available_selected));
@ -464,7 +464,7 @@ gnc_column_view_edit_remove_cb(GtkButton * button, gpointer user_data)
int count; int count;
int oldlength; int oldlength;
if(SCM_LISTP(r->contents_list)) { if(scm_is_list(r->contents_list)) {
oldlength = scm_ilength(r->contents_list); oldlength = scm_ilength(r->contents_list);
if(oldlength > r->contents_selected) { if(oldlength > r->contents_selected) {
for(count=0; count < r->contents_selected; count++) { for(count=0; count < r->contents_selected; count++) {

View File

@ -112,13 +112,13 @@ update_report_list(GtkListStore *store, CustomReportDialog *crd)
gtk_list_store_clear(store); 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, /* for all the names in the list, store them, with a reference,
in the gtkliststore */ 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_append(store, &iter);
gtk_list_store_set(store, &iter, gtk_list_store_set(store, &iter,
@ -184,7 +184,7 @@ custom_report_run_report(SCM guid,
int report_id; int report_id;
GncMainWindow *window = crd->window; GncMainWindow *window = crd->window;
if(!SCM_NULLP(guid)) if(!scm_is_null(guid))
{ {
/* this runs the report */ /* this runs the report */
@ -295,15 +295,15 @@ on_delete_custom_report_clicked(GtkWidget *button,
SCM template_menu_name = scm_c_eval_string("gnc:report-template-menu-name/report-guid"); SCM template_menu_name = scm_c_eval_string("gnc:report-template-menu-name/report-guid");
SCM guid; SCM guid;
gchar* report_name; const gchar* report_name;
sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(crd->reportview)); sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(crd->reportview));
guid = get_custom_report_selection(crd, _("You must select a report to delete.")); 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! */ /* 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)) && 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"); SCM del_report = scm_c_eval_string("gnc:delete-report");

View File

@ -71,15 +71,15 @@ dirty_same_stylesheet(gpointer key, gpointer val, gpointer data)
SCM func = NULL; SCM func = NULL;
func = scm_c_eval_string("gnc:report-stylesheet"); func = scm_c_eval_string("gnc:report-stylesheet");
if (SCM_PROCEDUREP(func)) if (scm_is_procedure(func))
rep_ss = scm_call_1(func, report); rep_ss = scm_call_1(func, report);
else else
return; 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?!"); func = scm_c_eval_string("gnc:report-set-dirty?!");
/* This makes _me_ feel dirty! */ /* This makes _me_ feel dirty! */
if (SCM_PROCEDUREP(func)) if (scm_is_procedure(func))
scm_call_2(func, report, SCM_BOOL_T); scm_call_2(func, report, SCM_BOOL_T);
} }
} }
@ -191,10 +191,10 @@ gnc_style_sheet_new (StyleSheetDialog * ssd)
gtk_list_store_clear(GTK_LIST_STORE(template_model)); gtk_list_store_clear(GTK_LIST_STORE(template_model));
/* put in the list of style sheet type names */ /* 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); SCM t = SCM_CAR(templates);
gtk_combo_box_append_text(GTK_COMBO_BOX(template_combo), 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); gtk_combo_box_set_active(GTK_COMBO_BOX(template_combo), 0);
@ -233,7 +233,7 @@ gnc_style_sheet_select_dialog_add_one(StyleSheetDialog * ss,
get_name = scm_c_eval_string("gnc:html-style-sheet-name"); get_name = scm_c_eval_string("gnc:html-style-sheet-name");
scm_name = scm_call_1(get_name, sheet_info); 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) if (!c_name)
return; return;
@ -258,7 +258,7 @@ gnc_style_sheet_select_dialog_fill(StyleSheetDialog * ss)
SCM sheet_info; SCM sheet_info;
/* pack it full of content */ /* 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); sheet_info = SCM_CAR(stylesheets);
gnc_style_sheet_select_dialog_add_one(ss, sheet_info, FALSE); gnc_style_sheet_select_dialog_add_one(ss, sheet_info, FALSE);
} }

View File

@ -705,7 +705,7 @@ gnc_plugin_page_report_save_page (GncPluginPage *plugin_page,
report = GNC_PLUGIN_PAGE_REPORT(plugin_page); report = GNC_PLUGIN_PAGE_REPORT(plugin_page);
priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report); 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) { SCM_UNBNDP(priv->cur_report) || SCM_BOOL_F == priv->cur_report) {
LEAVE("not saving invalid report"); LEAVE("not saving invalid report");
return; return;
@ -718,30 +718,30 @@ gnc_plugin_page_report_save_page (GncPluginPage *plugin_page,
while (count-- > 0) { while (count-- > 0) {
item = SCM_CAR(embedded); item = SCM_CAR(embedded);
embedded = SCM_CDR(embedded); embedded = SCM_CDR(embedded);
if (!SCM_NUMBERP(item)) if (!scm_is_number(item))
continue; continue;
id = SCM_INUM(item); id = SCM_INUM(item);
tmp_report = gnc_report_find(id); tmp_report = gnc_report_find(id);
scm_text = scm_call_1(gen_save_text, tmp_report); 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); DEBUG("child report %d: nothing to save", id);
continue; continue;
} }
key_name = g_strdup_printf(SCHEME_OPTIONS_N, id); 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_key_file_set_string(key_file, group_name, key_name, text);
g_free(text); g_free(text);
g_free(key_name); g_free(key_name);
} }
scm_text = scm_call_1(gen_save_text, priv->cur_report); 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"); LEAVE("nothing to save");
return; 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_key_file_set_string(key_file, group_name, SCHEME_OPTIONS, text);
g_free(text); g_free(text);
LEAVE(" "); LEAVE(" ");
@ -924,7 +924,7 @@ gnc_plugin_page_report_destroy(GncPluginPageReportPrivate * priv)
SCM edited, editor; SCM edited, editor;
/* close any open editors */ /* 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)) { edited = SCM_CDR(edited)) {
editor = scm_call_1(get_editor, SCM_CAR(edited)); editor = scm_call_1(get_editor, SCM_CAR(edited));
scm_call_2(set_editor, SCM_CAR(edited), SCM_BOOL_F); scm_call_2(set_editor, SCM_CAR(edited), SCM_BOOL_F);
@ -1251,16 +1251,16 @@ gnc_get_export_type_choice (SCM export_types)
int choice; int choice;
SCM tail; SCM tail;
if (!SCM_LISTP (export_types)) if (!scm_is_list (export_types))
return SCM_BOOL_F; 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); SCM pair = SCM_CAR (tail);
const gchar * name; const gchar * name;
SCM scm; SCM scm;
if (!SCM_CONSP (pair)) if (!scm_is_pair (pair))
{ {
g_warning ("unexpected list element"); g_warning ("unexpected list element");
bad = TRUE; bad = TRUE;
@ -1268,14 +1268,14 @@ gnc_get_export_type_choice (SCM export_types)
} }
scm = SCM_CAR (pair); scm = SCM_CAR (pair);
if (!SCM_STRINGP (scm)) if (!scm_is_string (scm))
{ {
g_warning ("unexpected pair element"); g_warning ("unexpected pair element");
bad = TRUE; bad = TRUE;
break; break;
} }
name = SCM_STRING_CHARS (scm); name = scm_to_locale_string (scm);
choices = g_list_prepend (choices, g_strdup (name)); choices = g_list_prepend (choices, g_strdup (name));
} }
@ -1323,7 +1323,7 @@ gnc_get_export_filename (SCM choice)
type = _("HTML"); type = _("HTML");
else 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". */ /* %s is the type of what is about to be saved, e.g. "HTML". */
@ -1412,7 +1412,7 @@ gnc_plugin_page_report_export_cb( GtkAction *action, GncPluginPageReport *report
export_thunk = scm_call_1 (scm_c_eval_string ("gnc:report-export-thunk"), export_thunk = scm_call_1 (scm_c_eval_string ("gnc:report-export-thunk"),
priv->cur_report); 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); choice = gnc_get_export_type_choice (export_types);
else else
choice = SCM_BOOL_T; choice = SCM_BOOL_T;
@ -1424,7 +1424,7 @@ gnc_plugin_page_report_export_cb( GtkAction *action, GncPluginPageReport *report
if (!filepath) if (!filepath)
return; return;
if (SCM_CONSP (choice)) if (scm_is_pair (choice))
{ {
SCM file_scm; SCM file_scm;
SCM res; SCM res;

View File

@ -153,8 +153,8 @@ gnc_report_window_default_params_editor(SCM options, SCM report)
ptr = scm_call_1(get_template, ptr); ptr = scm_call_1(get_template, ptr);
if (ptr != SCM_BOOL_F) { if (ptr != SCM_BOOL_F) {
ptr = scm_call_1(get_template_name, ptr); ptr = scm_call_1(get_template_name, ptr);
if (SCM_STRINGP(ptr)) if (scm_is_string(ptr))
title = SCM_STRING_CHARS(ptr); title = scm_to_locale_string(ptr);
} }
} }

View File

@ -76,7 +76,7 @@ gint gnc_report_add(SCM report)
gnc_report_init_table(); gnc_report_init_table();
value = scm_call_1(get_id, report); value = scm_call_1(get_id, report);
if (SCM_NUMBERP(value)) { if (scm_is_number(value)) {
id = scm_num2int(value, SCM_ARG1, G_STRFUNC); id = scm_num2int(value, SCM_ARG1, G_STRFUNC);
if (!g_hash_table_lookup(reports, &id)) { if (!g_hash_table_lookup(reports, &id)) {
key = g_new(gint, 1); key = g_new(gint, 1);
@ -146,10 +146,10 @@ gnc_run_report (gint report_id, char ** data)
scm_text = gfec_eval_string(str, error_handler); scm_text = gfec_eval_string(str, error_handler);
g_free(str); g_free(str);
if (scm_text == SCM_UNDEFINED || !SCM_STRINGP (scm_text)) if (scm_text == SCM_UNDEFINED || !scm_is_string (scm_text))
return FALSE; return FALSE;
free_data = SCM_STRING_CHARS (scm_text); free_data = scm_to_locale_string (scm_text);
*data = g_strdup (free_data); *data = g_strdup (free_data);
return TRUE; return TRUE;
@ -183,9 +183,9 @@ gnc_report_name( SCM report )
return NULL; return NULL;
value = scm_call_1(get_name, report); value = scm_call_1(get_name, report);
if (!SCM_STRINGP(value)) if (!scm_is_string(value))
return NULL; return NULL;
return g_strdup(SCM_STRING_CHARS(value)); return g_strdup(scm_to_locale_string(value));
} }