/contrib/cvs/lib/xtime.h

https://bitbucket.org/freebsd/freebsd-head/ · C++ Header · 61 lines · 33 code · 8 blank · 20 comment · 7 complexity · 01489ea1541477ca495c8dfb77ade4c1 MD5 · raw file

  1. /* This program is free software; you can redistribute it and/or modify
  2. it under the terms of the GNU General Public License as published by
  3. the Free Software Foundation; either version 2, or (at your option)
  4. any later version.
  5. This program is distributed in the hope that it will be useful,
  6. but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8. GNU General Public License for more details. */
  9. /* This file simply performs the include magic necessary for using time
  10. * functions
  11. */
  12. #ifndef XTIME_HEADER_INCLUDED
  13. #define XTIME_HEADER_INCLUDED
  14. #ifdef vms
  15. # include <time.h>
  16. #else /* vms */
  17. # if TIME_WITH_SYS_TIME
  18. # include <sys/time.h>
  19. # include <time.h>
  20. # else /* TIME_WITH_SYS_TIME */
  21. # if HAVE_SYS_TIME_H
  22. # include <sys/time.h>
  23. # else /* HAVE_SYS_TIME_H */
  24. # include <time.h>
  25. # endif /* !HAVE_SYS_TIME_H */
  26. # endif /* !TIME_WITH_SYS_TIME */
  27. # ifdef HAVE_SYS_TIMEB_H
  28. # include <sys/timeb.h>
  29. # else /* HAVE_SYS_TIMEB_H */
  30. /*
  31. * We use the obsolete `struct timeb' as part of our interface!
  32. * Since the system doesn't have it, we define it here;
  33. * our callers must do likewise.
  34. *
  35. * At the least we were using this in lib/getdate.y, but lib/system.h used to
  36. * define it too, so maybe CVS is using it elsewhere.
  37. */
  38. struct timeb {
  39. time_t time; /* Seconds since the epoch */
  40. unsigned short millitm; /* Field not used */
  41. short timezone; /* Minutes west of GMT */
  42. short dstflag; /* Field not used */
  43. };
  44. # endif /* !HAVE_SYS_TIMEB_H */
  45. # ifdef timezone
  46. # undef timezone /* needed for sgi */
  47. # endif /* timezone */
  48. # if !defined(HAVE_FTIME) && !defined(HAVE_TIMEZONE)
  49. extern long timezone;
  50. # endif /* !defined(HAVE_FTIME) && !defined(HAVE_TIMEZONE) */
  51. #endif /* !vms */
  52. #endif /* !XTIME_HEADER_INCLUDED */