1 2 // automatically generated by m4 from headers in proto subdir 3 4 5 #ifndef __TIME_H__ 6 #define __TIME_H__ 7 8 #include <stdint.h> 9 10 #ifndef NULL 11 #define NULL ((void*)(0)) 12 #endif 13 14 struct tm 15 { 16 uint8_t tm_sec; // 0-59 seconds (leap seconds may be accommodated) 17 uint8_t tm_min; // 0-59 minutes 18 uint8_t tm_hour; // 0-23 hour (since midnight) 19 uint8_t tm_mday; // 1-31 day of month 20 uint8_t tm_mon; // 0-11 month (since January) 21 int16_t tm_year; // years since 1900 (signed) 22 23 // following is not filled in by some time functions 24 25 uint8_t tm_wday; // 0-6 day (since Sunday) 26 uint16_t tm_yday; // 0-365 day (since January 1) 27 int8_t tm_isdst; // daylight savings time <0 (not avail), 0 (no), >0 (yes) 28 29 // following is bsd/gnu extension and may not be filled in by some targets 30 31 // int32_t tm_gmtoff; // seconds to add to UTC for local time 32 // const unsigned char tm_zone[6]; // name of timezone 33 }; 34 35 // MSDOS Time for FAT 36 37 struct dos_tm 38 { 39 uint16_t time; 40 uint16_t date; 41 }; 42 43 // dos time affects tm.tm_sec through tm.tm_year 44 45 extern void dostm_from_tm(struct dos_tm *,struct tm *); 46 extern void dostm_from_tm_callee(struct dos_tm *,struct tm *) __z88dk_callee; 47 #define dostm_from_tm(a,b) dostm_from_tm_callee(a,b) 48 49 50 extern void tm_from_dostm(struct tm *,struct dos_tm *); 51 extern void tm_from_dostm_callee(struct tm *,struct dos_tm *) __z88dk_callee; 52 #define tm_from_dostm(a,b) tm_from_dostm_callee(a,b) 53 54 55 56 // dos time comparison 57 58 extern int compare_dostm(struct dos_tm *a,struct dos_tm *b); 59 extern int compare_dostm_callee(struct dos_tm *a,struct dos_tm *b) __z88dk_callee; 60 #define compare_dostm(a,b) compare_dostm_callee(a,b) 61 62 63 64 #endif 65