time.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*****************************************************************************
  2. * *
  3. * sys/time.h *
  4. * *
  5. * Freely redistributable and modifiable. Use at your own risk. *
  6. * *
  7. * Copyright 1994 The Downhill Project *
  8. *
  9. * Modified by Shane Caraveo for PHP
  10. *
  11. *****************************************************************************/
  12. #ifndef TIME_H
  13. #define TIME_H
  14. /* Include stuff ************************************************************ */
  15. #include <time.h>
  16. #include "php.h"
  17. /* Struct stuff ************************************************************* */
  18. struct timezone {
  19. int tz_minuteswest;
  20. int tz_dsttime;
  21. };
  22. struct itimerval {
  23. struct timeval it_interval; /* next value */
  24. struct timeval it_value; /* current value */
  25. };
  26. #if !defined(timespec) && _MSC_VER < 1900
  27. struct timespec
  28. {
  29. time_t tv_sec; /* seconds */
  30. long tv_nsec; /* nanoseconds */
  31. };
  32. #endif
  33. #define ITIMER_REAL 0 /*generates sigalrm */
  34. #define ITIMER_VIRTUAL 1 /*generates sigvtalrm */
  35. #define ITIMER_VIRT 1 /*generates sigvtalrm */
  36. #define ITIMER_PROF 2 /*generates sigprof */
  37. typedef long suseconds_t;
  38. /* Prototype stuff ********************************************************** */
  39. PHPAPI extern int gettimeofday(struct timeval *time_Info, struct timezone *timezone_Info);
  40. /* setitimer operates at 100 millisecond resolution */
  41. PHPAPI extern int setitimer(int which, const struct itimerval *value,
  42. struct itimerval *ovalue);
  43. PHPAPI int nanosleep( const struct timespec * rqtp, struct timespec * rmtp );
  44. PHPAPI int usleep(unsigned int useconds);
  45. #ifdef PHP_EXPORTS
  46. /* This symbols are needed only for the DllMain, but should not be exported
  47. or be available when used with PHP binaries. */
  48. void php_win32_init_gettimeofday(void);
  49. #endif
  50. #endif