Adjust fileList from perl
[msysgit.git] / include / apr-0 / apr_date.h
blob87500a3394840efd1f444e7752a0727cf864b3ab
1 /* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
2 * applicable.
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.
17 #ifndef APR_DATE_H
18 #define APR_DATE_H
20 /**
21 * @file apr_date.h
22 * @brief APR-UTIL date routines
25 /**
26 * @defgroup APR_Util_Date Date routines
27 * @ingroup APR_Util
28 * @{
32 * apr_date.h: prototypes for date parsing utility routines
35 #include "apu.h"
36 #include "apr_time.h"
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
42 /** A bad date. */
43 #define APR_DATE_BAD ((apr_time_t)0)
45 /**
46 * Compare a string to a mask
47 * @param data The string to compare
48 * @param mask Mask characters (arbitrary maximum is 256 characters):
49 * <PRE>
50 * '\@' - uppercase letter
51 * '\$' - lowercase letter
52 * '\&' - hex digit
53 * '#' - digit
54 * '~' - digit or space
55 * '*' - swallow remaining characters
56 * </PRE>
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);
62 /**
63 * Parses an HTTP date in one of three standard forms:
64 * <PRE>
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
68 * </PRE>
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);
75 /**
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.
82 * <PRE>
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]
93 * </PRE>
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);
101 /** @} */
102 #ifdef __cplusplus
104 #endif
106 #endif /* !APR_DATE_H */