http_config.inc 74 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774
  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. * @file http_config.h
  18. * @brief Apache Configuration
  19. *
  20. * @defgroup APACHE_CORE_CONFIG Configuration
  21. * @ingroup APACHE_CORE
  22. * @{
  23. *)
  24. {$ifndef APACHE_HTTP_CONFIG_H}
  25. {$define APACHE_HTTP_CONFIG_H}
  26. //#include "util_cfgtree.h"
  27. //#include "ap_config.h"
  28. //#include "apr_tables.h"
  29. {*
  30. * The central data structures around here...
  31. *}
  32. {* Command dispatch structures... *}
  33. {fpc -> moved const sections up here}
  34. (**
  35. * @defgroup ConfigDirectives Allowed locations for configuration directives.
  36. *
  37. * The allowed locations for a configuration directive are the union of
  38. * those indicated by each set bit in the req_override mask.
  39. *
  40. * @{
  41. *)
  42. const
  43. OR_NONE = 0; {**< *.conf is not available anywhere in this override *}
  44. OR_LIMIT = 1; {**< *.conf inside &lt;Directory&gt; or &lt;Location&gt;
  45. and .htaccess when AllowOverride Limit *}
  46. OR_OPTIONS = 2; {**< *.conf anywhere
  47. and .htaccess when AllowOverride Options *}
  48. OR_FILEINFO = 4; {**< *.conf anywhere
  49. and .htaccess when AllowOverride FileInfo *}
  50. OR_AUTHCFG = 8; {**< *.conf inside &lt;Directory&gt; or &lt;Location&gt;
  51. and .htaccess when AllowOverride AuthConfig *}
  52. OR_INDEXES = 16; {**< *.conf anywhere
  53. and .htaccess when AllowOverride Indexes *}
  54. OR_UNSET = 32; {**< bit to indicate that AllowOverride has not been set *}
  55. ACCESS_CONF = 64; {**< *.conf inside &lt;Directory&gt; or &lt;Location&gt; *}
  56. RSRC_CONF = 128; {**< *.conf outside &lt;Directory&gt; or &lt;Location&gt; *}
  57. EXEC_ON_READ = 256; {**< force directive to execute a command
  58. which would modify the configuration (like including another
  59. file, or IFModule *}
  60. {* Flags to determine whether syntax errors in .htaccess should be
  61. * treated as nonfatal (log and ignore errors)
  62. *}
  63. NONFATAL_OVERRIDE = 512; {* Violation of AllowOverride rule *}
  64. NONFATAL_UNKNOWN = 1024;{* Unrecognised directive *}
  65. NONFATAL_ALL = (NONFATAL_OVERRIDE or NONFATAL_UNKNOWN);
  66. {** this directive can be placed anywhere *}
  67. OR_ALL = (OR_LIMIT or OR_OPTIONS or OR_FILEINFO or OR_AUTHCFG or OR_INDEXES);
  68. (** @} *)
  69. {**
  70. * This can be returned by a function if they don't wish to handle
  71. * a command. Make it something not likely someone will actually use
  72. * as an error code.
  73. *}
  74. DECLINE_CMD = '\a\b';
  75. {**
  76. * How the directives arguments should be parsed.
  77. * @remark Note that for all of these except RAW_ARGS, the config routine is
  78. * passed a freshly allocated string which can be modified or stored
  79. * or whatever...
  80. *}
  81. type
  82. cmd_how = (
  83. RAW_ARGS, {**< cmd_func parses command line itself *}
  84. TAKE1, {**< one argument only *}
  85. TAKE2, {**< two arguments only *}
  86. ITERATE, {**< one argument, occuring multiple times
  87. * (e.g., IndexIgnore)
  88. *}
  89. ITERATE2, {**< two arguments, 2nd occurs multiple times
  90. * (e.g., AddIcon)
  91. *}
  92. FLAG, {**< One of 'On' or 'Off' *}
  93. NO_ARGS, {**< No args at all, e.g. &lt;/Directory&gt; *}
  94. TAKE12, {**< one or two arguments *}
  95. TAKE3, {**< three arguments only *}
  96. TAKE23, {**< two or three arguments *}
  97. TAKE123, {**< one, two or three arguments *}
  98. TAKE13, {**< one or three arguments *}
  99. TAKE_ARGV {**< an argc and argv are passed *}
  100. );
  101. {**
  102. * This structure is passed to a command which is being invoked,
  103. * to carry a large variety of miscellaneous data which is all of
  104. * use to *somebody*...
  105. *}
  106. // typedef struct cmd_parms_struct cmd_parms;
  107. Pcmd_parms = ^cmd_parms_struct;
  108. //#if defined(AP_HAVE_DESIGNATED_INITIALIZER) || defined(DOXYGEN)
  109. tnoargsfunc = function(parms: Pcmd_parms; mconfig: pointer): PAnsiChar; cdecl;
  110. trawargsfunc = function(parms: Pcmd_parms; mconfig: pointer; args: PAnsiChar): PAnsiChar; cdecl;
  111. ttakeargvfunc = function(parms: Pcmd_parms; mconfig: pointer; argc: longint; argv: PPAnsiChar): PAnsiChar; cdecl;
  112. ttake1func = function(parms: Pcmd_parms; mconfig: pointer; w: PAnsiChar): PAnsiChar; cdecl;
  113. ttake2func = function(parms: Pcmd_parms; mconfig: pointer; w, w2: PAnsiChar): PAnsiChar; cdecl;
  114. ttake3func = function(parms: Pcmd_parms; mconfig: pointer; w, w2, w3: PAnsiChar): PAnsiChar; cdecl;
  115. tflagfunc = function(parms: Pcmd_parms; mconfig: pointer; on_: longint): PAnsiChar; cdecl;
  116. {**
  117. * All the types of functions that can be used in directives
  118. * @internal
  119. *}
  120. cmd_func = record
  121. case longint of
  122. {** function to call for a no-args *}
  123. 0 : ( no_args : tnoargsfunc);
  124. {** function to call for a raw-args *}
  125. 1 : ( raw_args : trawargsfunc);
  126. {** function to call for a argv/argc *}
  127. 2 : ( take_argv : ttakeargvfunc);
  128. {** function to call for a take1 *}
  129. 3 : ( take1 : ttake1func);
  130. {** function to call for a take2 *}
  131. 4 : ( take2 : ttake2func);
  132. {** function to call for a take3 *}
  133. 5 : ( take3 : ttake3func);
  134. {** function to call for a flag *}
  135. 6 : ( flag : tflagfunc);
  136. end;
  137. Pcmd_func = ^cmd_func;
  138. (*
  139. /** This configuration directive does not take any arguments */
  140. # define AP_NO_ARGS func.no_args
  141. /** This configuration directive will handle its own parsing of arguments*/
  142. # define AP_RAW_ARGS func.raw_args
  143. /** This configuration directive will handle its own parsing of arguments*/
  144. # define AP_TAKE_ARGV func.take_argv
  145. /** This configuration directive takes 1 argument*/
  146. # define AP_TAKE1 func.take1
  147. /** This configuration directive takes 2 arguments */
  148. # define AP_TAKE2 func.take2
  149. /** This configuration directive takes 3 arguments */
  150. # define AP_TAKE3 func.take3
  151. /** This configuration directive takes a flag (on/off) as a argument*/
  152. # define AP_FLAG func.flag
  153. /** mechanism for declaring a directive with no arguments */
  154. # define AP_INIT_NO_ARGS(directive, func, mconfig, where, help) \
  155. { directive, { .no_args=func }, mconfig, where, RAW_ARGS, help }
  156. /** mechanism for declaring a directive with raw argument parsing */
  157. # define AP_INIT_RAW_ARGS(directive, func, mconfig, where, help) \
  158. { directive, { .raw_args=func }, mconfig, where, RAW_ARGS, help }
  159. /** mechanism for declaring a directive with raw argument parsing */
  160. # define AP_INIT_TAKE_ARGV(directive, func, mconfig, where, help) \
  161. { directive, { .take_argv=func }, mconfig, where, TAKE_ARGV, help }
  162. /** mechanism for declaring a directive which takes 1 argument */
  163. # define AP_INIT_TAKE1(directive, func, mconfig, where, help) \
  164. { directive, { .take1=func }, mconfig, where, TAKE1, help }
  165. /** mechanism for declaring a directive which takes multiple arguments */
  166. # define AP_INIT_ITERATE(directive, func, mconfig, where, help) \
  167. { directive, { .take1=func }, mconfig, where, ITERATE, help }
  168. /** mechanism for declaring a directive which takes 2 arguments */
  169. # define AP_INIT_TAKE2(directive, func, mconfig, where, help) \
  170. { directive, { .take2=func }, mconfig, where, TAKE2, help }
  171. /** mechanism for declaring a directive which takes 1 or 2 arguments */
  172. # define AP_INIT_TAKE12(directive, func, mconfig, where, help) \
  173. { directive, { .take2=func }, mconfig, where, TAKE12, help }
  174. /** mechanism for declaring a directive which takes multiple 2 arguments */
  175. # define AP_INIT_ITERATE2(directive, func, mconfig, where, help) \
  176. { directive, { .take2=func }, mconfig, where, ITERATE2, help }
  177. /** mechanism for declaring a directive which takes 1 or 3 arguments */
  178. # define AP_INIT_TAKE13(directive, func, mconfig, where, help) \
  179. { directive, { .take3=func }, mconfig, where, TAKE13, help }
  180. /** mechanism for declaring a directive which takes 2 or 3 arguments */
  181. # define AP_INIT_TAKE23(directive, func, mconfig, where, help) \
  182. { directive, { .take3=func }, mconfig, where, TAKE23, help }
  183. /** mechanism for declaring a directive which takes 1 to 3 arguments */
  184. # define AP_INIT_TAKE123(directive, func, mconfig, where, help) \
  185. { directive, { .take3=func }, mconfig, where, TAKE123, help }
  186. /** mechanism for declaring a directive which takes 3 arguments */
  187. # define AP_INIT_TAKE3(directive, func, mconfig, where, help) \
  188. { directive, { .take3=func }, mconfig, where, TAKE3, help }
  189. /** mechanism for declaring a directive which takes a flag (on/off) argument */
  190. # define AP_INIT_FLAG(directive, func, mconfig, where, help) \
  191. { directive, { .flag=func }, mconfig, where, FLAG, help }
  192. #else /* AP_HAVE_DESIGNATED_INITIALIZER */
  193. typedef const AnsiChar *( *cmd_func) ();
  194. # define AP_NO_ARGS func
  195. # define AP_RAW_ARGS func
  196. # define AP_TAKE_ARGV func
  197. # define AP_TAKE1 func
  198. # define AP_TAKE2 func
  199. # define AP_TAKE3 func
  200. # define AP_FLAG func
  201. # define AP_INIT_NO_ARGS(directive, func, mconfig, where, help) \
  202. { directive, func, mconfig, where, RAW_ARGS, help }
  203. # define AP_INIT_RAW_ARGS(directive, func, mconfig, where, help) \
  204. { directive, func, mconfig, where, RAW_ARGS, help }
  205. # define AP_INIT_TAKE_ARGV(directive, func, mconfig, where, help) \
  206. { directive, func, mconfig, where, TAKE_ARGV, help }
  207. # define AP_INIT_TAKE1(directive, func, mconfig, where, help) \
  208. { directive, func, mconfig, where, TAKE1, help }
  209. # define AP_INIT_ITERATE(directive, func, mconfig, where, help) \
  210. { directive, func, mconfig, where, ITERATE, help }
  211. # define AP_INIT_TAKE2(directive, func, mconfig, where, help) \
  212. { directive, func, mconfig, where, TAKE2, help }
  213. # define AP_INIT_TAKE12(directive, func, mconfig, where, help) \
  214. { directive, func, mconfig, where, TAKE12, help }
  215. # define AP_INIT_ITERATE2(directive, func, mconfig, where, help) \
  216. { directive, func, mconfig, where, ITERATE2, help }
  217. # define AP_INIT_TAKE13(directive, func, mconfig, where, help) \
  218. { directive, func, mconfig, where, TAKE13, help }
  219. # define AP_INIT_TAKE23(directive, func, mconfig, where, help) \
  220. { directive, func, mconfig, where, TAKE23, help }
  221. # define AP_INIT_TAKE123(directive, func, mconfig, where, help) \
  222. { directive, func, mconfig, where, TAKE123, help }
  223. # define AP_INIT_TAKE3(directive, func, mconfig, where, help) \
  224. { directive, func, mconfig, where, TAKE3, help }
  225. # define AP_INIT_FLAG(directive, func, mconfig, where, help) \
  226. { directive, func, mconfig, where, FLAG, help }
  227. #endif /* AP_HAVE_DESIGNATED_INITIALIZER */
  228. *)
  229. {**
  230. * The command record structure. Each modules can define a table of these
  231. * to define the directives it will implement.
  232. *}
  233. command_struct = record
  234. {** Name of this command *}
  235. name: PAnsiChar;
  236. {** The function to be called when this directive is parsed *}
  237. func: cmd_func;
  238. {** Extra data, for functions which implement multiple commands... *}
  239. cmd_data: Pointer;
  240. {** What overrides need to be allowed to enable this command. *}
  241. req_override: Integer;
  242. {** What the command expects as arguments *}
  243. args_how: cmd_how;
  244. {** 'usage' message, in case of syntax errors *}
  245. errmsg: PAnsiChar;
  246. end;
  247. command_rec = command_struct;
  248. Pcommand_rec = ^command_rec;
  249. {** Common structure for reading of config files / passwd files etc. *}
  250. Pap_configfile_t = ^ap_configfile_t;
  251. PPap_configfile_t = ^Pap_configfile_t;
  252. ap_configfile_t = record
  253. {**< an apr_file_getc()-like function *}
  254. getch : function (ch:PAnsiChar; param:pointer):apr_status_t;cdecl;
  255. {**< an apr_file_gets()-like function *}
  256. getstr : function (buf:pointer; bufsiz:apr_size_t; param:pointer):apr_status_t;cdecl;
  257. {**< a close handler function *}
  258. close : function (param:pointer):apr_status_t;cdecl;
  259. {**< the argument passed to getch/getstr/close *}
  260. param : pointer;
  261. {**< the filename / description *}
  262. name : PAnsiChar;
  263. {**< current line number, starting at 1 *}
  264. line_number : dword;
  265. end;
  266. {**
  267. * This structure is passed to a command which is being invoked,
  268. * to carry a large variety of miscellaneous data which is all of
  269. * use to *somebody*...
  270. *}
  271. cmd_parms_struct = record
  272. {** Argument to command from cmd_table *}
  273. info : pointer;
  274. {** Which allow-override bits are set *}
  275. override_ : longint;
  276. {** Which allow-override-opts bits are set *}
  277. override_opts : longint;
  278. {** Table of directives allowed per AllowOverrideList *}
  279. override_list : Papr_table_t;
  280. {** Which methods are &lt;Limit&gt;ed *}
  281. limited : apr_int64_t;
  282. {** methods which are limited *}
  283. limited_xmethods : Papr_array_header_t;
  284. {** methods which are xlimited *}
  285. xlimited : Pap_method_list_t;
  286. {** Config file structure. *}
  287. config_file : Pap_configfile_t;
  288. {** the directive specifying this command *}
  289. directive : Pap_directive_t;
  290. {** Pool to allocate new storage in *}
  291. pool : Papr_pool_t;
  292. {** Pool for scratch memory; persists during configuration, but
  293. * wiped before the first request is served... *}
  294. temp_pool : Papr_pool_t;
  295. {** Server_rec being configured for *}
  296. server : Pserver_rec;
  297. {** If configuring for a directory, pathname of that directory.
  298. * NOPE! That's what it meant previous to the existence of &lt;Files&gt;,
  299. * &lt;Location&gt; and regex matching. Now the only usefulness that can be
  300. * derived from this field is whether a command is being called in a
  301. * server context (path == NULL) or being called in a dir context
  302. * (path != NULL). *}
  303. path : PAnsiChar;
  304. {** configuration command *}
  305. cmd : Pcommand_rec;
  306. {** per_dir_config vector passed to handle_command *}
  307. context : Pap_conf_vector_t;
  308. {** directive with syntax error *}
  309. err_directive : Pap_directive_t;
  310. end;
  311. {**
  312. * Module structures. Just about everything is dispatched through
  313. * these, directly or indirectly (through the command and handler
  314. * tables).
  315. *}
  316. Pmodule_struct = ^module_struct;
  317. module_struct = record
  318. {** API version, *not* module version; check that module is
  319. * compatible with this version of the server.
  320. *}
  321. version : longint;
  322. {** API minor version. Provides API feature milestones. Not checked
  323. * during module init *}
  324. minor_version : longint;
  325. {** Index to this modules structures in config vectors. *}
  326. module_index : longint;
  327. {** The name of the module's C file *}
  328. name : PAnsiChar;
  329. {** The handle for the DSO. Internal use only *}
  330. dynamic_load_handle : pointer;
  331. {** A pointer to the next module in the list
  332. * @var module_struct *next
  333. *}
  334. next : Pmodule_struct;
  335. {** Magic Cookie to identify a module structure; It's mainly
  336. * important for the DSO facility (see also mod_so). *}
  337. magic : dword;
  338. {** Function to allow MPMs to re-write command line arguments. This
  339. * hook is only available to MPMs.
  340. * @param The process that the server is running in.
  341. *}
  342. rewrite_args : procedure (process:Pprocess_rec);cdecl;
  343. {** Function to allow all modules to create per directory configuration
  344. * structures.
  345. * @param p The pool to use for all allocations.
  346. * @param dir The directory currently being processed.
  347. * @return The per-directory structure created
  348. *}
  349. create_dir_config : function (p:Papr_pool_t; dir:PAnsiChar):pointer;cdecl;
  350. {** Function to allow all modules to merge the per directory configuration
  351. * structures for two directories.
  352. * @param p The pool to use for all allocations.
  353. * @param base_conf The directory structure created for the parent directory.
  354. * @param new_conf The directory structure currently being processed.
  355. * @return The new per-directory structure created
  356. *}
  357. merge_dir_config : function (p:Papr_pool_t; base_conf:pointer; new_conf:pointer):pointer;cdecl;
  358. {** Function to allow all modules to create per server configuration
  359. * structures.
  360. * @param p The pool to use for all allocations.
  361. * @param s The server currently being processed.
  362. * @return The per-server structure created
  363. *}
  364. create_server_config : function (p:Papr_pool_t; s:Pserver_rec):pointer;cdecl;
  365. {** Function to allow all modules to merge the per server configuration
  366. * structures for two servers.
  367. * @param p The pool to use for all allocations.
  368. * @param base_conf The directory structure created for the parent directory.
  369. * @param new_conf The directory structure currently being processed.
  370. * @return The new per-directory structure created
  371. *}
  372. merge_server_config : function (p:Papr_pool_t; base_conf:pointer; new_conf:pointer):pointer;cdecl;
  373. {** A command_rec table that describes all of the directives this module
  374. * defines. *}
  375. cmds : Pcommand_rec;
  376. {** A hook to allow modules to hook other points in the request processing.
  377. * In this function, modules should call the ap_hook_*() functions to
  378. * register an interest in a specific step in processing the current
  379. * request.
  380. * @param p the pool to use for all allocations
  381. *}
  382. register_hooks : procedure (p:Papr_pool_t);cdecl;
  383. end;
  384. module = module_struct;
  385. Pmodule = ^module;
  386. PPmodule = ^Pmodule;
  387. {**
  388. * The APLOG_USE_MODULE macro is used choose which module a file belongs to.
  389. * This is necessary to allow per-module loglevel configuration.
  390. *
  391. * APLOG_USE_MODULE indirectly sets APLOG_MODULE_INDEX and APLOG_MARK.
  392. *
  393. * If a module should be backward compatible with versions before 2.3.6,
  394. * APLOG_USE_MODULE needs to be enclosed in a ifdef APLOG_USE_MODULE block.
  395. *
  396. * @param foo name of the module symbol of the current module, without the
  397. * trailing "_module" part
  398. * @see APLOG_MARK
  399. *}
  400. {#define APLOG_USE_MODULE(foo) \
  401. extern module AP_MODULE_DECLARE_DATA foo##_module; \
  402. static int * const aplog_module_index = &(foo##_module.module_index)
  403. /**
  404. * AP_DECLARE_MODULE is a convenience macro that combines a call of
  405. * APLOG_USE_MODULE with the definition of the module symbol.
  406. *
  407. * If a module should be backward compatible with versions before 2.3.6,
  408. * APLOG_USE_MODULE should be used explicitly instead of AP_DECLARE_MODULE.
  409. */
  410. #define AP_DECLARE_MODULE(foo) \
  411. APLOG_USE_MODULE(foo); \
  412. module AP_MODULE_DECLARE_DATA foo##_module
  413. }
  414. (**
  415. * @defgroup ModuleInit Module structure initializers
  416. *
  417. * Initializer for the first few module slots, which are only
  418. * really set up once we start running. Note that the first two slots
  419. * provide a version check; this should allow us to deal with changes to
  420. * the API. The major number should reflect changes to the API handler table
  421. * itself or removal of functionality. The minor number should reflect
  422. * additions of functionality to the existing API. (the server can detect
  423. * an old-format module, and either handle it back-compatibly, or at least
  424. * signal an error). See src/include/ap_mmn.h for MMN version history.
  425. * @{
  426. *)
  427. {** The one used in Apache 1.3, which will deliberately cause an error *}
  428. //#define STANDARD_MODULE_STUFF this_module_needs_to_be_ported_to_apache_2_0
  429. {** Use this in all standard modules *}
  430. (*#define STANDARD20_MODULE_STUFF MODULE_MAGIC_NUMBER_MAJOR, \
  431. MODULE_MAGIC_NUMBER_MINOR, \
  432. -1, \
  433. __FILE__, \
  434. NULL, \
  435. NULL, \
  436. MODULE_MAGIC_COOKIE, \
  437. NULL /* rewrite args spot */*)
  438. procedure STANDARD20_MODULE_STUFF(var mod_: module);
  439. {** Use this only in MPMs *}
  440. (*#define MPM20_MODULE_STUFF MODULE_MAGIC_NUMBER_MAJOR, \
  441. MODULE_MAGIC_NUMBER_MINOR, \
  442. -1, \
  443. __FILE__, \
  444. NULL, \
  445. NULL, \
  446. MODULE_MAGIC_COOKIE*)
  447. procedure MPM20_MODULE_STUFF(var mod_: module);
  448. (** @} *)
  449. {* CONFIGURATION VECTOR FUNCTIONS *}
  450. {** configuration vector structure *}
  451. //typedef struct ap_conf_vector_t ap_conf_vector_t;
  452. { Moved to httpd.pas}
  453. // ap_conf_vector_t = record end;
  454. // Pap_conf_vector_t = ^ap_conf_vector_t;
  455. // PPap_conf_vector_t = ^Pap_conf_vector_t;
  456. {**
  457. * Generic accessors for other modules to get at their own module-specific
  458. * data
  459. * @param cv The vector in which the modules configuration is stored.
  460. * usually r->per_dir_config or s->module_config
  461. * @param m The module to get the data for.
  462. * @return The module-specific data
  463. *}
  464. //AP_DECLARE(void *) ap_get_module_config(const ap_conf_vector_t *cv,
  465. // const module *m);
  466. {not found in httpd binary libraries, ignored}
  467. {**
  468. * Generic accessors for other modules to set at their own module-specific
  469. * data
  470. * @param cv The vector in which the modules configuration is stored.
  471. * usually r->per_dir_config or s->module_config
  472. * @param m The module to set the data for.
  473. * @param val The module-specific data to set
  474. *}
  475. //AP_DECLARE(void) ap_set_module_config(ap_conf_vector_t *cv, const module *m,
  476. // void *val);
  477. //{$ifndef AP_DEBUG}
  478. //
  479. //function ap_get_module_config(v: Pap_conf_vector_t; m: Pmodule): Pap_conf_vector_t;
  480. //
  481. //procedure ap_set_module_config(v: Pap_conf_vector_t; m: Pmodule; val: Pap_conf_vector_t);
  482. //
  483. //{$endif} {* AP_DEBUG *}
  484. {**
  485. * Generic accessor for modules to get the module-specific loglevel
  486. * @param s The server from which to get the loglevel.
  487. * @param index The module_index of the module to get the loglevel for.
  488. * @return The module-specific loglevel
  489. *}
  490. //AP_DECLARE(int) ap_get_server_module_loglevel(const server_rec *s, int index);
  491. {**
  492. * Generic accessor for modules the module-specific loglevel
  493. * @param c The connection from which to get the loglevel.
  494. * @param index The module_index of the module to get the loglevel for.
  495. * @return The module-specific loglevel
  496. *}
  497. //AP_DECLARE(int) ap_get_conn_module_loglevel(const conn_rec *c, int index);
  498. {**
  499. * Generic accessor for modules the module-specific loglevel
  500. * @param c The connection from which to get the loglevel.
  501. * @param s The server from which to get the loglevel if c does not have a
  502. * specific loglevel configuration.
  503. * @param index The module_index of the module to get the loglevel for.
  504. * @return The module-specific loglevel
  505. *}
  506. //AP_DECLARE(int) ap_get_conn_server_module_loglevel(const conn_rec *c,
  507. // const server_rec *s,
  508. // int index);
  509. {**
  510. * Generic accessor for modules to get the module-specific loglevel
  511. * @param r The request from which to get the loglevel.
  512. * @param index The module_index of the module to get the loglevel for.
  513. * @return The module-specific loglevel
  514. *}
  515. //AP_DECLARE(int) ap_get_request_module_loglevel(const request_rec *r, int index);
  516. {**
  517. * Accessor to set module-specific loglevel
  518. * @param p A pool
  519. * @param l The ap_logconf struct to modify.
  520. * @param index The module_index of the module to set the loglevel for.
  521. * @param level The new log level
  522. *}
  523. procedure ap_set_module_loglevel(p: Papr_pool_t; l: Pap_logconf;
  524. index, level: Integer);
  525. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  526. external LibHTTPD name LibNamePrefix + 'ap_set_module_loglevel' + LibSuff16;
  527. {
  528. #if !defined(AP_DEBUG)
  529. #define ap_get_conn_logconf(c) \
  530. ((c)->log ? (c)->log : \
  531. &(c)->base_server->log)
  532. #define ap_get_conn_server_logconf(c,s) \
  533. ( ( (c)->log != &(c)->base_server->log && (c)->log != NULL ) ? \
  534. (c)->log : \
  535. &(s)->log )
  536. #define ap_get_request_logconf(r) \
  537. ((r)->log ? (r)->log : \
  538. (r)->connection->log ? (r)->connection->log : \
  539. &(r)->server->log)
  540. #define ap_get_module_loglevel(l,i) \
  541. (((i) < 0 || (l)->module_levels == NULL || (l)->module_levels[i] < 0) ? \
  542. (l)->level : \
  543. (l)->module_levels[i])
  544. #define ap_get_server_module_loglevel(s,i) \
  545. (ap_get_module_loglevel(&(s)->log,i))
  546. #define ap_get_conn_module_loglevel(c,i) \
  547. (ap_get_module_loglevel(ap_get_conn_logconf(c),i))
  548. #define ap_get_conn_server_module_loglevel(c,s,i) \
  549. (ap_get_module_loglevel(ap_get_conn_server_logconf(c,s),i))
  550. #define ap_get_request_module_loglevel(r,i) \
  551. (ap_get_module_loglevel(ap_get_request_logconf(r),i))
  552. #endif /* AP_DEBUG */
  553. }
  554. {**
  555. * Set all module-specific loglevels to val
  556. * @param l The log config for which to set the loglevels.
  557. * @param val the value to set all loglevels to
  558. *}
  559. procedure ap_reset_module_loglevels(l: Pap_logconf; val: Integer);
  560. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  561. external LibHTTPD name LibNamePrefix + 'ap_reset_module_loglevels' + LibSuff8;
  562. {**
  563. * Generic command handling function for strings
  564. * @param cmd The command parameters for this directive
  565. * @param struct_ptr pointer into a given type
  566. * @param arg The argument to the directive
  567. * @return An error string or NULL on success
  568. *}
  569. //AP_DECLARE_NONSTD(const AnsiChar *) ap_set_string_slot(cmd_parms *cmd,
  570. // void *struct_ptr,
  571. // const AnsiChar *arg);
  572. function ap_set_string_slot(cmd: Pcmd_parms;
  573. struct_ptr: Pointer;
  574. const arg: PAnsiChar): PAnsiChar; cdecl;
  575. external LibHTTPD name 'ap_set_string_slot';
  576. {**
  577. * Generic command handling function for integers
  578. * @param cmd The command parameters for this directive
  579. * @param struct_ptr pointer into a given type
  580. * @param arg The argument to the directive
  581. * @return An error string or NULL on success
  582. *}
  583. //AP_DECLARE_NONSTD(const AnsiChar *) ap_set_int_slot(cmd_parms *cmd,
  584. // void *struct_ptr,
  585. // const AnsiChar *arg);
  586. function ap_set_int_slot(cmd: Pcmd_parms; struct_ptr: Pointer; const arg: PAnsiChar): PAnsiChar; cdecl;
  587. external LibHTTPD name 'ap_set_int_slot';
  588. {**
  589. * Parsing function for log level
  590. * @param str The string to parse
  591. * @param val The parsed log level
  592. * @return An error string or NULL on success
  593. *}
  594. function ap_parse_log_level(const str: PAnsiChar; val: Integer): PAnsiChar;
  595. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  596. external LibHTTPD name LibNamePrefix + 'ap_parse_log_level' + LibSuff8;
  597. {**
  598. * Return true if the specified method is limited by being listed in
  599. * a &lt;Limit&gt; container, or by *not* being listed in a &lt;LimitExcept&gt;
  600. * container.
  601. *
  602. * @param method Pointer to a string specifying the method to check.
  603. * @param cmd Pointer to the cmd_parms structure passed to the
  604. * directive handler.
  605. * @return 0 if the method is not limited in the current scope
  606. *}
  607. function ap_method_is_limited(cmd: Pcmd_parms; const method: PAnsiChar): Integer;
  608. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  609. external LibHTTPD name LibNamePrefix + 'ap_method_is_limited' + LibSuff8;
  610. {**
  611. * Generic command handling function for strings, always sets the value
  612. * to a lowercase string
  613. * @param cmd The command parameters for this directive
  614. * @param struct_ptr pointer into a given type
  615. * @param arg The argument to the directive
  616. * @return An error string or NULL on success
  617. *}
  618. //AP_DECLARE_NONSTD(const AnsiChar *) ap_set_string_slot_lower(cmd_parms *cmd,
  619. // void *struct_ptr,
  620. // const AnsiChar *arg);
  621. function ap_set_string_slot_lower(cmd: Pcmd_parms;
  622. struct_ptr: Pointer;
  623. const arg: PAnsiChar): PAnsiChar; cdecl;
  624. external LibHTTPD name 'ap_set_string_slot_lower';
  625. {**
  626. * Generic command handling function for flags stored in an int
  627. * @param cmd The command parameters for this directive
  628. * @param struct_ptr pointer into a given type
  629. * @param arg The argument to the directive (either 1 or 0)
  630. * @return An error string or NULL on success
  631. *}
  632. //AP_DECLARE_NONSTD(const AnsiChar *) ap_set_flag_slot(cmd_parms *cmd,
  633. // void *struct_ptr,
  634. // int arg);
  635. function ap_set_flag_slot(cmd: Pcmd_parms;
  636. struct_ptr: Pointer;
  637. const arg: PAnsiChar): PAnsiChar; cdecl;
  638. external LibHTTPD name 'ap_set_flag_slot';
  639. {**
  640. * Generic command handling function for flags stored in a AnsiChar
  641. * @param cmd The command parameters for this directive
  642. * @param struct_ptr pointer into a given type
  643. * @param arg The argument to the directive (either 1 or 0)
  644. * @return An error string or NULL on success
  645. *}
  646. //AP_DECLARE_NONSTD(const AnsiChar *) ap_set_flag_slot_char(cmd_parms *cmd,
  647. // void *struct_ptr,
  648. // int arg);
  649. function ap_set_flag_slot_char(cmd: Pcmd_parms;
  650. struct_ptr: Pointer;
  651. arg: Integer): PAnsiChar; cdecl;
  652. external LibHTTPD name 'ap_set_flag_slot_char';
  653. {**
  654. * Generic command handling function for files
  655. * @param cmd The command parameters for this directive
  656. * @param struct_ptr pointer into a given type
  657. * @param arg The argument to the directive
  658. * @return An error string or NULL on success
  659. *}
  660. //AP_DECLARE_NONSTD(const AnsiChar *) ap_set_file_slot(cmd_parms *cmd,
  661. // void *struct_ptr,
  662. // const AnsiChar *arg);
  663. function ap_set_file_slot(cmd: Pcmd_parms; struct_ptr: Pointer; const arg: PAnsiChar): PAnsiChar; cdecl;
  664. external LibHTTPD name 'ap_set_file_slot';
  665. {**
  666. * Generic command handling function to respond with cmd->help as an error
  667. * @param cmd The command parameters for this directive
  668. * @param struct_ptr pointer into a given type
  669. * @param arg The argument to the directive
  670. * @return The cmd->help value as the error string
  671. * @note This allows simple declarations such as:
  672. * @code
  673. * AP_INIT_RAW_ARGS("Foo", ap_set_deprecated, NULL, OR_ALL,
  674. * "The Foo directive is no longer supported, use Bar"),
  675. * @endcode
  676. *}
  677. //AP_DECLARE_NONSTD(const AnsiChar *) ap_set_deprecated(cmd_parms *cmd,
  678. // void *struct_ptr,
  679. // const AnsiChar *arg);
  680. function ap_set_deprecated(cmd: Pcmd_parms;
  681. struct_ptr: Pointer;
  682. const arg: PAnsiChar): PAnsiChar; cdecl;
  683. external LibHTTPD name 'ap_set_deprecated';
  684. {**
  685. * For modules which need to read config files, open logs, etc. this returns
  686. * the canonical form of fname made absolute to ap_server_root.
  687. * @param p pool to allocate data from
  688. * @param fname The file name
  689. *}
  690. function ap_server_root_relative(p: Papr_pool_t; const fname: PAnsiChar): PAnsiChar;
  691. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  692. external LibHTTPD name LibNamePrefix + 'ap_server_root_relative' + LibSuff8;
  693. {**
  694. * Compute the name of a run-time file (e.g., shared memory "file") relative
  695. * to the appropriate run-time directory. Absolute paths are returned as-is.
  696. * The run-time directory is configured via the DefaultRuntimeDir directive or
  697. * at build time.
  698. *}
  699. function ap_runtime_dir_relative(p: Papr_pool_t; const fname: PAnsiChar): PAnsiChar;
  700. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  701. external LibHTTPD name LibNamePrefix + 'ap_runtime_dir_relative' + LibSuff8;
  702. {* Finally, the hook for dynamically loading modules in... *}
  703. {**
  704. * Add a module to the server
  705. * @param m The module structure of the module to add
  706. * @param p The pool of the same lifetime as the module
  707. * @param s The module's symbol name (used for logging)
  708. *}
  709. function ap_add_module(m: Pmodule; p: Papr_pool_t; s: PAnsiChar): PAnsiChar;
  710. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  711. external LibHTTPD name LibNamePrefix + 'ap_add_module' + LibSuff12;
  712. {**
  713. * Remove a module from the server. There are some caveats:
  714. * when the module is removed, its slot is lost so all the current
  715. * per-dir and per-server configurations are invalid. So we should
  716. * only ever call this function when you are invalidating almost
  717. * all our current data. I.e. when doing a restart.
  718. * @param m the module structure of the module to remove
  719. *}
  720. procedure ap_remove_module(m: Pmodule);
  721. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  722. external LibHTTPD name LibNamePrefix + 'ap_remove_module' + LibSuff4;
  723. {**
  724. * Add a module to the chained modules list and the list of loaded modules
  725. * @param mod The module structure of the module to add
  726. * @param p The pool with the same lifetime as the module
  727. * @param s The module's symbol name (used for logging)
  728. *}
  729. function ap_add_loaded_module(mod_: Pmodule; p: Papr_pool_t; s: PAnsiChar): PAnsiChar;
  730. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  731. external LibHTTPD name LibNamePrefix + 'ap_add_loaded_module' + LibSuff12;
  732. {**
  733. * Remove a module fromthe chained modules list and the list of loaded modules
  734. * @param mod the module structure of the module to remove
  735. *}
  736. procedure ap_remove_loaded_module(m: Pmodule);
  737. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  738. external LibHTTPD name LibNamePrefix + 'ap_remove_loaded_module' + LibSuff4;
  739. {**
  740. * Find the name of the specified module
  741. * @param m The module to get the name for
  742. * @return the name of the module
  743. *}
  744. function ap_find_module_name(m: Pmodule): PAnsiChar;
  745. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  746. external LibHTTPD name LibNamePrefix + 'ap_find_module_name' + LibSuff4;
  747. {**
  748. * Find the short name of the module identified by the specified module index
  749. * @param module_index The module index to get the name for
  750. * @return the name of the module, NULL if not found
  751. *}
  752. function ap_find_module_short_name(module_index: Integer): PAnsiChar;
  753. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  754. external LibHTTPD name LibNamePrefix + 'ap_find_module_short_name' + LibSuff4;
  755. {**
  756. * Find a module based on the name of the module
  757. * @param name the name of the module
  758. * @return the module structure if found, NULL otherwise
  759. *}
  760. function ap_find_linked_module(const name: PAnsiChar): Pmodule;
  761. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  762. external LibHTTPD name LibNamePrefix + 'ap_find_linked_module' + LibSuff4;
  763. {**
  764. * Open a ap_configfile_t as apr_file_t
  765. * @param ret_cfg open ap_configfile_t struct pointer
  766. * @param p The pool to allocate the structure from
  767. * @param name the name of the file to open
  768. *}
  769. function ap_pcfg_openfile(ret_cfg: PPap_configfile_t;
  770. p: Papr_pool_t; const name: PAnsiChar): apr_status_t;
  771. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  772. external LibHTTPD name LibNamePrefix + 'ap_pcfg_openfile' + LibSuff12;
  773. {**
  774. * Allocate a ap_configfile_t handle with user defined functions and params
  775. * @param p The pool to allocate from
  776. * @param descr The name of the file
  777. * @param param The argument passed to getch/getstr/close
  778. * @param getc_func The getch function
  779. * @param gets_func The getstr function
  780. * @param close_func The close function
  781. *}
  782. //AP_DECLARE(ap_configfile_t *) ap_pcfg_open_custom(apr_pool_t *p,
  783. // const AnsiChar *descr,
  784. // void *param,
  785. // apr_status_t (*getc_func) (AnsiChar *ch, void *param),
  786. // apr_status_t (*gets_func) (void *buf, apr_size_t bufsiz, void *param),
  787. // apr_status_t (*close_func) (void *param));
  788. type
  789. getc_func_t = function (ch: PAnsiChar; param: Pointer): apr_status_t;
  790. gets_func_t = function (buf: Pointer; bufsiz: apr_size_t; param: Pointer): apr_status_t;
  791. close_func_t = function (param: Pointer): apr_status_t;
  792. function ap_pcfg_open_custom(p: Papr_pool_t;
  793. const descr: PAnsiChar;
  794. param: Pointer;
  795. getc_func: getc_func_t;
  796. gets_func: gets_func_t;
  797. close_func: close_func_t): Pap_configfile_t;
  798. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  799. external LibHTTPD name LibNamePrefix + 'ap_pcfg_open_custom' + LibSuff24;
  800. {**
  801. * Read one line from open ap_configfile_t, strip leading and trailing
  802. * whitespace, increase line number
  803. * @param buf place to store the line read
  804. * @param bufsize size of the buffer
  805. * @param cfp File to read from
  806. * @return error status, APR_ENOSPC if bufsize is too small for the line
  807. *}
  808. function ap_cfg_getline(buf: PAnsiChar; bufsize: apr_size_t; cfp: Pap_configfile_t): apr_status_t;
  809. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  810. external LibHTTPD name LibNamePrefix + 'ap_cfg_getline' + LibSuff12;
  811. {**
  812. * Read one AnsiChar from open configfile_t, increase line number upon LF
  813. * @param ch place to store the AnsiChar read
  814. * @param cfp The file to read from
  815. * @return error status
  816. *}
  817. function ap_cfg_getc(ch: PAnsiChar; cfp: Pap_configfile_t): apr_status_t;
  818. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  819. external LibHTTPD name LibNamePrefix + 'ap_cfg_getc' + LibSuff8;
  820. {**
  821. * Detach from open ap_configfile_t, calling the close handler
  822. * @param cfp The file to close
  823. * @return 1 on sucess, 0 on failure
  824. *}
  825. function ap_cfg_closefile(cfp: Pap_configfile_t): Integer;
  826. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  827. external LibHTTPD name LibNamePrefix + 'ap_cfg_closefile' + LibSuff4;
  828. {**
  829. * Convert a return value from ap_cfg_getline or ap_cfg_getc to a user friendly
  830. * string.
  831. * @param p The pool to allocate the string from
  832. * @param cfp The config file
  833. * @param rc The return value to convert
  834. * @return The error string, NULL if rc == APR_SUCCESS
  835. *}
  836. function ap_pcfg_strerror(p: Papr_pool_t; cfp: Pap_configfile_t;
  837. rc: apr_status_t): PAnsiChar;
  838. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  839. external LibHTTPD name LibNamePrefix + 'ap_pcfg_strerror' + LibSuff12;
  840. {**
  841. * Read all data between the current &lt;foo&gt; and the matching &lt;/foo&gt;. All
  842. * of this data is forgotten immediately.
  843. * @param cmd The cmd_parms to pass to the directives inside the container
  844. * @param directive The directive name to read until
  845. * @return Error string on failure, NULL on success
  846. * @note If cmd->pool == cmd->temp_pool, ap_soak_end_container() will assume
  847. * .htaccess context and use a lower maximum line length.
  848. *}
  849. function ap_soak_end_container(cmd: Pcmd_parms; directive: PAnsiChar): PAnsiChar;
  850. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  851. external LibHTTPD name LibNamePrefix + 'ap_soak_end_container' + LibSuff8;
  852. {**
  853. * Read all data between the current &lt;foo&gt; and the matching &lt;/foo&gt; and build
  854. * a config tree from it
  855. * @param p pool to allocate from
  856. * @param temp_pool Temporary pool to allocate from
  857. * @param parms The cmd_parms to pass to all directives read
  858. * @param current The current node in the tree
  859. * @param curr_parent The current parent node
  860. * @param orig_directive The directive to read until hit.
  861. * @return Error string on failure, NULL on success
  862. * @note If p == temp_pool, ap_build_cont_config() will assume .htaccess
  863. * context and use a lower maximum line length.
  864. *}
  865. function ap_build_cont_config(p,
  866. temp_pool: Papr_pool_t;
  867. parms: Pcmd_parms;
  868. current,
  869. curr_parent: PPap_directive_t;
  870. orig_directive: PAnsiChar): PAnsiChar;
  871. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  872. external LibHTTPD name LibNamePrefix + 'ap_build_cont_config' + LibSuff24;
  873. {**
  874. * Build a config tree from a config file
  875. * @param parms The cmd_parms to pass to all of the directives in the file
  876. * @param conf_pool The pconf pool
  877. * @param temp_pool The temporary pool
  878. * @param conftree Place to store the root node of the config tree
  879. * @return Error string on erro, NULL otherwise
  880. * @note If conf_pool == temp_pool, ap_build_config() will assume .htaccess
  881. * context and use a lower maximum line length.
  882. *}
  883. function ap_build_config(parms: Pcmd_parms;
  884. conf_pool,
  885. temp_pool: Papr_pool_t;
  886. conftree: PPap_directive_t): PAnsiChar;
  887. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  888. external LibHTTPD name LibNamePrefix + 'ap_build_config' + LibSuff16;
  889. {**
  890. * Walk a config tree and setup the server's internal structures
  891. * @param conftree The config tree to walk
  892. * @param parms The cmd_parms to pass to all functions
  893. * @param section_vector The per-section config vector.
  894. * @return Error string on error, NULL otherwise
  895. *}
  896. function ap_walk_config(conftree: Pap_directive_t;
  897. parms: Pcmd_parms;
  898. section_vector: Pap_conf_vector_t): PAnsiChar;
  899. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  900. external LibHTTPD name LibNamePrefix + 'ap_walk_config' + LibSuff12;
  901. (**
  902. * @defgroup ap_check_cmd_context Check command context
  903. * @{
  904. *)
  905. {**
  906. * Check the context a command is used in.
  907. * @param cmd The command to check
  908. * @param forbidden Where the command is forbidden.
  909. * @return Error string on error, NULL on success
  910. *}
  911. function ap_check_cmd_context(cmd: Pcmd_parms;
  912. forbidden: dword): PAnsiChar;
  913. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  914. external LibHTTPD name LibNamePrefix + 'ap_check_cmd_context' + LibSuff8;
  915. const
  916. NOT_IN_VIRTUALHOST = $01;{**< Forbidden in &lt;VirtualHost&gt; *}
  917. NOT_IN_LIMIT = $02;{**< Forbidden in &lt;Limit&gt; *}
  918. NOT_IN_DIRECTORY = $04;{**< Forbidden in &lt;Directory&gt; *}
  919. NOT_IN_LOCATION = $08;{**< Forbidden in &lt;Location&gt; *}
  920. NOT_IN_FILES = $10;{**< Forbidden in &lt;Files&gt; *}
  921. NOT_IN_HTACCESS = $20;{**< Forbidden in .htaccess files *}
  922. {** Forbidden in &lt;Directory&gt;/&lt;Location&gt;/&lt;Files&gt;*}
  923. NOT_IN_DIR_LOC_FILE = (NOT_IN_DIRECTORY or NOT_IN_LOCATION or NOT_IN_FILES);
  924. {** Forbidden in &lt;VirtualHost&gt;/&lt;Limit&gt;/&lt;Directory&gt;/&lt;Location&gt;/&lt;Files&gt; *}
  925. GLOBAL_ONLY = (NOT_IN_VIRTUALHOST or NOT_IN_LIMIT or NOT_IN_DIR_LOC_FILE);
  926. (** @} *)
  927. {**
  928. * @brief This structure is used to assign symbol names to module pointers
  929. *}
  930. type
  931. ap_module_symbol_t = record
  932. name: PAnsiChar;
  933. modp: Pmodule;
  934. end;
  935. {**
  936. * The topmost module in the list
  937. * @var module *ap_top_module
  938. *}
  939. //AP_DECLARE_DATA extern module *ap_top_module;
  940. {**
  941. * Array of all statically linked modules
  942. * @var module *ap_prelinked_modules[]
  943. *}
  944. //AP_DECLARE_DATA extern module *ap_prelinked_modules[];
  945. {**
  946. * Array of all statically linked modulenames (symbols)
  947. * @var ap_module_symbol_t ap_prelinked_module_symbols[]
  948. *}
  949. //AP_DECLARE_DATA extern ap_module_symbol_t ap_prelinked_module_symbols[];
  950. {**
  951. * Array of all preloaded modules
  952. * @var module *ap_preloaded_modules[]
  953. *}
  954. //AP_DECLARE_DATA extern module *ap_preloaded_modules[];
  955. {**
  956. * Array of all loaded modules
  957. * @var module **ap_loaded_modules
  958. *}
  959. //AP_DECLARE_DATA extern module **ap_loaded_modules;
  960. {* For mod_so.c... *}
  961. {** Run a single module's two create_config hooks
  962. * @param p the pool to allocate from
  963. * @param s The server to configure for.
  964. * @param m The module to configure
  965. *}
  966. procedure ap_single_module_configure(p: Papr_pool_t; s: Pserver_rec;
  967. m: Pmodule);
  968. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  969. external LibHTTPD name LibNamePrefix + 'ap_single_module_configure' + LibSuff12;
  970. {* For http_main.c... *}
  971. {**
  972. * Add all of the prelinked modules into the loaded module list
  973. * @param process The process that is currently running the server
  974. *}
  975. function ap_setup_prelinked_modules(process: Pprocess_rec): PAnsiChar;
  976. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  977. external LibHTTPD name LibNamePrefix + 'ap_setup_prelinked_modules' + LibSuff4;
  978. {**
  979. * Show the preloaded configuration directives, the help string explaining
  980. * the directive arguments, in what module they are handled, and in
  981. * what parts of the configuration they are allowed. Used for httpd -h.
  982. *}
  983. procedure ap_show_directives;
  984. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  985. external LibHTTPD name LibNamePrefix + 'ap_show_directives' + LibSuff0;
  986. {**
  987. * Show the preloaded module names. Used for httpd -l.
  988. *}
  989. procedure ap_show_modules;
  990. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  991. external LibHTTPD name LibNamePrefix + 'ap_show_modules' + LibSuff0;
  992. {**
  993. * Show the MPM name. Used in reporting modules such as mod_info to
  994. * provide extra information to the user
  995. *}
  996. function ap_show_mpm: PAnsiChar;
  997. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  998. external LibHTTPD name LibNamePrefix + 'ap_show_mpm' + LibSuff0;
  999. {**
  1000. * Read all config files and setup the server
  1001. * @param process The process running the server
  1002. * @param temp_pool A pool to allocate temporary data from.
  1003. * @param config_name The name of the config file
  1004. * @param conftree Place to store the root of the config tree
  1005. * @return The setup server_rec list.
  1006. *}
  1007. function ap_read_config(process: Pprocess_rec;
  1008. temp_pool: Papr_pool_t;
  1009. const config_name: PAnsiChar;
  1010. conftree: PPap_directive_t): Pserver_rec;
  1011. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1012. external LibHTTPD name LibNamePrefix + 'ap_read_config' + LibSuff16;
  1013. {**
  1014. * Run all rewrite args hooks for loaded modules
  1015. * @param process The process currently running the server
  1016. *}
  1017. procedure ap_run_rewrite_args(process: Pprocess_rec);
  1018. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1019. external LibHTTPD name LibNamePrefix + 'ap_run_rewrite_args' + LibSuff4;
  1020. {**
  1021. * Run the register hooks function for a specified module
  1022. * @param m The module to run the register hooks function fo
  1023. * @param p The pool valid for the lifetime of the module
  1024. *}
  1025. procedure ap_register_hooks(m: Pmodule; p: Papr_pool_t);
  1026. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1027. external LibHTTPD name LibNamePrefix + 'ap_register_hooks' + LibSuff8;
  1028. {**
  1029. * Setup all virtual hosts
  1030. * @param p The pool to allocate from
  1031. * @param main_server The head of the server_rec list
  1032. *}
  1033. procedure ap_fixup_virtual_hosts(p: Papr_pool_t;
  1034. main_server: Pserver_rec);
  1035. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1036. external LibHTTPD name LibNamePrefix + 'ap_fixup_virtual_hosts' + LibSuff8;
  1037. {**
  1038. * Reserve some modules slots for modules loaded by other means than
  1039. * EXEC_ON_READ directives.
  1040. * Relevant modules should call this in the pre_config stage.
  1041. * @param count The number of slots to reserve.
  1042. *}
  1043. procedure ap_reserve_module_slots(count: Longint);
  1044. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1045. external LibHTTPD name LibNamePrefix + 'ap_reserve_module_slots' + LibSuff4;
  1046. {**
  1047. * Reserve some modules slots for modules loaded by a specific
  1048. * non-EXEC_ON_READ config directive.
  1049. * This counts how often the given directive is used in the config and calls
  1050. * ap_reserve_module_slots() accordingly.
  1051. * @param directive The name of the directive
  1052. *}
  1053. procedure ap_reserve_module_slots_directive(const directive: PAnsiChar);
  1054. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1055. external LibHTTPD name LibNamePrefix + 'ap_reserve_module_slots_directive' + LibSuff4;
  1056. {* For http_request.c... *}
  1057. {**
  1058. * Setup the config vector for a request_rec
  1059. * @param p The pool to allocate the config vector from
  1060. * @return The config vector
  1061. *}
  1062. function ap_create_request_config(p: Papr_pool_t): Pap_conf_vector_t;
  1063. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1064. external LibHTTPD name LibNamePrefix + 'ap_create_request_config' + LibSuff4;
  1065. {**
  1066. * Setup the config vector for per dir module configs
  1067. * @param p The pool to allocate the config vector from
  1068. * @return The config vector
  1069. *}
  1070. //AP_CORE_DECLARE(ap_conf_vector_t *) ap_create_per_dir_config(apr_pool_t *p);
  1071. function ap_create_per_dir_config(p: Papr_pool_t): Pap_conf_vector_t;
  1072. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1073. external LibHTTPD name LibNamePrefix + 'ap_create_per_dir_config' + LibSuff4;
  1074. {**
  1075. * Run all of the modules merge per dir config functions
  1076. * @param p The pool to pass to the merge functions
  1077. * @param base The base directory config structure
  1078. * @param new_conf The new directory config structure
  1079. *}
  1080. function ap_merge_per_dir_configs(p: Papr_pool_t;
  1081. base,
  1082. new_conf: Pap_conf_vector_t): Pap_conf_vector_t;
  1083. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1084. external LibHTTPD name LibNamePrefix + 'ap_merge_per_dir_configs' + LibSuff12;
  1085. {**
  1086. * Allocate new ap_logconf and make (deep) copy of old ap_logconf
  1087. * @param p The pool to alloc from
  1088. * @param old The ap_logconf to copy (may be NULL)
  1089. * @return The new ap_logconf struct
  1090. *}
  1091. function ap_new_log_config(p: Papr_pool_t;
  1092. const old: Pap_logconf): Pap_logconf;
  1093. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1094. external LibHTTPD name LibNamePrefix + 'ap_new_log_config' + LibSuff8;
  1095. {**
  1096. * Merge old ap_logconf into new ap_logconf.
  1097. * old and new must have the same life time.
  1098. * @param old_conf The ap_logconf to merge from
  1099. * @param new_conf The ap_logconf to merge into
  1100. *}
  1101. procedure ap_merge_log_config(const old_conf: Pap_logconf;
  1102. new_conf: Pap_logconf);
  1103. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1104. external LibHTTPD name LibNamePrefix + 'ap_merge_log_config' + LibSuff8;
  1105. {* For http_connection.c... *}
  1106. {**
  1107. * Setup the config vector for a connection_rec
  1108. * @param p The pool to allocate the config vector from
  1109. * @return The config vector
  1110. *}
  1111. function ap_create_conn_config(p: Papr_pool_t): Pap_conf_vector_t;
  1112. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1113. external LibHTTPD name LibNamePrefix + 'ap_create_conn_config' + LibSuff4;
  1114. {* For http_core.c... (&lt;Directory&gt; command and virtual hosts) *}
  1115. {**
  1116. * parse an htaccess file
  1117. * @param result htaccess_result
  1118. * @param r The request currently being served
  1119. * @param override Which overrides are active
  1120. * @param override_opts Which allow-override-opts bits are set
  1121. * @param override_list Table of directives allowed for override
  1122. * @param path The path to the htaccess file
  1123. * @param access_name The list of possible names for .htaccess files
  1124. * int The status of the current request
  1125. *}
  1126. function ap_parse_htaccess(result_: PPap_conf_vector_t;
  1127. r: Prequest_rec;
  1128. override_: Longint;
  1129. override_opts: Longint;
  1130. override_list: Papr_table_t;
  1131. const path: PAnsiChar;
  1132. const access_name: PAnsiChar): Longint;
  1133. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1134. external LibHTTPD name LibNamePrefix + 'ap_parse_htaccess' + LibSuff28;
  1135. {**
  1136. * Setup a virtual host
  1137. * @param p The pool to allocate all memory from
  1138. * @param hostname The hostname of the virtual hsot
  1139. * @param main_server The main server for this Apache configuration
  1140. * @param ps Place to store the new server_rec
  1141. * return Error string on error, NULL on success
  1142. *}
  1143. function ap_init_virtual_host(p: Papr_pool_t;
  1144. const hostname: PAnsiChar;
  1145. main_server: Pserver_rec;
  1146. ps: PPserver_rec): PAnsiChar;
  1147. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1148. external LibHTTPD name LibNamePrefix + 'ap_init_virtual_host' + LibSuff16;
  1149. {**
  1150. * Process a config file for Apache
  1151. * @param s The server rec to use for the command parms
  1152. * @param fname The name of the config file
  1153. * @param conftree The root node of the created config tree
  1154. * @param p Pool for general allocation
  1155. * @param ptemp Pool for temporary allocation
  1156. *}
  1157. function ap_process_resource_config(s: Pserver_rec;
  1158. const fname: PAnsiChar;
  1159. conftree: PPap_directive_t;
  1160. p, ptemp: Papr_pool_t): PAnsiChar;
  1161. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1162. external LibHTTPD name LibNamePrefix + 'ap_process_resource_config' + LibSuff20;
  1163. {**
  1164. * Process all matching files as Apache configs
  1165. * @param s The server rec to use for the command parms
  1166. * @param fname The filename pattern of the config file
  1167. * @param conftree The root node of the created config tree
  1168. * @param p Pool for general allocation
  1169. * @param ptemp Pool for temporary allocation
  1170. * @param optional Whether a no-match wildcard is allowed
  1171. * @see apr_fnmatch for pattern handling
  1172. *}
  1173. function ap_process_fnmatch_configs(s: Pserver_rec;
  1174. const fname: PAnsiChar;
  1175. conftree: PPap_directive_t;
  1176. p, ptemp: Papr_pool_t;
  1177. optional: Longint): PAnsiChar;
  1178. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1179. external LibHTTPD name LibNamePrefix + 'ap_process_fnmatch_configs' + LibSuff24;
  1180. {**
  1181. * Process all directives in the config tree
  1182. * @param s The server rec to use in the command parms
  1183. * @param conftree The config tree to process
  1184. * @param p The pool for general allocation
  1185. * @param ptemp The pool for temporary allocations
  1186. * @return OK if no problems
  1187. *}
  1188. function ap_process_config_tree(s: Pserver_rec;
  1189. conftree: Pap_directive_t;
  1190. p, ptemp: Papr_pool_t): Longint;
  1191. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1192. external LibHTTPD name LibNamePrefix + 'ap_process_config_tree' + LibSuff16;
  1193. {**
  1194. * Store data which will be retained across unload/load of modules
  1195. * @param key The unique key associated with this module's retained data
  1196. * @param size in bytes of the retained data (to be allocated)
  1197. * @return Address of new retained data structure, initially cleared
  1198. *}
  1199. function ap_retained_data_create(const key: PAnsiChar; size: apr_size_t): Pointer;
  1200. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1201. external LibHTTPD name LibNamePrefix + 'ap_retained_data_create' + LibSuff8;
  1202. {**
  1203. * Retrieve data which was stored by ap_retained_data_create()
  1204. * @param key The unique key associated with this module's retained data
  1205. * @return Address of previously retained data structure, or NULL if not yet saved
  1206. *}
  1207. function ap_retained_data_get(const key: PAnsiChar): Pointer;
  1208. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1209. external LibHTTPD name LibNamePrefix + 'ap_retained_data_get' + LibSuff4;
  1210. {* Module-method dispatchers, also for http_request.c *}
  1211. {**
  1212. * Run the handler phase of each module until a module accepts the
  1213. * responsibility of serving the request
  1214. * @param r The current request
  1215. * @return The status of the current request
  1216. *}
  1217. function ap_invoke_handler(r: Prequest_rec): Longint;
  1218. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1219. external LibHTTPD name LibNamePrefix + 'ap_invoke_handler' + LibSuff4;
  1220. {* for mod_perl *}
  1221. {**
  1222. * Find a given directive in a command_rec table
  1223. * @param name The directive to search for
  1224. * @param cmds The table to search
  1225. * @return The directive definition of the specified directive
  1226. *}
  1227. function ap_find_command(const name: PAnsiChar;
  1228. const cmds: Pcommand_rec): Pcommand_rec;
  1229. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1230. external LibHTTPD name LibNamePrefix + 'ap_find_command' + LibSuff8;
  1231. {**
  1232. * Find a given directive in a list of modules.
  1233. * @param cmd_name The directive to search for
  1234. * @param mod Pointer to the first module in the linked list; will be set to
  1235. * the module providing cmd_name
  1236. * @return The directive definition of the specified directive.
  1237. * *mod will be changed to point to the module containing the
  1238. * directive.
  1239. *}
  1240. function ap_find_command_in_modules(const cmd_name: PAnsiChar;
  1241. mod_: PPmodule): Pcommand_rec;
  1242. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1243. external LibHTTPD name LibNamePrefix + 'ap_find_command_in_modules' + LibSuff8;
  1244. {**
  1245. * Ask a module to create per-server and per-section (dir/loc/file) configs
  1246. * (if it hasn't happened already). The results are stored in the server's
  1247. * config, and the specified per-section config vector.
  1248. * @param server The server to operate upon.
  1249. * @param section_vector The per-section config vector.
  1250. * @param section Which section to create a config for.
  1251. * @param mod The module which is defining the config data.
  1252. * @param pconf A pool for all configuration allocations.
  1253. * @return The (new) per-section config data.
  1254. *}
  1255. function ap_set_config_vectors(server: Pserver_rec;
  1256. section_vector: Pap_conf_vector_t;
  1257. const section: PAnsiChar;
  1258. mod_: Pmodule;
  1259. pconf: Papr_pool_t): Pointer;
  1260. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1261. external LibHTTPD name LibNamePrefix + 'ap_set_config_vectors' + LibSuff20;
  1262. {* Hooks *}
  1263. {**
  1264. * Run the header parser functions for each module
  1265. * @param r The current request
  1266. * @return OK or DECLINED
  1267. *}
  1268. //AP_DECLARE_HOOK(int,header_parser,(request_rec *r))
  1269. (*macro expanded:
  1270. typedef
  1271. int ap_HOOK_header_parser_t (request_rec *r);
  1272. void ap_hook_header_parser(ap_HOOK_header_parser_t *pf,
  1273. const AnsiChar * const *aszPre,
  1274. const AnsiChar * const *aszSucc,
  1275. int nOrder);
  1276. int ap_run_header_parser (request_rec *r);
  1277. apr_array_header_t * ap_hook_get_header_parser(void);
  1278. struct ap_LINK_header_parser_t {
  1279. ap_HOOK_header_parser_t *pFunc;
  1280. const AnsiChar *szName;
  1281. const AnsiChar * const *aszPredecessors;
  1282. const AnsiChar * const *aszSuccessors;
  1283. int nOrder;
  1284. } ap_LINK_header_parser_t;
  1285. *)
  1286. type
  1287. ap_HOOK_header_parser_t = function(r: Prequest_rec): Longint; cdecl;
  1288. procedure ap_hook_header_parser(pf: ap_HOOK_header_parser_t;
  1289. const aszPre: PPAnsiChar;
  1290. const aszSucc: PPAnsiChar;
  1291. nOrder: Longint);
  1292. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1293. external LibHTTPD name LibNamePrefix + 'ap_hook_header_parser' + LibSuff16;
  1294. function ap_run_header_parser(r: Prequest_rec): Longint;
  1295. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1296. external LibHTTPD name LibNamePrefix + 'ap_run_header_parser' + LibSuff4;
  1297. function ap_hook_get_header_parser: Papr_array_header_t;
  1298. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1299. external LibHTTPD name LibNamePrefix + 'ap_hook_get_header_parser' + LibSuff0;
  1300. {rest of macro is ignored (struct ap_LINK_header_parser_t)}
  1301. {**
  1302. * Run the pre_config function for each module
  1303. * @param pconf The config pool
  1304. * @param plog The logging streams pool
  1305. * @param ptemp The temporary pool
  1306. * @return OK or DECLINED on success anything else is a error
  1307. *}
  1308. //AP_DECLARE_HOOK(int,pre_config,(apr_pool_t *pconf,apr_pool_t *plog,
  1309. // apr_pool_t *ptemp))
  1310. (*macro expanded:
  1311. typedef
  1312. int ap_HOOK_pre_config_t (apr_pool_t *pconf,apr_pool_t *plog, apr_pool_t *ptemp);
  1313. void ap_hook_pre_config(ap_HOOK_pre_config_t *pf, const AnsiChar * const *aszPre, const AnsiChar * const *aszSucc, int nOrder);
  1314. int ap_run_pre_config (apr_pool_t *pconf,apr_pool_t *plog, apr_pool_t *ptemp);
  1315. apr_array_header_t * ap_hook_get_pre_config(void);
  1316. struct ap_LINK_pre_config_t { ap_HOOK_pre_config_t *pFunc; const AnsiChar *szName; const AnsiChar * const *aszPredecessors; const AnsiChar * const *aszSuccessors; int nOrder; } ap_LINK_pre_config_t;
  1317. *)
  1318. type
  1319. ap_HOOK_pre_config_t = function(pconf, plog, ptemp: Papr_pool_t): Longint; cdecl;
  1320. procedure ap_hook_pre_config(pf: ap_HOOK_pre_config_t; const aszPre: PPAnsiChar; const aszSucc: PPAnsiChar; nOrder: Longint);
  1321. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1322. external LibHTTPD name LibNamePrefix + 'ap_hook_pre_config' + LibSuff16;
  1323. function ap_run_pre_config(pconf, plog, ptemp: Papr_pool_t): Longint;
  1324. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1325. external LibHTTPD name LibNamePrefix + 'ap_run_pre_config' + LibSuff12;
  1326. function ap_hook_get_pre_config: Papr_array_header_t;
  1327. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1328. external LibHTTPD name LibNamePrefix + 'ap_hook_get_pre_config' + LibSuff0;
  1329. {rest of macro is ignored}
  1330. {**
  1331. * Run the check_config function for each module
  1332. * @param pconf The config pool
  1333. * @param plog The logging streams pool
  1334. * @param ptemp The temporary pool
  1335. * @param s the server to operate upon
  1336. * @return OK or DECLINED on success anything else is a error
  1337. *}
  1338. //AP_DECLARE_HOOK(int,check_config,(apr_pool_t *pconf, apr_pool_t *plog,
  1339. // apr_pool_t *ptemp, server_rec *s))
  1340. (*macro expanded:
  1341. int ap_HOOK_check_config_t (apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s);
  1342. void ap_hook_check_config(ap_HOOK_check_config_t *pf, const AnsiChar * const *aszPre, const AnsiChar * const *aszSucc, int nOrder);
  1343. int ap_run_check_config (apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s);
  1344. apr_array_header_t * ap_hook_get_check_config(void);
  1345. struct ap_LINK_check_config_t { ap_HOOK_check_config_t *pFunc; const AnsiChar *szName; const AnsiChar * const *aszPredecessors; const AnsiChar * const *aszSuccessors; int nOrder; } ap_LINK_check_config_t;
  1346. *)
  1347. type
  1348. ap_HOOK_check_config_t = function(pconf, plog, ptemp: Papr_pool_t; s: Pserver_rec): Longint; cdecl;
  1349. procedure ap_hook_check_config(pf: ap_HOOK_check_config_t; const aszPre: PPAnsiChar; const aszSucc: PPAnsiChar; nOrder: Longint);
  1350. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1351. external LibHTTPD name LibNamePrefix + 'ap_hook_check_config' + LibSuff16;
  1352. function ap_run_check_config(pconf, plog, ptemp: Papr_pool_t; s: Pserver_rec): Longint;
  1353. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1354. external LibHTTPD name LibNamePrefix + 'ap_run_check_config' + LibSuff16;
  1355. function ap_hook_get_check_config: Papr_array_header_t;
  1356. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1357. external LibHTTPD name LibNamePrefix + 'ap_hook_get_check_config' + LibSuff0;
  1358. {rest of macro is ignored}
  1359. {**
  1360. * Run the test_config function for each module; this hook is run
  1361. * only if the server was invoked to test the configuration syntax.
  1362. * @param pconf The config pool
  1363. * @param s The list of server_recs
  1364. * @note To avoid reordering problems due to different buffering, hook
  1365. * functions should only apr_file_*() to print to stdout/stderr and
  1366. * not simple printf()/fprintf().
  1367. *
  1368. *}
  1369. //AP_DECLARE_HOOK(void,test_config,(apr_pool_t *pconf, server_rec *s))
  1370. (*macro expanded:
  1371. void ap_HOOK_test_config_t (apr_pool_t *pconf, server_rec *s);
  1372. void ap_hook_test_config(ap_HOOK_test_config_t *pf, const AnsiChar * const *aszPre, const AnsiChar * const *aszSucc, int nOrder);
  1373. void ap_run_test_config (apr_pool_t *pconf, server_rec *s);
  1374. apr_array_header_t * ap_hook_get_test_config(void);
  1375. typedef struct ap_LINK_test_config_t { ap_HOOK_test_config_t *pFunc; const AnsiChar *szName; const AnsiChar * const *aszPredecessors; const AnsiChar * const *aszSuccessors; int nOrder; } ap_LINK_test_config_t;
  1376. *)
  1377. type
  1378. ap_HOOK_test_config_t = procedure(pconf: Papr_pool_t; s: Pserver_rec); cdecl;
  1379. procedure ap_hook_test_config(pf: ap_HOOK_test_config_t; const aszPre: PPAnsiChar; const aszSucc: PPAnsiChar; nOrder: Integer);
  1380. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1381. external LibHTTPD name LibNamePrefix + 'ap_hook_test_config' + LibSuff16;
  1382. procedure ap_run_test_config(pconf: Papr_pool_t; s: Pserver_rec);
  1383. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1384. external LibHTTPD name LibNamePrefix + 'ap_run_test_config' + LibSuff8;
  1385. function ap_hook_get_test_config: Papr_array_header_t;
  1386. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1387. external LibHTTPD name LibNamePrefix + 'ap_hook_get_test_config' + LibSuff0;
  1388. {rest of macro is ignored}
  1389. {**
  1390. * Run the post_config function for each module
  1391. * @param pconf The config pool
  1392. * @param plog The logging streams pool
  1393. * @param ptemp The temporary pool
  1394. * @param s The list of server_recs
  1395. * @return OK or DECLINED on success anything else is a error
  1396. *}
  1397. //AP_DECLARE_HOOK(int,post_config,(apr_pool_t *pconf,apr_pool_t *plog,
  1398. // apr_pool_t *ptemp,server_rec *s))
  1399. (*macro expanded:
  1400. int ap_HOOK_post_config_t (apr_pool_t *pconf,apr_pool_t *plog, apr_pool_t *ptemp,server_rec *s);
  1401. void ap_hook_post_config(ap_HOOK_post_config_t *pf, const AnsiChar * const *aszPre, const AnsiChar * const *aszSucc, int nOrder);
  1402. int ap_run_post_config (apr_pool_t *pconf,apr_pool_t *plog, apr_pool_t *ptemp,server_rec *s);
  1403. apr_array_header_t * ap_hook_get_post_config(void);
  1404. struct ap_LINK_post_config_t { ap_HOOK_post_config_t *pFunc; const AnsiChar *szName; const AnsiChar * const *aszPredecessors; const AnsiChar * const *aszSuccessors; int nOrder; } ap_LINK_post_config_t;
  1405. *)
  1406. type
  1407. ap_HOOK_post_config_t = function(pconf, plog, ptemp: Papr_pool_t; s: Pserver_rec): Longint; cdecl;
  1408. procedure ap_hook_post_config(pf: ap_HOOK_post_config_t; const aszPre: PPAnsiChar; const aszSucc: PPAnsiChar; nOrder: Integer);
  1409. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1410. external LibHTTPD name LibNamePrefix + 'ap_hook_post_config' + LibSuff16;
  1411. function ap_run_post_config(pconf, plog, ptemp: Papr_pool_t; s: Pserver_rec): Longint;
  1412. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1413. external LibHTTPD name LibNamePrefix + 'ap_run_post_config' + LibSuff16;
  1414. function ap_hook_get_post_config: Papr_array_header_t;
  1415. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1416. external LibHTTPD name LibNamePrefix + 'ap_hook_get_post_config' + LibSuff0;
  1417. {rest of macro is ignored}
  1418. {**
  1419. * Run the open_logs functions for each module
  1420. * @param pconf The config pool
  1421. * @param plog The logging streams pool
  1422. * @param ptemp The temporary pool
  1423. * @param s The list of server_recs
  1424. * @return OK or DECLINED on success anything else is a error
  1425. *}
  1426. //AP_DECLARE_HOOK(int,open_logs,(apr_pool_t *pconf,apr_pool_t *plog,
  1427. // apr_pool_t *ptemp,server_rec *s))
  1428. (*macro expanded:
  1429. int ap_HOOK_open_logs_t (apr_pool_t *pconf,apr_pool_t *plog, apr_pool_t *ptemp,server_rec *s);
  1430. void ap_hook_open_logs(ap_HOOK_open_logs_t *pf, const AnsiChar * const *aszPre, const AnsiChar * const *aszSucc, int nOrder);
  1431. int ap_run_open_logs (apr_pool_t *pconf,apr_pool_t *plog, apr_pool_t *ptemp,server_rec *s);
  1432. apr_array_header_t * ap_hook_get_open_logs(void);
  1433. struct ap_LINK_open_logs_t { ap_HOOK_open_logs_t *pFunc; const AnsiChar *szName; const AnsiChar * const *aszPredecessors; const AnsiChar * const *aszSuccessors; int nOrder; } ap_LINK_open_logs_t;
  1434. *)
  1435. type
  1436. ap_HOOK_open_logs_t = function(pconf, plog, ptemp: Papr_pool_t; s: Pserver_rec): Longint; cdecl;
  1437. procedure ap_hook_open_logs(pf: ap_HOOK_open_logs_t; const aszPre: PPAnsiChar; const aszSucc: PPAnsiChar; nOrder: Integer);
  1438. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1439. external LibHTTPD name LibNamePrefix + 'ap_hook_open_logs' + LibSuff16;
  1440. function ap_run_open_logs(pconf, plog, ptemp: Papr_pool_t; s: Pserver_rec): Longint;
  1441. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1442. external LibHTTPD name LibNamePrefix + 'ap_run_open_logs' + LibSuff16;
  1443. function ap_hook_get_open_logs: Papr_array_header_t;
  1444. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1445. external LibHTTPD name LibNamePrefix + 'ap_hook_get_open_logs' + LibSuff0;
  1446. {rest of macro is ignored}
  1447. {**
  1448. * Run the child_init functions for each module
  1449. * @param pchild The child pool
  1450. * @param s The list of server_recs in this server
  1451. *}
  1452. //AP_DECLARE_HOOK(void,child_init,(apr_pool_t *pchild, server_rec *s))
  1453. (*macro expanded:
  1454. void ap_HOOK_child_init_t (apr_pool_t *pchild, server_rec *s);
  1455. void ap_hook_child_init(ap_HOOK_child_init_t *pf, const AnsiChar * const *aszPre, const AnsiChar * const *aszSucc, int nOrder);
  1456. void ap_run_child_init (apr_pool_t *pchild, server_rec *s);
  1457. apr_array_header_t * ap_hook_get_child_init(void);
  1458. struct ap_LINK_child_init_t { ap_HOOK_child_init_t *pFunc; const AnsiChar *szName; const AnsiChar * const *aszPredecessors; const AnsiChar * const *aszSuccessors; int nOrder; } ap_LINK_child_init_t;
  1459. *)
  1460. type
  1461. ap_HOOK_child_init_t = procedure(pchild: Papr_pool_t; s: Pserver_rec); cdecl;
  1462. procedure ap_hook_child_init(pf: ap_HOOK_child_init_t; const aszPre: PPAnsiChar; const aszSucc: PPAnsiChar; nOrder: Integer);
  1463. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1464. external LibHTTPD name LibNamePrefix + 'ap_hook_child_init' + LibSuff16;
  1465. procedure ap_run_child_init(pchild: Papr_pool_t; s: Pserver_rec);
  1466. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1467. external LibHTTPD name LibNamePrefix + 'ap_run_child_init' + LibSuff8;
  1468. function ap_hook_get_child_init: Papr_array_header_t;
  1469. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1470. external LibHTTPD name LibNamePrefix + 'ap_hook_get_child_init' + LibSuff0;
  1471. {rest of macro is ignored}
  1472. {**
  1473. * Run the handler functions for each module
  1474. * @param r The request_rec
  1475. * @remark non-wildcard handlers should HOOK_MIDDLE, wildcard HOOK_LAST
  1476. *}
  1477. //AP_DECLARE_HOOK(int,handler,(request_rec *r))
  1478. (*macro expanded:
  1479. int ap_HOOK_handler_t (request_rec *r);
  1480. void ap_hook_handler(ap_HOOK_handler_t *pf, const AnsiChar * const *aszPre, const AnsiChar * const *aszSucc, int nOrder);
  1481. int ap_run_handler (request_rec *r);
  1482. apr_array_header_t * ap_hook_get_handler(void);
  1483. struct ap_LINK_handler_t { ap_HOOK_handler_t *pFunc; const AnsiChar *szName; const AnsiChar * const *aszPredecessors; const AnsiChar * const *aszSuccessors; int nOrder; } ap_LINK_handler_t;
  1484. *)
  1485. type
  1486. ap_HOOK_handler_t = function(r: Prequest_rec): Longint; cdecl;
  1487. procedure ap_hook_handler(pf: ap_HOOK_handler_t; const aszPre: PPAnsiChar; const aszSucc: PPAnsiChar; nOrder: Integer);
  1488. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1489. external LibHTTPD name LibNamePrefix + 'ap_hook_handler' + LibSuff16;
  1490. function ap_run_handler(r: Prequest_rec): Longint;
  1491. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1492. external LibHTTPD name LibNamePrefix + 'ap_run_handler' + LibSuff4;
  1493. function ap_hook_get_handler: Papr_array_header_t;
  1494. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1495. external LibHTTPD name LibNamePrefix + 'ap_hook_get_handler' + LibSuff0;
  1496. {rest of macro is ignored}
  1497. {**
  1498. * Run the quick handler functions for each module. The quick_handler
  1499. * is run before any other requests hooks are called (location_walk,
  1500. * directory_walk, access checking, et. al.). This hook was added
  1501. * to provide a quick way to serve content from a URI keyed cache.
  1502. *
  1503. * @param r The request_rec
  1504. * @param lookup_uri Controls whether the caller actually wants content or not.
  1505. * lookup is set when the quick_handler is called out of
  1506. * ap_sub_req_lookup_uri()
  1507. *}
  1508. //AP_DECLARE_HOOK(int,quick_handler,(request_rec *r, int lookup_uri))
  1509. (*macro expanded:
  1510. int ap_HOOK_quick_handler_t (request_rec *r, int lookup_uri);
  1511. void ap_hook_quick_handler(ap_HOOK_quick_handler_t *pf, const AnsiChar * const *aszPre, const AnsiChar * const *aszSucc, int nOrder);
  1512. int ap_run_quick_handler (request_rec *r, int lookup_uri);
  1513. apr_array_header_t * ap_hook_get_quick_handler(void);
  1514. struct ap_LINK_quick_handler_t { ap_HOOK_quick_handler_t *pFunc; const AnsiChar *szName; const AnsiChar * const *aszPredecessors; const AnsiChar * const *aszSuccessors; int nOrder; } ap_LINK_quick_handler_t;
  1515. *)
  1516. type
  1517. ap_HOOK_quick_handler_t = function(r: Prequest_rec; lookup_uri: Longint): Longint; cdecl;
  1518. procedure ap_hook_quick_handler(pf: ap_HOOK_quick_handler_t; const aszPre: PPAnsiChar; const aszSucc: PPAnsiChar; nOrder: Integer);
  1519. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1520. external LibHTTPD name LibNamePrefix + 'ap_hook_quick_handler' + LibSuff16;
  1521. function ap_run_quick_handler(r: Prequest_rec; lookup_uri: Longint): Longint;
  1522. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1523. external LibHTTPD name LibNamePrefix + 'ap_run_quick_handler' + LibSuff8;
  1524. function ap_hook_get_quick_handler: Papr_array_header_t;
  1525. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1526. external LibHTTPD name LibNamePrefix + 'ap_hook_get_quick_handler' + LibSuff0;
  1527. {rest of macro is ignored}
  1528. {**
  1529. * Retrieve the optional functions for each module.
  1530. * This is run immediately before the server starts. Optional functions should
  1531. * be registered during the hook registration phase.
  1532. *}
  1533. //AP_DECLARE_HOOK(void,optional_fn_retrieve,(void))
  1534. (*macro expanded:
  1535. void ap_HOOK_optional_fn_retrieve_t (void);
  1536. void ap_hook_optional_fn_retrieve(ap_HOOK_optional_fn_retrieve_t *pf, const AnsiChar * const *aszPre, const AnsiChar * const *aszSucc, int nOrder);
  1537. void ap_run_optional_fn_retrieve (void);
  1538. apr_array_header_t * ap_hook_get_optional_fn_retrieve(void);
  1539. struct ap_LINK_optional_fn_retrieve_t { ap_HOOK_optional_fn_retrieve_t *pFunc; const AnsiChar *szName; const AnsiChar * const *aszPredecessors; const AnsiChar * const *aszSuccessors; int nOrder; } ap_LINK_optional_fn_retrieve_t;
  1540. *)
  1541. type
  1542. ap_HOOK_optional_fn_retrieve_t = procedure; cdecl;
  1543. procedure ap_hook_optional_fn_retrieve(pf: ap_HOOK_optional_fn_retrieve_t; const aszPre: PPAnsiChar; const aszSucc: PPAnsiChar; nOrder: Integer);
  1544. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1545. external LibHTTPD name LibNamePrefix + 'ap_hook_optional_fn_retrieve' + LibSuff16;
  1546. procedure ap_run_optional_fn_retrieve;
  1547. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1548. external LibHTTPD name LibNamePrefix + 'ap_run_optional_fn_retrieve' + LibSuff0;
  1549. function ap_hook_get_optional_fn_retrieve: Papr_array_header_t;
  1550. {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
  1551. external LibHTTPD name LibNamePrefix + 'ap_hook_get_optional_fn_retrieve' + LibSuff0;
  1552. {rest of macro is ignored}
  1553. {**
  1554. * A generic pool cleanup that will reset a pointer to NULL. For use with
  1555. * apr_pool_cleanup_register.
  1556. * @param data The address of the pointer
  1557. * @return APR_SUCCESS
  1558. *}
  1559. //AP_DECLARE_NONSTD(apr_status_t) ap_pool_cleanup_set_null(void *data);
  1560. function ap_pool_cleanup_set_null(data: Pointer): apr_status_t; cdecl;
  1561. external LibHTTPD name LibNamePrefix + 'ap_pool_cleanup_set_null';
  1562. {$endif} {* !APACHE_HTTP_CONFIG_H *}
  1563. (** @} *)