~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to fpcsrc/packages/base/httpd/httpd-2.0/apr/apr_time.inc

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{ Copyright 2000-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
{
 
18
 * @file apr_time.h
 
19
 * @brief APR Time Library
 
20
 }
 
21
 
 
22
{#include "apr.h"
 
23
#include "apr_pools.h"
 
24
#include "apr_errno.h"}
 
25
 
 
26
{
 
27
 * @defgroup apr_time Time Routines
 
28
 * @ingroup APR 
 
29
 }
 
30
 
 
31
{ month names }
 
32
//APR_DECLARE_DATA extern const char apr_month_snames[12][4];
 
33
{ day names }
 
34
//APR_DECLARE_DATA extern const char apr_day_snames[7][4];
 
35
 
 
36
 
 
37
{ number of microseconds since 00:00:00 january 1, 1970 UTC }
 
38
type
 
39
  apr_time_t = apr_int64_t;
 
40
  Papr_time_t = ^apr_time_t;
 
41
 
 
42
 
 
43
{ mechanism to properly type apr_time_t literals }
 
44
//#define APR_TIME_C(val) APR_INT64_C(val)
 
45
 
 
46
{ mechanism to properly print apr_time_t values }
 
47
//  APR_TIME_T_FMT = APR_INT64_T_FMT;
 
48
 
 
49
{ intervals for I/O timeouts, in microseconds }
 
50
  apr_interval_time_t = apr_int64_t;
 
51
  Papr_interval_time_t = ^apr_interval_time_t;
 
52
{ short interval for I/O timeouts, in microseconds }
 
53
  apr_short_interval_time_t = apr_int32_t;
 
54
 
 
55
{ number of microseconds per second }
 
56
//  APR_USEC_PER_SEC APR_TIME_C(1000000)
 
57
 
 
58
{ @return apr_time_t as a second }
 
59
//#define apr_time_sec(time) ((time) / APR_USEC_PER_SEC)
 
60
 
 
61
{ @return apr_time_t as a usec }
 
62
//#define apr_time_usec(time) ((time) % APR_USEC_PER_SEC)
 
63
 
 
64
{ @return apr_time_t as a msec }
 
65
//#define apr_time_msec(time) (((time) / 1000) % 1000)
 
66
 
 
67
{ @return apr_time_t as a msec }
 
68
//#define apr_time_as_msec(time) ((time) / 1000)
 
69
 
 
70
{ @return a second as an apr_time_t }
 
71
//#define apr_time_from_sec(sec) ((apr_time_t)(sec) * APR_USEC_PER_SEC)
 
72
 
 
73
{ @return a second and usec combination as an apr_time_t }
 
74
//#define apr_time_make(sec, usec) ((apr_time_t)(sec) * APR_USEC_PER_SEC \
 
75
//                                + (apr_time_t)(usec))
 
76
 
 
77
{
 
78
 * @return the current time
 
79
 }
 
80
function apr_time_now: apr_time_t;
 
81
 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
82
 external LibAPR name LibNamePrefix + 'apr_time_now' + LibSuff0;
 
83
 
 
84
{ @see apr_time_exp_t }
 
85
type
 
86
  Papr_time_exp_t = ^apr_time_exp_t;
 
87
 
 
88
{
 
89
 * a structure similar to ANSI struct tm with the following differences:
 
90
 *  - tm_usec isn't an ANSI field
 
91
 *  - tm_gmtoff isn't an ANSI field (it's a bsdism)
 
92
 }
 
93
  apr_time_exp_t = record
 
94
    { microseconds past tm_sec }
 
95
    tm_usec: apr_int32_t;
 
96
    { (0-61) seconds past tm_min }
 
97
    tm_sec: apr_int32_t;
 
98
    { (0-59) minutes past tm_hour }
 
99
    tm_min: apr_int32_t;
 
100
    { (0-23) hours past midnight }
 
101
    tm_hour: apr_int32_t;
 
102
    { (1-31) day of the month }
 
103
    tm_mday: apr_int32_t;
 
104
    { (0-11) month of the year }
 
105
    tm_mon: apr_int32_t;
 
106
    { year since 1900 }
 
107
    tm_year: apr_int32_t;
 
108
    { (0-6) days since sunday }
 
109
    tm_wday: apr_int32_t;
 
110
    { (0-365) days since jan 1 }
 
111
    tm_yday: apr_int32_t;
 
112
    { daylight saving time }
 
113
    tm_isdst: apr_int32_t;
 
114
    { seconds east of UTC }
 
115
    tm_gmtoff: apr_int32_t;
 
116
  end;
 
117
 
 
118
{
 
119
 * convert an ansi time_t to an apr_time_t
 
120
 * @param result the resulting apr_time_t
 
121
 * @param input the time_t to convert
 
122
 }
 
123
function apr_time_ansi_put(result: Papr_time_t;
 
124
 input: time_t): apr_status_t;
 
125
 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
126
 external LibAPR name LibNamePrefix + 'apr_time_ansi_put' + LibSuff8;
 
127
 
 
128
{
 
129
 * convert a time to its human readable components using an offset
 
130
 * from GMT
 
131
 * @param result the exploded time
 
132
 * @param input the time to explode
 
133
 * @param offs the number of seconds offset to apply
 
134
 }
 
135
function apr_time_exp_tz(result: Papr_time_exp_t;
 
136
 input: apr_time_t; offs: apr_int32_t): apr_status_t;
 
137
 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
138
 external LibAPR name LibNamePrefix + 'apr_time_exp_tz' + LibSuff16;
 
139
 
 
140
{ @deprecated @see apr_time_exp_tz }
 
141
function apr_explode_time(result: Papr_time_exp_t;
 
142
 input: apr_time_t; offs: apr_int32_t): apr_status_t;
 
143
 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
144
 external LibAPR name LibNamePrefix + 'apr_explode_time' + LibSuff16;
 
145
 
 
146
{
 
147
 * convert a time to its human readable components in GMT timezone
 
148
 * @param result the exploded time
 
149
 * @param input the time to explode
 
150
 }
 
151
function apr_time_exp_gmt(result: Papr_time_exp_t;
 
152
 input: apr_time_t): apr_status_t;
 
153
 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
154
 external LibAPR name LibNamePrefix + 'apr_time_exp_gmt' + LibSuff12;
 
155
 
 
156
{
 
157
 * convert a time to its human readable components in local timezone
 
158
 * @param result the exploded time
 
159
 * @param input the time to explode
 
160
 }
 
161
function apr_time_exp_lt(result: Papr_time_exp_t;
 
162
 input: apr_time_t): apr_status_t;
 
163
 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
164
 external LibAPR name LibNamePrefix + 'apr_time_exp_lt' + LibSuff12;
 
165
 
 
166
{ @deprecated @see apr_time_exp_lt }
 
167
function apr_explode_localtime(result: Papr_time_exp_t;
 
168
 input: apr_time_t): apr_status_t;
 
169
 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
170
 external LibAPR name LibNamePrefix + 'apr_explode_localtime' + LibSuff12;
 
171
 
 
172
{
 
173
 * Convert time value from human readable format to a numeric apr_time_t 
 
174
 * e.g. elapsed usec since epoch
 
175
 * @param result the resulting imploded time
 
176
 * @param input the input exploded time
 
177
 }
 
178
function apr_time_exp_get(result: Papr_time_t;
 
179
 input: Papr_time_exp_t): apr_status_t;
 
180
 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
181
 external LibAPR name LibNamePrefix + 'apr_time_exp_get' + LibSuff8;
 
182
 
 
183
{
 
184
 * Convert time value from human readable format to a numeric apr_time_t that
 
185
 * always represents GMT
 
186
 * @param result the resulting imploded time
 
187
 * @param input the input exploded time
 
188
 }
 
189
function apr_time_exp_gmt_get(result: Papr_time_t;
 
190
 input: Papr_time_exp_t): apr_status_t;
 
191
 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
192
 external LibAPR name LibNamePrefix + 'apr_time_exp_gmt_get' + LibSuff8;
 
193
 
 
194
{ @deprecated @see apr_time_exp_gmt_get }
 
195
function apr_implode_gmt(result: Papr_time_t;
 
196
 input: Papr_time_exp_t): apr_status_t;
 
197
 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
198
 external LibAPR name LibNamePrefix + 'apr_implode_gmt' + LibSuff8;
 
199
 
 
200
{
 
201
 * Sleep for the specified number of micro-seconds.
 
202
 * @param t desired amount of time to sleep.
 
203
 * @warning May sleep for longer than the specified time. 
 
204
 }
 
205
procedure apr_sleep(t: apr_interval_time_t);
 
206
 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
207
 external LibAPR name LibNamePrefix + 'apr_sleep' + LibSuff8;
 
208
 
 
209
{ length of a RFC822 Date }
 
210
const APR_RFC822_DATE_LEN = (30);
 
211
{
 
212
 * apr_rfc822_date formats dates in the RFC822
 
213
 * format in an efficient manner.  It is a fixed length
 
214
 * format which requires the indicated amount of storage,
 
215
 * including the trailing null byte.
 
216
 * @param date_str String to write to.
 
217
 * @param t the time to convert 
 
218
 }
 
219
function apr_rfc822_date(date_str: PChar; t: apr_time_t): apr_status_t;
 
220
 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
221
 external LibAPR name LibNamePrefix + 'apr_rfc822_date' + LibSuff12;
 
222
 
 
223
{ length of a CTIME date }
 
224
const APR_CTIME_LEN = (25);
 
225
{
 
226
 * apr_ctime formats dates in the ctime() format
 
227
 * in an efficient manner.  it is a fixed length format
 
228
 * and requires the indicated amount of storage including
 
229
 * the trailing null byte.
 
230
 * Unlike ANSI/ISO C ctime(), apr_ctime() does not include
 
231
 * a \n at the end of the string.
 
232
 * @param date_str String to write to.
 
233
 * @param t the time to convert 
 
234
 }
 
235
function apr_ctime(date_str: PChar; t: apr_time_t): apr_status_t;
 
236
 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
237
 external LibAPR name LibNamePrefix + 'apr_ctime' + LibSuff12;
 
238
 
 
239
{
 
240
 * formats the exploded time according to the format specified
 
241
 * @param s string to write to
 
242
 * @param retsize The length of the returned string
 
243
 * @param max The maximum length of the string
 
244
 * @param format The format for the time string
 
245
 * @param tm The time to convert
 
246
 }
 
247
function apr_strftime(s: PChar; retsize: apr_size_t;
 
248
 max: apr_size_t; const format: PChar;
 
249
 tm: Papr_time_exp_t): apr_status_t;
 
250
 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
251
 external LibAPR name LibNamePrefix + 'apr_strftime' + LibSuff20;
 
252
 
 
253
{
 
254
 * Improve the clock resolution for the lifetime of the given pool.
 
255
 * Generally this is only desireable on benchmarking and other very
 
256
 * time-sensitive applications, and has no impact on most platforms.
 
257
 * @param p The pool to associate the finer clock resolution 
 
258
 }
 
259
procedure apr_time_clock_hires(p: Papr_pool_t);
 
260
 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
261
 external LibAPR name LibNamePrefix + 'apr_time_clock_hires' + LibSuff4;
 
262