ADD-TIME64-API: libgnucash/engine/gnc-pricedb.[ch]

gnc_pricedb_lookup_nearest_in_time64
gnc_pricedb_lookup_nearest_in_time_any_currency_t64
This commit is contained in:
Christopher Lam 2018-01-03 05:42:29 +11:00
parent 2f2ad18dfe
commit 465c9e1f21
2 changed files with 32 additions and 0 deletions

View File

@ -2068,6 +2068,18 @@ gnc_pricedb_lookup_nearest_in_time_any_currency(GNCPriceDB *db,
return result;
}
PriceList *
gnc_pricedb_lookup_nearest_in_time_any_currency_t64(GNCPriceDB *db,
const gnc_commodity *commodity,
time64 t64)
{
Timespec t;
t.tv_sec = t64;
t.tv_nsec = 0;
return gnc_pricedb_lookup_nearest_in_time_any_currency(db, commodity, t);
}
PriceList *
gnc_pricedb_lookup_latest_before_any_currency(GNCPriceDB *db,
const gnc_commodity *commodity,
@ -2442,6 +2454,18 @@ gnc_pricedb_lookup_nearest_in_time(GNCPriceDB *db,
return lookup_nearest_in_time(db, c, currency, t, FALSE);
}
GNCPrice *
gnc_pricedb_lookup_nearest_in_time64(GNCPriceDB *db,
const gnc_commodity *c,
const gnc_commodity *currency,
time64 t64)
{
Timespec t;
t.tv_sec = t64;
t.tv_nsec = 0;
return lookup_nearest_in_time(db, c, currency, t, FALSE);
}
GNCPrice *
gnc_pricedb_lookup_latest_before (GNCPriceDB *db,
gnc_commodity *c,

View File

@ -517,6 +517,11 @@ GNCPrice * gnc_pricedb_lookup_nearest_in_time(GNCPriceDB *db,
const gnc_commodity *currency,
Timespec t);
GNCPrice * gnc_pricedb_lookup_nearest_in_time64(GNCPriceDB *db,
const gnc_commodity *c,
const gnc_commodity *currency,
time64 t);
/** @brief Return the price nearest in time to that given between the given
* commodity and every other.
*
@ -532,6 +537,9 @@ GNCPrice * gnc_pricedb_lookup_nearest_in_time(GNCPriceDB *db,
PriceList * gnc_pricedb_lookup_nearest_in_time_any_currency(GNCPriceDB *db,
const gnc_commodity *c,
Timespec t);
PriceList * gnc_pricedb_lookup_nearest_in_time_any_currency_t64(GNCPriceDB *db,
const gnc_commodity *c,
time64 t64);
/** @brief Return the latest price between the given commodities before the
* given time.