1{ Copyright 1999-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  Declarations from other files centered here
19}
20const
21  (* Hook orderings *)
22  (** run this hook first, before ANYTHING *)
23  APR_HOOK_REALLY_FIRST	= -10;
24  (** run this hook first *)
25  APR_HOOK_FIRST	= 0;
26  (** run this hook somewhere *)
27  APR_HOOK_MIDDLE	= 10;
28  (** run this hook after every other hook which is defined*)
29  APR_HOOK_LAST		= 20;
30  (** run this hook last, after EVERYTHING *)
31  APR_HOOK_REALLY_LAST	= 30;
32
33
34//#include "apr_hooks.h"
35{.$include util_cfgtree.inc}
36
37{
38 * @file http_config.h
39 * @brief Apache Configuration
40 }
41
42{
43 * @defgroup ConfigDirectives Allowed locations for configuration directives.
44 *
45 * The allowed locations for a configuration directive are the union of
46 * those indicated by each set bit in the req_override mask.
47 }
48const
49  OR_NONE = 0;            {< *.conf is not available anywhere in this override }
50  OR_LIMIT = 1;	          {< *.conf inside <Directory> or <Location>
51				and .htaccess when AllowOverride Limit }
52  OR_OPTIONS = 2;         {< *.conf anywhere
53                                and .htaccess when AllowOverride Options }
54  OR_FILEINFO = 4;        {< *.conf anywhere
55				and .htaccess when AllowOverride FileInfo }
56  OR_AUTHCFG = 8;         {< *.conf inside <Directory> or <Location>
57				and .htaccess when AllowOverride AuthConfig }
58  OR_INDEXES = 16;        {< *.conf anywhere
59				and .htaccess when AllowOverride Indexes }
60  OR_UNSET = 32;          {< unset a directive (in Allow) }
61  ACCESS_CONF = 64;       {< *.conf inside <Directory> or <Location> }
62  RSRC_CONF = 128;	     {< *.conf outside <Directory> or <Location> }
63  EXEC_ON_READ = 256;     {< force directive to execute a command
64                which would modify the configuration (like including another
65                file, or IFModule }
66{ this directive can be placed anywhere }
67  OR_ALL = (OR_LIMIT or OR_OPTIONS or OR_FILEINFO or OR_AUTHCFG or OR_INDEXES);
68
69{
70 * This can be returned by a function if they don't wish to handle
71 * a command. Make it something not likely someone will actually use
72 * as an error code.
73 }
74const
75  DECLINE_CMD = '\a\b';
76
77{
78 * The central data structures around here...
79}
80
81{ Command dispatch structures... }
82
83{
84 * How the directives arguments should be parsed.
85 * @remark Note that for all of these except RAW_ARGS, the config routine is
86 *      passed a freshly allocated string which can be modified or stored
87 *      or whatever...
88 }
89type
90  cmd_how = (
91    RAW_ARGS,			{< cmd_func parses command line itself }
92    TAKE1,			{< one argument only }
93    TAKE2,			{< two arguments only }
94    ITERATE,			{< one argument, occuring multiple times
95				 * (e.g., IndexIgnore)
96                                 }
97    ITERATE2,			{< two arguments, 2nd occurs multiple times
98				 * (e.g., AddIcon)
99                                 }
100    FLAG,			{< One of 'On' or 'Off' }
101    NO_ARGS,			{< No args at all, e.g. </Directory> }
102    TAKE12,			{< one or two arguments }
103    TAKE3,			{< three arguments only }
104    TAKE23,			{< two or three arguments }
105    TAKE123,			{< one, two or three arguments }
106    TAKE13			{< one or three arguments }
107  );
108
109{
110 * This structure is passed to a command which is being invoked,
111 * to carry a large variety of miscellaneous data which is all of
112 * use to *somebody*...
113 }
114  Pcmd_parms = ^cmd_parms_struct;
115
116//#if defined(AP_HAVE_DESIGNATED_INITIALIZER) || defined(DOXYGEN)
117
118{
119 * All the types of functions that can be used in directives
120 * @internal
121 }
122
123  { function to call for a no-args }
124  no_args_t = function (parms: Pcmd_parms; mconfig: Pointer): PChar; cdecl;
125  { function to call for a raw-args }
126  raw_args_t = function (parms: Pcmd_parms; mconfig: Pointer; const args: PChar): Pchar; cdecl;
127  { function to call for a take1 }
128  take1_t = function (parms: Pcmd_parms; mconfig: Pointer; const w: PChar): PChar; cdecl;
129  { function to call for a take2 }
130  take2_t = function (parms: Pcmd_parms; mconfig: Pointer; const w, w2: PChar): PChar; cdecl;
131  { function to call for a take3 }
132  take3_t = function (parms: Pcmd_parms; mconfig: Pointer; const w, w2, w3: PChar): PChar; cdecl;
133  { function to call for a flag }
134  flag_t = function (parms: Pcmd_parms; mconfig: Pointer; on_: Integer): PChar; cdecl;
135
136  cmd_func_kind = ( cfk_no_args, cfk_raw_args, cfk_take1, cfk_take2, cfk_take3, cfk_flag);
137  cmd_func = record
138    case cmd_func_kind of
139      cfk_no_args   : ( func_no_args : no_args_t );
140      cfk_raw_args  : ( func_raw_args : raw_args_t );
141      cfk_take1     : ( func_take1 : take1_t);
142      cfk_take2     : ( func_take2 : take2_t);
143      cfk_take3     : ( func_take3 : take3_t);
144      cfk_flag      : ( func_flag : flag_t);
145  end;
146  Pcmd_func = ^cmd_func;
147
148//const
149  { This configuration directive does not take any arguments }
150//  AP_NO_ARGS =	func.no_args;
151  { This configuration directive will handle it's own parsing of arguments}
152//  AP_RAW_ARGS =	func.raw_args;
153  { This configuration directive takes 1 argument}
154//  AP_TAKE1 =	func.take1;
155  { This configuration directive takes 2 arguments }
156//  AP_TAKE2 =	func.take2;
157  { This configuration directive takes 3 arguments }
158//  AP_TAKE3 =	func.take3;
159  { This configuration directive takes a flag (on/off) as a argument}
160//  AP_FLAG =	func.flag;
161
162{ method of declaring a directive with no arguments }
163//# define AP_INIT_NO_ARGS(directive, func, mconfig, where, help) \
164    // directive, { .no_args=func }, mconfig, where, RAW_ARGS, help }
165{ method of declaring a directive with raw argument parsing }
166//# define AP_INIT_RAW_ARGS(directive, func, mconfig, where, help) \
167    // directive, { .raw_args=func }, mconfig, where, RAW_ARGS, help }
168{ method of declaring a directive which takes 1 argument }
169//# define AP_INIT_TAKE1(directive, func, mconfig, where, help) \
170    // directive, { .take1=func }, mconfig, where, TAKE1, help }
171{ method of declaring a directive which takes multiple arguments }
172//# define AP_INIT_ITERATE(directive, func, mconfig, where, help) \
173    // directive, { .take1=func }, mconfig, where, ITERATE, help }
174{ method of declaring a directive which takes 2 arguments }
175//# define AP_INIT_TAKE2(directive, func, mconfig, where, help) \
176    // directive, { .take2=func }, mconfig, where, TAKE2, help }
177{ method of declaring a directive which takes 1 or 2 arguments }
178//# define AP_INIT_TAKE12(directive, func, mconfig, where, help) \
179    // directive, { .take2=func }, mconfig, where, TAKE12, help }
180{ method of declaring a directive which takes multiple 2 arguments }
181//# define AP_INIT_ITERATE2(directive, func, mconfig, where, help) \
182    // directive, { .take2=func }, mconfig, where, ITERATE2, help }
183{ method of declaring a directive which takes 1 or 3 arguments }
184//# define AP_INIT_TAKE13(directive, func, mconfig, where, help) \
185    // directive, { .take3=func }, mconfig, where, TAKE13, help }
186{ method of declaring a directive which takes 2 or 3 arguments }
187//# define AP_INIT_TAKE23(directive, func, mconfig, where, help) \
188    // directive, { .take3=func }, mconfig, where, TAKE23, help }
189{ method of declaring a directive which takes 1 to 3 arguments }
190//# define AP_INIT_TAKE123(directive, func, mconfig, where, help) \
191    // directive, { .take3=func }, mconfig, where, TAKE123, help }
192{ method of declaring a directive which takes 3 arguments }
193//# define AP_INIT_TAKE3(directive, func, mconfig, where, help) \
194    // directive, { .take3=func }, mconfig, where, TAKE3, help }
195{ method of declaring a directive which takes a flag (on/off) as a argument}
196//# define AP_INIT_FLAG(directive, func, mconfig, where, help) \
197    // directive, { .flag=func }, mconfig, where, FLAG, help }
198
199//#else { AP_HAVE_DESIGNATED_INITIALIZER }
200
201//typedef const char *( *cmd_func) ();
202
203//# define AP_NO_ARGS  func
204//# define AP_RAW_ARGS func
205//# define AP_TAKE1    func
206//# define AP_TAKE2    func
207//# define AP_TAKE3    func
208//# define AP_FLAG     func
209
210//# define AP_INIT_NO_ARGS(directive, func, mconfig, where, help) \
211    { directive, func, mconfig, where, RAW_ARGS, help }
212//# define AP_INIT_RAW_ARGS(directive, func, mconfig, where, help) \
213    { directive, func, mconfig, where, RAW_ARGS, help }
214//# define AP_INIT_TAKE1(directive, func, mconfig, where, help) \
215    { directive, func, mconfig, where, TAKE1, help }
216//# define AP_INIT_ITERATE(directive, func, mconfig, where, help) \
217    { directive, func, mconfig, where, ITERATE, help }
218//# define AP_INIT_TAKE2(directive, func, mconfig, where, help) \
219    { directive, func, mconfig, where, TAKE2, help }
220//# define AP_INIT_TAKE12(directive, func, mconfig, where, help) \
221    { directive, func, mconfig, where, TAKE12, help }
222//# define AP_INIT_ITERATE2(directive, func, mconfig, where, help) \
223    { directive, func, mconfig, where, ITERATE2, help }
224//# define AP_INIT_TAKE13(directive, func, mconfig, where, help) \
225    { directive, func, mconfig, where, TAKE13, help }
226//# define AP_INIT_TAKE23(directive, func, mconfig, where, help) \
227    { directive, func, mconfig, where, TAKE23, help }
228//# define AP_INIT_TAKE123(directive, func, mconfig, where, help) \
229    { directive, func, mconfig, where, TAKE123, help }
230//# define AP_INIT_TAKE3(directive, func, mconfig, where, help) \
231    { directive, func, mconfig, where, TAKE3, help }
232//# define AP_INIT_FLAG(directive, func, mconfig, where, help) \
233    { directive, func, mconfig, where, FLAG, help }
234
235//#endif { AP_HAVE_DESIGNATED_INITIALIZER }
236
237{
238 * The command record structure.  Each modules can define a table of these
239 * to define the directives it will implement.
240 }
241  command_struct = record
242    { Name of this command }
243    name: PChar;
244    { The function to be called when this directive is parsed }
245    func: cmd_func;
246    { Extra data, for functions which implement multiple commands... }
247    cmd_data: Pointer;
248    { What overrides need to be allowed to enable this command. }
249    req_override: Integer;
250    { What the command expects as arguments
251     *  @defvar cmd_how args_how}
252    args_how: cmd_how;
253
254    { 'usage' message, in case of syntax errors }
255    errmsg: PChar;
256  end;
257  command_rec = command_struct;
258  Pcommand_rec = ^command_rec;
259
260  { Constants here were moved up }
261
262  { Common structure for reading of config files / passwd files etc. }
263
264  getch_t = function (param: Pointer): Integer;
265
266  getstr_t = function (buf: Pointer; bufsiz: size_t; param: Pointer): Pointer;
267
268  close_t = function (param: Pointer): Integer;
269
270  ap_configfile_t = record
271    getch: getch_t;    {< a getc()-like function }
272    getstr: getstr_t;  {< a fgets()-like function }
273    close: close_t;    {< a close handler function }
274    param: Pointer;    {< the argument passed to getch/getstr/close }
275    name: PChar;       {< the filename / description }
276    line_number: cuint;{< current line number, starting at 1 }
277  end;
278
279  Pap_configfile_t = ^ap_configfile_t;
280  PPap_configfile_t = ^Pap_configfile_t;
281
282{
283 * This structure is passed to a command which is being invoked,
284 * to carry a large variety of miscellaneous data which is all of
285 * use to *somebody*...
286 }
287  cmd_parms_struct = record
288    { Argument to command from cmd_table }
289    info: Pointer;
290    { Which allow-override bits are set }
291    override_: Integer;
292    { Which methods are <Limit>ed }
293    limited: apr_int64_t;
294    { methods which are limited }
295    limited_xmethods: Papr_array_header_t;
296    { methods which are xlimited }
297    xlimited: Pap_method_list_t;
298
299    { Config file structure. }
300    config_file: Pap_configfile_t;
301    { the directive specifying this command }
302    directive: Pap_directive_t;
303
304    { Pool to allocate new storage in }
305    pool: Papr_pool_t;
306    { Pool for scratch memory; persists during configuration, but
307     *  wiped before the first request is served...  }
308    temp_pool: Papr_pool_t;
309    { Server_rec being configured for }
310    server: Pserver_rec;
311    { If configuring for a directory, pathname of that directory.
312     *  NOPE!  That's what it meant previous to the existance of <Files>,
313     * <Location> and regex matching.  Now the only usefulness that can be
314     * derived from this field is whether a command is being called in a
315     * server context (path == NULL) or being called in a dir context
316     * (path != NULL).  }
317    path: PChar;
318    { configuration command }
319    cmd: Pcommand_rec;
320
321    { per_dir_config vector passed to handle_command }
322    context: Pap_conf_vector_t;
323    { directive with syntax error }
324    err_directive: Pap_directive_t;
325  end;
326
327  cmd_parms = cmd_parms_struct;
328
329{
330 * Module structures.  Just about everything is dispatched through
331 * these, directly or indirectly (through the command and handler
332 * tables).
333 }
334type
335  Pmodule_struct = ^module_struct;
336
337  module_struct = record
338    { API version, *not* module version; check that module is
339     * compatible with this version of the server.
340     }
341    version: Integer;
342    { API minor version. Provides API feature milestones. Not checked
343     *  during module init }
344    minor_version: Integer;
345    { Index to this modules structures in config vectors.  }
346    module_index: Integer;
347
348    { The name of the module's C file }
349    name: PChar;
350    { The handle for the DSO.  Internal use only }
351    dynamic_load_handle: Pointer;
352
353    { A pointer to the next module in the list
354     *  @defvar module_struct *next }
355    next: Pmodule_struct;
356
357    { Magic Cookie to identify a module structure;  It's mainly
358     *  important for the DSO facility (see also mod_so).  }
359    magic: Cardinal;
360
361    { Function to allow MPMs to re-write command line arguments.  This
362     *  hook is only available to MPMs.
363     *  @param The process that the server is running in.
364     }
365    rewrite_args: procedure(process: Pprocess_rec); cdecl;
366
367    { Function to allow all modules to create per directory configuration
368     *  structures.
369     *  @param p The pool to use for all allocations.
370     *  @param dir The directory currently being processed.
371     *  @return The per-directory structure created
372     }
373    create_dir_config: function(p: Papr_pool_t; dir: PChar): Pointer; cdecl;
374
375    { Function to allow all modules to merge the per directory configuration
376     *  structures for two directories.
377     *  @param p The pool to use for all allocations.
378     *  @param base_conf The directory structure created for the parent directory.
379     *  @param new_conf The directory structure currently being processed.
380     *  @return The new per-directory structure created
381     }
382    merge_dir_config: function(p: Papr_pool_t; base_conf: Pointer;
383      new_conf: Pointer): Pointer; cdecl;
384
385    { Function to allow all modules to create per server configuration
386     *  structures.
387     *  @param p The pool to use for all allocations.
388     *  @param s The server currently being processed.
389     *  @return The per-server structure created
390     }
391    create_server_config: function(p: Papr_pool_t; s: Pserver_rec): Pointer; cdecl;
392
393    { Function to allow all modules to merge the per server configuration
394     *  structures for two servers.
395     *  @param p The pool to use for all allocations.
396     *  @param base_conf The directory structure created for the parent directory.
397     *  @param new_conf The directory structure currently being processed.
398     *  @return The new per-directory structure created
399     }
400    merge_server_config: function(p: Papr_pool_t; base_conf: Pointer;
401      new_conf: Pointer): Pointer; cdecl;
402
403    { A command_rec table that describes all of the directives this module
404     * defines. }
405    cmds: Pcommand_rec;
406
407    { A hook to allow modules to hook other points in the request processing.
408     *  In this function, modules should call the ap_hook_*() functions to
409     *  register an interest in a specific step in processing the current
410     *  request.
411     *  @param p the pool to use for all allocations
412     }
413    register_hooks: procedure(p: Papr_pool_t); cdecl;
414  end;
415
416  module = module_struct;
417  Pmodule = ^module;
418  PPmodule = ^Pmodule;
419
420{
421 * @defgroup ModuleInit Module structure initializers
422 *
423 * Initializer for the first few module slots, which are only
424 * really set up once we start running.  Note that the first two slots
425 * provide a version check; this should allow us to deal with changes to
426 * the API. The major number should reflect changes to the API handler table
427 * itself or removal of functionality. The minor number should reflect
428 * additions of functionality to the existing API. (the server can detect
429 * an old-format module, and either handle it back-compatibly, or at least
430 * signal an error). See src/include/ap_mmn.h for MMN version history.
431 }
432
433{ The one used in Apache 1.3, which will deliberately cause an error }
434//#define STANDARD_MODULE_STUFF	this_module_needs_to_be_ported_to_apache_2_0
435
436{ Use this in all standard modules }
437procedure STANDARD20_MODULE_STUFF(var mod_: module);
438
439{ Use this only in MPMs }
440procedure MPM20_MODULE_STUFF(var mod_: module);
441
442{ CONFIGURATION VECTOR FUNCTIONS }
443
444{ configuration vector structure - Moved to httpd.pas}
445
446{
447  ap_get_module_config, ap_set_module_config are both commented out because even thought
448 they are on the headers, they are not present on the libhttpd.dll library.
449}
450
451{
452 * Generic accessors for other modules to get at their own module-specific
453 * data
454 * @param conf_vector The vector in which the modules configuration is stored.
455 *        usually r->per_dir_config or s->module_config
456 * @param m The module to get the data for.
457 * @return The module-specific data
458 }
459{
460  Function not found on the dll
461}
462//function ap_get_module_config(const cv: Pap_conf_vector_t; const m: Pmodule): Pointer;
463// {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
464// external LibHTTPD name LibNamePrefix + 'ap_get_module_config' + LibSuff8;
465
466{
467 * Generic accessors for other modules to set at their own module-specific
468 * data
469 * @param conf_vector The vector in which the modules configuration is stored.
470 *        usually r->per_dir_config or s->module_config
471 * @param m The module to set the data for.
472 * @param val The module-specific data to set
473 }
474//procedure ap_set_module_config(const cv: Pap_conf_vector_t; const m: Pmodule;
475// val: Pointer);
476// {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
477// external LibHTTPD name LibNamePrefix + 'ap_set_module_config' + LibSuff12;
478
479{$ifndef AP_DEBUG}
480
481function ap_get_module_config(v: Pap_conf_vector_t; m: Pmodule): Pap_conf_vector_t;
482
483procedure ap_set_module_config(v: Pap_conf_vector_t; m: Pmodule; val: Pap_conf_vector_t);
484
485{$endif} { AP_DEBUG }
486
487
488{
489 * Generic command handling function for strings
490 * @param cmd The command parameters for this directive
491 * @param struct_ptr pointer into a given type
492 * @param arg The argument to the directive
493 * @return An error string or NULL on success
494 }
495function ap_set_string_slot(cmd: Pcmd_parms; struct_ptr: Pointer; const arg: PChar): PChar;
496 cdecl; external LibHTTPD name 'ap_set_string_slot';
497
498{
499 * Generic command handling function for integers
500 * @param cmd The command parameters for this directive
501 * @param struct_ptr pointer into a given type
502 * @param arg The argument to the directive
503 * @return An error string or NULL on success
504 }
505function ap_set_int_slot(cmd: Pcmd_parms; struct_ptr: Pointer; const arg: PChar): PChar;
506 cdecl; external LibHTTPD name 'ap_set_int_slot';
507
508{
509 * Return true if the specified method is limited by being listed in
510 * a <Limit> container, or by *not* being listed in a <LimiteExcept>
511 * container.
512 *
513 * @param   method  Pointer to a string specifying the method to check.
514 * @param   cmd     Pointer to the cmd_parms structure passed to the
515 *                  directive handler.
516 * @return  0 if the method is not limited in the current scope
517 }
518function ap_method_is_limited(cmd: Pcmd_parms; const method: PChar): Integer;
519 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
520 external LibHTTPD name LibNamePrefix + 'ap_method_is_limited' + LibSuff8;
521
522{
523 * Generic command handling function for strings, always sets the value
524 * to a lowercase string
525 * @param cmd The command parameters for this directive
526 * @param struct_ptr pointer into a given type
527 * @param arg The argument to the directive
528 * @return An error string or NULL on success
529 }
530function ap_set_string_slot_lower(cmd: Pcmd_parms; struct_ptr: Pointer; const arg: PChar): PChar;
531 cdecl; external LibHTTPD name 'ap_set_string_slot_lower';
532
533{
534 * Generic command handling function for flags
535 * @param cmd The command parameters for this directive
536 * @param struct_ptr pointer into a given type
537 * @param arg The argument to the directive (either 1 or 0)
538 * @return An error string or NULL on success
539 }
540function ap_set_flag_slot(cmd: Pcmd_parms; struct_ptr: Pointer; const arg: PChar): PChar;
541 cdecl; external LibHTTPD name 'ap_set_flag_slot';
542
543{
544 * Generic command handling function for files
545 * @param cmd The command parameters for this directive
546 * @param struct_ptr pointer into a given type
547 * @param arg The argument to the directive
548 * @return An error string or NULL on success
549 }
550function ap_set_file_slot(cmd: Pcmd_parms; struct_ptr: Pointer; const arg: PChar): PChar;
551 cdecl; external LibHTTPD name 'ap_set_file_slot';
552
553{
554 * Generic command handling function to respond with cmd->help as an error
555 * @param cmd The command parameters for this directive
556 * @param struct_ptr pointer into a given type
557 * @param arg The argument to the directive
558 * @return The cmd->help value as the error string
559 * @tip This allows simple declarations such as;
560 * <pre>
561 *     AP_INIT_RAW_ARGS("Foo", ap_set_deprecated, NULL, OR_ALL,
562 *         "The Foo directive is no longer supported, use Bar"),
563 * </pre>
564 }
565function ap_set_deprecated(cmd: Pcmd_parms; struct_ptr: Pointer; const arg: PChar): PChar;
566 cdecl; external LibHTTPD name 'ap_set_deprecated';
567
568{
569 * For modules which need to read config files, open logs, etc. this returns
570 * the canonical form of fname made absolute to ap_server_root.
571 * @param p pool to allocate data from
572 * @param fname The file name
573 }
574function ap_server_root_relative(p: Papr_pool_t; const fname: PChar): PChar;
575 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
576 external LibHTTPD name LibNamePrefix + 'ap_server_root_relative' + LibSuff8;
577
578{ Finally, the hook for dynamically loading modules in... }
579
580{
581 * Add a module to the server
582 * @param m The module structure of the module to add
583 * @param p The pool of the same lifetime as the module
584 }
585procedure ap_add_module(m: Pmodule; p: Papr_pool_t);
586 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
587 external LibHTTPD name LibNamePrefix + 'ap_add_module' + LibSuff8;
588
589{
590 * Remove a module from the server.  There are some caveats:
591 * when the module is removed, its slot is lost so all the current
592 * per-dir and per-server configurations are invalid. So we should
593 * only ever call this function when you are invalidating almost
594 * all our current data. I.e. when doing a restart.
595 * @param m the module structure of the module to remove
596 }
597procedure ap_remove_module(m: Pmodule);
598 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
599 external LibHTTPD name LibNamePrefix + 'ap_remove_module' + LibSuff4;
600
601{
602 * Add a module to the chained modules list and the list of loaded modules
603 * @param m The module structure of the module to add
604 * @param p The pool with the same lifetime as the module
605 }
606procedure ap_add_loaded_module(mod_: Pmodule; p: Papr_pool_t);
607 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
608 external LibHTTPD name LibNamePrefix + 'ap_add_loaded_module' + LibSuff8;
609
610{
611 * Remove a module fromthe chained modules list and the list of loaded modules
612 * @param m the module structure of the module to remove
613 }
614procedure ap_remove_loaded_module(m: Pmodule);
615 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
616 external LibHTTPD name LibNamePrefix + 'ap_remove_loaded_module' + LibSuff4;
617
618{
619 * Add a module to the list of loaded module based on the name of the
620 * module
621 * @param name The name of the module
622 * @param p The pool valid for the lifetime of the module
623 * @return 1 on success, 0 on failure
624 }
625function ap_add_named_module(const name: PChar; p: Papr_pool_t): Integer;
626 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
627 external LibHTTPD name LibNamePrefix + 'ap_add_named_module' + LibSuff8;
628
629{
630 * Find the name of the specified module
631 * @param m The module to get the name for
632 * @return the name of the module
633 }
634function ap_find_module_name(m: Pmodule): PChar;
635 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
636 external LibHTTPD name LibNamePrefix + 'ap_find_module_name' + LibSuff4;
637
638{
639 * Find a module based on the name of the module
640 * @param name the name of the module
641 * @return the module structure if found, NULL otherwise
642 }
643function ap_find_linked_module(const name: PChar): Pmodule;
644 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
645 external LibHTTPD name LibNamePrefix + 'ap_find_linked_module' + LibSuff4;
646
647{
648 * Open a ap_configfile_t as apr_file_t
649 * @param ret_cfg open ap_configfile_t struct pointer
650 * @param p The pool to allocate the structure from
651 * @param name the name of the file to open
652 }
653function ap_pcfg_openfile(ret_cfg: PPap_configfile_t;
654 p: Papr_pool_t; const name: PChar): apr_status_t;
655 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
656 external LibHTTPD name LibNamePrefix + 'ap_pcfg_openfile' + LibSuff12;
657
658{
659 * Allocate a ap_configfile_t handle with user defined functions and params
660 * @param p The pool to allocate from
661 * @param descr The name of the file
662 * @param param The argument passed to getch/getstr/close
663 * @param getc_func The getch function
664 * @param gets_func The getstr function
665 * @param close_func The close function
666 }
667type
668  getc_func_t = function (param: Pointer): Integer;
669  gets_func_t = function (buf: Pointer; bufsiz: size_t; param: Pointer): Pointer;
670  close_func_t = function (param: Pointer): Integer;
671
672function ap_pcfg_open_custom(p: Papr_pool_t;
673 const descr: PChar; param: Pointer;
674 getc_func: getc_func_t; gets_func: gets_func_t;
675 close_func: close_func_t): Pap_configfile_t;
676 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
677 external LibHTTPD name LibNamePrefix + 'ap_pcfg_open_custom' + LibSuff24;
678
679{
680 * Read one line from open ap_configfile_t, strip LF, increase line number
681 * @param buf place to store the line read
682 * @param bufsize size of the buffer
683 * @param cfp File to read from
684 * @return 1 on success, 0 on failure
685 }
686function ap_cfg_getline(bug: PChar;
687 bufsize: size_t; cfp: Pap_configfile_t): Integer;
688 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
689 external LibHTTPD name LibNamePrefix + 'ap_cfg_getline' + LibSuff12;
690
691{
692 * Read one char from open configfile_t, increase line number upon LF
693 * @param cfp The file to read from
694 * @return the character read
695 }
696function ap_cfg_getc(cfp: Pap_configfile_t): Integer;
697 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
698 external LibHTTPD name LibNamePrefix + 'ap_cfg_getc' + LibSuff4;
699
700{
701 * Detach from open ap_configfile_t, calling the close handler
702 * @param cfp The file to close
703 * @return 1 on sucess, 0 on failure
704 }
705function ap_cfg_closefile(cfp: Pap_configfile_t): Integer;
706 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
707 external LibHTTPD name LibNamePrefix + 'ap_cfg_closefile' + LibSuff4;
708
709{
710 * Read all data between the current <foo> and the matching </foo>.  All
711 * of this data is forgotten immediately.
712 * @param cmd The cmd_parms to pass to the directives inside the container
713 * @param directive The directive name to read until
714 * @return Error string on failure, NULL on success
715 }
716function ap_soak_end_container(cmd: Pcmd_parms; directive: PChar): PChar;
717 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
718 external LibHTTPD name LibNamePrefix + 'ap_soak_end_container' + LibSuff8;
719
720{
721 * Read all data between the current <foo> and the matching </foo> and build
722 * a config tree from it
723 * @param p pool to allocate from
724 * @param temp_pool Temporary pool to allocate from
725 * @param parms The cmd_parms to pass to all directives read
726 * @param current The current node in the tree
727 * @param curr_parent The current parent node
728 * @param orig_directive The directive to read until hit.
729 * @return Error string on failure, NULL on success
730}
731function ap_build_cont_config(p, temp_pool: Papr_pool_t;
732 parms: Pcmd_parms; current, curr_parent: PPap_directive_t;
733 orig_directive: PChar): PChar;
734 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
735 external LibHTTPD name LibNamePrefix + 'ap_build_cont_config' + LibSuff24;
736
737{
738 * Build a config tree from a config file
739 * @param parms The cmd_parms to pass to all of the directives in the file
740 * @param conf_pool The pconf pool
741 * @param temp_pool The temporary pool
742 * @param conftree Place to store the root node of the config tree
743 * @return Error string on erro, NULL otherwise
744 }
745function ap_build_config(parms: Pcmd_parms;
746 conf_pool, temp_pool: Papr_pool_t; conftree: PPap_directive_t): PChar;
747 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
748 external LibHTTPD name LibNamePrefix + 'ap_build_config' + LibSuff16;
749
750{
751 * Walk a config tree and setup the server's internal structures
752 * @param conftree The config tree to walk
753 * @param parms The cmd_parms to pass to all functions
754 * @param section_vector The per-section config vector.
755 * @return Error string on error, NULL otherwise
756 }
757function ap_walk_config(conftree: Pap_directive_t;
758 parms: Pcmd_parms; section_vector: Pap_conf_vector_t): PChar;
759 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
760 external LibHTTPD name LibNamePrefix + 'ap_walk_config' + LibSuff12;
761
762{
763 * @defgroup ap_check_cmd_context ap_check_cmd_context
764 }
765{
766 * Check the context a command is used in.
767 * @param cmd The command to check
768 * @param forbidden Where the command is forbidden.
769 * @return Error string on error, NULL on success
770 }
771function ap_check_cmd_context(cmd: Pcmd_parms;
772 forbidden: cuint): PChar;
773 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
774 external LibHTTPD name LibNamePrefix + 'ap_check_cmd_context' + LibSuff8;
775
776const
777  NOT_IN_VIRTUALHOST    = $01; {< Forbidden in <Virtualhost> }
778  NOT_IN_LIMIT          = $02; {< Forbidden in <Limit> }
779  NOT_IN_DIRECTORY      = $04; {< Forbidden in <Directory> }
780  NOT_IN_LOCATION       = $08; {< Forbidden in <Location> }
781  NOT_IN_FILES          = $10; {< Forbidden in <Files> }
782{ Forbidden in <Directory>/<Location>/<Files>}
783  NOT_IN_DIR_LOC_FILE   = (NOT_IN_DIRECTORY or NOT_IN_LOCATION or NOT_IN_FILES);
784{ Forbidden in <VirtualHost>/<Limit>/<Directory>/<Location>/<Files> }
785  GLOBAL_ONLY           = (NOT_IN_VIRTUALHOST or NOT_IN_LIMIT or NOT_IN_DIR_LOC_FILE);
786
787//#ifdef CORE_PRIVATE
788
789{
790 * The topmost module in the list
791 * @defvar module *ap_top_module
792 }
793//AP_DECLARE_DATA extern module *ap_top_module;
794
795{
796 * Array of all statically linked modules
797 * @defvar module *ap_prelinked_modules[]
798 }
799//AP_DECLARE_DATA extern module *ap_prelinked_modules[];
800{
801 * Array of all preloaded modules
802 * @defvar module *ap_preloaded_modules[]
803 }
804//AP_DECLARE_DATA extern module *ap_preloaded_modules[];
805{
806 * Array of all loaded modules
807 * @defvar module **ap_loaded_modules
808 }
809//AP_DECLARE_DATA extern module **ap_loaded_modules;
810
811{ For mod_so.c... }
812{ Run a single module's two create_config hooks
813 *  @param p the pool to allocate from
814 *  @param s The server to configure for.
815 *  @param m The module to configure
816 }
817procedure ap_single_module_configure(p: Papr_pool_t;
818 s: Pserver_rec; m: Pmodule);
819 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
820 external LibHTTPD name LibNamePrefix + 'ap_single_module_configure' + LibSuff12;
821
822{ For http_main.c... }
823{
824 * Add all of the prelinked modules into the loaded module list
825 * @param process The process that is currently running the server
826 }
827procedure ap_setup_prelinked_modules(process: Pprocess_rec);
828 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
829 external LibHTTPD name LibNamePrefix + 'ap_setup_prelinked_modules' + LibSuff4;
830
831{
832 * Show the preloaded configuration directives, the help string explaining
833 * the directive arguments, in what module they are handled, and in
834 * what parts of the configuration they are allowed.  Used for httpd -h.
835 }
836procedure ap_show_directives;
837 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
838 external LibHTTPD name LibNamePrefix + 'ap_show_directives' + LibSuff0;
839
840{
841 * Show the preloaded module names.  Used for httpd -l.
842 }
843procedure ap_show_modules;
844 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
845 external LibHTTPD name LibNamePrefix + 'ap_show_modules' + LibSuff0;
846
847{
848 * Show the MPM name.  Used in reporting modules such as mod_info to
849 * provide extra information to the user
850 }
851function ap_show_mpm: PChar;
852 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
853 external LibHTTPD name LibNamePrefix + 'ap_show_mpm' + LibSuff0;
854
855{
856 * Read all config files and setup the server
857 * @param process The process running the server
858 * @param temp_pool A pool to allocate temporary data from.
859 * @param config_name The name of the config file
860 * @param conftree Place to store the root of the config tree
861 * @return The setup server_rec list.
862 }
863function ap_read_config(process: Pprocess_rec;
864 temp_pool: Papr_pool_t; const config_name: PChar;
865 conftree: PPap_directive_t): Pserver_rec;
866 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
867 external LibHTTPD name LibNamePrefix + 'ap_read_config' + LibSuff16;
868
869{
870 * Run all rewrite args hooks for loaded modules
871 * @param process The process currently running the server
872 }
873procedure ap_run_rewrite_args(process: Pprocess_rec);
874 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
875 external LibHTTPD name LibNamePrefix + 'ap_run_rewrite_args' + LibSuff4;
876
877{
878 * Run the register hooks function for a specified module
879 * @param m The module to run the register hooks function fo
880 * @param p The pool valid for the lifetime of the module
881 }
882procedure ap_register_hooks(m: Pmodule; p: Papr_pool_t);
883 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
884 external LibHTTPD name LibNamePrefix + 'ap_register_hooks' + LibSuff8;
885
886{
887 * Setup all virtual hosts
888 * @param p The pool to allocate from
889 * @param main_server The head of the server_rec list
890 }
891procedure ap_fixup_virtual_hosts(p: Papr_pool_t; main_server: Pserver_rec);
892 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
893 external LibHTTPD name LibNamePrefix + 'ap_fixup_virtual_hosts' + LibSuff8;
894
895{ For http_request.c... }
896
897{
898 * Setup the config vector for a request_rec
899 * @param p The pool to allocate the config vector from
900 * @return The config vector
901 }
902function ap_create_request_config(p: Papr_pool_t): Pap_conf_vector_t;
903 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
904 external LibHTTPD name LibNamePrefix + 'ap_create_request_config' + LibSuff4;
905
906{
907 * Setup the config vector for per dir module configs
908 * @param p The pool to allocate the config vector from
909 * @return The config vector
910 }
911function ap_create_per_dir_config(p: Papr_pool_t): Pap_conf_vector_t;
912 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
913 external LibHTTPD name LibNamePrefix + 'ap_create_per_dir_config' + LibSuff4;
914
915{
916 * Run all of the modules merge per dir config functions
917 * @param p The pool to pass to the merge functions
918 * @param base The base directory config structure
919 * @param new_conf The new directory config structure
920 }
921function ap_merge_per_dir_configs(p: Papr_pool_t;
922 base, new_conf: Pap_conf_vector_t): Pap_conf_vector_t;
923 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
924 external LibHTTPD name LibNamePrefix + 'ap_merge_per_dir_configs' + LibSuff12;
925
926{ For http_connection.c... }
927{
928 * Setup the config vector for a connection_rec
929 * @param p The pool to allocate the config vector from
930 * @return The config vector
931 }
932function ap_create_conn_config(p: Papr_pool_t): Pap_conf_vector_t;
933 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
934 external LibHTTPD name LibNamePrefix + 'ap_create_conn_config' + LibSuff4;
935
936{ For http_core.c... (<Directory> command and virtual hosts) }
937
938{
939 * parse an htaccess file
940 * @param resulting htaccess_result
941 * @param r The request currently being served
942 * @param override Which overrides are active
943 * @param path The path to the htaccess file
944 * @param access_name The list of possible names for .htaccess files
945 * int The status of the current request
946 }
947function ap_parse_htaccess(result: PPap_conf_vector_t;
948 r: Prequest_rec; override_: Integer;
949 const path, access_name: PChar): Integer;
950 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
951 external LibHTTPD name LibNamePrefix + 'ap_parse_htaccess' + LibSuff20;
952
953{
954 * Setup a virtual host
955 * @param p The pool to allocate all memory from
956 * @param hostname The hostname of the virtual hsot
957 * @param main_server The main server for this Apache configuration
958 * @param ps Place to store the new server_rec
959 * return Error string on error, NULL on success
960 }
961function ap_init_virtual_host(p: Papr_pool_t;
962 const hostname: PChar; main_server: Pserver_rec;
963 m: PPserver_rec): PChar;
964 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
965 external LibHTTPD name LibNamePrefix + 'ap_init_virtual_host' + LibSuff16;
966
967{
968 * Process the config file for Apache
969 * @param s The server rec to use for the command parms
970 * @param fname The name of the config file
971 * @param conftree The root node of the created config tree
972 * @param p Pool for general allocation
973 * @param ptem Pool for temporary allocation
974 }
975procedure ap_process_resource_config(s: Pserver_rec;
976 const fname: PChar; conftree: PPap_directive_t;
977 p, ptemp: Papr_pool_t);
978 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
979 external LibHTTPD name LibNamePrefix + 'ap_process_resource_config' + LibSuff20;
980
981{
982 * Process all directives in the config tree
983 * @param s The server rec to use in the command parms
984 * @param conftree The config tree to process
985 * @param p The pool for general allocation
986 * @param ptemp The pool for temporary allocations
987 }
988procedure ap_process_config_tree(s: Pserver_rec;
989 conftree: Pap_directive_t; p, ptemp: Papr_pool_t);
990 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
991 external LibHTTPD name LibNamePrefix + 'ap_process_config_tree' + LibSuff16;
992
993{ Module-method dispatchers, also for http_request.c }
994{
995 * Run the handler phase of each module until a module accepts the
996 * responsibility of serving the request
997 * @param r The current request
998 * @return The status of the current request
999 }
1000function ap_invoke_handler(r: Prequest_rec): Integer;
1001 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1002 external LibHTTPD name LibNamePrefix + 'ap_invoke_handler' + LibSuff4;
1003
1004{ for mod_perl }
1005
1006{
1007 * Find a given directive in a command_rec table
1008 * @param name The directive to search for
1009 * @param cmds The table to search
1010 * @return The directive definition of the specified directive
1011 }
1012function ap_find_command(const name: PChar;
1013 const cmds: Pcommand_rec): Pcommand_rec;
1014 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1015 external LibHTTPD name LibNamePrefix + 'ap_find_command' + LibSuff8;
1016
1017{
1018 * Find a given directive in a list module
1019 * @param cmd_name The directive to search for
1020 * @param mod The module list to search
1021 * @return The directive definition of the specified directive
1022 }
1023function ap_find_command_in_modules(const cmd_name: PChar;
1024 mod_: PPmodule): Pcommand_rec;
1025 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1026 external LibHTTPD name LibNamePrefix + 'ap_find_command_in_modules' + LibSuff8;
1027
1028{
1029 * Ask a module to create per-server and per-section (dir/loc/file) configs
1030 * (if it hasn't happened already). The results are stored in the server's
1031 * config, and the specified per-section config vector.
1032 * @param server The server to operate upon.
1033 * @param section_vector The per-section config vector.
1034 * @param section Which section to create a config for.
1035 * @param mod The module which is defining the config data.
1036 * @param pconf A pool for all configuration allocations.
1037 * @return The (new) per-section config data.
1038 }
1039function ap_set_config_vectors(server: Pserver_rec;
1040 ection_vector: Pap_conf_vector_t; const section: PChar;
1041 mod_: Pmodule; pconf: Papr_pool_t): Pointer;
1042 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1043 external LibHTTPD name LibNamePrefix + 'ap_set_config_vectors' + LibSuff20;
1044
1045{#endif}
1046
1047{ Hooks }
1048
1049{
1050 * Run the header parser functions for each module
1051 * @param r The current request
1052 * @return OK or DECLINED
1053 }
1054type
1055  ap_HOOK_header_parser_t = function(r: Prequest_rec): Integer; cdecl;
1056
1057procedure ap_hook_header_parser(pf: ap_HOOK_header_parser_t;
1058 const aszPre: PPChar; const aszSucc:
1059 PPChar; nOrder: Integer);
1060 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1061 external LibHTTPD name LibNamePrefix + 'ap_hook_header_parser' + LibSuff16;
1062
1063{
1064 * Run the pre_config function for each module
1065 * @param pconf The config pool
1066 * @param plog The logging streams pool
1067 * @param ptemp The temporary pool
1068 * @return OK or DECLINED on success anything else is a error
1069 }
1070type
1071  ap_HOOK_pre_config_t = function(pconf: Papr_pool_t; plog: Papr_pool_t;
1072    ptemp: Papr_pool_t): Integer; cdecl;
1073
1074procedure ap_hook_pre_config(pf: ap_HOOK_pre_config_t; const aszPre: PPChar;
1075 const aszSucc: PPChar; nOrder: Integer);
1076 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1077 external LibHTTPD name LibNamePrefix + 'ap_hook_pre_config' + LibSuff16;
1078
1079{
1080 * Run the post_config function for each module
1081 * @param pconf The config pool
1082 * @param plog The logging streams pool
1083 * @param ptemp The temporary pool
1084 * @param s The list of server_recs
1085 * @return OK or DECLINED on success anything else is a error
1086 }
1087type
1088  ap_HOOK_post_config_t = function(pconf, plog, ptemp: Papr_pool_t; s: Pserver_rec): Integer; cdecl;
1089
1090procedure ap_hook_post_config(pf: ap_HOOK_post_config_t; const aszPre: PPChar;
1091 const aszSucc: PPChar; nOrder: Integer);
1092 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1093 external LibHTTPD name LibNamePrefix + 'ap_hook_post_config' + LibSuff16;
1094
1095{
1096 * Run the open_logs functions for each module
1097 * @param pconf The config pool
1098 * @param plog The logging streams pool
1099 * @param ptemp The temporary pool
1100 * @param s The list of server_recs
1101 * @return OK or DECLINED on success anything else is a error
1102 }
1103type
1104  ap_HOOK_open_logs_t = function(pconf: Papr_pool_t; plog: Papr_pool_t;
1105    ptemp: Papr_pool_t; s: Pserver_rec): Integer; cdecl;
1106
1107procedure ap_hook_open_logs(pf: ap_HOOK_open_logs_t; const aszPre: PPChar;
1108 const aszSucc: PPChar; nOrder: Integer);
1109 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1110 external LibHTTPD name LibNamePrefix + 'ap_hook_open_logs' + LibSuff16;
1111
1112{
1113 * Run the child_init functions for each module
1114 * @param pchild The child pool
1115 * @param s The list of server_recs in this server
1116 }
1117type
1118  ap_HOOK_child_init_t = procedure(pchild: Papr_pool_t; s: Pserver_rec); cdecl;
1119
1120procedure ap_hook_child_init(pf: ap_HOOK_child_init_t; const aszPre: PPChar;
1121 const aszSucc: PPChar; nOrder: Integer);
1122 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1123 external LibHTTPD name LibNamePrefix + 'ap_hook_child_init' + LibSuff16;
1124
1125{
1126 * Run the handler functions for each module
1127 * @param r The request_rec
1128 * @remark non-wildcard handlers should HOOK_MIDDLE, wildcard HOOK_LAST
1129 }
1130type
1131  ap_HOOK_handler_t = function(r: Prequest_rec): Integer; cdecl;
1132
1133procedure ap_hook_handler(pf: ap_HOOK_handler_t; const aszPre: PPChar;
1134 const aszSucc: PPChar; nOrder: Integer);
1135 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1136 external LibHTTPD name LibNamePrefix + 'ap_hook_handler' + LibSuff16;
1137
1138{
1139 * Run the quick handler functions for each module. The quick_handler
1140 * is run before any other requests hooks are called (location_walk,
1141 * directory_walk, access checking, et. al.). This hook was added
1142 * to provide a quick way to serve content from a URI keyed cache.
1143 *
1144 * @param r The request_rec
1145 * @param lookup_uri Controls whether the caller actually wants content or not.
1146 * lookup is set when the quick_handler is called out of
1147 * ap_sub_req_lookup_uri()
1148 }
1149type
1150  ap_HOOK_quick_handler_t = function(r: Prequest_rec;
1151    lookup_uri: Integer): Integer; cdecl;
1152
1153procedure ap_hook_quick_handler(pf: ap_HOOK_quick_handler_t;
1154 const aszPre: PPChar; const aszSucc: PPChar; nOrder: Integer);
1155 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1156 external LibHTTPD name LibNamePrefix + 'ap_hook_quick_handler' + LibSuff16;
1157
1158{
1159 * Retrieve the optional functions for each module.
1160 * This is run immediately before the server starts. Optional functions should
1161 * be registered during the hook registration phase.
1162 }
1163type
1164  ap_HOOK_optional_fn_retrieve_t = procedure; cdecl;
1165
1166procedure ap_hook_optional_fn_retrieve(pf: ap_HOOK_optional_fn_retrieve_t;
1167 const aszPre: PPChar; const aszSucc: PPChar; nOrder: Integer);
1168 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
1169 external LibHTTPD name LibNamePrefix + 'ap_hook_optional_fn_retrieve' + LibSuff16;
1170
1171
1172