[Pcre-svn] [373] code/trunk: Update the Virtual Pascal + BCC…

Página Inicial
Delete this message
Autor: Subversion repository
Data:  
Para: pcre-svn
Assunto: [Pcre-svn] [373] code/trunk: Update the Virtual Pascal + BCC files for current versions.
Revision: 373
          http://vcs.pcre.org/viewvc?view=rev&revision=373
Author:   ph10
Date:     2008-09-05 11:25:46 +0100 (Fri, 05 Sep 2008)


Log Message:
-----------
Update the Virtual Pascal + BCC files for current versions.

Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/makevp.bat
    code/trunk/makevp_c.txt
    code/trunk/makevp_l.txt
    code/trunk/pcregexp.pas


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2008-08-26 11:49:38 UTC (rev 372)
+++ code/trunk/ChangeLog    2008-09-05 10:25:46 UTC (rev 373)
@@ -73,7 +73,12 @@


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
---------------------


Modified: code/trunk/makevp.bat
===================================================================
--- code/trunk/makevp.bat    2008-08-26 11:49:38 UTC (rev 372)
+++ code/trunk/makevp.bat    2008-09-05 10:25:46 UTC (rev 373)
@@ -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

Modified: code/trunk/makevp_c.txt
===================================================================
--- code/trunk/makevp_c.txt    2008-08-26 11:49:38 UTC (rev 372)
+++ code/trunk/makevp_c.txt    2008-09-05 10:25:46 UTC (rev 373)
@@ -14,7 +14,7 @@
 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


Modified: code/trunk/makevp_l.txt
===================================================================
--- code/trunk/makevp_l.txt    2008-08-26 11:49:38 UTC (rev 372)
+++ code/trunk/makevp_l.txt    2008-09-05 10:25:46 UTC (rev 373)
@@ -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


Modified: code/trunk/pcregexp.pas
===================================================================
--- code/trunk/pcregexp.pas    2008-08-26 11:49:38 UTC (rev 372)
+++ code/trunk/pcregexp.pas    2008-09-05 10:25:46 UTC (rev 373)
@@ -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,31 +106,47 @@
  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  +
                 PCRE_DOLLAR_ENDONLY + PCRE_DOTALL + PCRE_EXTENDED  +
                 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}
                  ;


 {$IFDEF PCRE_7_0}
  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 @@
{ 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 @@
  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 @@
 {$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 @@


 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 @@
 {$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 @@
 //   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 @@
 //   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