27 #include "business-options.h"
28 #include "swig-runtime.h"
30 #define FUNC_NAME G_STRFUNC
32 #define LOOKUP_OPTION(fcn) \
37 option = gnc_option_db_get_option_by_name (odb, section, name); \
40 return default_value; \
42 getter = gnc_option_getter (option); \
43 if (getter == SCM_UNDEFINED) \
44 return default_value; \
46 value = scm_call_0 (getter); \
47 if (value == SCM_BOOL_F) \
49 SWIG_GetModule(NULL); \
50 if (!SWIG_IsPointer(value)) \
51 scm_misc_error(fcn, "SCM is not a wrapped pointer.", value)
54 gnc_option_db_lookup_taxtable_option(
GNCOptionDB *odb,
59 LOOKUP_OPTION(
"gnc_option_db_lookup_taxtable_option");
60 return SWIG_MustGetPtr(value, SWIG_TypeQuery(
"_p__gncTaxTable"), 1, 0);
64 gnc_option_db_lookup_invoice_option(
GNCOptionDB *odb,
69 LOOKUP_OPTION(
"gnc_option_db_lookup_invoice_option");
70 return SWIG_MustGetPtr(value, SWIG_TypeQuery(
"_p__gncInvoice"), 1, 0);
74 gnc_option_db_lookup_customer_option(
GNCOptionDB *odb,
79 LOOKUP_OPTION(
"gnc_option_db_lookup_customer_option");
80 return SWIG_MustGetPtr(value, SWIG_TypeQuery(
"_p__gncCustomer"), 1, 0);
84 gnc_option_db_lookup_vendor_option(
GNCOptionDB *odb,
89 LOOKUP_OPTION(
"gnc_option_db_lookup_vendor_option");
90 return SWIG_MustGetPtr(value, SWIG_TypeQuery(
"_p__gncVendor"), 1, 0);