mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-25 10:20:18 -06:00
Delete the last vestiges of timepair.
This commit is contained in:
parent
773b070345
commit
6d605762dd
@ -32,10 +32,7 @@
|
||||
|
||||
/* Helpers for various conversions to and from guile */
|
||||
|
||||
SCM gnc_timespec2timepair(Timespec t);
|
||||
Timespec gnc_timepair2timespec(SCM x);
|
||||
GDate gnc_time64_to_GDate(SCM x);
|
||||
int gnc_timepair_p(SCM x);
|
||||
|
||||
SCM gnc_guid2scm(GncGUID guid);
|
||||
GncGUID gnc_scm2guid(SCM guid_scm);
|
||||
|
@ -284,28 +284,6 @@ gnc_book_option_remove_cb (gchar *key, GncBOCb func, gpointer user_data)
|
||||
}
|
||||
}
|
||||
|
||||
SCM
|
||||
gnc_timespec2timepair(Timespec t)
|
||||
{
|
||||
SCM secs;
|
||||
SCM nsecs;
|
||||
|
||||
secs = scm_from_int64(t.tv_sec);
|
||||
nsecs = scm_from_long (t.tv_nsec);
|
||||
return(scm_cons(secs, nsecs));
|
||||
}
|
||||
|
||||
Timespec
|
||||
gnc_timepair2timespec(SCM x)
|
||||
{
|
||||
Timespec result = {0, 0};
|
||||
if (gnc_timepair_p (x))
|
||||
{
|
||||
result.tv_sec = scm_to_int64(SCM_CAR(x));
|
||||
result.tv_nsec = scm_to_long(SCM_CDR(x));
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
GDate gnc_time64_to_GDate(SCM x)
|
||||
{
|
||||
@ -313,14 +291,6 @@ GDate gnc_time64_to_GDate(SCM x)
|
||||
return time64_to_gdate(time);
|
||||
}
|
||||
|
||||
int
|
||||
gnc_timepair_p(SCM x)
|
||||
{
|
||||
return(scm_is_pair(x) &&
|
||||
(scm_is_signed_integer(SCM_CAR(x), INT64_MIN, INT64_MAX) &&
|
||||
scm_is_signed_integer(SCM_CDR(x), INT64_MIN, INT64_MAX)));
|
||||
}
|
||||
|
||||
SCM
|
||||
gnc_guid2scm(GncGUID guid)
|
||||
{
|
||||
@ -390,8 +360,6 @@ gnc_guid_p(SCM guid_scm)
|
||||
* Each OR term is a list of AND terms.
|
||||
* Each AND term is a list of one of the following forms:
|
||||
*
|
||||
* ('pd-date pr-type sense-bool use-start-bool start-timepair
|
||||
* use-end-bool use-end-timepair)
|
||||
* ('pd-amount pr-type sense-bool amt-match-how amt-match-sign amount)
|
||||
* ('pd-account pr-type sense-bool acct-match-how list-of-account-guids)
|
||||
* ('pd-string pr-type sense-bool case-sense-bool use-regexp-bool string)
|
||||
|
@ -329,8 +329,8 @@ Timespec timespec_diff(const Timespec *ta, const Timespec *tb);
|
||||
/** absolute value, also normalized */
|
||||
Timespec timespec_abs(const Timespec *t);
|
||||
|
||||
/** convert a timepair on a certain day (localtime) to
|
||||
* the timepair representing midday on that day. Watch out - this is *not* the
|
||||
/** convert a timespec on a certain day (localtime) to
|
||||
* the timespec representing midday on that day. Watch out - this is *not* the
|
||||
* first second of the day, which is returned by various other functions
|
||||
* returning a Timespec. */
|
||||
Timespec timespecCanonicalDayTime(Timespec t);
|
||||
|
@ -56,11 +56,6 @@ gnc_scm_to_kvp_value_ptr(SCM val)
|
||||
auto tmpguid = guid_copy(&guid);
|
||||
return new KvpValue{tmpguid};
|
||||
}
|
||||
else if (gnc_timepair_p(val))
|
||||
{
|
||||
Timespec ts = gnc_timepair2timespec(val);
|
||||
return new KvpValue{ts};
|
||||
}
|
||||
else if (scm_is_string(val))
|
||||
{
|
||||
return new KvpValue{gnc_scm_to_utf8_string(val)};
|
||||
@ -106,10 +101,6 @@ gnc_kvp_value_ptr_to_scm(KvpValue* val)
|
||||
return gnc_guid2scm(*tempguid);
|
||||
}
|
||||
break;
|
||||
case KvpValue::Type::TIMESPEC:
|
||||
return gnc_timespec2timepair(val->get<Timespec>());
|
||||
break;
|
||||
|
||||
case KvpValue::Type::FRAME:
|
||||
{
|
||||
auto frame = val->get<KvpFrame*>();
|
||||
@ -117,10 +108,6 @@ gnc_kvp_value_ptr_to_scm(KvpValue* val)
|
||||
return SWIG_NewPointerObj(frame, SWIG_TypeQuery("_p_KvpFrame"), 0);
|
||||
}
|
||||
break;
|
||||
case KvpValue::Type::GDATE:
|
||||
return gnc_timespec2timepair(gdate_to_timespec(val->get<GDate>()));
|
||||
|
||||
/* FIXME: handle types below */
|
||||
case KvpValue::Type::GLIST:
|
||||
default:
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user