http_config.inc 44 KB

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