91 typedef struct QofCollection_s QofCollection;
95 #define QOF_ID_NONE NULL
96 #define QOF_ID_NULL "null"
98 #define QOF_ID_BOOK "Book"
99 #define QOF_ID_SESSION "Session"
103 # define QSTRCMP(da,db) ({ \
105 if ((da) && (db)) { \
106 if ((da) != (db)) { \
107 val = strcmp ((da), (db)); \
110 if ((!(da)) && (db)) { \
113 if ((da) && (!(db))) { \
120 # define QSTRCMP g_strcmp0
124 #define QOF_CHECK_TYPE(obj,type) (((obj) != NULL) && \
125 (0 == QSTRCMP((type),(((QofInstance *)(obj))->e_type))))
129 #define QOF_CHECK_CAST(obj,e_type,c_type) ( \
130 QOF_CHECK_TYPE((obj),(e_type)) ? \
133 g_log (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, \
134 "Error: Bad QofInstance at %s:%d", __FILE__, __LINE__); \
199 void qof_collection_set_data (QofCollection *col, gpointer user_data);
227 void qof_collection_remove_entity (QofInstance *ent);
gboolean qof_collection_is_dirty(const QofCollection *col)
QofInstance * qof_collection_lookup_entity(const QofCollection *, const GncGUID *)
const gchar * QofIdTypeConst
void qof_set_alt_dirty_mode(gboolean enabled)
globally unique ID User API
Object instance holds common fields that most gnucash objects use.
void qof_collection_foreach(const QofCollection *, QofInstanceForeachCB, gpointer user_data)
gint qof_collection_compare(QofCollection *target, QofCollection *merge)
Compare two secondary collections.
QofCollection * qof_collection_from_glist(QofIdType type, const GList *glist)
Create a secondary collection from a GList.
void(* QofInstanceForeachCB)(QofInstance *, gpointer user_data)
void qof_collection_destroy(QofCollection *col)
QofIdType qof_collection_get_type(const QofCollection *)
gboolean qof_collection_add_entity(QofCollection *coll, QofInstance *ent)
Add an entity to a QOF_TYPE_COLLECT.
guint qof_collection_count(const QofCollection *col)
gpointer qof_collection_get_data(const QofCollection *col)
gboolean qof_get_alt_dirty_mode(void)
const gchar * QofLogModule
QofCollection * qof_collection_new(QofIdType type)