~ubuntu-branches/ubuntu/lucid/fpc/lucid-proposed

« back to all changes in this revision

Viewing changes to fpcsrc/packages/base/httpd/httpd-2.0/util_script.inc

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-10-09 23:29:00 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20081009232900-553f61m37jkp6upv
Tags: 2.2.2-4
[ Torsten Werner ]
* Update ABI version in fpc-depends automatically.
* Remove empty directories from binary package fpc-source.

[ Mazen Neifer ]
* Removed leading path when calling update-alternatives to remove a Linitian
  error.
* Fixed clean target.
* Improved description of packages. (Closes: #498882)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{ Copyright 1999-2005 The Apache Software Foundation or its licensors, as
2
 
 * applicable.
3
 
 *
4
 
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 
 * you may not use this file except in compliance with the License.
6
 
 * You may obtain a copy of the License at
7
 
 *
8
 
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 
 *
10
 
 * Unless required by applicable law or agreed to in writing, software
11
 
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 
 * See the License for the specific language governing permissions and
14
 
 * limitations under the License.
15
 
 }
16
 
 
17
 
//#include "apr_buckets.h"
18
 
 
19
 
{
20
 
 * @package Apache script tools
21
 
 }
22
 
 
23
 
const
24
 
  APACHE_ARG_MAX = 512;
25
 
 
26
 
{
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)
33
 
 }
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;
37
 
 
38
 
{
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)
46
 
 }
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;
50
 
 
51
 
{
52
 
 * Add CGI environment variables required by HTTP/1.1 to the request's 
53
 
 * environment table
54
 
 * @param r the current request
55
 
 * @deffunc void ap_add_cgi_vars(request_rec *r)
56
 
 }
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;
60
 
 
61
 
{
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)
65
 
 }
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;
69
 
 
70
 
{
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
73
 
 * current request
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)
80
 
 }
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;
85
 
 
86
 
{
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
89
 
 * current request
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)
96
 
 }
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;
101
 
 
102
 
{
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
105
 
 * current request
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)
115
 
 }
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';
119
 
 
120
 
{
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
123
 
 * current request
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
128
 
                   act like gets()
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)
132
 
 }
133
 
type
134
 
  getsfunc_t = function(p1: PChar; p2: Integer; p3: Pointer): Integer;
135
 
  
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;
140