mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
2001-08-06 Dave Peticolas <dave@krondo.com>
* src/engine/sql/upgrade.h: fix warning * src/engine/gnc-pricedb.[ch] (gnc_price_equal): new func * src/engine/FreqSpec.c: add comment git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@5071 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
481fee0773
commit
18957d5333
@ -1,3 +1,11 @@
|
||||
2001-08-06 Dave Peticolas <dave@krondo.com>
|
||||
|
||||
* src/engine/sql/upgrade.h: fix warning
|
||||
|
||||
* src/engine/gnc-pricedb.[ch] (gnc_price_equal): new func
|
||||
|
||||
* src/engine/FreqSpec.c: add comment
|
||||
|
||||
2001-08-05 Dave Peticolas <dave@krondo.com>
|
||||
|
||||
* src/gnome/window-register.c: move close button to left
|
||||
|
@ -124,7 +124,10 @@ struct monthDesc {
|
||||
/* This stuff is going to need i18n.
|
||||
* wouldn't it be simpler to use the system
|
||||
* date conversion functions?
|
||||
* glib already knows about this. */
|
||||
* glib already knows about this.
|
||||
* *libc* already knows about this
|
||||
* and the month names below. Both
|
||||
* of these should go away! */
|
||||
static char *weekDayNames[] = {
|
||||
"Sunday",
|
||||
"Monday",
|
||||
|
@ -428,6 +428,44 @@ gnc_price_get_version(GNCPrice *p)
|
||||
return (p->version);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gnc_price_equal (GNCPrice *p1, GNCPrice *p2)
|
||||
{
|
||||
Timespec ts1;
|
||||
Timespec ts2;
|
||||
|
||||
if (p1 == p2) return TRUE;
|
||||
if (!p1 || !p2) return FALSE;
|
||||
|
||||
if (!gnc_commodity_equiv (gnc_price_get_commodity (p1),
|
||||
gnc_price_get_commodity (p2)))
|
||||
return FALSE;
|
||||
|
||||
if (!gnc_commodity_equiv (gnc_price_get_currency (p1),
|
||||
gnc_price_get_currency (p2)))
|
||||
return FALSE;
|
||||
|
||||
ts1 = gnc_price_get_time (p1);
|
||||
ts2 = gnc_price_get_time (p2);
|
||||
|
||||
if (!timespec_equal (&ts1, &ts2))
|
||||
return FALSE;
|
||||
|
||||
if (!safe_strcmp (gnc_price_get_source (p1),
|
||||
gnc_price_get_source (p2)))
|
||||
return FALSE;
|
||||
|
||||
if (!safe_strcmp (gnc_price_get_type (p1),
|
||||
gnc_price_get_type (p2)))
|
||||
return FALSE;
|
||||
|
||||
if (!gnc_numeric_eq (gnc_price_get_value (p1),
|
||||
gnc_price_get_value (p2)))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* ==================================================================== */
|
||||
/* price list manipulation functions */
|
||||
|
||||
|
@ -172,6 +172,8 @@ const char * gnc_price_get_type(GNCPrice *p);
|
||||
gnc_numeric gnc_price_get_value(GNCPrice *p);
|
||||
gint32 gnc_price_get_version(GNCPrice *p);
|
||||
|
||||
gboolean gnc_price_equal (GNCPrice *p1, GNCPrice *p2);
|
||||
|
||||
/**********************************************************************
|
||||
GNCPrice lists:
|
||||
|
||||
|
@ -38,4 +38,4 @@ int pgendDBVersionIsCurrent (PGBackend *be);
|
||||
|
||||
void pgendUpgradeDB (PGBackend *be);
|
||||
|
||||
#endif PGEND_UPGRADE_H
|
||||
#endif /* PGEND_UPGRADE_H */
|
||||
|
Loading…
Reference in New Issue
Block a user