123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237 |
- #ifndef APR_TIME_H
- #define APR_TIME_H
- #include "apr.h"
- #include "apr_errno.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
- APR_DECLARE_DATA extern const char apr_month_snames[12][4];
- APR_DECLARE_DATA extern const char apr_day_snames[7][4];
- typedef apr_int64_t apr_time_t;
- #define APR_TIME_C(val) APR_INT64_C(val)
- #define APR_TIME_T_FMT APR_INT64_T_FMT
- typedef apr_int64_t apr_interval_time_t;
- typedef apr_int32_t apr_short_interval_time_t;
- #define APR_USEC_PER_SEC APR_TIME_C(1000000)
- #define apr_time_sec(time) ((time) / APR_USEC_PER_SEC)
- #define apr_time_usec(time) ((time) % APR_USEC_PER_SEC)
- #define apr_time_msec(time) (((time) / 1000) % 1000)
- #define apr_time_as_msec(time) ((time) / 1000)
- #define apr_time_from_msec(msec) ((apr_time_t)(msec) * 1000)
- #define apr_time_from_sec(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC)
- #define apr_time_make(sec, usec) ((apr_time_t)(sec) * APR_USEC_PER_SEC \
- + (apr_time_t)(usec))
- APR_DECLARE(apr_time_t) apr_time_now(void);
- typedef struct apr_time_exp_t apr_time_exp_t;
- struct apr_time_exp_t {
-
- apr_int32_t tm_usec;
-
- apr_int32_t tm_sec;
-
- apr_int32_t tm_min;
-
- apr_int32_t tm_hour;
-
- apr_int32_t tm_mday;
-
- apr_int32_t tm_mon;
-
- apr_int32_t tm_year;
-
- apr_int32_t tm_wday;
-
- apr_int32_t tm_yday;
-
- apr_int32_t tm_isdst;
-
- apr_int32_t tm_gmtoff;
- };
- #include "apr_pools.h"
- APR_DECLARE(apr_status_t) apr_time_ansi_put(apr_time_t *result,
- time_t input);
- APR_DECLARE(apr_status_t) apr_time_exp_tz(apr_time_exp_t *result,
- apr_time_t input,
- apr_int32_t offs);
- APR_DECLARE(apr_status_t) apr_time_exp_gmt(apr_time_exp_t *result,
- apr_time_t input);
- APR_DECLARE(apr_status_t) apr_time_exp_lt(apr_time_exp_t *result,
- apr_time_t input);
- APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *result,
- apr_time_exp_t *input);
- APR_DECLARE(apr_status_t) apr_time_exp_gmt_get(apr_time_t *result,
- apr_time_exp_t *input);
- APR_DECLARE(void) apr_sleep(apr_interval_time_t t);
- #define APR_RFC822_DATE_LEN (30)
- APR_DECLARE(apr_status_t) apr_rfc822_date(char *date_str, apr_time_t t);
- #define APR_CTIME_LEN (25)
- APR_DECLARE(apr_status_t) apr_ctime(char *date_str, apr_time_t t);
- APR_DECLARE(apr_status_t) apr_strftime(char *s, apr_size_t *retsize,
- apr_size_t max, const char *format,
- apr_time_exp_t *tm);
- APR_DECLARE(void) apr_time_clock_hires(apr_pool_t *p);
- #ifdef __cplusplus
- }
- #endif
- #endif
|