1{ Copyright 2001-2005 The Apache Software Foundation or its licensors, as 2 * applicable. 3 * 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 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{#include "apr.h" 18#include "apr_time.h" 19#include "httpd.h"} 20 21{ 22 * @package Apache date-time handling functions 23 } 24 25{ Maximum delta from the current time, in seconds, for a past time 26 * to qualify as "recent" for use in the ap_explode_recent_*() functions: 27 * (Must be a power of two minus one!) 28 } 29const AP_TIME_RECENT_THRESHOLD = 15; 30 31{ 32 * convert a recent time to its human readable components in local timezone 33 * @param tm the exploded time 34 * @param t the time to explode: MUST be within the last 35 * AP_TIME_RECENT_THRESHOLD seconds 36 * @note This is a faster alternative to apr_explode_localtime that uses 37 * a cache of pre-exploded time structures. It is useful for things 38 * that need to explode the current time multiple times per second, 39 * like loggers. 40 * @return APR_SUCCESS iff successful 41 } 42function ap_explode_recent_localtime(tm: Papr_time_exp_t; t: apr_time_t): apr_status_t; 43 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF} 44 external LibHTTPD name LibNamePrefix + 'ap_explode_recent_localtime' + LibSuff12; 45 46{ 47 * convert a recent time to its human readable components in GMT timezone 48 * @param tm the exploded time 49 * @param t the time to explode: MUST be within the last 50 * AP_TIME_RECENT_THRESHOLD seconds 51 * @note This is a faster alternative to apr_time_exp_gmt that uses 52 * a cache of pre-exploded time structures. It is useful for things 53 * that need to explode the current time multiple times per second, 54 * like loggers. 55 * @return APR_SUCCESS iff successful 56 } 57function ap_explode_recent_gmt(tm: Papr_time_exp_t; t: apr_time_t): apr_status_t; 58 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF} 59 external LibHTTPD name LibNamePrefix + 'ap_explode_recent_gmt' + LibSuff12; 60 61{ 62 * format a recent timestamp in the ctime() format. 63 * @param date_str String to write to. 64 * @param t the time to convert 65 } 66function ap_recent_ctime(date_str: PChar; t: apr_time_t): apr_status_t; 67 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF} 68 external LibHTTPD name LibNamePrefix + 'ap_recent_ctime' + LibSuff12; 69 70{ 71 * format a recent timestamp in the RFC822 format 72 * @param date_str String to write to (must have length >= APR_RFC822_DATE_LEN) 73 * @param t the time to convert 74 } 75function ap_recent_rfc822_date(date_str: PChar; t: apr_time_t): apr_status_t; 76 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF} 77 external LibHTTPD name LibNamePrefix + 'ap_recent_rfc822_date' + LibSuff12; 78 79