Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions doc/pcre2api.3
Original file line number Diff line number Diff line change
Expand Up @@ -1296,8 +1296,9 @@ documentation for more details.
.sp
PCRE2_CONFIG_JITTARGET
.sp
The \fIwhere\fP argument should point to a buffer that is at least 64 code
units long. (The exact length required can be found by calling
The \fIwhere\fP argument should point to a buffer that is at least
.\" DEFINE PCRE2_JITTARGET_BUFFSIZE_LIMIT
71 code units long. (The exact length required can be found by calling
\fBpcre2_config()\fP with \fBwhere\fP set to NULL.) The buffer is filled with a
string that contains the name of the architecture for which the JIT compiler is
configured, for example "x86 32bit (little endian + unaligned)". If JIT support
Expand Down
2 changes: 1 addition & 1 deletion maint/LintMan
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use vars qw /$opt_verbose/;
my $file;
my %defs;

foreach $file ("../src/config.h.generic")
foreach $file ("../src/config.h.generic", "../src/pcre2_api_internal.h")
{
open (INCLUDE, $file) or die "Failed to open include $file\n";

Expand Down
3 changes: 2 additions & 1 deletion maint/UpdateAlways
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

# Detrail A Perl script that removes trailing spaces from files.

# LintMan A Perl script that lints man pages looking for inconsistencies.
# LintMan A Perl script that lints man pages looking for inconsistencies
# in numerical configuration or API values.

# doc/index.html.src
# A file that is copied as index.html into the doc/html directory
Expand Down
48 changes: 48 additions & 0 deletions src/pcre2_api_internal.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*************************************************
* Perl-Compatible Regular Expressions *
*************************************************/

/* PCRE2 is a library of functions to support regular expressions whose syntax
and semantics are as close as possible to those of the Perl 5 language.

Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge
New API code Copyright (c) 2016-2024 University of Cambridge

-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

* Neither the name of the University of Cambridge nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-----------------------------------------------------------------------------
*/

#ifndef PCRE2_API_INTERNAL_H_IDEMPOTENT_GUARD
#define PCRE2_API_INTERNAL_H_IDEMPOTENT_GUARD

#define PCRE2_JITTARGET_BUFFSIZE_LIMIT 71 /* sljit */

#endif /* PCRE2_API_INTERNAL_H_IDEMPOTENT_GUARD */

/* End of pcre2_api_internal.h */
7 changes: 4 additions & 3 deletions src/pcre2_jit_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ POSSIBILITY OF SUCH DAMAGE.

#define PCRE2_CODE_UNIT_WIDTH 0
#include "pcre2.h"
#include "pcre2_api_internal.h"

/*
Letter characters:
Expand Down Expand Up @@ -1228,11 +1229,11 @@ static int regression_tests(void)
#endif

#if defined SUPPORT_PCRE2_8
PCRE2_UCHAR8 cpu_info[128];
PCRE2_UCHAR8 cpu_info[PCRE2_JITTARGET_BUFFSIZE_LIMIT];
#elif defined SUPPORT_PCRE2_16
PCRE2_UCHAR16 cpu_info[128];
PCRE2_UCHAR16 cpu_info[PCRE2_JITTARGET_BUFFSIZE_LIMIT];
#elif defined SUPPORT_PCRE2_32
PCRE2_UCHAR32 cpu_info[128];
PCRE2_UCHAR32 cpu_info[PCRE2_JITTARGET_BUFFSIZE_LIMIT];
#endif
#if defined SUPPORT_UNICODE && ((defined(SUPPORT_PCRE2_8) + defined(SUPPORT_PCRE2_16) + defined(SUPPORT_PCRE2_32)) >= 2)
int return_value;
Expand Down
3 changes: 2 additions & 1 deletion src/pcre2test.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ needs to be when compiling one of the libraries). */
#include "pcre2.h"
#include "pcre2posix.h"
#include "pcre2_internal.h"
#include "pcre2_api_internal.h"

/* We need access to some of the data tables that PCRE2 uses. The previous
definition of PCRE2_PCRE2TEST makes some minor changes in the files. The
Expand Down Expand Up @@ -3046,7 +3047,7 @@ fprintf(f, "Unicode version %s", buf);
static void
print_jit_target(FILE *f)
{
char buf[VERSION_SIZE];
char buf[PCRE2_JITTARGET_BUFFSIZE_LIMIT];
config_str(PCRE2_CONFIG_JITTARGET, buf);
fputs(buf, f);
}
Expand Down
Loading