get/set the guid

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6880 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas
2002-05-21 05:16:47 +00:00
parent 54be97345b
commit d34d0327fd
3 changed files with 25 additions and 0 deletions

View File

@@ -64,6 +64,7 @@ struct gnc_lot_struct
gboolean is_closed;
};
void gnc_lot_set_guid(GNCLot *lot, GUID guid);
#endif /* GNC_LOT_P_H */

View File

@@ -98,6 +98,28 @@ gnc_lot_destroy (GNCLot *lot)
g_free (lot);
}
/* ============================================================= */
const GUID *
gnc_lot_get_guid (GNCLot *lot)
{
if (!lot) return NULL;
return &lot->guid;
}
void
gnc_lot_set_guid (GNCLot *lot, GUID uid)
{
if (!lot) return;
if (guid_equal (&lot->guid, &uid)) return;
xaccRemoveEntity(lot->book->entity_table, &lot->guid);
lot->guid = uid;
xaccStoreEntity(lot->book->entity_table, lot, &lot->guid, GNC_ID_LOT);
}
/* ============================================================= */
gboolean

View File

@@ -43,6 +43,8 @@
GNCLot * gnc_lot_new (GNCBook *);
void gnc_lot_destroy (GNCLot *);
const GUID * gnc_lot_get_guid (GNCLot *p);
void gnc_lot_add_split (GNCLot *, Split *);
void gnc_lot_remove_split (GNCLot *, Split *);