Apache HTTPD
apr_time.h
Go to the documentation of this file.
1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef APR_TIME_H
18#define APR_TIME_H
19
25#include "apr.h"
26#include "apr_errno.h"
27
28#ifdef __cplusplus
29extern "C" {
30#endif /* __cplusplus */
31
39APR_DECLARE_DATA extern const char apr_month_snames[12][4];
41APR_DECLARE_DATA extern const char apr_day_snames[7][4];
42
43
46
47
49#define APR_TIME_C(val) APR_INT64_C(val)
50
52#define APR_TIME_T_FMT APR_INT64_T_FMT
53
58
60#define APR_USEC_PER_SEC APR_TIME_C(1000000)
61
63#define apr_time_sec(time) ((time) / APR_USEC_PER_SEC)
64
66#define apr_time_usec(time) ((time) % APR_USEC_PER_SEC)
67
69#define apr_time_msec(time) (((time) / 1000) % 1000)
70
72#define apr_time_as_msec(time) ((time) / 1000)
73
75#define apr_time_from_msec(msec) ((apr_time_t)(msec) * 1000)
76
78#define apr_time_from_sec(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC)
79
81#define apr_time_make(sec, usec) ((apr_time_t)(sec) * APR_USEC_PER_SEC \
82 + (apr_time_t)(usec))
83
88
91
121
122/* Delayed the include to avoid a circular reference */
123#include "apr_pools.h"
124
132
143
151
159
168
177
184
186#define APR_RFC822_DATE_LEN (30)
196
198#define APR_CTIME_LEN (25)
210
220 apr_size_t max, const char *format,
222
230
233#ifdef __cplusplus
234}
235#endif
236
237#endif /* ! APR_TIME_H */
APR Error Codes.
APR memory allocation.
apr_size_t size
int apr_status_t
Definition apr_errno.h:44
apr_array_header_t ** result
const char * s
Definition apr_strings.h:95
apr_int32_t apr_short_interval_time_t
Definition apr_time.h:57
apr_size_t apr_size_t const char apr_time_exp_t * tm
Definition apr_time.h:221
APR_DECLARE_DATA const char apr_month_snames[12][4]
Definition timestr.c:33
apr_size_t apr_size_t const char * format
Definition apr_time.h:220
APR_DECLARE_DATA const char apr_day_snames[7][4]
Definition timestr.c:37
APR_DECLARE(void) apr_sleep(apr_interval_time_t t)
Definition apr_pools.h:646
apr_time_t apr_int32_t offs
Definition apr_time.h:142
apr_int64_t apr_interval_time_t
Definition apr_time.h:55
time_t input
Definition apr_time.h:131
apr_size_t apr_size_t max
Definition apr_time.h:220
apr_time_t t
Definition apr_time.h:195
apr_size_t * retsize
Definition apr_time.h:219
apr_int64_t apr_time_t
Definition apr_time.h:45
apr_pool_t * p
Definition md_event.c:32
apr_int32_t tm_gmtoff
Definition apr_time.h:119
apr_int32_t tm_sec
Definition apr_time.h:101
apr_int32_t tm_hour
Definition apr_time.h:105
apr_int32_t tm_year
Definition apr_time.h:111
apr_int32_t tm_isdst
Definition apr_time.h:117
apr_int32_t tm_min
Definition apr_time.h:103
apr_int32_t tm_wday
Definition apr_time.h:113
apr_int32_t tm_mday
Definition apr_time.h:107
apr_int32_t tm_mon
Definition apr_time.h:109
apr_int32_t tm_yday
Definition apr_time.h:115
apr_int32_t tm_usec
Definition apr_time.h:99
apr_status_t apr_strftime(char *s, apr_size_t *retsize, apr_size_t max, const char *format, apr_time_exp_t *xt)
Definition timestr.c:132
apr_status_t apr_ctime(char *date_str, apr_time_t t)
Definition timestr.c:90
apr_status_t apr_rfc822_date(char *date_str, apr_time_t t)
Definition timestr.c:42