r14690 - gnucash/trunk - Add some 'const' declarations.
David Hampton
hampton at cvs.gnucash.org
Fri Aug 18 00:48:22 EDT 2006
Author: hampton
Date: 2006-08-18 00:48:18 -0400 (Fri, 18 Aug 2006)
New Revision: 14690
Trac: http://svn.gnucash.org/trac/changeset/14690
Modified:
gnucash/trunk/ChangeLog
gnucash/trunk/lib/libqof/qof/qofbackend-p.h
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/qofchoice.c
gnucash/trunk/lib/libqof/qof/qofchoice.h
gnucash/trunk/lib/libqof/qof/qofid-p.h
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/qofinstance.h
gnucash/trunk/lib/libqof/qof/qofobject-p.h
gnucash/trunk/lib/libqof/qof/qofobject.c
gnucash/trunk/lib/libqof/qof/qofobject.h
gnucash/trunk/src/engine/Group.c
gnucash/trunk/src/engine/Group.h
gnucash/trunk/src/engine/SX-book.c
gnucash/trunk/src/engine/SX-book.h
gnucash/trunk/src/engine/gnc-pricedb.c
gnucash/trunk/src/engine/test/test-object.c
Log:
Add some 'const' declarations.
Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog 2006-08-17 12:47:46 UTC (rev 14689)
+++ gnucash/trunk/ChangeLog 2006-08-18 04:48:18 UTC (rev 14690)
@@ -1,3 +1,7 @@
+2006-08-18 David Hampton <hampton at employees.org>
+
+ * various: Add some 'const' declarations.
+
2006-08-17 Christian Stimming <stimming at tuhh.de>
* lib/libqof/qof/qof.h, qofsession.c: Move #include "qofla-dir.h"
Modified: gnucash/trunk/lib/libqof/qof/qofbackend-p.h
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofbackend-p.h 2006-08-17 12:47:46 UTC (rev 14689)
+++ gnucash/trunk/lib/libqof/qof/qofbackend-p.h 2006-08-18 04:48:18 UTC (rev 14690)
@@ -382,7 +382,7 @@
@return 'y' if book is open, otherwise 'n'.
*/
-gchar qof_book_get_open_marker(QofBook *book);
+gchar qof_book_get_open_marker(const QofBook *book);
/** get the book version
@@ -391,13 +391,13 @@
@return -1 if no book exists, 0 if the book is
new, otherwise the book version number.
*/
-gint32 qof_book_get_version (QofBook *book);
+gint32 qof_book_get_version (const QofBook *book);
/** get the book tag number
used for kvp management in sql backends.
*/
-guint32 qof_book_get_idata (QofBook *book);
+guint32 qof_book_get_idata (const QofBook *book);
void qof_book_set_version (QofBook *book, gint32 version);
Modified: gnucash/trunk/lib/libqof/qof/qofbackend.h
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofbackend.h 2006-08-17 12:47:46 UTC (rev 14689)
+++ gnucash/trunk/lib/libqof/qof/qofbackend.h 2006-08-18 04:48:18 UTC (rev 14690)
@@ -273,7 +273,7 @@
qof_load_backend_library(const gchar *directory, const gchar* module_name);
/** \brief Retrieve the backend used by this book */
-QofBackend* qof_book_get_backend (QofBook *book);
+QofBackend* qof_book_get_backend (const QofBook *book);
void qof_book_set_backend (QofBook *book, QofBackend *);
Modified: gnucash/trunk/lib/libqof/qof/qofbook.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofbook.c 2006-08-17 12:47:46 UTC (rev 14689)
+++ gnucash/trunk/lib/libqof/qof/qofbook.c 2006-08-18 04:48:18 UTC (rev 14690)
@@ -135,7 +135,7 @@
/* XXX this should probably be calling is_equal callbacks on gncObject */
gboolean
-qof_book_equal (QofBook *book_1, QofBook *book_2)
+qof_book_equal (const QofBook *book_1, const QofBook *book_2)
{
if (book_1 == book_2) return TRUE;
if (!book_1 || !book_2) return FALSE;
@@ -145,7 +145,7 @@
/* ====================================================================== */
gboolean
-qof_book_not_saved (QofBook *book)
+qof_book_not_saved (const QofBook *book)
{
if (!book) return FALSE;
@@ -185,15 +185,16 @@
}
void
-qof_book_print_dirty (QofBook *book)
+qof_book_print_dirty (const QofBook *book)
{
if (book->inst.dirty)
printf("book is dirty.\n");
- qof_book_foreach_collection(book, qof_collection_print_dirty, NULL);
+ qof_book_foreach_collection
+ (book, (QofCollectionForeachCB)qof_collection_print_dirty, NULL);
}
time_t
-qof_book_get_dirty_time (QofBook *book)
+qof_book_get_dirty_time (const QofBook *book)
{
return book->dirty_time;
}
@@ -209,14 +210,14 @@
/* getters */
QofBackend *
-qof_book_get_backend (QofBook *book)
+qof_book_get_backend (const QofBook *book)
{
if (!book) return NULL;
return book->backend;
}
gboolean
-qof_book_shutting_down (QofBook *book)
+qof_book_shutting_down (const QofBook *book)
{
if (!book) return FALSE;
return book->shutting_down;
@@ -262,7 +263,7 @@
}
gpointer
-qof_book_get_data (QofBook *book, const char *key)
+qof_book_get_data (const QofBook *book, const char *key)
{
if (!book || !key) return NULL;
return g_hash_table_lookup (book->data_tables, (gpointer)key);
@@ -271,7 +272,7 @@
/* ====================================================================== */
QofCollection *
-qof_book_get_collection (QofBook *book, QofIdType entity_type)
+qof_book_get_collection (const QofBook *book, QofIdType entity_type)
{
QofCollection *col;
@@ -302,7 +303,7 @@
}
void
-qof_book_foreach_collection (QofBook *book,
+qof_book_foreach_collection (const QofBook *book,
QofCollectionForeachCB cb, gpointer user_data)
{
struct _iterate iter;
@@ -324,19 +325,19 @@
book->book_open = 'n';
}
-gchar qof_book_get_open_marker(QofBook *book)
+gchar qof_book_get_open_marker(const QofBook *book)
{
if(!book) { return 'n'; }
return book->book_open;
}
-gint32 qof_book_get_version (QofBook *book)
+gint32 qof_book_get_version (const QofBook *book)
{
if(!book) { return -1; }
return book->version;
}
-guint32 qof_book_get_idata (QofBook *book)
+guint32 qof_book_get_idata (const QofBook *book)
{
if(!book) { return 0; }
return book->idata;
Modified: gnucash/trunk/lib/libqof/qof/qofbook.h
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofbook.h 2006-08-17 12:47:46 UTC (rev 14689)
+++ gnucash/trunk/lib/libqof/qof/qofbook.h 2006-08-18 04:48:18 UTC (rev 14690)
@@ -99,11 +99,11 @@
* a non-NULL value. (Unless the system malloc failed (out of
* memory) in which case what happens??).
*/
-QofCollection * qof_book_get_collection (QofBook *, QofIdType);
+QofCollection * qof_book_get_collection (const QofBook *, QofIdType);
/** Invoke the indicated callback on each collection in the book. */
typedef void (*QofCollectionForeachCB) (QofCollection *, gpointer user_data);
-void qof_book_foreach_collection (QofBook *, QofCollectionForeachCB, gpointer);
+void qof_book_foreach_collection (const QofBook *, QofCollectionForeachCB, gpointer);
/** Return The kvp data for the book.
* Note that the book KVP data is persistent, and is stored/retrieved
@@ -134,10 +134,10 @@
QofBookFinalCB);
/** Retrieves arbitrary pointers to structs stored by qof_book_set_data. */
-gpointer qof_book_get_data (QofBook *book, const gchar *key);
+gpointer qof_book_get_data (const QofBook *book, const gchar *key);
/** Is the book shutting down? */
-gboolean qof_book_shutting_down (QofBook *book);
+gboolean qof_book_shutting_down (const QofBook *book);
/** qof_book_not_saved() will return TRUE if any
* data in the book hasn't been saved to long-term storage.
@@ -147,7 +147,7 @@
* 'dirty' flag. Its up to the backend to periodically reset this
* flag, when it actually does save the data.)
*/
-gboolean qof_book_not_saved (QofBook *book);
+gboolean qof_book_not_saved (const QofBook *book);
/** The qof_book_mark_saved() routine marks the book as having been
* saved (to a file, to a database). Used by backends to mark the
@@ -166,10 +166,10 @@
* and all subsidiary structures, printing out which structures
* have been marked dirty.
*/
-void qof_book_print_dirty (QofBook *book);
+void qof_book_print_dirty (const QofBook *book);
/** Retrieve the earliest modification time on the book. */
-time_t qof_book_get_dirty_time(QofBook *book);
+time_t qof_book_get_dirty_time(const QofBook *book);
/** Set the function to call when a book transitions from clean to
* dirty, or vice versa.
@@ -183,7 +183,7 @@
/** The qof_book_equal() method returns TRUE if books are equal.
* XXX this routine is broken, and does not currently compare data.
*/
-gboolean qof_book_equal (QofBook *book_1, QofBook *book_2);
+gboolean qof_book_equal (const QofBook *book_1, const QofBook *book_2);
/** This will 'get and increment' the named counter for this book.
* The return value is -1 on error or the incremented counter.
Modified: gnucash/trunk/lib/libqof/qof/qofchoice.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofchoice.c 2006-08-17 12:47:46 UTC (rev 14689)
+++ gnucash/trunk/lib/libqof/qof/qofchoice.c 2006-08-18 04:48:18 UTC (rev 14690)
@@ -41,7 +41,7 @@
return TRUE;
}
-gboolean qof_object_is_choice(QofIdType type)
+gboolean qof_object_is_choice(QofIdTypeConst type)
{
gpointer value, check;
@@ -67,7 +67,9 @@
return TRUE;
}
-gboolean qof_choice_add_class(char* select, char* option, char* param_name)
+gboolean qof_choice_add_class(const char* select,
+ char* option,
+ char* param_name)
{
GHashTable *param_table;
GList *option_list;
@@ -97,7 +99,9 @@
return choices;
}
-gboolean qof_choice_check(char* choice_obj, char *param_name, char* choice )
+gboolean qof_choice_check(const char* choice_obj,
+ const char *param_name,
+ const char* choice )
{
GList *choices, *result;
GHashTable *param_table;
Modified: gnucash/trunk/lib/libqof/qof/qofchoice.h
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofchoice.h 2006-08-17 12:47:46 UTC (rev 14689)
+++ gnucash/trunk/lib/libqof/qof/qofchoice.h 2006-08-18 04:48:18 UTC (rev 14690)
@@ -113,7 +113,7 @@
@return TRUE if one or more choice parameters has been
registered using the object definition, otherwise FALSE.
*/
-gboolean qof_object_is_choice(QofIdType type);
+gboolean qof_object_is_choice(QofIdTypeConst type);
/** \brief Set an object as using QOF_TYPE_CHOICE. */
gboolean qof_choice_create(char* type);
@@ -127,7 +127,7 @@
@return FALSE if object is not a choice object or on error
otherwise TRUE.
*/
-gboolean qof_choice_add_class(char* choice, char* add, char* param_name);
+gboolean qof_choice_add_class(const char* choice, char* add, char* param_name);
/** \brief Return the list of all object types usable with this parameter.
@@ -150,7 +150,9 @@
@return TRUE if choice is found in the list of allowed choices for
this parameter of this object. Otherwise, FALSE
*/
-gboolean qof_choice_check(char* choice_obj, char *param_name, char* choice);
+gboolean qof_choice_check(const char* choice_obj,
+ const char *param_name,
+ const char* choice);
/** @} */
/** @} */
Modified: gnucash/trunk/lib/libqof/qof/qofid-p.h
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofid-p.h 2006-08-17 12:47:46 UTC (rev 14689)
+++ gnucash/trunk/lib/libqof/qof/qofid-p.h 2006-08-18 04:48:18 UTC (rev 14690)
@@ -49,7 +49,7 @@
/** reset value of dirty flag */
void qof_collection_mark_clean (QofCollection *);
void qof_collection_mark_dirty (QofCollection *);
-void qof_collection_print_dirty (QofCollection *col, gpointer dummy);
+void qof_collection_print_dirty (const QofCollection *col, gpointer dummy);
/* @} */
/* @} */
Modified: gnucash/trunk/lib/libqof/qof/qofid.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofid.c 2006-08-17 12:47:46 UTC (rev 14689)
+++ gnucash/trunk/lib/libqof/qof/qofid.c 2006-08-18 04:48:18 UTC (rev 14690)
@@ -113,7 +113,7 @@
}
const GUID *
-qof_entity_get_guid (QofEntity *ent)
+qof_entity_get_guid (const QofEntity *ent)
{
if (!ent) return guid_null();
return &ent->guid;
@@ -182,7 +182,7 @@
/* getters */
QofIdType
-qof_collection_get_type (QofCollection *col)
+qof_collection_get_type (const QofCollection *col)
{
return col->e_type;
}
@@ -303,7 +303,7 @@
}
QofEntity *
-qof_collection_lookup_entity (QofCollection *col, const GUID * guid)
+qof_collection_lookup_entity (const QofCollection *col, const GUID * guid)
{
QofEntity *ent;
g_return_val_if_fail (col, NULL);
@@ -332,7 +332,7 @@
}
guint
-qof_collection_count (QofCollection *col)
+qof_collection_count (const QofCollection *col)
{
guint c;
@@ -343,7 +343,7 @@
/* =============================================================== */
gboolean
-qof_collection_is_dirty (QofCollection *col)
+qof_collection_is_dirty (const QofCollection *col)
{
return col ? col->is_dirty : FALSE;
}
@@ -361,17 +361,17 @@
}
void
-qof_collection_print_dirty (QofCollection *col, gpointer dummy)
+qof_collection_print_dirty (const QofCollection *col, gpointer dummy)
{
if (col->is_dirty)
printf("%s collection is dirty.\n", col->e_type);
- qof_collection_foreach(col, qof_instance_print_dirty, NULL);
+ qof_collection_foreach(col, (QofEntityForeachCB)qof_instance_print_dirty, NULL);
}
/* =============================================================== */
gpointer
-qof_collection_get_data (QofCollection *col)
+qof_collection_get_data (const QofCollection *col)
{
return col ? col->data : NULL;
}
@@ -398,7 +398,7 @@
}
void
-qof_collection_foreach (QofCollection *col, QofEntityForeachCB cb_func,
+qof_collection_foreach (const QofCollection *col, QofEntityForeachCB cb_func,
gpointer user_data)
{
struct _iterate iter;
Modified: gnucash/trunk/lib/libqof/qof/qofid.h
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofid.h 2006-08-17 12:47:46 UTC (rev 14689)
+++ gnucash/trunk/lib/libqof/qof/qofid.h 2006-08-18 04:48:18 UTC (rev 14690)
@@ -178,7 +178,7 @@
void qof_set_alt_dirty_mode (gboolean enabled);
/** Return the GUID of this entity */
-const GUID * qof_entity_get_guid (QofEntity *);
+const GUID * qof_entity_get_guid (const QofEntity *);
/** @name Collections of Entities
@{ */
@@ -187,22 +187,22 @@
QofCollection * qof_collection_new (QofIdType type);
/** return the number of entities in the collection. */
-guint qof_collection_count (QofCollection *col);
+guint qof_collection_count (const QofCollection *col);
/** destroy the collection */
void qof_collection_destroy (QofCollection *col);
/** return the type that the collection stores */
-QofIdType qof_collection_get_type (QofCollection *);
+QofIdType qof_collection_get_type (const QofCollection *);
/** Find the entity going only from its guid */
-QofEntity * qof_collection_lookup_entity (QofCollection *, const GUID *);
+QofEntity * qof_collection_lookup_entity (const QofCollection *, const GUID *);
/** Callback type for qof_entity_foreach */
typedef void (*QofEntityForeachCB) (QofEntity *, gpointer user_data);
/** Call the callback for each entity in the collection. */
-void qof_collection_foreach (QofCollection *, QofEntityForeachCB,
+void qof_collection_foreach (const QofCollection *, QofEntityForeachCB,
gpointer user_data);
/** Store and retreive arbitrary object-defined data
@@ -211,11 +211,11 @@
* destroyed, so that the user has a chance to clean up anything
* that was put in the 'data' member here.
*/
-gpointer qof_collection_get_data (QofCollection *col);
+gpointer qof_collection_get_data (const QofCollection *col);
void qof_collection_set_data (QofCollection *col, gpointer user_data);
/** Return value of 'dirty' flag on collection */
-gboolean qof_collection_is_dirty (QofCollection *col);
+gboolean qof_collection_is_dirty (const QofCollection *col);
/** @name QOF_TYPE_COLLECT: Linking one entity to many of one type
Modified: gnucash/trunk/lib/libqof/qof/qofinstance.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofinstance.c 2006-08-17 12:47:46 UTC (rev 14689)
+++ gnucash/trunk/lib/libqof/qof/qofinstance.c 2006-08-18 04:48:18 UTC (rev 14690)
@@ -79,28 +79,28 @@
}
const GUID *
-qof_instance_get_guid (QofInstance *inst)
+qof_instance_get_guid (const QofInstance *inst)
{
if (!inst) return NULL;
return &inst->entity.guid;
}
QofBook *
-qof_instance_get_book (QofInstance *inst)
+qof_instance_get_book (const QofInstance *inst)
{
if (!inst) return NULL;
return inst->book;
}
KvpFrame*
-qof_instance_get_slots (QofInstance *inst)
+qof_instance_get_slots (const QofInstance *inst)
{
if (!inst) return NULL;
return inst->kvp_data;
}
Timespec
-qof_instance_get_last_update (QofInstance *inst)
+qof_instance_get_last_update (const QofInstance *inst)
{
if (!inst)
{
@@ -111,7 +111,7 @@
}
int
-qof_instance_version_cmp (QofInstance *left, QofInstance *right)
+qof_instance_version_cmp (const QofInstance *left, const QofInstance *right)
{
if (!left && !right) return 0;
if (!left) return -1;
@@ -124,7 +124,7 @@
}
void
-qof_instance_print_dirty (QofEntity *entity, gpointer dummy)
+qof_instance_print_dirty (const QofEntity *entity, gpointer dummy)
{
QofInstance *inst = QOF_INSTANCE(entity);
@@ -160,14 +160,14 @@
}
gboolean
-qof_instance_check_edit(QofInstance *inst)
+qof_instance_check_edit(const QofInstance *inst)
{
if(inst->editlevel > 0) { return TRUE; }
return FALSE;
}
gboolean
-qof_instance_do_free(QofInstance *inst)
+qof_instance_do_free(const QofInstance *inst)
{
return inst->do_free;
}
@@ -211,7 +211,7 @@
/* ========================================================== */
void
-qof_instance_gemini (QofInstance *to, QofInstance *from)
+qof_instance_gemini (QofInstance *to, const QofInstance *from)
{
time_t now;
@@ -234,7 +234,7 @@
}
QofInstance *
-qof_instance_lookup_twin (QofInstance *src, QofBook *target_book)
+qof_instance_lookup_twin (const QofInstance *src, QofBook *target_book)
{
QofCollection *col;
KvpFrame *fr;
Modified: gnucash/trunk/lib/libqof/qof/qofinstance.h
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofinstance.h 2006-08-17 12:47:46 UTC (rev 14689)
+++ gnucash/trunk/lib/libqof/qof/qofinstance.h 2006-08-18 04:48:18 UTC (rev 14690)
@@ -57,13 +57,13 @@
void qof_instance_release (QofInstance *inst);
/** Return the book pointer */
-QofBook * qof_instance_get_book (QofInstance *);
+QofBook * qof_instance_get_book (const QofInstance *);
/** Return the GUID of this instance */
-const GUID * qof_instance_get_guid (QofInstance *);
+const GUID * qof_instance_get_guid (const QofInstance *);
/** Return the pointer to the kvp_data */
-KvpFrame* qof_instance_get_slots (QofInstance *);
+KvpFrame* qof_instance_get_slots (const QofInstance *);
/** Return the last time this instance was modified. If QofInstances
* are used with the QofObject storage backends, then the instance
@@ -71,7 +71,7 @@
* multi-user updates. Non-backend code should not set the update
* times.
*/
-Timespec qof_instance_get_last_update (QofInstance *inst);
+Timespec qof_instance_get_last_update (const QofInstance *inst);
/** Compare two instances, based on thier last update times.
* Returns a negative, zero or positive value, respectively,
@@ -79,9 +79,9 @@
* Accepts NULL pointers, NULL's are by definition earlier
* than any value.
*/
-int qof_instance_version_cmp (QofInstance *left, QofInstance *right);
+int qof_instance_version_cmp (const QofInstance *left, const QofInstance *right);
-void qof_instance_print_dirty (QofEntity *entity, gpointer dummy);
+void qof_instance_print_dirty (const QofEntity *entity, gpointer dummy);
/** Return value of is_dirty flag */
gboolean qof_instance_is_dirty (QofInstance *);
@@ -92,9 +92,9 @@
*/
void qof_instance_set_dirty(QofInstance* inst);
-gboolean qof_instance_check_edit(QofInstance *inst);
+gboolean qof_instance_check_edit(const QofInstance *inst);
-gboolean qof_instance_do_free(QofInstance *inst);
+gboolean qof_instance_do_free(const QofInstance *inst);
void qof_instance_mark_free(QofInstance *inst);
@@ -109,7 +109,7 @@
* the gemini kvp includes the book guid as well, so that the right book can
* be found.
*/
-void qof_instance_gemini (QofInstance *to, QofInstance *from);
+void qof_instance_gemini (QofInstance *to, const QofInstance *from);
/** The qof_instance_lookup_twin() routine will find the "twin" of this
* instance 'src' in the given other 'book' (if the twin exists).
@@ -125,7 +125,7 @@
* in 'book', and return it. If not found, it returns NULL. This
* routine uses the 'gemini' kvp values to do its work.
*/
-QofInstance * qof_instance_lookup_twin (QofInstance *src, QofBook *book);
+QofInstance * qof_instance_lookup_twin (const QofInstance *src, QofBook *book);
/* @} */
/* @} */
Modified: gnucash/trunk/lib/libqof/qof/qofobject-p.h
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofobject-p.h 2006-08-17 12:47:46 UTC (rev 14689)
+++ gnucash/trunk/lib/libqof/qof/qofobject-p.h 2006-08-18 04:48:18 UTC (rev 14690)
@@ -40,7 +40,7 @@
void qof_object_book_begin (QofBook *book);
void qof_object_book_end (QofBook *book);
-gboolean qof_object_is_dirty (QofBook *book);
+gboolean qof_object_is_dirty (const QofBook *book);
void qof_object_mark_clean (QofBook *book);
/** \brief check an object can be created and supports iteration
Modified: gnucash/trunk/lib/libqof/qof/qofobject.c
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofobject.c 2006-08-17 12:47:46 UTC (rev 14689)
+++ gnucash/trunk/lib/libqof/qof/qofobject.c 2006-08-18 04:48:18 UTC (rev 14690)
@@ -89,7 +89,7 @@
}
gboolean
-qof_object_is_dirty (QofBook *book)
+qof_object_is_dirty (const QofBook *book)
{
GList *l;
Modified: gnucash/trunk/lib/libqof/qof/qofobject.h
===================================================================
--- gnucash/trunk/lib/libqof/qof/qofobject.h 2006-08-17 12:47:46 UTC (rev 14689)
+++ gnucash/trunk/lib/libqof/qof/qofobject.h 2006-08-18 04:48:18 UTC (rev 14690)
@@ -92,7 +92,7 @@
void (*book_end)(QofBook *);
/** Determine if there are any dirty items in this book */
- gboolean (*is_dirty)(QofCollection *);
+ gboolean (*is_dirty)(const QofCollection *);
/** Mark this object's book clean (for after a load) */
void (*mark_clean)(QofCollection *);
@@ -104,7 +104,7 @@
* provide this routine, as without it, little of interest can
* be done.
*/
- void (*foreach)(QofCollection *, QofEntityForeachCB, gpointer);
+ void (*foreach)(const QofCollection *, QofEntityForeachCB, gpointer);
/** Given a particular item of this type, return a printable string.
*/
Modified: gnucash/trunk/src/engine/Group.c
===================================================================
--- gnucash/trunk/src/engine/Group.c 2006-08-17 12:47:46 UTC (rev 14689)
+++ gnucash/trunk/src/engine/Group.c 2006-08-18 04:48:18 UTC (rev 14690)
@@ -77,7 +77,7 @@
\********************************************************************/
AccountGroup *
-xaccCollGetAccountGroup (QofCollection *col)
+xaccCollGetAccountGroup (const QofCollection *col)
{
if (!col) return NULL;
return qof_collection_get_data (col);
@@ -1287,7 +1287,7 @@
}
static gboolean
-group_is_dirty (QofCollection *col)
+group_is_dirty (const QofCollection *col)
{
return xaccGroupNotSaved(xaccCollGetAccountGroup(col));
}
Modified: gnucash/trunk/src/engine/Group.h
===================================================================
--- gnucash/trunk/src/engine/Group.h 2006-08-17 12:47:46 UTC (rev 14689)
+++ gnucash/trunk/src/engine/Group.h 2006-08-18 04:48:18 UTC (rev 14690)
@@ -60,7 +60,7 @@
* The xaccCollAccountGroup() routine will return the top-most
* account group associated with the indicated collection.
*/
-AccountGroup * xaccCollGetAccountGroup (QofCollection *col);
+AccountGroup * xaccCollGetAccountGroup (const QofCollection *col);
/** The xaccAccountDestroy() routine will destroy and free all
* the data associated with this account group. The group
Modified: gnucash/trunk/src/engine/SX-book.c
===================================================================
--- gnucash/trunk/src/engine/SX-book.c 2006-08-17 12:47:46 UTC (rev 14689)
+++ gnucash/trunk/src/engine/SX-book.c 2006-08-18 04:48:18 UTC (rev 14690)
@@ -53,7 +53,7 @@
/* ====================================================================== */
AccountGroup *
-gnc_collection_get_template_group( QofCollection *col )
+gnc_collection_get_template_group( const QofCollection *col )
{
return qof_collection_get_data (col);
}
@@ -118,7 +118,7 @@
static gboolean
-sxtg_is_dirty(QofCollection *col)
+sxtg_is_dirty(const QofCollection *col)
{
return xaccGroupNotSaved(gnc_collection_get_template_group(col));
}
@@ -145,13 +145,13 @@
/* ====================================================================== */
SchedXactions *
-gnc_collection_get_schedxaction_list(QofCollection *col)
+gnc_collection_get_schedxaction_list(const QofCollection *col)
{
return qof_collection_get_data (col);
}
GList *
-gnc_collection_get_schedxactions(QofCollection *col)
+gnc_collection_get_schedxactions(const QofCollection *col)
{
SchedXactions *list;
list = qof_collection_get_data (col);
@@ -236,7 +236,7 @@
}
static gboolean
-book_sxlist_notsaved(QofCollection *col)
+book_sxlist_notsaved(const QofCollection *col)
{
GList *sxlist;
SchedXactions *sxl;
Modified: gnucash/trunk/src/engine/SX-book.h
===================================================================
--- gnucash/trunk/src/engine/SX-book.h 2006-08-17 12:47:46 UTC (rev 14689)
+++ gnucash/trunk/src/engine/SX-book.h 2006-08-18 04:48:18 UTC (rev 14690)
@@ -43,13 +43,13 @@
typedef struct xaccSchedXactionsDef SchedXactions;
-SchedXactions * gnc_collection_get_schedxaction_list(QofCollection *col);
-GList * gnc_collection_get_schedxactions(QofCollection *col);
+SchedXactions * gnc_collection_get_schedxaction_list(const QofCollection *col);
+GList * gnc_collection_get_schedxactions(const QofCollection *col);
GList * gnc_book_get_schedxactions(QofBook *book);
/** Returns the template group from the book. **/
AccountGroup * gnc_book_get_template_group(QofBook *book);
-AccountGroup * gnc_collection_get_template_group(QofCollection *col);
+AccountGroup * gnc_collection_get_template_group(const QofCollection *col);
/** @return The list of SXes which reference the given Account. Caller should free this list. **/
GList* gnc_sx_get_sxes_referencing_account(QofBook *book, Account *acct);
Modified: gnucash/trunk/src/engine/gnc-pricedb.c
===================================================================
--- gnucash/trunk/src/engine/gnc-pricedb.c 2006-08-17 12:47:46 UTC (rev 14689)
+++ gnucash/trunk/src/engine/gnc-pricedb.c 2006-08-18 04:48:18 UTC (rev 14690)
@@ -2376,7 +2376,7 @@
}
static void
-price_foreach(QofCollection *col, QofEntityForeachCB cb, gpointer data)
+price_foreach(const QofCollection *col, QofEntityForeachCB cb, gpointer data)
{
GNCPriceDB *db;
Modified: gnucash/trunk/src/engine/test/test-object.c
===================================================================
--- gnucash/trunk/src/engine/test/test-object.c 2006-08-17 12:47:46 UTC (rev 14689)
+++ gnucash/trunk/src/engine/test/test-object.c 2006-08-18 04:48:18 UTC (rev 14690)
@@ -32,7 +32,7 @@
#define TEST_MODULE_NAME "object-test"
#define TEST_MODULE_DESC "Test Object"
-static void obj_foreach (QofCollection *, QofEntityForeachCB, gpointer);
+static void obj_foreach (const QofCollection *, QofEntityForeachCB, gpointer);
static const char * printable (gpointer obj);
static void test_printable (const char *name, gpointer obj);
static void test_foreach (QofBook *, const char *);
@@ -78,7 +78,7 @@
}
static void
-obj_foreach (QofCollection *col, QofEntityForeachCB cb, gpointer u_d)
+obj_foreach (const QofCollection *col, QofEntityForeachCB cb, gpointer u_d)
{
int *foo = u_d;
More information about the gnucash-changes
mailing list