Back to home page

Nginx displayed by LXR

Source navigation ]
Diff markup ]
Identifier search ]
general search ]
 
 
Version: nginx-1.15.12 ]​[ nginx-1.16.0 ]​

0001 
0002 /*
0003  * Copyright (C) Igor Sysoev
0004  * Copyright (C) Nginx, Inc.
0005  */
0006 
0007 
0008 #ifndef _NGX_TIME_H_INCLUDED_
0009 #define _NGX_TIME_H_INCLUDED_
0010 
0011 
0012 #include <ngx_config.h>
0013 #include <ngx_core.h>
0014 
0015 
0016 typedef ngx_rbtree_key_t      ngx_msec_t;
0017 typedef ngx_rbtree_key_int_t  ngx_msec_int_t;
0018 
0019 typedef struct tm             ngx_tm_t;
0020 
0021 #define ngx_tm_sec            tm_sec
0022 #define ngx_tm_min            tm_min
0023 #define ngx_tm_hour           tm_hour
0024 #define ngx_tm_mday           tm_mday
0025 #define ngx_tm_mon            tm_mon
0026 #define ngx_tm_year           tm_year
0027 #define ngx_tm_wday           tm_wday
0028 #define ngx_tm_isdst          tm_isdst
0029 
0030 #define ngx_tm_sec_t          int
0031 #define ngx_tm_min_t          int
0032 #define ngx_tm_hour_t         int
0033 #define ngx_tm_mday_t         int
0034 #define ngx_tm_mon_t          int
0035 #define ngx_tm_year_t         int
0036 #define ngx_tm_wday_t         int
0037 
0038 
0039 #if (NGX_HAVE_GMTOFF)
0040 #define ngx_tm_gmtoff         tm_gmtoff
0041 #define ngx_tm_zone           tm_zone
0042 #endif
0043 
0044 
0045 #if (NGX_SOLARIS)
0046 
0047 #define ngx_timezone(isdst) (- (isdst ? altzone : timezone) / 60)
0048 
0049 #else
0050 
0051 #define ngx_timezone(isdst) (- (isdst ? timezone + 3600 : timezone) / 60)
0052 
0053 #endif
0054 
0055 
0056 void ngx_timezone_update(void);
0057 void ngx_localtime(time_t s, ngx_tm_t *tm);
0058 void ngx_libc_localtime(time_t s, struct tm *tm);
0059 void ngx_libc_gmtime(time_t s, struct tm *tm);
0060 
0061 #define ngx_gettimeofday(tp)  (void) gettimeofday(tp, NULL);
0062 #define ngx_msleep(ms)        (void) usleep(ms * 1000)
0063 #define ngx_sleep(s)          (void) sleep(s)
0064 
0065 
0066 #endif /* _NGX_TIME_H_INCLUDED_ */