From 4cfe73161d6e00b583c452ef2502862c80d9ce9f Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 12 Oct 2016 07:15:15 -0700 Subject: Support gmtoff and zone in time struct. * lib.c (gmtoff_s, zone_s): New symbol variables. (tm_to_time_struct): Copy tm_gmtoff and tm_zone into Lisp struct from struct tm, if the platform has these. (time_fields_to_tm): Zero/null-out the tm_gmtoff and tm_zone fields of the target structure, if the platform has them. (time_init): Intern the gmtoff and zone symbols, initializing the gmtoff_s and zone_s variables. Add the gmtoff and zone slots to the time struct. * txr.1: Documented new slots. --- txr.1 | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index c7f53a6f..095fa482 100644 --- a/txr.1 +++ b/txr.1 @@ -38352,7 +38352,8 @@ function. .coNP Structure @ time .synb (defstruct time nil - year month day hour min sec dst) + year month day hour min sec dst + gmtoff zone) .syne .desc The @@ -38377,7 +38378,7 @@ January, whereas the C member .code tm_mon uses a zero-based month. The .code dst -slot is a \*(TL Boolean value. The remaining slots +slot is a \*(TL Boolean value. The slots .codn hour , .codn min , and @@ -38388,6 +38389,37 @@ correspond directly to and .codn tm_sec . +The slot +.code gmtoff +represents the number of seconds east of UTC, and +.code zone +holds a string giving the abbreviated time zone name. +On platform where the C type +.code "struct tm" +has fields corresponding to these slots, values for +these slots are calculated and stored into them by the +.code time-struct-local +and +.code time-struct-utc +functions, and also the related +.code time-local +and +.code time-utc +methods. On platform where the corresponding fields are not +present in the C language +.codn "struct tm" , +these slots are unaffected by those functions, +retaining the default initial value +.code nil +or a previously stored value, if applicable. +Lastly, the values of +.code gmtoff +and +.code zone +are not ignored by functions which accept a +.code time +structure as a source of input values. + .coNP Functions @ time-struct-local and @ time-struct-utc .synb .mets (time-struct-local << time ) -- cgit v1.2.3