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
15 /* Include stuff ************************************************************ */
16 #include <time.h>
17 #include "php.h"
18
19 /* Struct stuff ************************************************************* */
20 struct timezone {
21 int tz_minuteswest;
22 int tz_dsttime;
23 };
24
25
26 struct itimerval {
27 struct timeval it_interval; /* next value */
28 struct timeval it_value; /* current value */
29 };
30
31 #if !defined(timespec) && _MSC_VER < 1900
32 struct timespec
33 {
34 time_t tv_sec; /* seconds */
35 long tv_nsec; /* nanoseconds */
36 };
37 #endif
38
39 #define ITIMER_REAL 0 /*generates sigalrm */
40 #define ITIMER_VIRTUAL 1 /*generates sigvtalrm */
41 #define ITIMER_VIRT 1 /*generates sigvtalrm */
42 #define ITIMER_PROF 2 /*generates sigprof */
43
44 /* Prototype stuff ********************************************************** */
45 PHPAPI extern int gettimeofday(struct timeval *time_Info, struct timezone *timezone_Info);
46
47 /* setitimer operates at 100 millisecond resolution */
48 PHPAPI extern int setitimer(int which, const struct itimerval *value,
49 struct itimerval *ovalue);
50
51 PHPAPI int nanosleep( const struct timespec * rqtp, struct timespec * rmtp );
52
53 PHPAPI int usleep(unsigned int useconds);
54
55 #ifdef PHP_EXPORTS
56 /* This symbols are needed only for the DllMain, but should not be exported
57 or be available when used with PHP binaries. */
58 BOOL php_win32_init_gettimeofday(void);
59 #endif
60
61 #endif