home *** CD-ROM | disk | FTP | other *** search
/ ftp.uni-stuttgart.de/pub/systems/acorn/ / Acorn.tar / Acorn / acornet / dev / c / debug / mnemosyn.spk / !Mnemosyne / sys / H / Time < prev    next >
Text File  |  1991-04-24  |  1KB  |  50 lines

  1. /* Sys.H.Time: Arm 5-byte time utilities (header file) */
  2.  
  3. #ifndef _sys_time_h
  4. #define _sys_time_h
  5.  
  6. /* Get struct tm from the ANSI header */
  7. #include <time.h>
  8.  
  9. /* ARM System time format */
  10.  
  11. #ifndef __TIME_h
  12. #define __TIME_h
  13. typedef struct
  14. {
  15.     unsigned char t[5];    /* Low byte first - ie. t[0] is low */
  16. }
  17. TIME;
  18. #endif
  19.  
  20. struct utimbuf {
  21.   time_t actime;    /* Access time       */
  22.   time_t modtime;   /* Modification time */
  23. };
  24.  
  25. /* Units of time which could be added/subtracted from a TIME */
  26. #define Secs(n)    ((n) * 100)
  27. #define Mins(n) ((n) * 6000)
  28. #define Hrs(n)    ((n) * 360000)
  29.  
  30. /* A time of "zero" */
  31. extern TIME TIMENull;
  32.  
  33. /* Time arithmetic */
  34. extern TIME TIMEadd (TIME t, int n);
  35. extern int  TIMEsub (TIME t1, TIME t2);
  36. extern int  TIMEcmp (TIME t1, TIME t2);
  37.  
  38. /* Time formatting */
  39. extern char *TIMEfmt (const char *fmt, char *buffer, int len, TIME t);
  40. extern char *TIMEstd (TIME t);
  41.  
  42. /* Creating time variables */
  43. extern TIME TIMEnow (TIME *tp);
  44. extern TIME TIMEmktime (struct tm *time);
  45.  
  46. /* Creating a 'struct tm' from a TIME */
  47. extern struct tm *TIMEstruct (TIME t);
  48.  
  49. #endif
  50.