~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to fpcsrc/packages/base/httpd/httpd-2.2/ap_regex.inc

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
{ Derived from PCRE's pcreposix.h.
 
18
 
 
19
            Copyright (c) 1997-2004 University of Cambridge
 
20
 
 
21
-----------------------------------------------------------------------------
 
22
Redistribution and use in source and binary forms, with or without
 
23
modification, are permitted provided that the following conditions are met:
 
24
 
 
25
    * Redistributions of source code must retain the above copyright notice,
 
26
      this list of conditions and the following disclaimer.
 
27
 
 
28
    * Redistributions in binary form must reproduce the above copyright
 
29
      notice, this list of conditions and the following disclaimer in the
 
30
      documentation and/or other materials provided with the distribution.
 
31
 
 
32
    * Neither the name of the University of Cambridge nor the names of its
 
33
      contributors may be used to endorse or promote products derived from
 
34
      this software without specific prior written permission.
 
35
 
 
36
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 
37
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 
38
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 
39
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 
40
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 
41
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 
42
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 
43
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 
44
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 
45
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 
46
POSSIBILITY OF SUCH DAMAGE.
 
47
-----------------------------------------------------------------------------
 
48
}
 
49
 
 
50
{
 
51
 * @file ap_regex.h
 
52
 * @brief Apache Regex defines
 
53
 }
 
54
 
 
55
//#include "apr.h"
 
56
 
 
57
{ Options for ap_regexec: }
 
58
 
 
59
const
 
60
  AP_REG_ICASE    = $01; { use a case-insensitive match }
 
61
  AP_REG_NEWLINE  = $02; { don't match newlines against '.' etc }
 
62
  AP_REG_NOTBOL   = $04; { ^ will not match against start-of-string }
 
63
  AP_REG_NOTEOL   = $08; { $ will not match against end-of-string }
 
64
 
 
65
  AP_REG_EXTENDED = (0);  { unused }
 
66
  AP_REG_NOSUB    = (0);  { unused }
 
67
 
 
68
{ Error values: }
 
69
 
 
70
  AP_REG_ASSERT  = 1;     { internal error ? }
 
71
  AP_REG_ESPACE  = 2;     { failed to get memory }
 
72
  AP_REG_INVARG  = 3;     { invalid argument }
 
73
  AP_REG_NOMATCH = 4;     { match failed }
 
74
 
 
75
{ The structure representing a compiled regular expression. }
 
76
type
 
77
  Pap_regex_t = ^ap_regex_t;
 
78
  
 
79
  ap_regex_t = record
 
80
    re_pcre: Pointer;
 
81
    re_nsub: apr_size_t;
 
82
    re_erroffset: apr_size_t;
 
83
  end;
 
84
 
 
85
{ The structure in which a captured offset is returned. }
 
86
  Pap_regmatch_t = ^ap_regmatch_t;
 
87
 
 
88
  ap_regmatch_t = record
 
89
    rm_so: Integer;
 
90
    rm_eo: Integer;
 
91
  end;
 
92
 
 
93
{ The functions }
 
94
 
 
95
{
 
96
 * Compile a regular expression.
 
97
 * @param preg Returned compiled regex
 
98
 * @param regex The regular expression string
 
99
 * @param cflags Must be zero (currently).
 
100
 * @return Zero on success or non-zero on error
 
101
 }
 
102
function ap_regcomp(preg: Pap_regex_t; const regex: PChar; cflags: Integer): Integer;
 
103
 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
104
 external LibHTTPD name LibNamePrefix + 'ap_regcomp' + LibSuff12;
 
105
 
 
106
{
 
107
 * Match a NUL-terminated string against a pre-compiled regex.
 
108
 * @param preg The pre-compiled regex
 
109
 * @param string The string to match
 
110
 * @param nmatch Provide information regarding the location of any matches
 
111
 * @param pmatch Provide information regarding the location of any matches
 
112
 * @param eflags Bitwise OR of any of AP_REG_* flags 
 
113
 * @return 0 for successful match, #REG_NOMATCH otherwise
 
114
 }
 
115
function ap_regexec(const preg: Pap_regex_t; const string_: PChar;
 
116
 nmatch: apr_size_t; pmatch: Pap_regmatch_t; eflags: Integer): Integer;
 
117
 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
118
 external LibHTTPD name LibNamePrefix + 'ap_regexec' + LibSuff20;
 
119
 
 
120
{
 
121
 * Return the error code returned by regcomp or regexec into error messages
 
122
 * @param errcode the error code returned by regexec or regcomp
 
123
 * @param preg The precompiled regex
 
124
 * @param errbuf A buffer to store the error in
 
125
 * @param errbuf_size The size of the buffer
 
126
 }
 
127
function ap_regerror(errcord: Integer; const preg: Pap_regex_t;
 
128
 errbuf: PChar; errbuf_size: apr_size_t): apr_size_t;
 
129
 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
130
 external LibHTTPD name LibNamePrefix + 'ap_regerror' + LibSuff16;
 
131
 
 
132
{ Destroy a pre-compiled regex.
 
133
 * @param preg The pre-compiled regex to free.
 
134
 }
 
135
procedure ap_regfree(preg: Pap_regex_t);
 
136
 {$IFDEF WINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
 
137
 external LibHTTPD name LibNamePrefix + 'ap_regfree' + LibSuff4;
 
138