r16764 - gnucash/trunk - Make some parameters const

Phil Longstaff plongstaff at cvs.gnucash.org
Sat Dec 29 14:40:29 EST 2007


Author: plongstaff
Date: 2007-12-29 14:40:28 -0500 (Sat, 29 Dec 2007)
New Revision: 16764
Trac: http://svn.gnucash.org/trac/changeset/16764

Modified:
   gnucash/trunk/lib/libqof/qof/gnc-date.c
   gnucash/trunk/lib/libqof/qof/gnc-date.h
   gnucash/trunk/lib/libqof/qof/kvp_frame.c
   gnucash/trunk/lib/libqof/qof/kvp_frame.h
   gnucash/trunk/lib/libqof/qof/qofbackend.c
   gnucash/trunk/lib/libqof/qof/qofbackend.h
   gnucash/trunk/lib/libqof/qof/qofbook.c
   gnucash/trunk/lib/libqof/qof/qofbook.h
   gnucash/trunk/lib/libqof/qof/qofbookmerge.c
   gnucash/trunk/lib/libqof/qof/qofid.c
   gnucash/trunk/lib/libqof/qof/qofid.h
   gnucash/trunk/lib/libqof/qof/qofinstance.c
   gnucash/trunk/lib/libqof/qof/qoflog.c
   gnucash/trunk/lib/libqof/qof/qoflog.h
   gnucash/trunk/lib/libqof/qof/qofquery-p.h
   gnucash/trunk/lib/libqof/qof/qofquery.c
   gnucash/trunk/lib/libqof/qof/qofquery.h
   gnucash/trunk/lib/libqof/qof/qofquerycore-p.h
   gnucash/trunk/lib/libqof/qof/qofquerycore.c
   gnucash/trunk/lib/libqof/qof/qofquerycore.h
   gnucash/trunk/lib/libqof/qof/qofsession-p.h
   gnucash/trunk/lib/libqof/qof/qofsession.c
   gnucash/trunk/lib/libqof/qof/qofsession.h
   gnucash/trunk/src/engine/engine-helpers.c
   gnucash/trunk/src/engine/engine-helpers.h
Log:
Make some parameters const


Modified: gnucash/trunk/lib/libqof/qof/gnc-date.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/gnc-date.c	2007-12-29 17:44:00 UTC (rev 16763)
+++ gnucash/trunk/lib/libqof/qof/gnc-date.c	2007-12-29 19:40:28 UTC (rev 16764)
@@ -279,7 +279,7 @@
 param  tm: the time value in question
 return the last day of the month, integer.
 */
-int date_get_last_mday(struct tm *tm)
+int date_get_last_mday(const struct tm *tm)
 {
   return gnc_date_my_last_mday (tm->tm_mon+1, tm->tm_year+1900);
 }
@@ -291,7 +291,7 @@
 param  tm: the time value in question
 return TRUE if tm_mday matches the last day of the month, else FALSE.
 */
-gboolean date_is_last_mday(struct tm *tm)
+gboolean date_is_last_mday(const struct tm *tm)
 {
   return(tm->tm_mday == date_get_last_mday(tm));
 }
@@ -472,7 +472,7 @@
 }
 
 size_t
-qof_print_gdate( char *buf, size_t len, GDate *gd )
+qof_print_gdate( char *buf, size_t len, const GDate *gd )
 {
   return qof_print_date_dmy_buff( buf, len,
              g_date_get_day(gd),
@@ -1292,7 +1292,7 @@
 \********************************************************************/
 
 long int
-gnc_timezone (struct tm *tm)
+gnc_timezone (const struct tm *tm)
 {
   g_return_val_if_fail (tm != NULL, 0);
 

Modified: gnucash/trunk/lib/libqof/qof/gnc-date.h
===================================================================
--- gnucash/trunk/lib/libqof/qof/gnc-date.h	2007-12-29 17:44:00 UTC (rev 16763)
+++ gnucash/trunk/lib/libqof/qof/gnc-date.h	2007-12-29 19:40:28 UTC (rev 16764)
@@ -267,7 +267,7 @@
  * daylight savings time! Timezone stuff under unix is not
  * standardized and is a big mess.
  */
-glong gnc_timezone (struct tm *tm);
+glong gnc_timezone (const struct tm *tm);
 // @}
 
 /* ------------------------------------------------------------------------ */
@@ -380,7 +380,7 @@
 size_t qof_print_date_buff (char * buff, size_t buflen, time_t secs);
 
 /** Convenience; calls through to qof_print_date_dmy_buff(). **/
-size_t qof_print_gdate( char *buf, size_t bufflen, GDate *gd );
+size_t qof_print_gdate( char *buf, size_t bufflen, const GDate *gd );
 
 /** Convenience; calls through to qof_print_date_dmy_buff(). 
  *  Return: string, which should be freed when no longer needed.
@@ -499,10 +499,10 @@
 time_t gnc_timet_get_day_end(time_t time_val);
 
 /** Get the numerical last date of the month. (28, 29, 30, 31) */
-int date_get_last_mday(struct tm *tm);
+int date_get_last_mday(const struct tm *tm);
 
 /** Is the mday field the last day of the specified month.*/
-gboolean date_is_last_mday(struct tm *tm);
+gboolean date_is_last_mday(const struct tm *tm);
 
 /** \deprecated Use date_get_last_mday() */
 int gnc_date_my_last_mday (int month, int year);

Modified: gnucash/trunk/lib/libqof/qof/kvp_frame.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/kvp_frame.c	2007-12-29 17:44:00 UTC (rev 16763)
+++ gnucash/trunk/lib/libqof/qof/kvp_frame.c	2007-12-29 19:40:28 UTC (rev 16764)
@@ -129,7 +129,7 @@
 }
 
 gboolean
-kvp_frame_is_empty(KvpFrame * frame) 
+kvp_frame_is_empty(const KvpFrame * frame) 
 {
   if (!frame) return TRUE;
   if (!frame->hash) return TRUE;
@@ -921,7 +921,7 @@
 /* ============================================================ */
 
 KvpFrame *
-kvp_frame_get_frame_gslist (KvpFrame *frame, GSList *key_path) 
+kvp_frame_get_frame_gslist (KvpFrame *frame, const GSList *key_path) 
 {
   if (!frame) return frame;
 
@@ -1010,7 +1010,7 @@
 
 KvpValue *
 kvp_frame_get_slot_path_gslist (KvpFrame *frame,
-                                GSList *key_path) 
+                                const GSList *key_path) 
 {
   if (!frame || !key_path) return NULL;
 

Modified: gnucash/trunk/lib/libqof/qof/kvp_frame.h
===================================================================
--- gnucash/trunk/lib/libqof/qof/kvp_frame.h	2007-12-29 17:44:00 UTC (rev 16763)
+++ gnucash/trunk/lib/libqof/qof/kvp_frame.h	2007-12-29 19:40:28 UTC (rev 16764)
@@ -126,7 +126,7 @@
 KvpFrame   * kvp_frame_copy(const KvpFrame * frame);
 
 /** Return TRUE if the KvpFrame is empty */
-gboolean     kvp_frame_is_empty(KvpFrame * frame);
+gboolean     kvp_frame_is_empty(const KvpFrame * frame);
 
 /** @} */
 
@@ -395,7 +395,7 @@
  *  Note that this is *VERY DIFFERENT FROM* kvp_frame_get_frame()
  */
 KvpFrame    * kvp_frame_get_frame_gslist (KvpFrame *frame,
-                                           GSList *key_path);
+                                           const GSList *key_path);
 
 /** This routine returns the last frame of the path.
  *  If the frame path doesn't exist, it is created.  
@@ -502,7 +502,7 @@
  * path, or NULL if any portion of the path doesn't exist.
  */
 KvpValue   * kvp_frame_get_slot_path_gslist (KvpFrame *frame,
-                                              GSList *key_path);
+                                              const GSList *key_path);
 
 /**
  * Similar returns as strcmp.

Modified: gnucash/trunk/lib/libqof/qof/qofbackend.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofbackend.c	2007-12-29 17:44:00 UTC (rev 16763)
+++ gnucash/trunk/lib/libqof/qof/qofbackend.c	2007-12-29 19:40:28 UTC (rev 16764)
@@ -153,7 +153,7 @@
 }
 
 gboolean
-qof_backend_begin_exists(QofBackend *be)
+qof_backend_begin_exists(const QofBackend *be)
 {
 	if(be->begin) { return TRUE; }
 	else { return FALSE; }
@@ -179,7 +179,7 @@
 	be->config_count = 0;
 }
 
-void qof_backend_prepare_option(QofBackend *be, QofBackendOption *option)
+void qof_backend_prepare_option(QofBackend *be, const QofBackendOption *option)
 {
 	KvpValue *value;
 	gchar *temp;
@@ -376,7 +376,7 @@
 }
 
 gboolean
-qof_backend_commit_exists(QofBackend *be)
+qof_backend_commit_exists(const QofBackend *be)
 {
 	if(!be) { return FALSE; }
 	if(be->commit) { return TRUE; }

Modified: gnucash/trunk/lib/libqof/qof/qofbackend.h
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofbackend.h	2007-12-29 17:44:00 UTC (rev 16763)
+++ gnucash/trunk/lib/libqof/qof/qofbackend.h	2007-12-29 19:40:28 UTC (rev 16764)
@@ -165,11 +165,11 @@
 
 void qof_backend_run_begin(QofBackend *be, QofInstance *inst);
 
-gboolean qof_backend_begin_exists(QofBackend *be);
+gboolean qof_backend_begin_exists(const QofBackend *be);
 
 void qof_backend_run_commit(QofBackend *be, QofInstance *inst);
 
-gboolean qof_backend_commit_exists(QofBackend *be);
+gboolean qof_backend_commit_exists(const QofBackend *be);
 //@}
 
 /** The qof_backend_set_error() routine pushes an error code onto the error
@@ -214,7 +214,7 @@
 void qof_backend_prepare_frame(QofBackend *be);
 
 /** Add an option to the backend_configuration. Repeat for more. */
-void qof_backend_prepare_option(QofBackend *be, QofBackendOption *option);
+void qof_backend_prepare_option(QofBackend *be, const QofBackendOption *option);
 
 /** Complete the backend_configuration and return the frame. */
 KvpFrame* qof_backend_complete_frame(QofBackend *be);

Modified: gnucash/trunk/lib/libqof/qof/qofbook.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofbook.c	2007-12-29 17:44:00 UTC (rev 16763)
+++ gnucash/trunk/lib/libqof/qof/qofbook.c	2007-12-29 19:40:28 UTC (rev 16764)
@@ -366,7 +366,7 @@
 }
 
 gint64
-qof_book_get_counter (QofBook *book, const char *counter_name)
+qof_book_get_counter (const QofBook *book, const char *counter_name)
 {
   QofBackend *be;
   KvpFrame *kvp;

Modified: gnucash/trunk/lib/libqof/qof/qofbook.h
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofbook.h	2007-12-29 17:44:00 UTC (rev 16763)
+++ gnucash/trunk/lib/libqof/qof/qofbook.h	2007-12-29 19:40:28 UTC (rev 16764)
@@ -264,7 +264,7 @@
 /** This will 'get and increment' the named counter for this book.
  * The return value is -1 on error or the incremented counter.
  */
-gint64 qof_book_get_counter (QofBook *book, const char *counter_name);
+gint64 qof_book_get_counter (const QofBook *book, const char *counter_name);
 
 /** deprecated */
 #define qof_book_get_guid(X) qof_entity_get_guid (QOF_INSTANCE(X))

Modified: gnucash/trunk/lib/libqof/qof/qofbookmerge.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofbookmerge.c	2007-12-29 17:44:00 UTC (rev 16763)
+++ gnucash/trunk/lib/libqof/qof/qofbookmerge.c	2007-12-29 19:40:28 UTC (rev 16764)
@@ -627,7 +627,7 @@
  * Returns the corresponding target entity to the given importEnt
  */
 static QofInstance*
-qof_book_merge_map_entity(QofBookMergeData *mergeData, QofInstance* importEnt)
+qof_book_merge_map_entity(const QofBookMergeData *mergeData, const QofInstance* importEnt)
 {
     QofBookMergeRule *currentRule;
     GList *node;

Modified: gnucash/trunk/lib/libqof/qof/qofid.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofid.c	2007-12-29 17:44:00 UTC (rev 16763)
+++ gnucash/trunk/lib/libqof/qof/qofid.c	2007-12-29 19:40:28 UTC (rev 16764)
@@ -260,11 +260,11 @@
 }
 
 QofCollection *
-qof_collection_from_glist (QofIdType type, GList *glist)
+qof_collection_from_glist (QofIdType type, const GList *glist)
 {
 	QofCollection *coll;
 	QofInstance *ent;
-	GList *list;
+	const GList *list;
 
 	coll = qof_collection_new(type);
 	for(list = glist; list != NULL; list = list->next)

Modified: gnucash/trunk/lib/libqof/qof/qofid.h
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofid.h	2007-12-29 17:44:00 UTC (rev 16763)
+++ gnucash/trunk/lib/libqof/qof/qofid.h	2007-12-29 19:40:28 UTC (rev 16764)
@@ -252,7 +252,7 @@
 	on success.
 */
 QofCollection*
-qof_collection_from_glist (QofIdType type, GList *glist);
+qof_collection_from_glist (QofIdType type, const GList *glist);
 
 /** @} */
 /** @} */

Modified: gnucash/trunk/lib/libqof/qof/qofinstance.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofinstance.c	2007-12-29 17:44:00 UTC (rev 16763)
+++ gnucash/trunk/lib/libqof/qof/qofinstance.c	2007-12-29 19:40:28 UTC (rev 16764)
@@ -633,7 +633,7 @@
 }
 
 gboolean
-qof_instance_check_edit(const  QofInstance *inst)
+qof_instance_check_edit(const QofInstance *inst)
 {
     g_return_val_if_fail(QOF_IS_INSTANCE(inst), FALSE);
     return (GET_PRIVATE(inst)->editlevel > 0);

Modified: gnucash/trunk/lib/libqof/qof/qoflog.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/qoflog.c	2007-12-29 17:44:00 UTC (rev 16763)
+++ gnucash/trunk/lib/libqof/qof/qoflog.c	2007-12-29 19:40:28 UTC (rev 16764)
@@ -382,7 +382,7 @@
 }
 
 QofLogLevel
-qof_log_level_from_string(gchar *str)
+qof_log_level_from_string(const gchar *str)
 {
      if (g_ascii_strncasecmp("error", str, 5) == 0) return QOF_LOG_FATAL;
      if (g_ascii_strncasecmp("crit", str, 4) == 0) return QOF_LOG_ERROR;

Modified: gnucash/trunk/lib/libqof/qof/qoflog.h
===================================================================
--- gnucash/trunk/lib/libqof/qof/qoflog.h	2007-12-29 17:44:00 UTC (rev 16763)
+++ gnucash/trunk/lib/libqof/qof/qoflog.h	2007-12-29 19:40:28 UTC (rev 16764)
@@ -101,7 +101,7 @@
 DEFINE_ENUM (QofLogLevel, LOG_LEVEL_LIST)
 
 gchar* qof_log_level_to_string(QofLogLevel lvl);
-QofLogLevel qof_log_level_from_string(gchar *str);
+QofLogLevel qof_log_level_from_string(const gchar *str);
 
 /** Indents one level; see ENTER macro. **/
 void qof_log_indent(void);

Modified: gnucash/trunk/lib/libqof/qof/qofquery-p.h
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofquery-p.h	2007-12-29 17:44:00 UTC (rev 16763)
+++ gnucash/trunk/lib/libqof/qof/qofquery-p.h	2007-12-29 19:40:28 UTC (rev 16764)
@@ -30,7 +30,7 @@
 typedef struct _QofQuerySort QofQuerySort;
 
 /* Functions to get Query information */
-int qof_query_get_max_results (QofQuery *q);
+int qof_query_get_max_results (const QofQuery *q);
 
 
 /* Functions to get and look at QueryTerms */
@@ -43,11 +43,11 @@
  * Note that you should NOT modify this list in any way.  It belongs
  * to the query.
  */
-GList * qof_query_get_terms (QofQuery *q);
+GList * qof_query_get_terms (const QofQuery *q);
 
-GSList * qof_query_term_get_param_path (QofQueryTerm *queryterm);
-QofQueryPredData *qof_query_term_get_pred_data (QofQueryTerm *queryterm);
-gboolean qof_query_term_is_inverted (QofQueryTerm *queryterm);
+GSList * qof_query_term_get_param_path (const QofQueryTerm *queryterm);
+QofQueryPredData *qof_query_term_get_pred_data (const QofQueryTerm *queryterm);
+gboolean qof_query_term_is_inverted (const QofQueryTerm *queryterm);
 
 
 /* Functions to get and look at QuerySorts */
@@ -58,8 +58,8 @@
 void qof_query_get_sorts (QofQuery *q, QofQuerySort **primary,
                        QofQuerySort **secondary, QofQuerySort **tertiary);
 
-GSList * qof_query_sort_get_param_path (QofQuerySort *querysort);
-gint qof_query_sort_get_sort_options (QofQuerySort *querysort);
-gboolean qof_query_sort_get_increasing (QofQuerySort *querysort);
+GSList * qof_query_sort_get_param_path (const QofQuerySort *querysort);
+gint qof_query_sort_get_sort_options (const QofQuerySort *querysort);
+gboolean qof_query_sort_get_increasing (const QofQuerySort *querysort);
 
 #endif /* QOF_QUERY_P_H */

Modified: gnucash/trunk/lib/libqof/qof/qofquery.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofquery.c	2007-12-29 17:44:00 UTC (rev 16763)
+++ gnucash/trunk/lib/libqof/qof/qofquery.c	2007-12-29 19:40:28 UTC (rev 16764)
@@ -180,7 +180,7 @@
   g_free (qt);
 }
 
-static QofQueryTerm * copy_query_term (QofQueryTerm *qt)
+static QofQueryTerm * copy_query_term (const QofQueryTerm *qt)
 {
   QofQueryTerm *new_qt;
   if (!qt) return NULL;
@@ -193,10 +193,10 @@
   return new_qt;
 }
 
-static GList * copy_and_terms (GList *and_terms)
+static GList * copy_and_terms (const GList *and_terms)
 {
   GList *and = NULL;
-  GList *cur_and;
+  const GList *cur_and;
 
   for(cur_and = and_terms; cur_and; cur_and = cur_and->next)
   {
@@ -207,10 +207,10 @@
 }
 
 static GList * 
-copy_or_terms(GList * or_terms) 
+copy_or_terms(const GList * or_terms) 
 {
   GList * or = NULL;
-  GList * cur_or;
+  const GList * cur_or;
 
   for(cur_or = or_terms; cur_or; cur_or = cur_or->next)
   {
@@ -270,8 +270,8 @@
   q->results = NULL;
 }
 
-static int cmp_func (QofQuerySort *sort, QofSortFunc default_sort,
-                     gconstpointer a, gconstpointer b)
+static int cmp_func (const QofQuerySort *sort, QofSortFunc default_sort,
+                     const gconstpointer a, const gconstpointer b)
 {
   QofParam *param = NULL;
   GSList *node;
@@ -319,10 +319,10 @@
   return sort->obj_cmp (conva, convb);
 }
 
-static int sort_func (gconstpointer a, gconstpointer b, gpointer q)
+static int sort_func (const gconstpointer a, const gconstpointer b, const gpointer q)
 {
   int retval;
-  QofQuery *sortQuery = q;
+  const QofQuery *sortQuery = q;
 
   g_return_val_if_fail (sortQuery, 0);
 
@@ -355,11 +355,11 @@
  */
 
 static int 
-check_object (QofQuery *q, gpointer object)
+check_object (const QofQuery *q, gpointer object)
 {
-  GList     * and_ptr;
-  GList     * or_ptr;
-  QofQueryTerm * qt;
+  const GList     * and_ptr;
+  const GList     * or_ptr;
+  const QofQueryTerm * qt;
   int       and_terms_ok=1;
   
   for(or_ptr = q->terms; or_ptr; or_ptr = or_ptr->next) 
@@ -370,7 +370,7 @@
       qt = (QofQueryTerm *)(and_ptr->data);
       if (qt->param_fcns && qt->pred_fcn) 
       {
-        GSList *node;
+        const GSList *node;
         QofParam *param = NULL;
         gpointer conv_obj = object;
 
@@ -556,7 +556,7 @@
   return;
 }
 
-static int param_list_cmp (GSList *l1, GSList *l2)
+static int param_list_cmp (const GSList *l1, const GSList *l2)
 {
   while (1) {
     int ret;
@@ -1311,39 +1311,39 @@
   qof_query_core_shutdown ();
 }
 
-int qof_query_get_max_results (QofQuery *q)
+int qof_query_get_max_results (const QofQuery *q)
 {
   if (!q) return 0;
   return q->max_results;
 }
 
-QofIdType qof_query_get_search_for (QofQuery *q)
+QofIdType qof_query_get_search_for (const QofQuery *q)
 {
   if (!q) return NULL;
   return q->search_for;
 }
 
-GList * qof_query_get_terms (QofQuery *q)
+GList * qof_query_get_terms (const QofQuery *q)
 {
   if (!q) return NULL;
   return q->terms;
 }
 
-GSList * qof_query_term_get_param_path (QofQueryTerm *qt)
+GSList * qof_query_term_get_param_path (const QofQueryTerm *qt)
 {
   if (!qt)
     return NULL;
   return qt->param_list;
 }
 
-QofQueryPredData *qof_query_term_get_pred_data (QofQueryTerm *qt)
+QofQueryPredData *qof_query_term_get_pred_data (const QofQueryTerm *qt)
 {
   if (!qt)
     return NULL;
   return qt->pdata;
 }
 
-gboolean qof_query_term_is_inverted (QofQueryTerm *qt)
+gboolean qof_query_term_is_inverted (const QofQueryTerm *qt)
 {
   if (!qt)
     return FALSE;
@@ -1363,21 +1363,21 @@
     *tertiary = &(q->tertiary_sort);
 }
 
-GSList * qof_query_sort_get_param_path (QofQuerySort *qs)
+GSList * qof_query_sort_get_param_path (const QofQuerySort *qs)
 {
   if (!qs)
     return NULL;
   return qs->param_list;
 }
 
-gint qof_query_sort_get_sort_options (QofQuerySort *qs)
+gint qof_query_sort_get_sort_options (const QofQuerySort *qs)
 {
   if (!qs)
     return 0;
   return qs->options;
 }
 
-gboolean qof_query_sort_get_increasing (QofQuerySort *qs)
+gboolean qof_query_sort_get_increasing (const QofQuerySort *qs)
 {
   if (!qs)
     return FALSE;
@@ -1385,7 +1385,7 @@
 }
 
 static gboolean 
-qof_query_term_equal (QofQueryTerm *qt1, QofQueryTerm *qt2)
+qof_query_term_equal (const QofQueryTerm *qt1, const QofQueryTerm *qt2)
 {
   if (qt1 == qt2) return TRUE;
   if (!qt1 || !qt2) return FALSE;
@@ -1396,7 +1396,7 @@
 }
 
 static gboolean 
-qof_query_sort_equal (QofQuerySort* qs1, QofQuerySort* qs2)
+qof_query_sort_equal (const QofQuerySort* qs1, const QofQuerySort* qs2)
 {
   if (qs1 == qs2) return TRUE;
   if (!qs1 || !qs2) return FALSE;
@@ -1409,7 +1409,7 @@
   return (param_list_cmp (qs1->param_list, qs2->param_list) == 0);
 }
 
-gboolean qof_query_equal (QofQuery *q1, QofQuery *q2)
+gboolean qof_query_equal (const QofQuery *q1, const QofQuery *q2)
 {
   GList *or1, *or2;
 

Modified: gnucash/trunk/lib/libqof/qof/qofquery.h
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofquery.h	2007-12-29 17:44:00 UTC (rev 16763)
+++ gnucash/trunk/lib/libqof/qof/qofquery.h	2007-12-29 19:40:28 UTC (rev 16764)
@@ -360,7 +360,7 @@
  * implementation -- logical equivalences between different
  * and/or trees are ignored. 
  */
-gboolean qof_query_equal (QofQuery *q1, QofQuery *q2);
+gboolean qof_query_equal (const QofQuery *q1, const QofQuery *q2);
 
 /** Log the Query 
  *
@@ -371,7 +371,7 @@
 void qof_query_print (QofQuery *query);
 
 /** Return the type of data we're querying for */
-QofIdType qof_query_get_search_for (QofQuery *q);
+QofIdType qof_query_get_search_for (const QofQuery *q);
 
 /** Return the list of books we're using */
 GList * qof_query_get_books (QofQuery *q);

Modified: gnucash/trunk/lib/libqof/qof/qofquerycore-p.h
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofquerycore-p.h	2007-12-29 17:44:00 UTC (rev 16763)
+++ gnucash/trunk/lib/libqof/qof/qofquerycore-p.h	2007-12-29 19:40:28 UTC (rev 16764)
@@ -50,7 +50,7 @@
 QofCompareFunc qof_query_core_get_compare (gchar const *type);
 
 /* Compare two predicates */
-gboolean qof_query_core_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2);
+gboolean qof_query_core_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2);
 
 /* Predicate Data Structures:
  *

Modified: gnucash/trunk/lib/libqof/qof/qofquerycore.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofquerycore.c	2007-12-29 17:44:00 UTC (rev 16763)
+++ gnucash/trunk/lib/libqof/qof/qofquerycore.c	2007-12-29 19:40:28 UTC (rev 16764)
@@ -35,7 +35,7 @@
 typedef void (*QueryPredDataFree) (QofQueryPredData *pdata);
 
 /* A function to copy a query's predicate data */
-typedef QofQueryPredData *(*QueryPredicateCopyFunc) (QofQueryPredData *pdata);
+typedef QofQueryPredData *(*QueryPredicateCopyFunc) (const QofQueryPredData *pdata);
 
 /* A function to take the object, apply the getter->param_getfcn,
  * and return a printable string.  Note that this QofParam->getfnc
@@ -46,8 +46,8 @@
 typedef char * (*QueryToString) (gpointer object, QofParam *getter);
 
 /* A function to test for equality of predicate data */
-typedef gboolean (*QueryPredicateEqual) (QofQueryPredData *p1,
-                                         QofQueryPredData *p2);
+typedef gboolean (*QueryPredicateEqual) (const QofQueryPredData *p1,
+                                         const QofQueryPredData *p2);
 
 static QueryPredicateCopyFunc qof_query_copy_predicate (QofType type);
 static QueryPredDataFree qof_query_predicate_free (QofType type);
@@ -228,9 +228,9 @@
 }
 
 static QofQueryPredData *
-string_copy_predicate (QofQueryPredData *pd)
+string_copy_predicate (const QofQueryPredData *pd)
 {
-  query_string_t pdata = (query_string_t) pd;
+  const query_string_t pdata = (const query_string_t) pd;
 
   VERIFY_PDATA_R (query_string_type);
 
@@ -240,10 +240,10 @@
 }
 
 static gboolean
-string_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2)
+string_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2)
 {
-  query_string_t pd1 = (query_string_t) p1;
-  query_string_t pd2 = (query_string_t) p2;
+  const query_string_t pd1 = (const query_string_t) p1;
+  const query_string_t pd2 = (const query_string_t) p2;
 
   if (pd1->options != pd2->options) return FALSE;
   if (pd1->is_regex != pd2->is_regex) return FALSE;
@@ -375,9 +375,9 @@
 }
 
 static QofQueryPredData *
-date_copy_predicate (QofQueryPredData *pd)
+date_copy_predicate (const QofQueryPredData *pd)
 {
-  query_date_t pdata = (query_date_t)pd;
+  const query_date_t pdata = (const query_date_t)pd;
 
   VERIFY_PDATA_R (query_date_type);
 
@@ -385,10 +385,10 @@
 }
 
 static gboolean
-date_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2)
+date_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2)
 {
-  query_date_t pd1 = (query_date_t) p1;
-  query_date_t pd2 = (query_date_t) p2;
+  const query_date_t pd1 = (const query_date_t) p1;
+  const query_date_t pd2 = (const query_date_t) p2;
 
   if (pd1->options != pd2->options) return FALSE;
   return timespec_equal (&(pd1->date), &(pd2->date));
@@ -409,9 +409,9 @@
 }
 
 gboolean
-qof_query_date_predicate_get_date (QofQueryPredData *pd, Timespec *date)
+qof_query_date_predicate_get_date (const QofQueryPredData *pd, Timespec *date)
 {
-  query_date_t pdata = (query_date_t)pd;
+  const query_date_t pdata = (const query_date_t)pd;
 
   if (pdata->pd.type_name != query_date_type)
     return FALSE;
@@ -509,18 +509,18 @@
 }
 
 static QofQueryPredData *
-numeric_copy_predicate (QofQueryPredData *pd)
+numeric_copy_predicate (const QofQueryPredData *pd)
 {
-  query_numeric_t pdata = (query_numeric_t)pd;
+  const query_numeric_t pdata = (const query_numeric_t)pd;
   VERIFY_PDATA_R (query_numeric_type);
   return qof_query_numeric_predicate (pd->how, pdata->options, pdata->amount);
 }
 
 static gboolean
-numeric_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2)
+numeric_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2)
 {
-  query_numeric_t pd1 = (query_numeric_t) p1;
-  query_numeric_t pd2 = (query_numeric_t) p2;
+  const query_numeric_t pd1 = (const query_numeric_t) p1;
+  const query_numeric_t pd2 = (const query_numeric_t) p2;
 
   if (pd1->options != pd2->options) return FALSE;
   return gnc_numeric_equal (pd1->amount, pd2->amount);
@@ -684,18 +684,18 @@
 }
 
 static QofQueryPredData *
-guid_copy_predicate (QofQueryPredData *pd)
+guid_copy_predicate (const QofQueryPredData *pd)
 {
-  query_guid_t pdata = (query_guid_t)pd;
+  const query_guid_t pdata = (const query_guid_t)pd;
   VERIFY_PDATA_R (query_guid_type);
   return qof_query_guid_predicate (pdata->options, pdata->guids);
 }
 
 static gboolean
-guid_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2)
+guid_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2)
 {
-  query_guid_t pd1 = (query_guid_t) p1;
-  query_guid_t pd2 = (query_guid_t) p2;
+  const query_guid_t pd1 = (const query_guid_t) p1;
+  const query_guid_t pd2 = (const query_guid_t) p2;
   GList *l1 = pd1->guids, *l2 = pd2->guids;
 
   if (pd1->options != pd2->options) return FALSE;
@@ -788,18 +788,18 @@
 }
 
 static QofQueryPredData *
-int32_copy_predicate (QofQueryPredData *pd)
+int32_copy_predicate (const QofQueryPredData *pd)
 {
-  query_int32_t pdata = (query_int32_t)pd;
+  const query_int32_t pdata = (const query_int32_t)pd;
   VERIFY_PDATA_R (query_int32_type);
   return qof_query_int32_predicate (pd->how, pdata->val);
 }
 
 static gboolean
-int32_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2)
+int32_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2)
 {
-  query_int32_t pd1 = (query_int32_t) p1;
-  query_int32_t pd2 = (query_int32_t) p2;
+  const query_int32_t pd1 = (const query_int32_t) p1;
+  const query_int32_t pd2 = (const query_int32_t) p2;
 
   return (pd1->val == pd2->val);
 }
@@ -879,18 +879,18 @@
 }
 
 static QofQueryPredData *
-int64_copy_predicate (QofQueryPredData *pd)
+int64_copy_predicate (const QofQueryPredData *pd)
 {
-  query_int64_t pdata = (query_int64_t)pd;
+  const query_int64_t pdata = (const query_int64_t)pd;
   VERIFY_PDATA_R (query_int64_type);
   return qof_query_int64_predicate (pd->how, pdata->val);
 }
 
 static gboolean
-int64_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2)
+int64_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2)
 {
-  query_int64_t pd1 = (query_int64_t) p1;
-  query_int64_t pd2 = (query_int64_t) p2;
+  const query_int64_t pd1 = (const query_int64_t) p1;
+  const query_int64_t pd2 = (const query_int64_t) p2;
 
   return (pd1->val == pd2->val);
 }
@@ -970,18 +970,18 @@
 }
 
 static QofQueryPredData *
-double_copy_predicate (QofQueryPredData *pd)
+double_copy_predicate (const QofQueryPredData *pd)
 {
-  query_double_t pdata = (query_double_t)pd;
+  const query_double_t pdata = (const query_double_t)pd;
   VERIFY_PDATA_R (query_double_type);
   return qof_query_double_predicate (pd->how, pdata->val);
 }
 
 static gboolean
-double_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2)
+double_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2)
 {
-  query_double_t pd1 = (query_double_t) p1;
-  query_double_t pd2 = (query_double_t) p2;
+  const query_double_t pd1 = (const query_double_t) p1;
+  const query_double_t pd2 = (const query_double_t) p2;
 
   return (pd1->val == pd2->val);
 }
@@ -1050,18 +1050,18 @@
 }
 
 static QofQueryPredData *
-boolean_copy_predicate (QofQueryPredData *pd)
+boolean_copy_predicate (const QofQueryPredData *pd)
 {
-  query_boolean_t pdata = (query_boolean_t)pd;
+  const query_boolean_t pdata = (const query_boolean_t)pd;
   VERIFY_PDATA_R (query_boolean_type);
   return qof_query_boolean_predicate (pd->how, pdata->val);
 }
 
 static gboolean
-boolean_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2)
+boolean_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2)
 {
-  query_boolean_t pd1 = (query_boolean_t) p1;
-  query_boolean_t pd2 = (query_boolean_t) p2;
+  const query_boolean_t pd1 = (const query_boolean_t) p1;
+  const query_boolean_t pd2 = (const query_boolean_t) p2;
 
   return (pd1->val == pd2->val);
 }
@@ -1133,18 +1133,18 @@
 }
 
 static QofQueryPredData *
-char_copy_predicate (QofQueryPredData *pd)
+char_copy_predicate (const QofQueryPredData *pd)
 {
-  query_char_t pdata = (query_char_t)pd;
+  const query_char_t pdata = (const query_char_t)pd;
   VERIFY_PDATA_R (query_char_type);
   return qof_query_char_predicate (pdata->options, pdata->char_list);
 }
 
 static gboolean
-char_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2)
+char_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2)
 {
-  query_char_t pd1 = (query_char_t) p1;
-  query_char_t pd2 = (query_char_t) p2;
+  const query_char_t pd1 = (const query_char_t) p1;
+  const query_char_t pd2 = (const query_char_t) p2;
 
   if (pd1->options != pd2->options) return FALSE;
   return (safe_strcmp (pd1->char_list, pd2->char_list) == 0);
@@ -1235,18 +1235,18 @@
 }
 
 static QofQueryPredData *
-kvp_copy_predicate (QofQueryPredData *pd)
+kvp_copy_predicate (const QofQueryPredData *pd)
 {
-  query_kvp_t pdata = (query_kvp_t)pd;
+  const query_kvp_t pdata = (const query_kvp_t)pd;
   VERIFY_PDATA_R (query_kvp_type);
   return qof_query_kvp_predicate (pd->how, pdata->path, pdata->value);
 }
 
 static gboolean
-kvp_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2)
+kvp_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2)
 {
-  query_kvp_t pd1 = (query_kvp_t) p1;
-  query_kvp_t pd2 = (query_kvp_t) p2;
+  const query_kvp_t pd1 = (const query_kvp_t) p1;
+  const query_kvp_t pd2 = (const query_kvp_t) p2;
   GSList *n1, *n2;
 
   n1 = pd1->path;
@@ -1426,23 +1426,21 @@
 }
 
 static QofQueryPredData *
-collect_copy_predicate (QofQueryPredData *pd)
+collect_copy_predicate (const QofQueryPredData *pd)
 {
-	query_coll_t pdata = (query_coll_t) pd;
+	const query_coll_t pdata = (const query_coll_t) pd;
 
 	VERIFY_PDATA_R (query_collect_type);
 	return qof_query_collect_predicate (pdata->options, pdata->coll);
 }
 
 static gboolean
-collect_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2)
+collect_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2)
 {
-	query_coll_t pd1;
-	query_coll_t pd2;
+	const query_coll_t pd1 = (const query_coll_t) p1;
+	const query_coll_t pd2 = (const query_coll_t) p2;
 	gint result;
 
-	pd1 = (query_coll_t) p1;
-	pd2 = (query_coll_t) p2;
 	result = qof_collection_compare(pd1->coll, pd2->coll);
 	if(result == 0) { return TRUE; }
 	return FALSE;
@@ -1588,18 +1586,18 @@
 }
 
 static QofQueryPredData *
-choice_copy_predicate (QofQueryPredData *pd)
+choice_copy_predicate (const QofQueryPredData *pd)
 {
-  query_choice_t pdata = (query_choice_t)pd;
+  const query_choice_t pdata = (const query_choice_t)pd;
   VERIFY_PDATA_R (query_choice_type);
   return qof_query_choice_predicate (pdata->options, pdata->guids);
 }
 
 static gboolean
-choice_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2)
+choice_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2)
 {
-  query_choice_t pd1 = (query_choice_t) p1;
-  query_choice_t pd2 = (query_choice_t) p2;
+  const query_choice_t pd1 = (const query_choice_t) p1;
+  const query_choice_t pd2 = (const query_choice_t) p2;
   GList *l1 = pd1->guids, *l2 = pd2->guids;
 
   if (pd1->options != pd2->options) return FALSE;
@@ -1821,7 +1819,7 @@
 }
 
 QofQueryPredData *
-qof_query_core_predicate_copy (QofQueryPredData *pdata)
+qof_query_core_predicate_copy (const QofQueryPredData *pdata)
 {
   QueryPredicateCopyFunc copy;
 
@@ -1849,7 +1847,7 @@
 }
 
 gboolean
-qof_query_core_predicate_equal (QofQueryPredData *p1, QofQueryPredData *p2)
+qof_query_core_predicate_equal (const QofQueryPredData *p1, const QofQueryPredData *p2)
 {
   QueryPredicateEqual pred_equal;
 

Modified: gnucash/trunk/lib/libqof/qof/qofquerycore.h
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofquerycore.h	2007-12-29 17:44:00 UTC (rev 16763)
+++ gnucash/trunk/lib/libqof/qof/qofquerycore.h	2007-12-29 19:40:28 UTC (rev 16764)
@@ -175,13 +175,13 @@
                                                 const KvpValue *value);
 
 /** Copy a predicate. */
-QofQueryPredData *qof_query_core_predicate_copy (QofQueryPredData *pdata);
+QofQueryPredData *qof_query_core_predicate_copy (const QofQueryPredData *pdata);
 
 /** Destroy a predicate. */
 void qof_query_core_predicate_free (QofQueryPredData *pdata);
 
 /** Retrieve a predicate. */
-gboolean qof_query_date_predicate_get_date (QofQueryPredData *pd, Timespec *date);
+gboolean qof_query_date_predicate_get_date (const QofQueryPredData *pd, Timespec *date);
 /** Return a printable string for a core data object.  Caller needs
  *  to g_free() the returned string.
  */

Modified: gnucash/trunk/lib/libqof/qof/qofsession-p.h
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofsession-p.h	2007-12-29 17:44:00 UTC (rev 16763)
+++ gnucash/trunk/lib/libqof/qof/qofsession-p.h	2007-12-29 19:40:28 UTC (rev 16764)
@@ -67,7 +67,7 @@
 };
 
 
-QofBackend * qof_session_get_backend (QofSession *session);
+QofBackend * qof_session_get_backend (const QofSession *session);
 
 void qof_session_push_error (QofSession *session, QofBackendError err,
                              const char *message);

Modified: gnucash/trunk/lib/libqof/qof/qofsession.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofsession.c	2007-12-29 17:44:00 UTC (rev 16763)
+++ gnucash/trunk/lib/libqof/qof/qofsession.c	2007-12-29 19:40:28 UTC (rev 16764)
@@ -165,7 +165,7 @@
 }
 
 const char *
-qof_session_get_error_message(QofSession *session)
+qof_session_get_error_message(const QofSession *session)
 {
     if(!session) return "";
     if(!session->error_message)
@@ -234,7 +234,7 @@
 }
 
 QofBook *
-qof_session_get_book (QofSession *session)
+qof_session_get_book (const QofSession *session)
 {
    GList *node;
    if (!session) return NULL;
@@ -282,14 +282,14 @@
 }
 
 QofBackend * 
-qof_session_get_backend (QofSession *session)
+qof_session_get_backend (const QofSession *session)
 {
    if (!session) return NULL;
    return session->backend;
 }
 
 const char *
-qof_session_get_file_path (QofSession *session)
+qof_session_get_file_path (const QofSession *session)
 {
    if (!session) return NULL;
    if (!session->backend) return NULL;
@@ -297,7 +297,7 @@
 }
 
 const char *
-qof_session_get_url (QofSession *session)
+qof_session_get_url (const QofSession *session)
 {
    if (!session) return NULL;
    return session->book_id;
@@ -865,7 +865,7 @@
 };
 
 static void
-qof_session_load_backend(QofSession * session, char * access_method)
+qof_session_load_backend(QofSession * session, const char * access_method)
 {
 	GSList *p;
 	GList *node;
@@ -1176,7 +1176,7 @@
 /* ====================================================================== */
 
 gboolean
-qof_session_save_may_clobber_data (QofSession *session)
+qof_session_save_may_clobber_data (const QofSession *session)
 {
   if (!session) return FALSE;
   if (!session->backend) return FALSE;
@@ -1447,7 +1447,7 @@
 /* ====================================================================== */
 
 gboolean
-qof_session_events_pending (QofSession *session)
+qof_session_events_pending (const QofSession *session)
 {
   if (!session) return FALSE;
   if (!session->backend) return FALSE;

Modified: gnucash/trunk/lib/libqof/qof/qofsession.h
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofsession.h	2007-12-29 17:44:00 UTC (rev 16763)
+++ gnucash/trunk/lib/libqof/qof/qofsession.h	2007-12-29 19:40:28 UTC (rev 16764)
@@ -173,7 +173,7 @@
  *    for any failure.  Calling this routine returns the current error.
  */
 QofBackendError qof_session_get_error (QofSession *session);
-const char * qof_session_get_error_message(QofSession *session);
+const char * qof_session_get_error_message(const QofSession *session);
 
 /**
  * The qof_session_pop_error() routine can be used to obtain the reason
@@ -197,7 +197,7 @@
  */
 void qof_session_add_book (QofSession *session, QofBook *book);
 
-QofBook * qof_session_get_book (QofSession *session);
+QofBook * qof_session_get_book (const QofSession *session);
 
 /**
  *    The qof_session_get_file_path() routine returns the fully-qualified file
@@ -213,9 +213,9 @@
  *    URL's for local files take the form of 
  *    file:/some/where/some/file.gml
  */
-const char * qof_session_get_file_path (QofSession *session);
+const char * qof_session_get_file_path (const QofSession *session);
 
-const char * qof_session_get_url (QofSession *session);
+const char * qof_session_get_url (const QofSession *session);
 
 /**
  * The qof_session_not_saved() subroutine will return TRUE
@@ -225,7 +225,7 @@
 gboolean qof_session_save_in_progress(QofSession *session);
 
 /** Allows the backend to warn the user if a dataset already exists. */
-gboolean qof_session_save_may_clobber_data (QofSession *session);
+gboolean qof_session_save_may_clobber_data (const QofSession *session);
 
 /** The qof_session_save() method will commit all changes that have been
  *    made to the session. For the file backend, this is nothing
@@ -409,7 +409,7 @@
  *  backend has pending events which must be processed to bring 
  *  the engine up to date with the backend.
  */
-gboolean qof_session_events_pending (QofSession *session);
+gboolean qof_session_events_pending (const QofSession *session);
 
 /**  The qof_session_process_events() method will process any events
  *   indicated by the qof_session_events_pending() method. It returns 

Modified: gnucash/trunk/src/engine/engine-helpers.c
===================================================================
--- gnucash/trunk/src/engine/engine-helpers.c	2007-12-29 17:44:00 UTC (rev 16763)
+++ gnucash/trunk/src/engine/engine-helpers.c	2007-12-29 19:40:28 UTC (rev 16764)
@@ -47,7 +47,7 @@
 static QofLogModule log_module = GNC_MOD_ENGINE;
 
 Timespec
-gnc_transaction_get_date_posted(Transaction *t) 
+gnc_transaction_get_date_posted(const Transaction *t) 
 {
   Timespec result;
   xaccTransGetDatePostedTS(t, &result);
@@ -55,7 +55,7 @@
 }
 
 Timespec
-gnc_transaction_get_date_entered(Transaction *t) 
+gnc_transaction_get_date_entered(const Transaction *t) 
 {
   Timespec result;
   xaccTransGetDateEnteredTS(t, &result);
@@ -63,7 +63,7 @@
 }
 
 Timespec
-gnc_split_get_date_reconciled(Split *s) 
+gnc_split_get_date_reconciled(const Split *s) 
 {
   Timespec result;
   xaccSplitGetDateReconciledTS(s, &result);
@@ -382,10 +382,10 @@
 }
 
 static SCM
-gnc_guid_glist2scm (GList *account_guids)
+gnc_guid_glist2scm (const GList *account_guids)
 {
   SCM guids = SCM_EOL;
-  GList *node;
+  const GList *node;
 
   for (node = account_guids; node; node = node->next)
   {
@@ -460,10 +460,10 @@
 }
 
 static SCM
-gnc_query_path2scm (GSList *path)
+gnc_query_path2scm (const GSList *path)
 {
   SCM path_scm = SCM_EOL;
-  GSList *node;
+  const GSList *node;
 
   for (node = path; node; node = node->next)
   {
@@ -522,7 +522,7 @@
 static SCM gnc_kvp_frame2scm (KvpFrame *frame);
 
 static SCM
-gnc_kvp_value2scm (KvpValue *value)
+gnc_kvp_value2scm (const KvpValue *value)
 {
   SCM value_scm = SCM_EOL;
   KvpValueType value_t;
@@ -770,7 +770,7 @@
 }
 
 static SCM
-gnc_queryterm2scm (QofQueryTerm *qt)
+gnc_queryterm2scm (const QofQueryTerm *qt)
 {
   SCM qt_scm = SCM_EOL;
   QofQueryPredData *pd = NULL;
@@ -1413,10 +1413,10 @@
 }
 
 static SCM
-gnc_query_terms2scm (GList *terms)
+gnc_query_terms2scm (const GList *terms)
 {
   SCM or_terms = SCM_EOL;
-  GList *or_node;
+  const GList *or_node;
 
   for (or_node = terms; or_node; or_node = or_node->next)
   {
@@ -1524,7 +1524,7 @@
 }
 
 static SCM
-gnc_query_sort2scm (QofQuerySort *qs)
+gnc_query_sort2scm (const QofQuerySort *qs)
 {
   SCM sort_scm = SCM_EOL;
   GSList *path;
@@ -2191,13 +2191,13 @@
 }
 
 SCM
-gnc_book_to_scm (QofBook *book)
+gnc_book_to_scm (const QofBook *book)
 {
     return gnc_generic_to_scm(book, "_p_QofBook");
 }
 
 SCM
-qof_session_to_scm (QofSession *session)
+qof_session_to_scm (const QofSession *session)
 {
     return gnc_generic_to_scm(session, "_p_QofSession");
 }

Modified: gnucash/trunk/src/engine/engine-helpers.h
===================================================================
--- gnucash/trunk/src/engine/engine-helpers.h	2007-12-29 17:44:00 UTC (rev 16763)
+++ gnucash/trunk/src/engine/engine-helpers.h	2007-12-29 19:40:28 UTC (rev 16764)
@@ -33,10 +33,10 @@
 #include "Query.h"
 #include "Transaction.h"
 
-Timespec gnc_transaction_get_date_posted(Transaction *t);
-Timespec gnc_transaction_get_date_entered(Transaction *t);
+Timespec gnc_transaction_get_date_posted(const Transaction *t);
+Timespec gnc_transaction_get_date_entered(const Transaction *t);
 
-Timespec gnc_split_get_date_reconciled(Split *s);
+Timespec gnc_split_get_date_reconciled(const Split *s);
 
 void gnc_transaction_set_date_posted(Transaction *t, const Timespec d);
 void gnc_transaction_set_date_entered(Transaction *t, const Timespec d);
@@ -71,7 +71,7 @@
 int gnc_numeric_p(SCM arg);
 gnc_commodity * gnc_scm_to_commodity(SCM scm);
 SCM gnc_commodity_to_scm (const gnc_commodity *commodity);
-SCM gnc_book_to_scm (QofBook *book);
-SCM qof_session_to_scm (QofSession *session);
+SCM gnc_book_to_scm (const QofBook *book);
+SCM qof_session_to_scm (const QofSession *session);
 
 #endif



More information about the gnucash-changes mailing list