Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
3.0 KiB

  1. /***
  2. *timeset.c - contains defaults for timezone setting
  3. *
  4. * Copyright (c) 1985-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * Contains the timezone values for default timezone.
  8. * Also contains month and day name three letter abbreviations.
  9. *
  10. *Revision History:
  11. * 12-03-86 JMB added Japanese defaults and module header
  12. * 09-22-87 SKS fixed declarations, include <time.h>
  13. * 02-21-88 SKS Clean up ifdef-ing, change IBMC20 to IBMC2
  14. * 07-05-89 PHG Remove _NEAR_ for 386
  15. * 08-15-89 GJF Fixed copyright, indents. Got rid of _NEAR.
  16. * 03-20-90 GJF Added #include <cruntime.h> and fixed the copyright.
  17. * 05-18-90 GJF Added _VARTYPE1 to publics to match declaration in
  18. * time.h (picky 6.0 front-end!).
  19. * 01-21-91 GJF ANSI naming.
  20. * 08-10-92 PBS Posix support(TZ stuff).
  21. * 04-06-93 SKS Remove _VARTYPE1
  22. * 06-08-93 KRS Tie JAPAN switch to _KANJI switch.
  23. * 09-13-93 GJF Merged NT SDK and Cuda versions.
  24. * 04-08-94 GJF Made non-POSIX definitions of _timezone, _daylight
  25. * and _tzname conditional on ndef DLL_FOR_WIN32S.
  26. * 10-04-94 CFW Removed #ifdef _KANJI
  27. * 02-13-95 GJF Fixed def of tzname[] so that string constants would
  28. * not get overwritten (dangerous if string-pooling is
  29. * turned on in build). Made it big enough to hold
  30. * timezone names which work with Posix. Also, made
  31. * __mnames[] and __dnames[] const.
  32. * 03-01-95 BWT Fix POSIX by including limits.h
  33. * 08-30-95 GJF Added _dstbias for Win32. Also increased limit on
  34. * timezone strings to 63.
  35. * 05-13-99 PML Remove Win32s
  36. *
  37. *******************************************************************************/
  38. #include <cruntime.h>
  39. #include <stdlib.h>
  40. #include <time.h>
  41. #include <internal.h>
  42. #ifndef _POSIX_
  43. long _timezone = 8 * 3600L; /* Pacific Time Zone */
  44. int _daylight = 1; /* Daylight Saving Time (DST) in timezone */
  45. long _dstbias = -3600L; /* DST offset in seconds */
  46. /* note that NT Posix's TZNAME_MAX is only 10 */
  47. static char tzstd[64] = { "PST" };
  48. static char tzdst[64] = { "PDT" };
  49. char *_tzname[2] = { tzstd, tzdst };
  50. #else /* _POSIX_ */
  51. #include <limits.h>
  52. long _timezone = 8*3600L; /* Pacific Time */
  53. int _daylight = 1; /* Daylight Savings Time */
  54. /* when appropriate */
  55. static char tzstd[TZNAME_MAX + 1] = { "PST" };
  56. static char tzdst[TZNAME_MAX + 1] = { "PDT" };
  57. char *tzname[2] = { tzstd, tzdst };
  58. char *_rule;
  59. long _dstoffset = 3600L;
  60. #endif /* _POSIX_ */
  61. /* Day names must be Three character abbreviations strung together */
  62. const char __dnames[] = {
  63. "SunMonTueWedThuFriSat"
  64. };
  65. /* Month names must be Three character abbreviations strung together */
  66. const char __mnames[] = {
  67. "JanFebMarAprMayJunJulAugSepOctNovDec"
  68. };