Documentation tidies and code tidies for Windows.

This commit is contained in:
Philip.Hazel 2017-04-08 15:21:39 +00:00
parent 13c0ea59b2
commit 7afe4e4110
9 changed files with 28 additions and 29 deletions

View File

@ -658,10 +658,8 @@ if %ERRORLEVEL% equ 0 (
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 (

View File

@ -380,7 +380,7 @@ When using multiple libraries in an application, you must take care when
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

View File

@ -512,7 +512,7 @@ system stack, but if
--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>

View File

@ -459,7 +459,7 @@ PCRE2 8-BIT, 16-BIT, AND 32-BIT LIBRARIES
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 @@ OBSOLETE OPTION
--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.

View File

@ -316,7 +316,7 @@ When using multiple libraries in an application, you must take care when
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

View File

@ -524,7 +524,7 @@ system stack, but if
--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"

View File

@ -101,6 +101,7 @@ others can be added next to them */
#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.

View File

@ -5118,14 +5118,14 @@ jump = CMP(SLJIT_SIG_LESS_EQUAL, TMP2, 0, SLJIT_IMM, 0);
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 @@ OP1(SLJIT_NEG, TMP2, 0, TMP2, 0);
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);
}

View File

@ -630,11 +630,24 @@ Unix-style directory scanning can be used (see below). */
#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 @@ when it did not exist. David Byron added a patch that moved the #include of
#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 @@ return _isatty(_fileno(f));
/************* 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)
{