diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2008-09-05 10:25:46 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2008-09-05 10:25:46 +0000 |
commit | 32982f0c81923033745576c49e5bf2f11ad5403b (patch) | |
tree | af12f656ee4391cfcd593ea74a8144e767a09e25 | |
parent | 27353e42354a40c18ff4c79676749c76999e759e (diff) | |
download | pcre-32982f0c81923033745576c49e5bf2f11ad5403b.tar.gz |
Update the Virtual Pascal + BCC files for current versions.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@373 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | makevp.bat | 52 | ||||
-rw-r--r-- | makevp_c.txt | 2 | ||||
-rw-r--r-- | makevp_l.txt | 10 | ||||
-rw-r--r-- | pcregexp.pas | 75 |
5 files changed, 104 insertions, 40 deletions
@@ -73,6 +73,11 @@ Version 7.8 25-Aug-08 18. Tidied a few places to stop certain compilers from issuing warnings. +19. Updated the Virtual Pascal + BCC files to compile the latest v7.7, as + supplied by Stefan Weber. I made a further small update for 7.8 because + there is a change of source arrangements: the pcre_searchfuncs.c module is + replaced by pcre_ucd.c. + Version 7.7 07-May-08 --------------------- @@ -1,44 +1,66 @@ -@echo off - :: AH 20-12-06 modified for new PCRE-7.0 and VP/BCC :: PH 19-03-07 renamed !compile.txt and !linklib.txt as makevp-compile.txt and :: makevp-linklib.txt :: PH 26-03-07 re-renamed !compile.txt and !linklib.txt as makevp-c.txt and :: makevp-l.txt :: PH 29-03-07 hopefully the final rename to makevp_c and makevp_l +:: AH 27.08.08 updated for new PCRE-7.7 +:: required PCRE.H and CONFIG.H will be generated if not existing + +@echo off +echo. +echo Compiling PCRE with BORLAND C++ for VIRTUAL PASCAL +echo. REM This file was contributed by Alexander Tokarev for building PCRE for use REM with Virtual Pascal. It has not been tested with the latest PCRE release. +REM This file has been modified and extended to compile with newer PCRE releases +REM by Stefan Weber (Angels Holocaust). + REM CHANGE THIS FOR YOUR BORLAND C++ COMPILER PATH +SET BORLAND=f:\bcc +REM location of the TASM binaries, if compiling with the -B BCC switch +SET TASM=f:\tasm -SET BORLAND=F:\bcc -SET PATH=%PATH%;%BORLAND%\bin;f:\tasm\bin -SET PCRE_VER=70 +SET PATH=%PATH%;%BORLAND%\bin;%TASM%\bin +SET PCRE_VER=77 +SET COMPILE_DEFAULTS=-DHAVE_CONFIG_H -DPCRE_STATIC -I%BORLAND%\include + +del pcre%PCRE_VER%.lib >nul 2>nul :: sh configure -bcc32 -DDFTABLES -DSTATIC -I%BORLAND%\include -L%BORLAND%\lib dftables.c -:: bcc32 -DDFTABLES -DSTATIC -DVPCOMPAT -I%BORLAND%\include -L%BORLAND%\lib dftables.c -IF ERRORLEVEL 1 EXIT +:: check for needed header files +if not exist pcre.h copy pcre.h.generic pcre.h +if not exist config.h copy config.h.generic config.h + +bcc32 -DDFTABLES %COMPILE_DEFAULTS% -L%BORLAND%\lib dftables.c +IF ERRORLEVEL 1 GOTO ERROR :: dftables > chartables.c dftables pcre_chartables.c REM compile and link the PCRE library into lib: option -B for ASM compile works too -bcc32 -a4 -c -RT- -y- -v- -u- -R- -Q- -X -d -fp -ff -P- -O2 -Oc -Ov -3 -w-8004 -w-8064 -w-8065 -w-8012 -DSTATIC -DVPCOMPAT -UDFTABLES -I%BORLAND%\include @makevp_c.txt -:: bcc32 -c -RT- -y- -v- -u- -P- -O2 -5 -DSTATIC -DVPCOMPAT -UDFTABLES -I%BORLAND%\include get.c maketables.c pcre.c study.c -IF ERRORLEVEL 1 EXIT +bcc32 -a4 -c -RT- -y- -v- -u- -R- -Q- -X -d -fp -ff -P- -O2 -Oc -Ov -3 -w-8004 -w-8064 -w-8065 -w-8012 -UDFTABLES -DVPCOMPAT %COMPILE_DEFAULTS% @makevp_c.txt +IF ERRORLEVEL 1 GOTO ERROR tlib %BORLAND%\lib\cw32.lib *calloc *del *strncmp *memcpy *memmove *memset *memcmp *strlen -:: tlib %BORLAND%\lib\cw32.lib *calloc *del *strncmp *memcpy *memmove *memset -IF ERRORLEVEL 1 EXIT +IF ERRORLEVEL 1 GOTO ERROR tlib pcre%PCRE_VER%.lib @makevp_l.txt +calloc.obj +del.obj +strncmp.obj +memcpy.obj +memmove.obj +memset.obj +memcmp.obj +strlen.obj -:: tlib pcre.lib +get.obj +maketables.obj +pcre.obj +study.obj +calloc.obj +del.obj +strncmp.obj +memcpy.obj +memmove.obj +memset.obj -IF ERRORLEVEL 1 EXIT +IF ERRORLEVEL 1 GOTO ERROR del *.obj *.tds *.bak >nul 2>nul echo --- echo Now the library should be complete. Please check all messages above. echo Don't care for warnings, it's OK. +goto END + +:ERROR +echo --- +echo Error while compiling PCRE. Aborting... +pause +goto END + +:END diff --git a/makevp_c.txt b/makevp_c.txt index 6048517..931b8ab 100644 --- a/makevp_c.txt +++ b/makevp_c.txt @@ -14,7 +14,7 @@ pcre_refcount.c pcre_study.c
pcre_tables.c
pcre_try_flipped.c
-pcre_ucp_searchfuncs.c
+pcre_ucd.c
pcre_valid_utf8.c
pcre_version.c
pcre_xclass.c
diff --git a/makevp_l.txt b/makevp_l.txt index cd02aa5..6de1cb4 100644 --- a/makevp_l.txt +++ b/makevp_l.txt @@ -2,19 +2,19 @@ +pcre_compile.obj &
+pcre_config.obj &
+pcre_dfa_exec.obj &
-+pcre_exec.obj &
++pcre_exec.obj &
+pcre_fullinfo.obj &
-+pcre_get.obj &
++pcre_get.obj &
+pcre_globals.obj &
-+pcre_info.obj &
++pcre_info.obj &
+pcre_maketables.obj &
+pcre_newline.obj &
+pcre_ord2utf8.obj &
+pcre_refcount.obj &
-+pcre_study.obj &
++pcre_study.obj &
+pcre_tables.obj &
+pcre_try_flipped.obj &
-+pcre_ucp_searchfuncs.obj &
++pcre_ucd.obj &
+pcre_valid_utf8.obj &
+pcre_version.obj &
+pcre_xclass.obj
diff --git a/pcregexp.pas b/pcregexp.pas index 4f4d444..272a96e 100644 --- a/pcregexp.pas +++ b/pcregexp.pas @@ -24,9 +24,10 @@ 19-02-06 - added SearchOfs(): let PCRE use the complete string and offset
into the string itself
20-12-06 - support for version 7.0
+ 27.08.08 - support for v7.7
}
-{$H+} {$DEFINE PCRE_3_7} {$DEFINE PCRE_5_0} {$DEFINE PCRE_7_0}
+{$H+} {$DEFINE PCRE_3_7} {$DEFINE PCRE_5_0} {$DEFINE PCRE_7_0} {$DEFINE PCRE_7_7}
Unit pcregexp;
@@ -105,6 +106,14 @@ Const { Options } PCRE_NEWLINE_CRLF = $00300000;
PCRE_NEWLINE_ANY = $00400000;
PCRE_NEWLINE_ANYCRLF = $00500000;
+
+ PCRE_NEWLINE_BITS = PCRE_NEWLINE_CR or PCRE_NEWLINE_LF or PCRE_NEWLINE_ANY;
+
+{$ENDIF}
+{$IFDEF PCRE_7_7}
+ PCRE_BSR_ANYCRLF = $00800000;
+ PCRE_BSR_UNICODE = $01000000;
+ PCRE_JAVASCRIPT_COMPAT= $02000000;
{$ENDIF}
PCRE_COMPILE_ALLOWED_OPTIONS = PCRE_ANCHORED + PCRE_AUTO_CALLOUT + PCRE_CASELESS +
@@ -112,15 +121,20 @@ Const { Options } PCRE_EXTRA + PCRE_MULTILINE + PCRE_NO_AUTO_CAPTURE +
PCRE_UNGREEDY + PCRE_UTF8 + PCRE_NO_UTF8_CHECK
{$IFDEF PCRE_7_0}
- + PCRE_DUPNAMES + PCRE_FIRSTLINE + PCRE_NEWLINE_CRLF
- + PCRE_NEWLINE_ANY + PCRE_NEWLINE_CRLF + + PCRE_DUPNAMES + PCRE_FIRSTLINE + PCRE_NEWLINE_BITS
+ {$ENDIF}
+ {$IFDEF PCRE_7_7}
+ + PCRE_BSR_ANYCRLF + PCRE_BSR_UNICODE + PCRE_JAVASCRIPT_COMPAT
{$ENDIF}
;
PCRE_EXEC_ALLOWED_OPTIONS = PCRE_ANCHORED + PCRE_NOTBOL + PCRE_NOTEOL +
PCRE_NOTEMPTY + PCRE_NO_UTF8_CHECK + PCRE_PARTIAL
{$IFDEF PCRE_7_0}
- + PCRE_NEWLINE_CRLF + PCRE_NEWLINE_ANY +PCRE_NEWLINE_ANYCRLF + + PCRE_NEWLINE_BITS
+ {$ENDIF}
+ {$IFDEF PCRE_7_7}
+ + PCRE_BSR_ANYCRLF + PCRE_BSR_UNICODE
{$ENDIF}
;
@@ -128,8 +142,11 @@ Const { Options } PCRE_DFA_EXEC_ALLOWED_OPTIONS = PCRE_ANCHORED + PCRE_NOTBOL + PCRE_NOTEOL +
PCRE_NOTEMPTY + PCRE_NO_UTF8_CHECK + PCRE_PARTIAL +
PCRE_DFA_SHORTEST + PCRE_DFA_RESTART +
- PCRE_NEWLINE_CR + PCRE_NEWLINE_LF + PCRE_NEWLINE_CRLF +
- PCRE_NEWLINE_ANY + PCRE_NEWLINE_ANYCRLF
+ PCRE_NEWLINE_BITS
+ {$IFDEF PCRE_7_7}
+ + PCRE_BSR_ANYCRLF + PCRE_BSR_UNICODE
+ {$ENDIF}
+ ;
{$ENDIF}
{ Exec-time and get/set-time error codes }
@@ -164,7 +181,7 @@ Const { Options } { Request types for pcre_fullinfo() }
PCRE_INFO_OPTIONS = 0;
- PCRE_INFO_SIZE = 1;
+ PCRE_INFO_SIZE = 1;
PCRE_INFO_CAPTURECOUNT = 2;
PCRE_INFO_BACKREFMAX = 3;
PCRE_INFO_FIRSTBYTE = 4;
@@ -178,12 +195,17 @@ Const { Options } PCRE_INFO_STUDYSIZE = 10;
PCRE_INFO_DEFAULT_TABLES = 11;
{$ENDIF PCRE_5_0}
+{$IFDEF PCRE_7_7}
+ PCRE_INFO_OKPARTIAL = 12;
+ PCRE_INFO_JCHANGED = 13;
+ PCRE_INFO_HASCRORLF = 14;
+{$ENDIF}
{ Request types for pcre_config() }
{$IFDEF PCRE_5_0}
- PCRE_CONFIG_UTF8 = 0;
- PCRE_CONFIG_NEWLINE = 1;
- PCRE_CONFIG_LINK_SIZE = 2;
+ PCRE_CONFIG_UTF8 = 0;
+ PCRE_CONFIG_NEWLINE = 1;
+ PCRE_CONFIG_LINK_SIZE = 2;
PCRE_CONFIG_POSIX_MALLOC_THRESHOLD = 3;
PCRE_CONFIG_MATCH_LIMIT = 4;
PCRE_CONFIG_STACKRECURSE = 5;
@@ -192,13 +214,16 @@ Const { Options } {$IFDEF PCRE_7_0}
PCRE_CONFIG_MATCH_LIMIT_RECURSION = 7;
{$ENDIF}
+{$IFDEF PCRE_7_7}
+ PCRE_CONFIG_BSR = 8;
+{$ENDIF}
{ Bit flags for the pcre_extra structure }
{$IFDEF PCRE_5_0}
- PCRE_EXTRA_STUDY_DATA = $0001;
- PCRE_EXTRA_MATCH_LIMIT = $0002;
+ PCRE_EXTRA_STUDY_DATA = $0001;
+ PCRE_EXTRA_MATCH_LIMIT = $0002;
PCRE_EXTRA_CALLOUT_DATA = $0004;
- PCRE_EXTRA_TABLES = $0008;
+ PCRE_EXTRA_TABLES = $0008;
{$ENDIF PCRE_5_0}
{$IFDEF PCRE_7_0}
PCRE_EXTRA_MATCH_LIMIT_RECURSION = $0010;
@@ -215,7 +240,7 @@ remain compatible. } type ppcre_extra = ^tpcre_extra;
tpcre_extra = record
- flags : longint; { Bits for which fields are set }
+ flags : longint; { Bits for which fields are set }
study_data : pointer; { Opaque data from pcre_study() }
match_limit : longint; { Maximum number of calls to match() }
callout_data : pointer; { Data passed back in callouts }
@@ -392,9 +417,21 @@ data is not zero. *) {$IFDEF VIRTUALPASCAL} {&Cdecl-} {$ENDIF VIRTUALPASCAL}
// Always include the newest version of the library
-{$IFDEF PCRE_3_7} {$IFNDEF PCRE_5_0} {$IFNDEF PCRE_7_0} {$L pcre37.lib} {$ENDIF PCRE_7_0} {$ENDIF PCRE_5_0} {$ENDIF PCRE_3_7}
-{$IFDEF PCRE_5_0} {$IFNDEF PCRE_7_0} {$L pcre50.lib} {$ENDIF PCRE_7_0} {$ENDIF PCRE_5_0}
-{$IFDEF PCRE_7_0} {$L pcre70.lib} {$ENDIF PCRE_7_0}
+{$IFDEF PCRE_7_7}
+ {$L pcre77.lib}
+{$ELSE}
+ {$IFDEF PCRE_7_0}
+ {$L pcre70.lib}
+ {$ELSE}
+ {$IFDEF PCRE_5_0}
+ {$L pcre50.lib}
+ {$ELSE}
+ {$IFDEF PCRE_3_7}
+ {$L pcre37.lib}
+ {$ENDIF PCRE_3_7}
+ {$ENDIF PCRE_5_0}
+ {$ENDIF PCRE_7_0}
+{$ENDIF PCRE_7_7}
{TpcRegExp}
@@ -646,7 +683,7 @@ begin // l1:=length(PpcRegExp(P1)^.RegExp);
// l2:=length(PpcRegExp(P2)^.RegExp);
// if l1 > l2 then l:=l2 else
-// l:=l1;
+// l:=l1;
// for i:=1 to l do
// if PpcRegExp(P1).RegExp[i] <> PpcRegExp(P2).RegExp[i] then break;
// if i <=l then
@@ -659,7 +696,7 @@ begin // l1:=length(PpcRegExp(P1)^.RegExp);
// l2:=length(SearchRegExp);
// if l1 > l2 then l:=l2 else
-// l:=l1;
+// l:=l1;
// for i:=1 to l do
// if PpcRegExp(P1).RegExp[i] <> SearchRegExp[i] then
// begin
|