home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / uccs / root.14 / udk / usr / include / tzfile.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-19  |  3.1 KB  |  113 lines

  1. /*
  2.  * Copyright (c) 1998 The Santa Cruz Operation, Inc.. All Rights Reserved. 
  3.  *                                                                         
  4.  *        THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE               
  5.  *                   SANTA CRUZ OPERATION INC.                             
  6.  *                                                                         
  7.  *   The copyright notice above does not evidence any actual or intended   
  8.  *   publication of such source code.                                      
  9.  */
  10.  
  11. #ifndef _TZFILE_H
  12. #define _TZFILE_H
  13.  
  14. #ident    "@(#)sgs-head:common/head/tzfile.h    1.4"
  15. /*    @(#)tzfile.h 1.5 88/02/07 SMI; from Arthur Olson's 3.1    */
  16.  
  17. /*
  18. ** Information about time zone files.
  19. */
  20.  
  21. #define TZDIR        "/usr/lib/locale/TZ"    /* Time zone object file directory */
  22.  
  23. #define TZDEFAULT    "localtime"
  24.  
  25. /*
  26. ** Each file begins with. . .
  27. */
  28.  
  29. struct tzhead {
  30.     char    tzh_reserved[32];    /* reserved for future use */
  31.     char    tzh_timecnt[4];        /* coded number of transition times */
  32.     char    tzh_typecnt[4];        /* coded number of local time types */
  33.     char    tzh_charcnt[4];        /* coded number of abbr. chars */
  34. };
  35.  
  36. /*
  37. ** . . .followed by. . .
  38. **
  39. **    tzh_timecnt (char [4])s        coded transition times a la time(2)
  40. **    tzh_timecnt (unsigned char)s    types of local time starting at above
  41. **    tzh_typecnt repetitions of
  42. **        one (char [4])        coded GMT offset in seconds
  43. **        one (unsigned char)    used to set tm_isdt
  44. **        one (unsigned char)    that's an abbreviation list index
  45. **    tzh_charcnt (char)s        '\0'-terminated zone abbreviaton strings
  46. */
  47.  
  48. /*
  49. ** In the current implementation, "tzset()" refuses to deal with files that
  50. ** exceed any of the limits below.
  51. */
  52.  
  53. /*
  54. ** The TZ_MAX_TIMES value below is enough to handle a bit more than a
  55. ** year's worth of solar time (corrected daily to the nearest second) or
  56. ** 138 years of Pacific Presidential Election time
  57. ** (where there are three time zone transitions every fourth year).
  58. */
  59. #define TZ_MAX_TIMES    370
  60.  
  61. #ifndef NOSOLAR
  62. #define TZ_MAX_TYPES    256    /* Limited by what (unsigned char)'s can hold */
  63. #else /* !NOSOLAR */
  64. #define TZ_MAX_TYPES    10    /* Maximum number of local time types */
  65. #endif /* !NOSOLAR */
  66.  
  67. #define TZ_MAX_CHARS    50    /* Maximum number of abbreviation characters */
  68.  
  69. #define SECS_PER_MIN    60
  70. #define MINS_PER_HOUR    60
  71. #define HOURS_PER_DAY    24
  72. #define DAYS_PER_WEEK    7
  73. #define DAYS_PER_NYEAR    365
  74. #define DAYS_PER_LYEAR    366
  75. #define SECS_PER_HOUR    (SECS_PER_MIN * MINS_PER_HOUR)
  76. #define SECS_PER_DAY    ((long) SECS_PER_HOUR * HOURS_PER_DAY)
  77. #define MONS_PER_YEAR    12
  78.  
  79. #define TM_SUNDAY    0
  80. #define TM_MONDAY    1
  81. #define TM_TUESDAY    2
  82. #define TM_WEDNESDAY    3
  83. #define TM_THURSDAY    4
  84. #define TM_FRIDAY    5
  85. #define TM_SATURDAY    6
  86.  
  87. #define TM_JANUARY    0
  88. #define TM_FEBRUARY    1
  89. #define TM_MARCH    2
  90. #define TM_APRIL    3
  91. #define TM_MAY        4
  92. #define TM_JUNE        5
  93. #define TM_JULY        6
  94. #define TM_AUGUST    7
  95. #define TM_SEPTEMBER    8
  96. #define TM_OCTOBER    9
  97. #define TM_NOVEMBER    10
  98. #define TM_DECEMBER    11
  99.  
  100. #define TM_YEAR_BASE    1900
  101.  
  102. #define EPOCH_YEAR    1970
  103. #define EPOCH_WDAY    TM_THURSDAY
  104.  
  105. /*
  106. ** Accurate only for the past couple of centuries;
  107. ** that will probably do.
  108. */
  109.  
  110. #define isleap(y) (((y) % 4) == 0 && ((y) % 100) != 0 || ((y) % 400) == 0)
  111.  
  112. #endif /* _TZFILE_H */
  113.