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

« back to all changes in this revision

Viewing changes to fpcsrc/packages/base/httpd/httpd-1.3/httpd.pas

  • 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
{
 
2
 httpd.pas
 
3
 
 
4
 Copyright (C) 2006 Felipe Monteiro de Carvalho
 
5
 
 
6
 This unit is a pascal binding for the Apache 1.3.37 headers.
 
7
 The headers were released under the following copyright:
 
8
}
 
9
{ Licensed to the Apache Software Foundation (ASF) under one or more
 
10
 * contributor license agreements.  See the NOTICE file distributed with
 
11
 * this work for additional information regarding copyright ownership.
 
12
 * The ASF licenses this file to You under the Apache License, Version 2.0
 
13
 * (the "License"); you may not use this file except in compliance with
 
14
 * the License.  You may obtain a copy of the License at
 
15
 *
 
16
 *     http://www.apache.org/licenses/LICENSE-2.0
 
17
 *
 
18
 * Unless required by applicable law or agreed to in writing, software
 
19
 * distributed under the License is distributed on an "AS IS" BASIS,
 
20
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
21
 * See the License for the specific language governing permissions and
 
22
 * limitations under the License.
 
23
 }
 
24
unit httpd;
 
25
 
 
26
{$ifdef fpc}
 
27
  {$mode delphi}{$H+}
 
28
{$endif}
 
29
 
 
30
{$IFNDEF FPC}
 
31
  {$DEFINE WINDOWS}
 
32
{$ENDIF}
 
33
 
 
34
{$IFDEF WIN32}
 
35
  {$DEFINE WINDOWS}
 
36
{$ENDIF}
 
37
 
 
38
{$IFDEF WIN64}
 
39
  {$DEFINE WINDOWS}
 
40
{$ENDIF}
 
41
 
 
42
{$ifdef Unix}
 
43
  {$PACKRECORDS C}
 
44
{$endif}
 
45
 
 
46
{$define Apache1_3}
 
47
 
 
48
interface
 
49
 
 
50
uses
 
51
{$ifdef WINDOWS}
 
52
  Windows,
 
53
{$ELSE}
 
54
  UnixType,
 
55
{$ENDIF}
 
56
  ctypes;
 
57
 
 
58
const
 
59
{$ifndef fpc}
 
60
  LineEnding = #13#10;
 
61
{$endif}
 
62
 
 
63
{$IFDEF WINDOWS}
 
64
  LibHTTPD = 'ApacheCore.dll';
 
65
{$ELSE}
 
66
  LibHTTPD = '';
 
67
{$ENDIF}
 
68
 
 
69
{ Declarations moved here to be on top of all declarations }
 
70
 
 
71
{ Various types}
 
72
type
 
73
  time_t = LongInt;
 
74
  size_t = Integer;
 
75
 
 
76
{ configuration vector structure }
 
77
type
 
78
  ap_conf_vector_t = record end;
 
79
  Pap_conf_vector_t = ^ap_conf_vector_t;
 
80
  PPap_conf_vector_t = ^Pap_conf_vector_t;
 
81
 
 
82
{
 
83
  Main httpd header files
 
84
 
 
85
  Note: There are more include files other then these, because some include files
 
86
 include more files.
 
87
}
 
88
 
 
89
{.$include ap_provider.inc}
 
90
{.$include util_cfgtree.inc}
 
91
 
 
92
{$include httpd.inc}
 
93
{$include http_config.inc}
 
94
{$include http_core.inc}
 
95
{$include http_log.inc}
 
96
{$include http_main.inc}
 
97
{$include http_protocol.inc}
 
98
{$include http_request.inc}
 
99
{$include http_vhost.inc}
 
100
 
 
101
{.$include util_script.inc}
 
102
{.$include util_time.inc}
 
103
{.$include util_md5.inc}
 
104
{.$include ap_mpm.inc}
 
105
 
 
106
implementation
 
107
 
 
108
{
 
109
  Macros transformed into functions in the translation
 
110
}
 
111
 
 
112
{ from httpd.inc }
 
113
 
 
114
{ Internal representation for a HTTP protocol number, e.g., HTTP/1.1 }
 
115
function HTTP_VERSION(major, minor: Integer): Integer;
 
116
begin
 
117
  Result := (1000*(major)+(minor));
 
118
end;
 
119
 
 
120
{ Major part of HTTP protocol }
 
121
function HTTP_VERSION_MAJOR(number: Integer): Integer;
 
122
begin
 
123
  Result := number div 1000;
 
124
end;
 
125
 
 
126
{ Minor part of HTTP protocol }
 
127
function HTTP_VERSION_MINOR(number: Integer): Integer;
 
128
begin
 
129
  Result := number mod 1000;
 
130
end;
 
131
 
 
132
{function ap_escape_uri(p: Papr_pool_t; const path: PChar): PChar;
 
133
begin
 
134
  Result := ap_os_escape_path(p, path, 1);
 
135
end;}
 
136
 
 
137
{ from http_config.inc }
 
138
 
 
139
{ Use this in all standard modules }
 
140
 
 
141
procedure STANDARD_MODULE_STUFF(var mod_: module);
 
142
begin
 
143
  mod_.version := MODULE_MAGIC_NUMBER_MAJOR;
 
144
  mod_.minor_version := MODULE_MAGIC_NUMBER_MINOR;
 
145
  mod_.module_index := -1;
 
146
//  mod_.name: PChar;
 
147
  mod_.dynamic_load_handle := nil;
 
148
  mod_.next := nil;
 
149
  mod_.magic := MODULE_MAGIC_COOKIE;
 
150
end;
 
151
 
 
152
{ Use this only in MPMs }
 
153
//procedure MPM20_MODULE_STUFF(var mod_: module);
 
154
//begin
 
155
//  mod_.version := MODULE_MAGIC_NUMBER_MAJOR;
 
156
//  mod_.minor_version := MODULE_MAGIC_NUMBER_MINOR;
 
157
//  mod_.module_index := -1;
 
158
//  mod_.name: PChar;
 
159
//  mod_.dynamic_load_handle := nil;
 
160
//  mod_.next := nil;
 
161
//  mod_.magic := MODULE_MAGIC_COOKIE;
 
162
//end;
 
163
 
 
164
function ap_get_module_config(v: Pap_conf_vector_t; m: Pmodule): Pap_conf_vector_t;
 
165
begin
 
166
  Result := Pointer(PtrInt(v) + m^.module_index);
 
167
end;
 
168
 
 
169
procedure ap_set_module_config(v: Pap_conf_vector_t; m: Pmodule; val: Pap_conf_vector_t);
 
170
var
 
171
  P: PPointer;
 
172
begin
 
173
  P := PPointer(PtrInt(v) + m^.module_index);
 
174
  P^ := val;
 
175
end;
 
176
 
 
177
end.
 
178