[Pcre-svn] [737] code/trunk: Documentation tidies and code t…

Inizio della pagina
Delete this message
Autore: Subversion repository
Data:  
To: pcre-svn
Oggetto: [Pcre-svn] [737] code/trunk: Documentation tidies and code tidies for Windows.
Revision: 737
          http://www.exim.org/viewvc/pcre2?view=rev&revision=737
Author:   ph10
Date:     2017-04-08 16:21:39 +0100 (Sat, 08 Apr 2017)
Log Message:
-----------
Documentation tidies and code tidies for Windows.


Modified Paths:
--------------
    code/trunk/RunGrepTest.bat
    code/trunk/doc/html/pcre2api.html
    code/trunk/doc/html/pcre2build.html
    code/trunk/doc/pcre2.txt
    code/trunk/doc/pcre2api.3
    code/trunk/doc/pcre2build.3
    code/trunk/src/pcre2.h.generic
    code/trunk/src/pcre2_jit_compile.c
    code/trunk/src/pcre2grep.c


Modified: code/trunk/RunGrepTest.bat
===================================================================
--- code/trunk/RunGrepTest.bat    2017-04-07 11:06:56 UTC (rev 736)
+++ code/trunk/RunGrepTest.bat    2017-04-08 15:21:39 UTC (rev 737)
@@ -658,10 +658,8 @@
   echo Testing pcre2grep script callouts
   %pcre2grep% "(T)(..(.))(?C'cmd|/c echo|Arg1: [$1] [$2] [$3]|Arg2: ^$|${1}^$| ($4) ($14) ($0)')()" %srcdir%/testdata/grepinputv >testtrygrep
   %pcre2grep% "(T)(..(.))()()()()()()()(..)(?C'cmd|/c echo|Arg1: [$11] [${11}]')" %srcdir%/testdata/grepinputv >>testtrygrep
-  %pcre2grep% "(T)(?C'|$0:$1')" %srcdir%/testdata/grepinputv >>testtrygrep
-  %pcre2grep% --om-separator / "(T)(?C'|$1')" %srcdir%/testdata/grepinputv >>testtrygrep
-  :: The above has no newline, which 'diff -ub' ignores, so add one.
-  echo />>testtrygrep
+  %pcre2grep% "(T)(?C'|$0:$1$n')" %srcdir%/testdata/grepinputv >>testtrygrep
+  %pcre2grep% "(T)(?C'|$1$n')(*F)" %srcdir%/testdata/grepinputv >>testtrygrep
   %cf% %srcdir%\testdata\grepoutputC testtrygrep %cfout%
   if ERRORLEVEL 1 exit /b 1
 ) else (


Modified: code/trunk/doc/html/pcre2api.html
===================================================================
--- code/trunk/doc/html/pcre2api.html    2017-04-07 11:06:56 UTC (rev 736)
+++ code/trunk/doc/html/pcre2api.html    2017-04-08 15:21:39 UTC (rev 737)
@@ -380,7 +380,7 @@
 processing any particular pattern to use only functions from a single library.
 For example, if you want to run a match using a pattern that was compiled with
 <b>pcre2_compile_16()</b>, you must do so with <b>pcre2_match_16()</b>, not
-<b>pcre2_match_8()</b> or <b>pcre2_match_32</b>.
+<b>pcre2_match_8()</b> or <b>pcre2_match_32()</b>.
 </P>
 <P>
 In the function summaries above, and in the rest of this document and other


Modified: code/trunk/doc/html/pcre2build.html
===================================================================
--- code/trunk/doc/html/pcre2build.html    2017-04-07 11:06:56 UTC (rev 736)
+++ code/trunk/doc/html/pcre2build.html    2017-04-08 15:21:39 UTC (rev 737)
@@ -512,7 +512,7 @@
   --disable-stack-for-recursion
 </pre>
 was set, memory on the heap was used. From release 10.30 onwards this has 
-changed (the stack is no lonter used) and this option now does nothing except
+changed (the stack is no longer used) and this option now does nothing except
 give a warning.
 </P>
 <br><a name="SEC23" href="#TOC1">SEE ALSO</a><br>


Modified: code/trunk/doc/pcre2.txt
===================================================================
--- code/trunk/doc/pcre2.txt    2017-04-07 11:06:56 UTC (rev 736)
+++ code/trunk/doc/pcre2.txt    2017-04-08 15:21:39 UTC (rev 737)
@@ -459,7 +459,7 @@
        when processing any particular pattern to use  only  functions  from  a
        single  library.   For example, if you want to run a match using a pat-
        tern that was compiled with pcre2_compile_16(), you  must  do  so  with
-       pcre2_match_16(), not pcre2_match_8() or pcre2_match_32.
+       pcre2_match_16(), not pcre2_match_8() or pcre2_match_32().


        In  the  function summaries above, and in the rest of this document and
        other PCRE2 documents, functions and data  types  are  described  using
@@ -3683,7 +3683,7 @@
          --disable-stack-for-recursion


        was set, memory on the heap was used. From release 10.30  onwards  this
-       has  changed  (the  stack  is  no lonter used) and this option now does
+       has  changed  (the  stack  is  no longer used) and this option now does
        nothing except give a warning.




Modified: code/trunk/doc/pcre2api.3
===================================================================
--- code/trunk/doc/pcre2api.3    2017-04-07 11:06:56 UTC (rev 736)
+++ code/trunk/doc/pcre2api.3    2017-04-08 15:21:39 UTC (rev 737)
@@ -316,7 +316,7 @@
 processing any particular pattern to use only functions from a single library.
 For example, if you want to run a match using a pattern that was compiled with
 \fBpcre2_compile_16()\fP, you must do so with \fBpcre2_match_16()\fP, not
-\fBpcre2_match_8()\fP or \fBpcre2_match_32\fP.
+\fBpcre2_match_8()\fP or \fBpcre2_match_32()\fP.
 .P
 In the function summaries above, and in the rest of this document and other
 PCRE2 documents, functions and data types are described using their generic


Modified: code/trunk/doc/pcre2build.3
===================================================================
--- code/trunk/doc/pcre2build.3    2017-04-07 11:06:56 UTC (rev 736)
+++ code/trunk/doc/pcre2build.3    2017-04-08 15:21:39 UTC (rev 737)
@@ -524,7 +524,7 @@
   --disable-stack-for-recursion
 .sp
 was set, memory on the heap was used. From release 10.30 onwards this has 
-changed (the stack is no lonter used) and this option now does nothing except
+changed (the stack is no longer used) and this option now does nothing except
 give a warning.
 .
 .SH "SEE ALSO"


Modified: code/trunk/src/pcre2.h.generic
===================================================================
--- code/trunk/src/pcre2.h.generic    2017-04-07 11:06:56 UTC (rev 736)
+++ code/trunk/src/pcre2.h.generic    2017-04-08 15:21:39 UTC (rev 737)
@@ -101,6 +101,7 @@


 #define PCRE2_ANCHORED            0x80000000u
 #define PCRE2_NO_UTF_CHECK        0x40000000u
+#define PCRE2_ENDANCHORED         0x20000000u


/* The following option bits can be passed only to pcre2_compile(). However,
they may affect compilation, JIT compilation, and/or interpretive execution.

Modified: code/trunk/src/pcre2_jit_compile.c
===================================================================
--- code/trunk/src/pcre2_jit_compile.c    2017-04-07 11:06:56 UTC (rev 736)
+++ code/trunk/src/pcre2_jit_compile.c    2017-04-08 15:21:39 UTC (rev 737)
@@ -5118,14 +5118,14 @@
 OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0);
 if (sljit_get_register_index (TMP3) < 0)
   {
-  OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), 0, SLJIT_MEM1(STACK_TOP), -2 * sizeof(sljit_sw));
-  OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), sizeof(sljit_sw), SLJIT_MEM1(STACK_TOP), -3 * sizeof(sljit_sw));
+  OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), 0, SLJIT_MEM1(STACK_TOP), -(2 * sizeof(sljit_sw)));
+  OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), sizeof(sljit_sw), SLJIT_MEM1(STACK_TOP), -(3 * sizeof(sljit_sw)));
   OP2(SLJIT_SUB, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, 3 * sizeof(sljit_sw));
   }
 else
   {
-  OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), -2 * sizeof(sljit_sw));
-  OP1(SLJIT_MOV, TMP3, 0, SLJIT_MEM1(STACK_TOP), -3 * sizeof(sljit_sw));
+  OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), -(2 * sizeof(sljit_sw)));
+  OP1(SLJIT_MOV, TMP3, 0, SLJIT_MEM1(STACK_TOP), -(3 * sizeof(sljit_sw)));
   OP2(SLJIT_SUB, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, 3 * sizeof(sljit_sw));
   OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), 0, TMP1, 0);
   GET_LOCAL_BASE(TMP1, 0, 0);
@@ -5143,12 +5143,12 @@
 OP2(SLJIT_ADD, TMP2, 0, TMP2, 0, TMP1, 0);
 if (sljit_get_register_index (TMP3) < 0)
   {
-  OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), 0, SLJIT_MEM1(STACK_TOP), -2 * sizeof(sljit_sw));
+  OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), 0, SLJIT_MEM1(STACK_TOP), -(2 * sizeof(sljit_sw)));
   OP2(SLJIT_SUB, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, 2 * sizeof(sljit_sw));
   }
 else
   {
-  OP1(SLJIT_MOV, TMP3, 0, SLJIT_MEM1(STACK_TOP), -2 * sizeof(sljit_sw));
+  OP1(SLJIT_MOV, TMP3, 0, SLJIT_MEM1(STACK_TOP), -(2 * sizeof(sljit_sw)));
   OP2(SLJIT_SUB, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, 2 * sizeof(sljit_sw));
   OP1(SLJIT_MOV, SLJIT_MEM1(TMP2), 0, TMP3, 0);
   }


Modified: code/trunk/src/pcre2grep.c
===================================================================
--- code/trunk/src/pcre2grep.c    2017-04-07 11:06:56 UTC (rev 736)
+++ code/trunk/src/pcre2grep.c    2017-04-08 15:21:39 UTC (rev 737)
@@ -630,11 +630,24 @@


#ifdef WIN32

+#ifndef STRICT
+# define STRICT
+#endif
+#ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
+
+#include <windows.h>
+
#define iswild(name) (strpbrk(name, "*?") != NULL)

/* Convert ANSI BGR format to RGB used by Windows */
#define BGR_RGB(x) ((x & 1 ? 4 : 0) | (x & 2) | (x & 4 ? 1 : 0))

+static HANDLE hstdout;
+static CONSOLE_SCREEN_BUFFER_INFO csbi;
+static WORD match_colour;
+
static WORD
decode_ANSI_colour(const char *cs)
{
@@ -817,15 +830,6 @@

#elif defined WIN32

-#ifndef STRICT
-# define STRICT
-#endif
-#ifndef WIN32_LEAN_AND_MEAN
-# define WIN32_LEAN_AND_MEAN
-#endif
-
-#include <windows.h>
-
#ifndef INVALID_FILE_ATTRIBUTES
#define INVALID_FILE_ATTRIBUTES 0xFFFFFFFF
#endif
@@ -940,10 +944,6 @@

/************* Print optionally coloured match in Windows **********/

-static HANDLE hstdout;
-static CONSOLE_SCREEN_BUFFER_INFO csbi;
-static WORD match_colour;
-
static void
print_match(const void *buf, int length)
{