Index: src/libqof/qof/qofbook.c
===================================================================
--- src/libqof/qof/qofbook.c	(revision 18449)
+++ src/libqof/qof/qofbook.c	(working copy)
@@ -39,7 +39,6 @@
 #include <string.h>
 
 #include <glib.h>
-#include <libguile.h>
 
 #include "qof.h"
 #include "qofevent-p.h"
@@ -47,6 +46,7 @@
 #include "qofbook-p.h"
 #include "qofid-p.h"
 #include "qofobject-p.h"
+#include "qofbookslots.h"
 
 static QofLogModule log_module = QOF_MOD_ENGINE;
 
@@ -440,39 +440,17 @@
     return counter;
 }
 
-static char *get_scm_string(const char *str_name)
-{
-    SCM scm_string = scm_c_eval_string (str_name);
-    if (! SCM_STRINGP(scm_string))
-        return NULL;
-        
-    return g_strdup(SCM_STRING_CHARS(scm_string));
-}
-
 /* Determine whether this book uses trading accounts */
 gboolean qof_book_use_trading_accounts (const QofBook *book)
 {
-#if 0
-    static char *options_name = NULL;
-    static char *acct_section = NULL;
-    static char *trading_opt = NULL;
-    
     const char *opt;
     kvp_value *kvp_val;
     
-    if (options_name == NULL)
-    {
-        options_name = get_scm_string ("(car gnc:*kvp-option-path*)");
-        //acct_section = get_scm_string ("gnc:*book-label*");
-        //trading_opt = get_scm_string ("gnc:*trading-accounts*");
-        if (options_name == NULL || acct_section == NULL || trading_opt == NULL)
-        {
-            PWARN ("Unable to find trading account preference");
-        }
-    }
     
-    kvp_val = kvp_frame_get_slot_path (qof_book_get_slots (book), options_name, acct_section,
-                                       trading_opt, NULL);
+    kvp_val = kvp_frame_get_slot_path (qof_book_get_slots (book), 
+                                       BOOK_OPTIONS_NAME, 
+                                       ACCOUNT_OPTIONS_SECTION,
+                                       TRADING_ACCOUNTS_OPTION, NULL);
     if (kvp_val == NULL)
         return FALSE;
     
@@ -480,7 +458,6 @@
     
     if (opt && opt[0] == 't' && opt[1] == 0)
         return TRUE;
-#endif
     return FALSE;
 }
 
Index: src/libqof/qof/qofbookslots.h
===================================================================
--- src/libqof/qof/qofbookslots.h	(revision 0)
+++ src/libqof/qof/qofbookslots.h	(revision 0)
@@ -0,0 +1,33 @@
+/********************************************************************\
+ * qofbookslots.h -- Defines the names of slots used in the book.   *
+ * This program is free software; you can redistribute it and/or    *
+ * modify it under the terms of the GNU General Public License as   *
+ * published by the Free Software Foundation; either version 2 of   *
+ * the License, or (at your option) any later version.              *
+ *                                                                  *
+ * This program is distributed in the hope that it will be useful,  *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
+ * GNU General Public License for more details.                     *
+ *                                                                  *
+ * You should have received a copy of the GNU General Public License*
+ * along with this program; if not, contact:                        *
+ *                                                                  *
+ * Free Software Foundation           Voice:  +1-617-542-5942       *
+ * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
+ * Boston, MA  02110-1301,  USA       gnu@gnu.org                   *
+ *                                                                  *
+\********************************************************************/
+
+/** @name Book parameter names
+
+ * These define the names used for the slots used to store book level parameters.
+ * They are defined here so swig will find them since they need to be available to 
+ * Scheme code too.
+ @{
+*/
+#define BOOK_OPTIONS_NAME       "options"
+#define ACCOUNT_OPTIONS_SECTION "Accounts"
+#define TRADING_ACCOUNTS_OPTION "Trading Accounts"
+
+/** @} */

Property changes on: src/libqof/qof/qofbookslots.h
___________________________________________________________________
Added: svn:eol-style
   + native

Index: src/libqof/qof/Makefile.am
===================================================================
--- src/libqof/qof/Makefile.am	(revision 18449)
+++ src/libqof/qof/Makefile.am	(working copy)
@@ -2,14 +2,12 @@
 
 libgnc_qof_la_LDFLAGS= -version-info $(LIBQOF_LIBRARY_VERSION)
 libgnc_qof_la_LIBADD= \
-  $(GUILE_LIBS) \
   $(GLIB_LIBS) \
   $(REGEX_LIBS) \
   $(top_builddir)/lib/libc/libc-missing.la
 
 AM_CPPFLAGS = \
   -I$(top_srcdir)/lib/libc \
-  $(GUILE_INCS) \
   $(GLIB_CFLAGS)
 
 libgnc_qof_la_SOURCES =  \
@@ -58,6 +56,7 @@
    qofinstance.h     \
    qofquery.h        \
    qofbook.h         \
+   qofbookslots.h    \
    qoflog.h          \
    qofobject.h       \
    qofquerycore.h    \
Index: src/business/business-utils/business-utils.scm
===================================================================
--- src/business/business-utils/business-utils.scm	(revision 18449)
+++ src/business/business-utils/business-utils.scm	(working copy)
@@ -18,8 +18,8 @@
             gnc:*company-phone* gnc:*company-fax* gnc:*company-url*
             gnc:*company-email* gnc:*company-contact*)
 
-(define gnc:*book-label* (N_ "Accounts"))
-(define gnc:*trading-accounts* (N_ "Trading Accounts"))
+(define gnc:*book-label* ACCOUNT-OPTIONS-SECTION)
+(define gnc:*trading-accounts* TRADING-ACCOUNTS-OPTION)
 
 (export gnc:*book-label* gnc:*trading-accounts*)
 
Index: src/engine/engine.i
===================================================================
--- src/engine/engine.i	(revision 18449)
+++ src/engine/engine.i	(working copy)
@@ -114,6 +114,7 @@
 %ignore qof_query_run;
 %include <qofquery.h>
 %include <qofquerycore.h>
+%include <qofbookslots.h>
 
 gnc_numeric gnc_numeric_create(gint64 num, gint64 denom);
 gnc_numeric gnc_numeric_zero(void);
@@ -297,6 +298,10 @@
     SET_ENUM("TRANS-DATE-POSTED");
     SET_ENUM("TRANS-DESCRIPTION");
     SET_ENUM("TRANS-NUM");
+    
+    SET_ENUM("BOOK-OPTIONS-NAME");
+    SET_ENUM("ACCOUNT-OPTIONS-SECTION");
+    SET_ENUM("TRADING-ACCOUNTS-OPTION");
 
     SET_ENUM("ACCOUNT-CODE-");  /* sic */
 
Index: src/app-utils/app-utils.scm
===================================================================
--- src/app-utils/app-utils.scm	(revision 18449)
+++ src/app-utils/app-utils.scm	(working copy)
@@ -257,7 +257,7 @@
 (export simple-obj-from-list)
 (export make-simple-obj)
 
-(define gnc:*kvp-option-path* '("options"))
+(define gnc:*kvp-option-path* (list BOOK-OPTIONS-NAME))
 (export gnc:*kvp-option-path*)
 
 (load-from-path "c-interface.scm")
