Apache2
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
29 extern "C" {
30 #endif /* __cplusplus */
31 
39 APR_DECLARE_DATA extern const char apr_month_snames[12][4];
41 APR_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 
90 typedef struct apr_time_exp_t apr_time_exp_t;
91 
120 };
121 
122 /* Delayed the include to avoid a circular reference */
123 #include "apr_pools.h"
124 
131  time_t input);
132 
141  apr_time_t input,
142  apr_int32_t offs);
143 
150  apr_time_t input);
151 
158  apr_time_t input);
159 
167  apr_time_exp_t *input);
168 
176  apr_time_exp_t *input);
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,
221  apr_time_exp_t *tm);
222 
230 
233 #ifdef __cplusplus
234 }
235 #endif
236 
237 #endif /* ! APR_TIME_H */
APR Platform Definitions.
APR Error Codes.
APR memory allocation.
const char * s
Definition: mod_dav.h:1327
int apr_status_t
Definition: apr_errno.h:44
int apr_int32_t
Definition: apr.h:347
size_t apr_size_t
Definition: apr.h:394
int64_t apr_int64_t
Definition: apr.h:386
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
apr_status_t apr_time_exp_gmt_get(apr_time_t *result, apr_time_exp_t *input)
apr_status_t apr_time_exp_lt(apr_time_exp_t *result, apr_time_t input)
apr_int32_t apr_short_interval_time_t
Definition: apr_time.h:57
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_DATA const char apr_month_snames[12][4]
APR_DECLARE_DATA const char apr_day_snames[7][4]
void apr_sleep(apr_interval_time_t t)
apr_int64_t apr_interval_time_t
Definition: apr_time.h:55
apr_status_t apr_time_exp_tz(apr_time_exp_t *result, apr_time_t input, apr_int32_t offs)
apr_status_t apr_time_exp_get(apr_time_t *result, apr_time_exp_t *input)
apr_status_t apr_time_ansi_put(apr_time_t *result, time_t input)
void apr_time_clock_hires(apr_pool_t *p)
apr_time_t apr_time_now(void)
apr_status_t apr_ctime(char *date_str, apr_time_t t)
apr_status_t apr_rfc822_date(char *date_str, apr_time_t t)
apr_int64_t apr_time_t
Definition: apr_time.h:45
apr_status_t apr_time_exp_gmt(apr_time_exp_t *result, apr_time_t input)
#define APR_DECLARE_DATA
Definition: macros.h:17
#define APR_DECLARE(x)
Definition: macros.h:6
Definition: apr_time.h:97
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_pool_t * p