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