1
/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
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.
22
* @brief APR-UTIL date routines
26
* @defgroup APR_Util_Date Date routines
32
* apr_date.h: prototypes for date parsing utility routines
43
#define APR_DATE_BAD ((apr_time_t)0)
46
* Compare a string to a mask
47
* @param data The string to compare
48
* @param mask Mask characters (arbitrary maximum is 256 characters):
50
* '\@' - uppercase letter
51
* '\$' - lowercase letter
54
* '~' - digit or space
55
* '*' - swallow remaining characters
57
* @remark The mask tests for an exact match for any other character
58
* @return 1 if the string matches, 0 otherwise
60
APU_DECLARE(int) apr_date_checkmask(const char *data, const char *mask);
63
* Parses an HTTP date in one of three standard forms:
65
* Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123
66
* Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
67
* Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
69
* @param date The date in one of the three formats above
70
* @return the apr_time_t number of microseconds since 1 Jan 1970 GMT, or
71
* 0 if this would be out of range or if the date is invalid.
73
APU_DECLARE(apr_time_t) apr_date_parse_http(const char *date);
76
* Parses a string resembling an RFC 822 date. This is meant to be
77
* leinent in its parsing of dates. Hence, this will parse a wider
78
* range of dates than apr_date_parse_http.
80
* The prominent mailer (or poster, if mailer is unknown) that has
81
* been seen in the wild is included for the unknown formats.
83
* Sun, 06 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123
84
* Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
85
* Sun Nov 6 08:49:37 1994 ; ANSI C's asctime() format
86
* Sun, 6 Nov 1994 08:49:37 GMT ; RFC 822, updated by RFC 1123
87
* Sun, 06 Nov 94 08:49:37 GMT ; RFC 822
88
* Sun, 6 Nov 94 08:49:37 GMT ; RFC 822
89
* Sun, 06 Nov 94 08:49 GMT ; Unknown [drtr\@ast.cam.ac.uk]
90
* Sun, 6 Nov 94 08:49 GMT ; Unknown [drtr\@ast.cam.ac.uk]
91
* Sun, 06 Nov 94 8:49:37 GMT ; Unknown [Elm 70.85]
92
* Sun, 6 Nov 94 8:49:37 GMT ; Unknown [Elm 70.85]
95
* @param date The date in one of the formats above
96
* @return the apr_time_t number of microseconds since 1 Jan 1970 GMT, or
97
* 0 if this would be out of range or if the date is invalid.
99
APU_DECLARE(apr_time_t) apr_date_parse_rfc(const char *date);
106
#endif /* !APR_DATE_H */