src/core/ngx_times.h - nginx-1.7.10

Data types defined

Macros defined

Source code


  1. /*
  2. * Copyright (C) Igor Sysoev
  3. * Copyright (C) Nginx, Inc.
  4. */


  5. #ifndef _NGX_TIMES_H_INCLUDED_
  6. #define _NGX_TIMES_H_INCLUDED_


  7. #include <ngx_config.h>
  8. #include <ngx_core.h>


  9. typedef struct {
  10.     time_t      sec;
  11.     ngx_uint_t  msec;
  12.     ngx_int_t   gmtoff;
  13. } ngx_time_t;


  14. void ngx_time_init(void);
  15. void ngx_time_update(void);
  16. void ngx_time_sigsafe_update(void);
  17. u_char *ngx_http_time(u_char *buf, time_t t);
  18. u_char *ngx_http_cookie_time(u_char *buf, time_t t);
  19. void ngx_gmtime(time_t t, ngx_tm_t *tp);

  20. time_t ngx_next_time(time_t when);
  21. #define ngx_next_time_n      "mktime()"


  22. extern volatile ngx_time_t  *ngx_cached_time;

  23. #define ngx_time()           ngx_cached_time->sec
  24. #define ngx_timeofday()      (ngx_time_t *) ngx_cached_time

  25. extern volatile ngx_str_t    ngx_cached_err_log_time;
  26. extern volatile ngx_str_t    ngx_cached_http_time;
  27. extern volatile ngx_str_t    ngx_cached_http_log_time;
  28. extern volatile ngx_str_t    ngx_cached_http_log_iso8601;
  29. extern volatile ngx_str_t    ngx_cached_syslog_time;

  30. /*
  31. * milliseconds elapsed since epoch and truncated to ngx_msec_t,
  32. * used in event timers
  33. */
  34. extern volatile ngx_msec_t  ngx_current_msec;


  35. #endif /* _NGX_TIMES_H_INCLUDED_ */