1
{ Copyright 1999-2005 The Apache Software Foundation or its licensors, as
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
8
* http://www.apache.org/licenses/LICENSE-2.0
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.
17
//#include "apr_buckets.h"
20
* @package Apache script tools
27
* Create an environment variable out of an Apache table of key-value pairs
28
* @param p pool to allocate out of
29
* @param t Apache table of key-value pairs
30
* @return An array containing the same key-value pairs suitable for
31
* use with an exec call.
32
* @deffunc char **ap_create_environment(apr_pool_t *p, apr_table_t *t)
34
function ap_create_environment(p: Papr_pool_t; t: Papr_table_t): PPChar;
35
{$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
36
external LibHTTPD name LibNamePrefix + 'ap_create_environment' + LibSuff8;
39
* This "cute" little function comes about because the path info on
40
* filenames and URLs aren't always the same. So we take the two,
41
* and find as much of the two that match as possible.
42
* @param uri The uri we are currently parsing
43
* @param path_info The current path info
44
* @return The length of the path info
45
* @deffunc int ap_find_path_info(const char *uri, const char *path_info)
47
function ap_find_path_info(const uri, path_info: PChar): Integer;
48
{$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
49
external LibHTTPD name LibNamePrefix + 'ap_find_path_info' + LibSuff8;
52
* Add CGI environment variables required by HTTP/1.1 to the request's
54
* @param r the current request
55
* @deffunc void ap_add_cgi_vars(request_rec *r)
57
procedure ap_add_cgi_vars(r: Prequest_rec);
58
{$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
59
external LibHTTPD name LibNamePrefix + 'ap_add_cgi_vars' + LibSuff4;
62
* Add common CGI environment variables to the requests environment table
63
* @param r The current request
64
* @deffunc void ap_add_common_vars(request_rec *r)
66
procedure ap_add_common_vars(r: Prequest_rec);
67
{$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
68
external LibHTTPD name LibNamePrefix + 'ap_add_common_vars' + LibSuff4;
71
* Read headers output from a script, ensuring that the output is valid. If
72
* the output is valid, then the headers are added to the headers out of the
74
* @param r The current request
75
* @param f The file to read from
76
* @param buffer Empty when calling the function. On output, if there was an
77
* error, the string that cause the error is stored here.
78
* @return HTTP_OK on success, HTTP_INTERNAL_SERVER_ERROR otherwise
79
* @deffunc int ap_scan_script_header_err(request_rec *r, apr_file_t *f, char *buffer)
81
function ap_scan_script_header_err(r: Prequest_rec;
82
f: Papr_file_t; buffer: PChar): Integer;
83
{$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
84
external LibHTTPD name LibNamePrefix + 'ap_scan_script_header_err' + LibSuff12;
87
* Read headers output from a script, ensuring that the output is valid. If
88
* the output is valid, then the headers are added to the headers out of the
90
* @param r The current request
91
* @param bb The brigade from which to read
92
* @param buffer Empty when calling the function. On output, if there was an
93
* error, the string that cause the error is stored here.
94
* @return HTTP_OK on success, HTTP_INTERNAL_SERVER_ERROR otherwise
95
* @deffunc int ap_scan_script_header_err_brigade(request_rec *r, apr_bucket_brigade *bb, char *buffer)
97
function ap_scan_script_header_err_brigade(r: Prequest_rec;
98
bb: Papr_bucket_brigade; buffer: PChar): Integer;
99
{$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
100
external LibHTTPD name LibNamePrefix + 'ap_scan_script_header_err_brigade' + LibSuff12;
103
* Read headers strings from a script, ensuring that the output is valid. If
104
* the output is valid, then the headers are added to the headers out of the
106
* @param r The current request
107
* @param buffer Empty when calling the function. On output, if there was an
108
* error, the string that cause the error is stored here.
109
* @param termch Pointer to the last character parsed.
110
* @param termarg Pointer to an int to capture the last argument parsed.
111
* @param args String arguments to parse consecutively for headers,
112
* a NULL argument terminates the list.
113
* @return HTTP_OK on success, HTTP_INTERNAL_SERVER_ERROR otherwise
114
* @deffunc int ap_scan_script_header_err_core(request_rec *r, char *buffer, int (*getsfunc)(char *, int, void *), void *getsfunc_data)
116
function ap_scan_script_header_err_strs(buffer: PChar;
117
termch: PPChar; termarg: PInteger; others: array of const): Integer;
118
cdecl; external LibHTTPD name 'ap_scan_script_header_err_strs';
121
* Read headers output from a script, ensuring that the output is valid. If
122
* the output is valid, then the headers are added to the headers out of the
124
* @param r The current request
125
* @param buffer Empty when calling the function. On output, if there was an
126
* error, the string that cause the error is stored here.
127
* @param getsfunc Function to read the headers from. This function should
129
* @param getsfunc_data The place to read from
130
* @return HTTP_OK on success, HTTP_INTERNAL_SERVER_ERROR otherwise
131
* @deffunc int ap_scan_script_header_err_core(request_rec *r, char *buffer, int (*getsfunc)(char *, int, void *), void *getsfunc_data)
134
getsfunc_t = function(p1: PChar; p2: Integer; p3: Pointer): Integer;
136
function ap_scan_script_header_err_core(r: Prequest_rec;
137
buffer: PChar; getsfunc: getsfunc_t; getsfunc_data: Pointer): Integer;
138
{$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
139
external LibHTTPD name LibNamePrefix + 'ap_scan_script_header_err_core' + LibSuff16;