r14973 - gnucash/branches/swig-redo/src - Prepare the engine module for swigification.

Chris Shoemaker chris at cvs.gnucash.org
Mon Oct 9 20:05:25 EDT 2006


Author: chris
Date: 2006-10-09 20:05:22 -0400 (Mon, 09 Oct 2006)
New Revision: 14973
Trac: http://svn.gnucash.org/trac/changeset/14973

Modified:
   gnucash/branches/swig-redo/src/engine/Account.h
   gnucash/branches/swig-redo/src/engine/Group.c
   gnucash/branches/swig-redo/src/engine/Group.h
   gnucash/branches/swig-redo/src/engine/Query.c
   gnucash/branches/swig-redo/src/engine/Query.h
   gnucash/branches/swig-redo/src/engine/Transaction.h
   gnucash/branches/swig-redo/src/engine/engine-helpers.c
   gnucash/branches/swig-redo/src/engine/engine-helpers.h
   gnucash/branches/swig-redo/src/engine/glib-helpers.c
   gnucash/branches/swig-redo/src/engine/glib-helpers.h
   gnucash/branches/swig-redo/src/engine/gnc-budget.h
   gnucash/branches/swig-redo/src/engine/gnc-commodity.c
   gnucash/branches/swig-redo/src/engine/gnc-commodity.h
   gnucash/branches/swig-redo/src/engine/gnc-pricedb.c
   gnucash/branches/swig-redo/src/engine/gnc-pricedb.h
   gnucash/branches/swig-redo/src/gnome-utils/gnc-file.c
   gnucash/branches/swig-redo/src/report/report-system/report-utilities.scm
Log:
Prepare the engine module for swigification.
  - Remove undefined functions
  - Use more specific types for GList-of-objects.
  - Use gboolean instead of int in some appropriate places.
  - Convert some macros to functions.
  - Implement gnc_scm_to_gslist_string() and publicize gnc_query_scm2path(),
    both of which will be useful for type-mapping.
  - Use #t/#f instead of 1/0 in some guile code.



Modified: gnucash/branches/swig-redo/src/engine/Account.h
===================================================================
--- gnucash/branches/swig-redo/src/engine/Account.h	2006-10-10 00:04:40 UTC (rev 14972)
+++ gnucash/branches/swig-redo/src/engine/Account.h	2006-10-10 00:05:22 UTC (rev 14973)
@@ -558,10 +558,6 @@
  *  in accfrom to accto. */
 void xaccAccountMoveAllSplits (Account *accfrom, Account *accto);
 
-/** \warning  Unimplemented */
-gpointer xaccAccountForEachSplit(Account *account, SplitCallback,
-                                 gpointer data);
-
 /** The xaccAccountForEachTransaction() routine will traverse all of
    the transactions in the given 'account' and call the callback
    function 'proc' on each transaction.  Processing will continue

Modified: gnucash/branches/swig-redo/src/engine/Group.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/Group.c	2006-10-10 00:04:40 UTC (rev 14972)
+++ gnucash/branches/swig-redo/src/engine/Group.c	2006-10-10 00:05:22 UTC (rev 14973)
@@ -470,7 +470,7 @@
   return grp->accounts;
 }
 
-GList *
+AccountList *
 xaccGroupGetAccountListSorted (const AccountGroup *grp)
 {
   if (!grp) return NULL;

Modified: gnucash/branches/swig-redo/src/engine/Group.h
===================================================================
--- gnucash/branches/swig-redo/src/engine/Group.h	2006-10-10 00:04:40 UTC (rev 14972)
+++ gnucash/branches/swig-redo/src/engine/Group.h	2006-10-10 00:05:22 UTC (rev 14973)
@@ -215,7 +215,7 @@
  *    immediate children of the account group.  The returned list
  *    should be freed with g_list_free() when no longer needed.
  */
-GList * xaccGroupGetAccountListSorted (const AccountGroup *grp);
+AccountList * xaccGroupGetAccountListSorted (const AccountGroup *grp);
 
 /** The xaccGroupGetRoot() subroutine will find the topmost 
  *    (root) group to which this group belongs.

Modified: gnucash/branches/swig-redo/src/engine/Query.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/Query.c	2006-10-10 00:04:40 UTC (rev 14972)
+++ gnucash/branches/swig-redo/src/engine/Query.c	2006-10-10 00:05:22 UTC (rev 14973)
@@ -295,7 +295,8 @@
 
 void
 xaccQueryAddStringMatch (Query* q, const char *matchstring,
-			 int case_sens, int use_regexp, QofQueryOp op,
+			 gboolean case_sens, gboolean use_regexp,
+                         QofQueryOp op,
 			 const char * path, ...)
 {
   QofQueryPredData *pred_data;
@@ -353,8 +354,8 @@
 
 void
 xaccQueryAddDateMatchTS (Query * q, 
-			 int use_start, Timespec sts, 
-			 int use_end, Timespec ets,
+			 gboolean use_start, Timespec sts,
+			 gboolean use_end, Timespec ets,
 			 QofQueryOp op)
 {
   Query *tmp_q = NULL;
@@ -425,8 +426,8 @@
 
 void
 xaccQueryAddDateMatch(Query * q, 
-                      int use_start, int sday, int smonth, int syear,
-                      int use_end, int eday, int emonth, int eyear,
+                      gboolean use_start, int sday, int smonth, int syear,
+                      gboolean use_end, int eday, int emonth, int eyear,
                       QofQueryOp op) 
 {
   /* gcc -O3 will auto-inline this function, avoiding a call overhead */
@@ -444,9 +445,9 @@
 
 void
 xaccQueryAddDateMatchTT(Query * q, 
-                        int    use_start,
+                        gboolean use_start,
                         time_t stt,
-                        int    use_end,
+                        gboolean use_end,
                         time_t ett,
                         QofQueryOp op) 
 {
@@ -626,4 +627,68 @@
   return latest;
 }
 
+void
+xaccQueryAddDescriptionMatch(Query *q, const char *m, gboolean c, gboolean r,
+                             QofQueryOp o)
+{
+    xaccQueryAddStringMatch ((q), (m), (c), (r), (o), SPLIT_TRANS,
+                             TRANS_DESCRIPTION, NULL);
+}
+
+void
+xaccQueryAddNumberMatch(Query *q, const char *m, gboolean c, gboolean r,
+                        QofQueryOp o)
+{
+    xaccQueryAddStringMatch ((q), (m), (c), (r), (o), SPLIT_TRANS,
+                             TRANS_NUM, NULL);
+}
+
+void
+xaccQueryAddActionMatch(Query *q, const char *m, gboolean c, gboolean r,
+                        QofQueryOp o)
+{
+    xaccQueryAddStringMatch ((q), (m), (c), (r), (o), SPLIT_ACTION, NULL);
+}
+
+void
+xaccQueryAddMemoMatch(Query *q, const char *m, gboolean c, gboolean r,
+                      QofQueryOp o)
+{
+    xaccQueryAddStringMatch ((q), (m), (c), (r), (o), SPLIT_MEMO, NULL);
+}
+
+void
+xaccQueryAddValueMatch(Query *q, gnc_numeric amt, QofNumericMatch sgn,
+                       QofQueryCompare how, QofQueryOp op)
+{
+    xaccQueryAddNumericMatch ((q), (amt), (sgn), (how), (op),
+                              SPLIT_VALUE, NULL);
+}
+
+void
+xaccQueryAddSharePriceMatch(Query *q, gnc_numeric amt, QofQueryCompare how,
+                            QofQueryOp op)
+{
+    xaccQueryAddNumericMatch ((q), (amt), QOF_NUMERIC_MATCH_ANY, (how), (op),
+                              SPLIT_SHARE_PRICE, NULL);
+}
+
+void
+xaccQueryAddSharesMatch(Query *q, gnc_numeric amt, QofQueryCompare how,
+                        QofQueryOp op)
+{
+    xaccQueryAddNumericMatch ((q), (amt), QOF_NUMERIC_MATCH_ANY, (how), (op),
+                              SPLIT_AMOUNT, NULL);
+}
+
+void
+xaccQueryAddBalanceMatch(Query *q, QofQueryCompare bal, QofQueryOp op)
+{
+    xaccQueryAddNumericMatch(
+        (q), gnc_numeric_zero(), QOF_NUMERIC_MATCH_ANY,
+        ((bal) ? QOF_COMPARE_EQUAL : QOF_COMPARE_NEQ), (op),
+        SPLIT_TRANS, TRANS_IMBALANCE, NULL);
+}
+
+
 /* ======================== END OF FILE ======================= */

Modified: gnucash/branches/swig-redo/src/engine/Query.h
===================================================================
--- gnucash/branches/swig-redo/src/engine/Query.h	2006-10-10 00:04:40 UTC (rev 14972)
+++ gnucash/branches/swig-redo/src/engine/Query.h	2006-10-10 00:05:22 UTC (rev 14973)
@@ -124,43 +124,37 @@
 void xaccQueryAddSingleAccountMatch(Query *, Account *, QofQueryOp);
 
 void xaccQueryAddStringMatch (Query* q, const char *matchstring,
-			      int case_sens, int use_regexp, QofQueryOp op,
+			      gboolean case_sens, gboolean use_regexp,
+                              QofQueryOp op,
 			      const char * path, ...);
+void
+xaccQueryAddDescriptionMatch(Query *q, const char *m, gboolean c, gboolean r,
+                             QofQueryOp o);
+void
+xaccQueryAddNumberMatch(Query *q, const char *m, gboolean c, gboolean r,
+                        QofQueryOp o);
+void
+xaccQueryAddActionMatch(Query *q, const char *m, gboolean c, gboolean r,
+                        QofQueryOp o);
+void
+xaccQueryAddMemoMatch(Query *q, const char *m, gboolean c, gboolean r,
+                      QofQueryOp o);
+void
+xaccQueryAddValueMatch(Query *q, gnc_numeric amt, QofNumericMatch sgn,
+                       QofQueryCompare how, QofQueryOp op);
+void
+xaccQueryAddSharePriceMatch(Query *q, gnc_numeric amt, QofQueryCompare how,
+                            QofQueryOp op);
+void
+xaccQueryAddSharesMatch(Query *q, gnc_numeric amt, QofQueryCompare how,
+                        QofQueryOp op);
+void
+xaccQueryAddBalanceMatch(Query *q, QofQueryCompare bal, QofQueryOp op);
 
-#define xaccQueryAddDescriptionMatch(q,m,c,r,o) \
-	xaccQueryAddStringMatch ((q), (m), (c), (r), (o), SPLIT_TRANS, \
-				TRANS_DESCRIPTION, NULL)
-#define xaccQueryAddNumberMatch(q,m,c,r,o) \
-	xaccQueryAddStringMatch ((q), (m), (c), (r), (o), SPLIT_TRANS, \
-				TRANS_NUM, NULL)
-#define xaccQueryAddActionMatch(q,m,c,r,o) \
-	xaccQueryAddStringMatch ((q), (m), (c), (r), (o), SPLIT_ACTION, \
-				NULL)
-#define xaccQueryAddMemoMatch(q,m,c,r,o) \
-	xaccQueryAddStringMatch ((q), (m), (c), (r), (o), SPLIT_MEMO, \
-				NULL)
-
 void xaccQueryAddNumericMatch (Query *q, gnc_numeric amount,
 			       QofNumericMatch sign, QofQueryCompare how,
 			       QofQueryOp op, const char * path, ...);
 
-#define xaccQueryAddValueMatch(q,amt,sgn,how,op) \
-	xaccQueryAddNumericMatch ((q), (amt), (sgn), (how), (op), \
-				SPLIT_VALUE, NULL)
-
-#define xaccQueryAddSharePriceMatch(q,amt,how,op) \
-	xaccQueryAddNumericMatch ((q), (amt), QOF_NUMERIC_MATCH_ANY, (how), (op), \
-				SPLIT_SHARE_PRICE, NULL)
- 
-#define xaccQueryAddSharesMatch(q,amt,how,op) \
-	xaccQueryAddNumericMatch ((q), (amt), QOF_NUMERIC_MATCH_ANY, (how), (op), \
-				SPLIT_AMOUNT, NULL)
-
-#define xaccQueryAddBalanceMatch(q,bal,op) \
-	xaccQueryAddNumericMatch ((q), gnc_numeric_zero(), QOF_NUMERIC_MATCH_ANY, \
-				((bal) ? QOF_COMPARE_EQUAL : QOF_COMPARE_NEQ), (op), \
-				SPLIT_TRANS, TRANS_IMBALANCE, NULL)
-
 /** The DateMatch queries match transactions whose posted date
  *    is in a date range.  If use_start is TRUE, then a matching
  *    posted date will be greater than the start date.   If 
@@ -170,17 +164,17 @@
  *    all transactions are matched.
  */
 
-void xaccQueryAddDateMatch(Query * q, 
-                           int use_start, int sday, int smonth, int syear, 
-                           int use_end, int eday, int emonth, int eyear,
+void xaccQueryAddDateMatch(Query * q, gboolean use_start,
+                           int sday, int smonth, int syear,
+                           gboolean use_end, int eday, int emonth, int eyear,
                            QofQueryOp op);
 void xaccQueryAddDateMatchTS(Query * q, 
-                             int use_start, Timespec sts, 
-                             int use_end, Timespec ets,
+                             gboolean use_start, Timespec sts,
+                             gboolean use_end, Timespec ets,
                              QofQueryOp op);
 void xaccQueryAddDateMatchTT(Query * q, 
-                             int use_start, time_t stt, 
-                             int use_end, time_t ett,
+                             gboolean use_start, time_t stt,
+                             gboolean use_end, time_t ett,
                              QofQueryOp op);
 void xaccQueryGetDateMatchTS (Query * q, 
 			      Timespec * sts,

Modified: gnucash/branches/swig-redo/src/engine/Transaction.h
===================================================================
--- gnucash/branches/swig-redo/src/engine/Transaction.h	2006-10-10 00:04:40 UTC (rev 14972)
+++ gnucash/branches/swig-redo/src/engine/Transaction.h	2006-10-10 00:05:22 UTC (rev 14973)
@@ -226,10 +226,6 @@
  */
 void          xaccTransSortSplits (Transaction *trans);
 
-/** Print the transaction out to the console. Used for debugging.
- */
-void          xaccTransDump (Transaction *trans, const char *tag);
-
 /** Set the  Transaction Type
  *
  * See #TXN_TYPE_NONE, #TXN_TYPE_INVOICE and #TXN_TYPE_PAYMENT */

Modified: gnucash/branches/swig-redo/src/engine/engine-helpers.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/engine-helpers.c	2006-10-10 00:04:40 UTC (rev 14972)
+++ gnucash/branches/swig-redo/src/engine/engine-helpers.c	2006-10-10 00:05:22 UTC (rev 14973)
@@ -551,7 +551,7 @@
   return scm_reverse (path_scm);
 }
 
-static GSList *
+GSList *
 gnc_query_scm2path (SCM path_scm)
 {
   GSList *path = NULL;

Modified: gnucash/branches/swig-redo/src/engine/engine-helpers.h
===================================================================
--- gnucash/branches/swig-redo/src/engine/engine-helpers.h	2006-10-10 00:04:40 UTC (rev 14972)
+++ gnucash/branches/swig-redo/src/engine/engine-helpers.h	2006-10-10 00:05:22 UTC (rev 14973)
@@ -53,6 +53,9 @@
 GUID gnc_scm2guid(SCM guid_scm);
 int  gnc_guid_p(SCM guid_scm);
 
+/* for a list of strings */
+GSList * gnc_query_scm2path (SCM path_scm);
+
 /* These two functions convert a query object into a scheme
  * representation of the query and vice-versa. They do not
  * simply convert a query pointer to a g-wrapped query pointer! */

Modified: gnucash/branches/swig-redo/src/engine/glib-helpers.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/glib-helpers.c	2006-10-10 00:04:40 UTC (rev 14972)
+++ gnucash/branches/swig-redo/src/engine/glib-helpers.c	2006-10-10 00:05:22 UTC (rev 14973)
@@ -143,9 +143,9 @@
 
 /********************************************************************
  * gnc_scm_to_glist_string
- * i.e. (glist-of (<gw:mchars> calee-owned) callee-owned)
+ * i.e. (glist-of (<gw:mchars> callee-owned) callee-owned)
  * or equivalently
- * i.e. (glist-of (<gw:gchars> calee-owned) callee-owned)
+ * i.e. (glist-of (<gw:gchars> callee-owned) callee-owned)
  ********************************************************************/
 
 GList *
@@ -164,6 +164,22 @@
   return g_list_reverse (glist);
 }
 
+GSList *
+gnc_scm_to_gslist_string(SCM list)
+{
+  GSList *gslist = NULL;
+
+  while (!SCM_NULLP (list))
+  {
+    const gchar * str = SCM_STRING_CHARS (SCM_CAR(list));
+    if (str)
+      gslist = g_slist_prepend (gslist, g_strdup (str));
+    list = SCM_CDR (list);
+  }
+
+  return g_slist_reverse (gslist);
+}
+
 /********************************************************************
  * gnc_glist_string_p
  ********************************************************************/

Modified: gnucash/branches/swig-redo/src/engine/glib-helpers.h
===================================================================
--- gnucash/branches/swig-redo/src/engine/glib-helpers.h	2006-10-10 00:04:40 UTC (rev 14972)
+++ gnucash/branches/swig-redo/src/engine/glib-helpers.h	2006-10-10 00:05:22 UTC (rev 14973)
@@ -37,6 +37,8 @@
 GList * gnc_scm_to_glist_string(SCM list);
 int     gnc_glist_string_p(SCM list);
 
+GSList * gnc_scm_to_gslist_string(SCM list);
 
 
+
 #endif

Modified: gnucash/branches/swig-redo/src/engine/gnc-budget.h
===================================================================
--- gnucash/branches/swig-redo/src/engine/gnc-budget.h	2006-10-10 00:04:40 UTC (rev 14972)
+++ gnucash/branches/swig-redo/src/engine/gnc-budget.h	2006-10-10 00:05:22 UTC (rev 14973)
@@ -108,8 +108,6 @@
 const Recurrence * gnc_budget_get_recurrence(GncBudget *budget);
 
 /** Set/Get the starting date of the Budget */
-void gnc_budget_set_start_date(GncBudget* budget, Timespec date);
-Timespec gnc_budget_get_start_date(GncBudget* budget);
 Timespec gnc_budget_get_period_start_date(GncBudget* budget, guint period_num);
 
 /* Period indices are zero-based. */
@@ -124,9 +122,6 @@
 /** Get the book that this budget is associated with. */
 QofBook* gnc_budget_get_book(GncBudget* budget);
 
-/* Caller owns the list of all budgets in the book. */
-GList* gnc_book_get_budgets(QofBook* book);
-
 /* Returns some budget in the book, or NULL. */
 GncBudget* gnc_budget_get_default(QofBook *book);
 

Modified: gnucash/branches/swig-redo/src/engine/gnc-commodity.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/gnc-commodity.c	2006-10-10 00:04:40 UTC (rev 14972)
+++ gnucash/branches/swig-redo/src/engine/gnc-commodity.c	2006-10-10 00:05:22 UTC (rev 14973)
@@ -1415,7 +1415,7 @@
  * list commodities in a give namespace 
  ********************************************************************/
 
-GList * 
+CommodityList *
 gnc_commodity_table_get_commodities(const gnc_commodity_table * table,
                                     const char * namespace) 
 {
@@ -1460,7 +1460,7 @@
   return TRUE;
 }
 
-GList * 
+CommodityList *
 gnc_commodity_table_get_quotable_commodities(const gnc_commodity_table * table)
 {
   gnc_commodity_namespace * ns = NULL;

Modified: gnucash/branches/swig-redo/src/engine/gnc-commodity.h
===================================================================
--- gnucash/branches/swig-redo/src/engine/gnc-commodity.h	2006-10-10 00:04:40 UTC (rev 14972)
+++ gnucash/branches/swig-redo/src/engine/gnc-commodity.h	2006-10-10 00:05:22 UTC (rev 14973)
@@ -78,6 +78,7 @@
 #define GNC_COMMODITY_NS_AMEX   "AMEX"
 #define GNC_COMMODITY_NS_ASX    "ASX"
 
+typedef GList CommodityList;
 
 /** @name Commodity Quote Source functions 
  @{
@@ -807,8 +808,8 @@
  *  argument was supplied, or the namespace could not be found.
  *
  *  @note It is the callers responsibility to free the list. */
-GList * gnc_commodity_table_get_commodities(const gnc_commodity_table * table,
-					    const char * namespace);
+CommodityList * gnc_commodity_table_get_commodities(
+    const gnc_commodity_table * table, const char * namespace);
 
 /** This function returns a list of commodities for which price quotes
  *  should be retrieved.  It will scan the entire commodity table (or
@@ -827,7 +828,7 @@
  *  quote retrieval.
  *
  *  @note It is the callers responsibility to free the list. */
-GList * gnc_commodity_table_get_quotable_commodities(
+CommodityList * gnc_commodity_table_get_quotable_commodities(
     const gnc_commodity_table * table);
 
 /** Call a function once for each commodity in the commodity table.

Modified: gnucash/branches/swig-redo/src/engine/gnc-pricedb.c
===================================================================
--- gnucash/branches/swig-redo/src/engine/gnc-pricedb.c	2006-10-10 00:04:40 UTC (rev 14972)
+++ gnucash/branches/swig-redo/src/engine/gnc-pricedb.c	2006-10-10 00:05:22 UTC (rev 14973)
@@ -458,7 +458,7 @@
 }
 
 gboolean
-gnc_price_list_insert(GList **prices, GNCPrice *p, gboolean check_dupl)
+gnc_price_list_insert(PriceList **prices, GNCPrice *p, gboolean check_dupl)
 {
   GList *result_list;
   PriceListIsDuplStruct* pStruct;
@@ -487,7 +487,7 @@
 }
 
 gboolean
-gnc_price_list_remove(GList **prices, GNCPrice *p)
+gnc_price_list_remove(PriceList **prices, GNCPrice *p)
 {
   GList *result_list;
   GList *found_element;
@@ -512,14 +512,14 @@
 }
 
 void
-gnc_price_list_destroy(GList *prices)
+gnc_price_list_destroy(PriceList *prices)
 {
   g_list_foreach(prices, price_list_destroy_helper, NULL);
   g_list_free(prices);
 }
 
 gboolean
-gnc_price_list_equal(GList *prices1, GList *prices2)
+gnc_price_list_equal(PriceList *prices1, PriceList *prices2)
 {
   GList *n1, *n2;
 
@@ -1117,7 +1117,7 @@
   gnc_price_list_insert(return_list, price_list->data, FALSE);
 }
 
-GList *
+PriceList *
 gnc_pricedb_lookup_latest_any_currency(GNCPriceDB *db,
                                        const gnc_commodity *commodity)
 {
@@ -1212,7 +1212,7 @@
 }
 
 
-GList *
+PriceList *
 gnc_pricedb_get_prices(GNCPriceDB *db,
                        const gnc_commodity *commodity,
                        const gnc_commodity *currency)
@@ -1258,7 +1258,7 @@
 }
 
 
-GList *
+PriceList *
 gnc_pricedb_lookup_day(GNCPriceDB *db,
                        const gnc_commodity *c,
                        const gnc_commodity *currency,
@@ -1331,7 +1331,7 @@
   }
 }
 
-GList *
+PriceList *
 gnc_pricedb_lookup_day_any_currency(GNCPriceDB *db,
 				    const gnc_commodity *c,
                                     Timespec t)
@@ -1376,7 +1376,7 @@
 }
 
 
-GList *
+PriceList *
 gnc_pricedb_lookup_at_time(GNCPriceDB *db,
                            const gnc_commodity *c,
                            const gnc_commodity *currency,
@@ -1446,7 +1446,7 @@
   }
 }
 
-GList *
+PriceList *
 gnc_pricedb_lookup_at_time_any_currency(GNCPriceDB *db,
 					const gnc_commodity *c,
                                         Timespec t)
@@ -1706,7 +1706,7 @@
 }
 
 
-GList *
+PriceList *
 gnc_pricedb_lookup_nearest_in_time_any_currency(GNCPriceDB *db,
                                                 const gnc_commodity *c,
                                                 Timespec t)
@@ -1749,7 +1749,7 @@
 }
 
 
-GList *
+PriceList *
 gnc_pricedb_lookup_latest_before_any_currency(GNCPriceDB *db,
 					      gnc_commodity *c,
 					      Timespec t)

Modified: gnucash/branches/swig-redo/src/engine/gnc-pricedb.h
===================================================================
--- gnucash/branches/swig-redo/src/engine/gnc-pricedb.h	2006-10-10 00:04:40 UTC (rev 14972)
+++ gnucash/branches/swig-redo/src/engine/gnc-pricedb.h	2006-10-10 00:05:22 UTC (rev 14973)
@@ -126,6 +126,7 @@
 
 /** */
 typedef struct gnc_price_lookup_s GNCPriceLookup;
+typedef GList PriceList;
 
 /* ------------------ */
 /** @name Constructors 
@@ -216,17 +217,18 @@
 
 /** gnc_price_list_insert - insert a price into the given list, calling
      gnc_price_ref on it during the process. */
-gboolean gnc_price_list_insert(GList **prices, GNCPrice *p, gboolean check_dupl);
+gboolean gnc_price_list_insert(PriceList **prices, GNCPrice *p,
+                               gboolean check_dupl);
 
 /** gnc_price_list_remove - remove the price, p, from the given list,
      calling gnc_price_unref on it during the process. */
-gboolean gnc_price_list_remove(GList **prices, GNCPrice *p);
+gboolean gnc_price_list_remove(PriceList **prices, GNCPrice *p);
 
 /** gnc_price_list_destroy - destroy the given price list, calling
      gnc_price_unref on all the prices included in the list. */
-void     gnc_price_list_destroy(GList *prices);
+void     gnc_price_list_destroy(PriceList *prices);
 
-gboolean gnc_price_list_equal(GList *prices1, GList *prices2);
+gboolean gnc_price_list_equal(PriceList *prices1, PriceList *prices2);
 /**  @} */
 /**  @}  end of the Price doxygen group */
 
@@ -288,8 +290,8 @@
 /** gnc_pricedb_lookup_latest_any_currency - find the most recent prices
      for the given commodity in any available currency. Prices will be
      returned as a GNCPrice list (see above). */
-GList      *gnc_pricedb_lookup_latest_any_currency(GNCPriceDB *db,
-                                                   const gnc_commodity *commodity);
+PriceList * gnc_pricedb_lookup_latest_any_currency(GNCPriceDB *db,
+                                                 const gnc_commodity *commodity);
 
 /** gnc_pricedb_has_prices - return an indication of whether or not
     there are any prices for a given commodity in the given currency.
@@ -301,39 +303,39 @@
 /** gnc_pricedb_get_prices - return all the prices for a given
      commodity in the given currency.  Returns NULL on failure.  The
      result is a GNCPrice list (see above).  */
-GList      * gnc_pricedb_get_prices(GNCPriceDB *db,
-                                    const gnc_commodity *commodity,
-                                    const gnc_commodity *currency);
+PriceList * gnc_pricedb_get_prices(GNCPriceDB *db,
+                                 const gnc_commodity *commodity,
+                                 const gnc_commodity *currency);
 
 /** gnc_pricedb_lookup_at_time - return all prices that match the given
      commodity, currency, and timespec.  Prices will be returned as a
      GNCPrice list (see above). */
-GList      * gnc_pricedb_lookup_at_time(GNCPriceDB *db,
-                                        const gnc_commodity *commodity,
-                                        const gnc_commodity *currency,
-                                        Timespec t);
+PriceList * gnc_pricedb_lookup_at_time(GNCPriceDB *db,
+                                     const gnc_commodity *commodity,
+                                     const gnc_commodity *currency,
+                                     Timespec t);
 
 /** gnc_pricedb_lookup_at_time_any_currency - return all prices that match the
      given commodity and timespec in any available currency.  Prices will be
      returned as a GNCPrice list (see above). */
-GList      * gnc_pricedb_lookup_at_time_any_currency(GNCPriceDB *db,
- 		                                     const gnc_commodity *c,
-		                                     Timespec t);
+PriceList * gnc_pricedb_lookup_at_time_any_currency(GNCPriceDB *db,
+                                                  const gnc_commodity *c,
+                                                  Timespec t);
 
 /** gnc_pricedb_lookup_day - return all prices that match the given
      commodity, currency, and timespec.  Prices will be returned as a
      GNCPrice list (see above). */
-GList      * gnc_pricedb_lookup_day(GNCPriceDB *db,
-				    const gnc_commodity *commodity,
-				    const gnc_commodity *currency,
-				    Timespec t);
+PriceList * gnc_pricedb_lookup_day(GNCPriceDB *db,
+                                 const gnc_commodity *commodity,
+                                 const gnc_commodity *currency,
+                                 Timespec t);
 
 /** gnc_pricedb_lookup_day_any_currency - return all prices that match the
      given commodity and timespec in any available currency.  Prices will be
      returned as a GNCPrice list (see above). */
-GList      * gnc_pricedb_lookup_day_any_currency(GNCPriceDB *db,
- 		                                 const gnc_commodity *c,
-		                                 Timespec t);
+PriceList * gnc_pricedb_lookup_day_any_currency(GNCPriceDB *db,
+                                              const gnc_commodity *c,
+                                              Timespec t);
 
 /** gnc_pricedb_lookup_nearest_in_time - return the price for the given
      commodity in the given currency nearest to the given time t. */
@@ -345,9 +347,9 @@
 /** gnc_pricedb_lookup_nearest_in_time_any_currency - return all prices that
      match the given commodity and timespec in any available currency. Prices
      will be returned as a GNCPrice list (see above). */
-GList      * gnc_pricedb_lookup_nearest_in_time_any_currency(GNCPriceDB *db,
- 		                                             const gnc_commodity *c,
-		                                             Timespec t);
+PriceList * gnc_pricedb_lookup_nearest_in_time_any_currency(GNCPriceDB *db,
+                                                          const gnc_commodity *c,
+                                                          Timespec t);
 /** gnc_pricedb_lookup_latest_before - return the latest price for the given commodity
     in the given currency up to and including time t. */
 GNCPrice * gnc_pricedb_lookup_latest_before(GNCPriceDB *db,
@@ -358,9 +360,9 @@
 /** gnc_pricedb_lookup_latest_before_any_currency - return recent prices that
      match the given commodity up to and including time t in any available currency. Prices
      will be returned as a GNCPrice list (see above). */
-GList      * gnc_pricedb_lookup_latest_before_any_currency(GNCPriceDB *db,
- 		                                             gnc_commodity *c,
-		                                             Timespec t);
+PriceList * gnc_pricedb_lookup_latest_before_any_currency(GNCPriceDB *db,
+                                                        gnc_commodity *c,
+                                                        Timespec t);
 
 
 /** gnc_pricedb_convert_balance_latest_price - Convert a balance

Modified: gnucash/branches/swig-redo/src/gnome-utils/gnc-file.c
===================================================================
--- gnucash/branches/swig-redo/src/gnome-utils/gnc-file.c	2006-10-10 00:04:40 UTC (rev 14972)
+++ gnucash/branches/swig-redo/src/gnome-utils/gnc-file.c	2006-10-10 00:05:22 UTC (rev 14973)
@@ -26,7 +26,6 @@
 #include <errno.h>
 #include <libguile.h>
 #include <string.h>
-#include <g-wrap-wct.h>
 
 #include "dialog-utils.h"
 #include "druid-gnc-xml-import.h"

Modified: gnucash/branches/swig-redo/src/report/report-system/report-utilities.scm
===================================================================
--- gnucash/branches/swig-redo/src/report/report-system/report-utilities.scm	2006-10-10 00:04:40 UTC (rev 14972)
+++ gnucash/branches/swig-redo/src/report/report-system/report-utilities.scm	2006-10-10 00:05:22 UTC (rev 14973)
@@ -723,8 +723,8 @@
 		    (let ((lst (assoc-ref alist key)))
 		      (if lst (car lst) lst))))
 	 (matchstr (get-val type 'str))
-	 (case-sens (if (get-val type 'cased) 1 0))
-	 (regexp (if (get-val type 'regexp) 1 0))
+	 (case-sens (if (get-val type 'cased) #t #f))
+	 (regexp (if (get-val type 'regexp) #t #f))
 	 (total (gnc:make-commodity-collector))
 	 )
     (gnc:query-set-book query (gnc-get-current-book))
@@ -765,8 +765,8 @@
 		    (let ((lst (assoc-ref alist key)))
 		      (if lst (car lst) lst))))
 	 (matchstr (get-val type 'str))
-	 (case-sens (if (get-val type 'cased) 1 0))
-	 (regexp (if (get-val type 'regexp) 1 0))
+	 (case-sens (if (get-val type 'cased) #t #f))
+	 (regexp (if (get-val type 'regexp) #t #f))
 	 (pos? (if (get-val type 'positive) #t #f))
          (total (gnc:make-commodity-collector))
          )



More information about the gnucash-changes mailing list