Blame include/apr_date.h

Packit 383869
/* Licensed to the Apache Software Foundation (ASF) under one or more
Packit 383869
 * contributor license agreements.  See the NOTICE file distributed with
Packit 383869
 * this work for additional information regarding copyright ownership.
Packit 383869
 * The ASF licenses this file to You under the Apache License, Version 2.0
Packit 383869
 * (the "License"); you may not use this file except in compliance with
Packit 383869
 * the License.  You may obtain a copy of the License at
Packit 383869
 *
Packit 383869
 *     http://www.apache.org/licenses/LICENSE-2.0
Packit 383869
 *
Packit 383869
 * Unless required by applicable law or agreed to in writing, software
Packit 383869
 * distributed under the License is distributed on an "AS IS" BASIS,
Packit 383869
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit 383869
 * See the License for the specific language governing permissions and
Packit 383869
 * limitations under the License.
Packit 383869
 */
Packit 383869
Packit 383869
#ifndef APR_DATE_H
Packit 383869
#define APR_DATE_H
Packit 383869
Packit 383869
/**
Packit 383869
 * @file apr_date.h
Packit 383869
 * @brief APR-UTIL date routines
Packit 383869
 */
Packit 383869
Packit 383869
/**
Packit 383869
 * @defgroup APR_Util_Date Date routines
Packit 383869
 * @ingroup APR_Util
Packit 383869
 * @{
Packit 383869
 */
Packit 383869
Packit 383869
/*
Packit 383869
 * apr_date.h: prototypes for date parsing utility routines
Packit 383869
 */
Packit 383869
Packit 383869
#include "apu.h"
Packit 383869
#include "apr_time.h"
Packit 383869
Packit 383869
#ifdef __cplusplus
Packit 383869
extern "C" {
Packit 383869
#endif
Packit 383869
Packit 383869
/** A bad date. */
Packit 383869
#define APR_DATE_BAD ((apr_time_t)0)
Packit 383869
Packit 383869
/**
Packit 383869
 * Compare a string to a mask
Packit 383869
 * @param data The string to compare
Packit 383869
 * @param mask Mask characters (arbitrary maximum is 256 characters):
Packit 383869
 * 
Packit 383869
 *   '\@' - uppercase letter
Packit 383869
 *   '\$' - lowercase letter
Packit 383869
 *   '\&' - hex digit
Packit 383869
 *   '#' - digit
Packit 383869
 *   '~' - digit or space
Packit 383869
 *   '*' - swallow remaining characters
Packit 383869
 * 
Packit 383869
 * @remark The mask tests for an exact match for any other character
Packit 383869
 * @return 1 if the string matches, 0 otherwise
Packit 383869
 */
Packit 383869
APU_DECLARE(int) apr_date_checkmask(const char *data, const char *mask);
Packit 383869
Packit 383869
/**
Packit 383869
 * Parses an HTTP date in one of three standard forms:
Packit 383869
 * 
Packit 383869
 *     Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 822, updated by RFC 1123
Packit 383869
 *     Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
Packit 383869
 *     Sun Nov  6 08:49:37 1994       ; ANSI C's asctime() format
Packit 383869
 * 
Packit 383869
 * @param date The date in one of the three formats above
Packit 383869
 * @return the apr_time_t number of microseconds since 1 Jan 1970 GMT, or
Packit 383869
 *         0 if this would be out of range or if the date is invalid.
Packit 383869
 */
Packit 383869
APU_DECLARE(apr_time_t) apr_date_parse_http(const char *date);
Packit 383869
Packit 383869
/**
Packit 383869
 * Parses a string resembling an RFC 822 date.  This is meant to be
Packit 383869
 * leinent in its parsing of dates.  Hence, this will parse a wider 
Packit 383869
 * range of dates than apr_date_parse_http.
Packit 383869
 *
Packit 383869
 * The prominent mailer (or poster, if mailer is unknown) that has
Packit 383869
 * been seen in the wild is included for the unknown formats.
Packit 383869
 * 
Packit 383869
 *     Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 822, updated by RFC 1123
Packit 383869
 *     Sunday, 06-Nov-94 08:49:37 GMT ; RFC 850, obsoleted by RFC 1036
Packit 383869
 *     Sun Nov  6 08:49:37 1994       ; ANSI C's asctime() format
Packit 383869
 *     Sun, 6 Nov 1994 08:49:37 GMT   ; RFC 822, updated by RFC 1123
Packit 383869
 *     Sun, 06 Nov 94 08:49:37 GMT    ; RFC 822
Packit 383869
 *     Sun, 6 Nov 94 08:49:37 GMT     ; RFC 822
Packit 383869
 *     Sun, 06 Nov 94 08:49 GMT       ; Unknown [drtr\@ast.cam.ac.uk] 
Packit 383869
 *     Sun, 6 Nov 94 08:49 GMT        ; Unknown [drtr\@ast.cam.ac.uk]
Packit 383869
 *     Sun, 06 Nov 94 8:49:37 GMT     ; Unknown [Elm 70.85]
Packit 383869
 *     Sun, 6 Nov 94 8:49:37 GMT      ; Unknown [Elm 70.85] 
Packit 383869
 * 
Packit 383869
 *
Packit 383869
 * @param date The date in one of the formats above
Packit 383869
 * @return the apr_time_t number of microseconds since 1 Jan 1970 GMT, or
Packit 383869
 *         0 if this would be out of range or if the date is invalid.
Packit 383869
 */
Packit 383869
APU_DECLARE(apr_time_t) apr_date_parse_rfc(const char *date);
Packit 383869
Packit 383869
/** @} */
Packit 383869
#ifdef __cplusplus
Packit 383869
}
Packit 383869
#endif
Packit 383869
Packit 383869
#endif	/* !APR_DATE_H */