Adding some time64 alternatives

This commit is contained in:
lmat 2017-12-16 08:29:25 -08:00 committed by Christopher Lam
parent 2f89e4595b
commit 61d4aaaf08
4 changed files with 22 additions and 0 deletions

View File

@ -2402,6 +2402,12 @@ xaccTransRetDatePostedTS (const Transaction *trans)
return trans ? trans->date_posted : ts;
}
time64
xaccTransRetDatePosted (const Transaction *trans)
{
return trans ? trans->date_posted.tv_sec : 0;
}
GDate
xaccTransGetDatePostedGDate (const Transaction *trans)
{
@ -2445,6 +2451,12 @@ xaccTransRetDateEnteredTS (const Transaction *trans)
return trans ? trans->date_entered : ts;
}
time64
xaccTransRetDateEntered (const Transaction *trans)
{
return trans ? trans->date_entered.tv_sec : 0;
}
void
xaccTransGetDateDueTS (const Transaction *trans, Timespec *ts)
{

View File

@ -656,6 +656,7 @@ void xaccTransGetDatePostedTS (const Transaction *trans, Timespec *ts);
having different function names, GetDate and GetDatePosted refer
to the same single date.)*/
Timespec xaccTransRetDatePostedTS (const Transaction *trans);
time64 xaccTransRetDatePosted (const Transaction *trans);
/** Retrieve the posted date of the transaction. The posted date is
the date when this transaction was posted at the bank. */
GDate xaccTransGetDatePostedGDate (const Transaction *trans);
@ -671,6 +672,7 @@ void xaccTransGetDateEnteredTS (const Transaction *trans, Timespec *ts)
/** Retrieve the date of when the transaction was entered. The entered
* date is the date when the register entry was made.*/
Timespec xaccTransRetDateEnteredTS (const Transaction *trans);
time64 xaccTransRetDateEntered (const Transaction *trans);
/** Dates and txn-type for A/R and A/P "invoice" postings */
Timespec xaccTransRetDateDueTS (const Transaction *trans);

View File

@ -591,6 +591,13 @@ gnc_price_get_commodity(const GNCPrice *p)
return p->commodity;
}
time64
gnc_price_get_time64(const GNCPrice *p)
{
if (!p) return 0;
return p->tmspec.tv_sec;
}
Timespec
gnc_price_get_time(const GNCPrice *p)
{

View File

@ -257,6 +257,7 @@ gnc_commodity * gnc_price_get_commodity(const GNCPrice *p);
/*@ dependent @*/
gnc_commodity * gnc_price_get_currency(const GNCPrice *p);
Timespec gnc_price_get_time(const GNCPrice *p);
time64 gnc_price_get_time64(const GNCPrice *p);
PriceSource gnc_price_get_source(const GNCPrice *p);
const char * gnc_price_get_source_string(const GNCPrice *p);
const char * gnc_price_get_typestr(const GNCPrice *p);