[M3devel] UtimeExtra.i3

Jay K jay.krell at cornell.edu
Sun Apr 11 07:15:44 CEST 2010


Just a note that the following are both duplicated and slightly buggy:

 


C:\dev2\cm3.2\m3-mail\postcard\src\UtimeExtra.i3
C:\dev2\cm3.2\m3-mail\postcard\src\OSUtils.m3
C:\dev2\cm3.2\m3-mail\postcard\src\OSUtils.i3
C:\dev2\cm3.2\m3-mail\webcard\src\UtimeExtra.i3
C:\dev2\cm3.2\m3-mail\webcard\src\OSUtils.m3
C:\dev2\cm3.2\m3-mail\webcard\src\OSUtils.i3

 


The copies are identical.

 


UtimeExtra.i3:

(* The declaration of struct_tm in Utime omits "gmtoff"; mktime isn there
   at all. *)

TYPE
  struct_tm = RECORD
    tm_sec:   int;     (* seconds (0 - 59) *)
    tm_min:   int;     (* minutes (0 - 59) *)
    tm_hour:  int;     (* hours (0 - 23) *)
    tm_mday:  int;     (* day of month (1 - 31) *)
    tm_mon:   int;     (* month of year (0 - 11) *)
    tm_year:  int;     (* year - 1900 *)
    tm_wday:  int;     (* day of week (Sunday = 0) *)
    tm_yday:  int;     (* day of year (0 - 365) *)
    tm_isdst: int;     (* flag: daylight savings time in effect *)
    tm_gmtoff: long;   (* offset from GMT in seconds *)
    tm_zone: char_star;(* abbreviation of timezone name *)
  END;

  struct_tm_star = UNTRACED REF struct_tm;

<*EXTERNAL*> PROCEDURE localtime (clock: long_star): struct_tm_star;
<*EXTERNAL*> PROCEDURE gmtime    (clock: long_star): struct_tm_star;
<*EXTERNAL*> PROCEDURE mktime    (VAR tm: struct_tm): long;


 

gmtoff is omitted deliberately, because it isn't always there.
e.g. on Cygwin, Solaris, Interix, Posix.

They are #ifed on Linux -- they are there.

 


I don't believe the order of the fields is guaranteed either, but
everything I looked at has them the same.

 


 - Jay
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20100411/776474d1/attachment-0001.html>


More information about the M3devel mailing list