Export a make-tm constructor to generate time values.

Patch from Barry Fishman.
This commit is contained in:
Alex Shinn 2013-10-15 09:06:50 +09:00
parent 045c96bbf4
commit 617fbbba6a
2 changed files with 3 additions and 1 deletions

View file

@ -2,7 +2,7 @@
(define-library (chibi time) (define-library (chibi time)
(export current-seconds get-time-of-day set-time-of-day! (export current-seconds get-time-of-day set-time-of-day!
seconds->time seconds->string time->seconds time->string seconds->time seconds->string time->seconds time->string
make-timeval timeval-seconds timeval-microseconds make-timeval make-tm timeval-seconds timeval-microseconds
timezone-offset timezone-dst-time timezone-offset timezone-dst-time
time-second time-minute time-hour time-day time-month time-year time-second time-minute time-hour time-day time-month time-year
time-day-of-week time-day-of-year time-dst? time-day-of-week time-day-of-year time-dst?

View file

@ -7,6 +7,8 @@
(define-c-struct tm (define-c-struct tm
predicate: tm? predicate: tm?
constructor: (make-tm tm_sec tm_min tm_hour
tm_mday tm_mon tm_year tm_isdst)
(int tm_sec time-second) (int tm_sec time-second)
(int tm_min time-minute) (int tm_min time-minute)
(int tm_hour time-hour) (int tm_hour time-hour)