Skip to content
Merged
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
11 changes: 4 additions & 7 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ copy_file(
out = "src/pcre2_chartables.c",
)

# Removed src/pcre2_ucptables.c below because it is #included in
# src/pcre2_tables.c. Also fixed typo: ckdint should be chkdint.
# PH, 22-March-2023.
cc_library(
name = "pcre2",
srcs = [
Expand All @@ -39,12 +36,15 @@ cc_library(
"src/pcre2_extuni.c",
"src/pcre2_find_bracket.c",
"src/pcre2_jit_compile.c",
"src/pcre2_jit_match_inc.h",
"src/pcre2_jit_misc_inc.h",
"src/pcre2_maketables.c",
"src/pcre2_match.c",
"src/pcre2_match_data.c",
"src/pcre2_newline.c",
"src/pcre2_ord2utf.c",
"src/pcre2_pattern_info.c",
"src/pcre2_printint_inc.h",
"src/pcre2_script_run.c",
"src/pcre2_serialize.c",
"src/pcre2_string_utils.c",
Expand All @@ -60,13 +60,11 @@ cc_library(
"src/pcre2_internal.h",
"src/pcre2_intmodedep.h",
"src/pcre2_ucp.h",
"src/pcre2_ucptables_inc.h",
"src/pcre2_util.h",
":config_h_generic",
],
textual_hdrs = [
"src/pcre2_jit_match.c",
"src/pcre2_jit_misc.c",
"src/pcre2_ucptables.c",
],
hdrs = [
":pcre2_h_generic",
Expand Down Expand Up @@ -119,7 +117,6 @@ cc_library(
name = "pcre2test_dotc_headers",
hdrs = [
"src/pcre2_chkdint.c",
"src/pcre2_printint.c",
"src/pcre2_tables.c",
"src/pcre2_ucd.c",
"src/pcre2_valid_utf.c",
Expand Down
19 changes: 5 additions & 14 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,8 @@ COMMON_SOURCES = \
src/pcre2_intmodedep.h \
src/pcre2_jit_char_inc.h \
src/pcre2_jit_compile.c \
src/pcre2_jit_match_inc.h \
src/pcre2_jit_misc_inc.h \
src/pcre2_jit_neon_inc.h \
src/pcre2_jit_simd_inc.h \
src/pcre2_maketables.c \
Expand All @@ -412,6 +414,7 @@ COMMON_SOURCES = \
src/pcre2_newline.c \
src/pcre2_ord2utf.c \
src/pcre2_pattern_info.c \
src/pcre2_printint_inc.h \
src/pcre2_script_run.c \
src/pcre2_serialize.c \
src/pcre2_string_utils.c \
Expand All @@ -421,14 +424,11 @@ COMMON_SOURCES = \
src/pcre2_tables.c \
src/pcre2_ucd.c \
src/pcre2_ucp.h \
src/pcre2_ucptables_inc.h \
src/pcre2_util.h \
src/pcre2_valid_utf.c \
src/pcre2_xclass.c

# The pcre2_ucptables.c file is #included by pcre2_tables.c

EXTRA_DIST += src/pcre2_ucptables.c

if WITH_PCRE2_8
lib_LTLIBRARIES += libpcre2-8.la
libpcre2_8_la_SOURCES = \
Expand Down Expand Up @@ -520,12 +520,6 @@ EXTRA_DIST += \
deps/sljit/sljit_src/allocator_src/sljitWXExecAllocatorPosix.c \
deps/sljit/sljit_src/allocator_src/sljitWXExecAllocatorWindows.c

# Some of the JIT sources are also in separate files that are #included.

EXTRA_DIST += \
src/pcre2_jit_match.c \
src/pcre2_jit_misc.c

if WITH_PCRE2_8
libpcre2_8_la_LDFLAGS = $(EXTRA_LIBPCRE2_8_LDFLAGS)
endif # WITH_PCRE2_8
Expand Down Expand Up @@ -681,12 +675,9 @@ pcre2_jit_test_LDADD += $(GCOV_LIBS)
endif # WITH_GCOV
endif # WITH_JIT

# Build the general pcre2test program. The file src/pcre2_printint.c is
# #included by pcre2test as many times as needed, at different code unit
# widths.
# Build the general pcre2test program.

bin_PROGRAMS += pcre2test
EXTRA_DIST += src/pcre2_printint.c
pcre2test_SOURCES = src/pcre2test.c
pcre2test_CFLAGS = $(AM_CFLAGS)
pcre2test_LDADD = $(LIBREADLINE)
Expand Down
4 changes: 1 addition & 3 deletions NON-AUTOTOOLS-BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,7 @@ example.
defined SUPPORT_JIT in src/config.h, because when JIT support is not
configured, dummy functions are compiled. When JIT support IS configured,
pcre2_jit_compile.c #includes other files from the sljit dependency,
all of whose names begin with "sljit". It also #includes
src/pcre2_jit_match.c and src/pcre2_jit_misc.c, so you should not compile
those yourself.
all of whose names begin with "sljit".

Note also that the pcre2_fuzzsupport.c file contains special code that is
useful to those who want to run fuzzing tests on the PCRE2 library. Unless
Expand Down
12 changes: 6 additions & 6 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -860,10 +860,8 @@ The distribution should contain the files listed below.
src/pcre2_extuni.c )
src/pcre2_find_bracket.c )
src/pcre2_jit_compile.c )
src/pcre2_jit_match.c ) sources for the functions in the library,
src/pcre2_jit_misc.c ) and some internal functions that they use
src/pcre2_maketables.c )
src/pcre2_match.c )
src/pcre2_maketables.c ) sources for the functions in the library,
src/pcre2_match.c ) and some internal functions that they use
src/pcre2_match_data.c )
src/pcre2_newline.c )
src/pcre2_ord2utf.c )
Expand All @@ -876,11 +874,9 @@ The distribution should contain the files listed below.
src/pcre2_substring.c )
src/pcre2_tables.c )
src/pcre2_ucd.c )
src/pcre2_ucptables.c )
src/pcre2_valid_utf.c )
src/pcre2_xclass.c )

src/pcre2_printint.c debugging function that is used by pcre2test,
src/pcre2_fuzzsupport.c function for (optional) fuzzing support

src/config.h.in template for config.h, when built by "configure"
Expand All @@ -890,9 +886,13 @@ The distribution should contain the files listed below.
src/pcre2_internal.h header for internal use
src/pcre2_intmodedep.h a mode-specific internal header
src/pcre2_jit_char_inc.h header used by JIT
src/pcre2_jit_match_inc.h header used by JIT
src/pcre2_jit_misc_inc.h header used by JIT
src/pcre2_jit_neon_inc.h header used by JIT
src/pcre2_jit_simd_inc.h header used by JIT
src/pcre2_printint_inc.h debugging function that is used by pcre2test
src/pcre2_ucp.h header for Unicode property handling
src/pcre2_ucptables_inc.h header with Unicode data tables
src/pcre2_util.h header for internal utils

deps/sljit/sljit_src/* source files for the JIT compiler
Expand Down
4 changes: 1 addition & 3 deletions doc/html/NON-AUTOTOOLS-BUILD.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,7 @@ example.
defined SUPPORT_JIT in src/config.h, because when JIT support is not
configured, dummy functions are compiled. When JIT support IS configured,
pcre2_jit_compile.c #includes other files from the sljit dependency,
all of whose names begin with "sljit". It also #includes
src/pcre2_jit_match.c and src/pcre2_jit_misc.c, so you should not compile
those yourself.
all of whose names begin with "sljit".

Note also that the pcre2_fuzzsupport.c file contains special code that is
useful to those who want to run fuzzing tests on the PCRE2 library. Unless
Expand Down
12 changes: 6 additions & 6 deletions doc/html/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -860,10 +860,8 @@ The distribution should contain the files listed below.
src/pcre2_extuni.c )
src/pcre2_find_bracket.c )
src/pcre2_jit_compile.c )
src/pcre2_jit_match.c ) sources for the functions in the library,
src/pcre2_jit_misc.c ) and some internal functions that they use
src/pcre2_maketables.c )
src/pcre2_match.c )
src/pcre2_maketables.c ) sources for the functions in the library,
src/pcre2_match.c ) and some internal functions that they use
src/pcre2_match_data.c )
src/pcre2_newline.c )
src/pcre2_ord2utf.c )
Expand All @@ -876,11 +874,9 @@ The distribution should contain the files listed below.
src/pcre2_substring.c )
src/pcre2_tables.c )
src/pcre2_ucd.c )
src/pcre2_ucptables.c )
src/pcre2_valid_utf.c )
src/pcre2_xclass.c )

src/pcre2_printint.c debugging function that is used by pcre2test,
src/pcre2_fuzzsupport.c function for (optional) fuzzing support

src/config.h.in template for config.h, when built by "configure"
Expand All @@ -890,9 +886,13 @@ The distribution should contain the files listed below.
src/pcre2_internal.h header for internal use
src/pcre2_intmodedep.h a mode-specific internal header
src/pcre2_jit_char_inc.h header used by JIT
src/pcre2_jit_match_inc.h header used by JIT
src/pcre2_jit_misc_inc.h header used by JIT
src/pcre2_jit_neon_inc.h header used by JIT
src/pcre2_jit_simd_inc.h header used by JIT
src/pcre2_printint_inc.h debugging function that is used by pcre2test
src/pcre2_ucp.h header for Unicode property handling
src/pcre2_ucptables_inc.h header with Unicode data tables
src/pcre2_util.h header for internal utils

deps/sljit/sljit_src/* source files for the JIT compiler
Expand Down
2 changes: 1 addition & 1 deletion maint/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ucptest
utf8

pcre2_ucp.h
pcre2_ucptables.c
pcre2_ucptables_inc.h
pcre2_ucd.c

testinput
Expand Down
6 changes: 3 additions & 3 deletions maint/GenerateUcpTables.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# PCRE2 UNICODE PROPERTY SUPPORT
# ------------------------------

# This script generates the pcre2_ucptables.c file, which contains tables for
# This script generates the pcre2_ucptables_inc.h file, which contains tables for
# recognizing Unicode property names. It is #included by pcre2_tables.c. In
# order to reduce the number of relocations when loading the PCRE2 library, the
# names are held as a single large string, with offsets in the table. This is
Expand Down Expand Up @@ -60,7 +60,7 @@
# Open the output file (no return on failure). This call also writes standard
# header boilerplate.

f = open_output("pcre2_ucptables.c")
f = open_output("pcre2_ucptables_inc.h")

# The list in bidi_classes contains just the Unicode classes such as AN, LRE,
# etc., along with comments. We need to add "bidi" in front of each value, in
Expand Down Expand Up @@ -195,7 +195,7 @@ def stdnames(x):

#endif /* SUPPORT_UNICODE */

/* End of pcre2_ucptables.c */
/* End of pcre2_ucptables_inc.h */
""")

f.close
Expand Down
12 changes: 6 additions & 6 deletions maint/README
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ GenerateUcpHeader.py
Unicode property values.

GenerateUcpTables.py
A Python script that generates the file pcre2_ucptables.c from
A Python script that generates the file pcre2_ucptables_inc.h from
GenerateCommon.py and Unicode data files. The generated file contains tables
for looking up Unicode property names.

Expand Down Expand Up @@ -145,17 +145,17 @@ of supported scripts, and the command to do so is part of the documentation.
You can give an output file name as an argument to the following scripts, but
by default:

GenerateUcd.py creates pcre2_ucd.c )
GenerateUcpHeader.py creates pcre2_ucp.h ) in the current directory
GenerateUcpTables.py creates pcre2_ucptables.c )
GenerateUcd.py creates pcre2_ucd.c )
GenerateUcpHeader.py creates pcre2_ucp.h ) in the current directory
GenerateUcpTables.py creates pcre2_ucptables_inc.h )

These files can be compared against the existing versions in the src directory
to check on any changes before replacing the old files, but you can also
generate directly into the final location by running:

./GenerateUcd.py ../src/pcre2_ucd.c
./GenerateUcpHeader.py ../src/pcre2_ucp.h
./GenerateUcpTables.py ../src/pcre2_ucptables.c
./GenerateUcpTables.py ../src/pcre2_ucptables_inc.h

Once the .c and .h files are in the ../src directory, the ucptest program can
be compiled and used to check that the new tables work properly. The data files
Expand All @@ -176,7 +176,7 @@ In summary:
```
./GenerateUcd.py ../src/pcre2_ucd.c
./GenerateUcpHeader.py ../src/pcre2_ucp.h
./GenerateUcpTables.py ../src/pcre2_ucptables.c
./GenerateUcpTables.py ../src/pcre2_ucptables_inc.h
./GenerateTest.py
mv testinput ../testdata/testinput27
mv testoutput ../testdata/testoutput27
Expand Down
8 changes: 4 additions & 4 deletions maint/UpdateAlways
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ c_files=(
src/pcre2_intmodedep.h
src/pcre2_jit_char_inc.h
src/pcre2_jit_compile.c
src/pcre2_jit_match.c
src/pcre2_jit_misc.c
src/pcre2_jit_match_inc.h
src/pcre2_jit_misc_inc.h
src/pcre2_jit_neon_inc.h
src/pcre2_jit_simd_inc.h
src/pcre2_jit_test.c
Expand All @@ -293,7 +293,7 @@ c_files=(
src/pcre2_newline.c
src/pcre2_ord2utf.c
src/pcre2_pattern_info.c
src/pcre2_printint.c
src/pcre2_printint_inc.h
src/pcre2_script_run.c
src/pcre2_serialize.c
src/pcre2_string_utils.c
Expand All @@ -303,7 +303,7 @@ c_files=(
src/pcre2_tables.c
src/pcre2_ucd.c
src/pcre2_ucp.h
src/pcre2_ucptables.c
src/pcre2_ucptables_inc.h
src/pcre2_util.h
src/pcre2_valid_utf.c
src/pcre2_xclass.c
Expand Down
8 changes: 4 additions & 4 deletions maint/manifest-tarball
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ drwxr-xr-x tarball-dir/pcre2-SNAPSHOT/src
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_intmodedep.h
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_jit_char_inc.h
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_jit_compile.c
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_jit_match.c
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_jit_misc.c
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_jit_match_inc.h
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_jit_misc_inc.h
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_jit_neon_inc.h
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_jit_simd_inc.h
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_jit_test.c
Expand All @@ -338,7 +338,7 @@ drwxr-xr-x tarball-dir/pcre2-SNAPSHOT/src
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_newline.c
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_ord2utf.c
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_pattern_info.c
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_printint.c
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_printint_inc.h
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_script_run.c
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_serialize.c
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_string_utils.c
Expand All @@ -348,7 +348,7 @@ drwxr-xr-x tarball-dir/pcre2-SNAPSHOT/src
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_tables.c
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_ucd.c
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_ucp.h
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_ucptables.c
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_ucptables_inc.h
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_util.h
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_valid_utf.c
-rw-r--r-- tarball-dir/pcre2-SNAPSHOT/src/pcre2_xclass.c
Expand Down
2 changes: 1 addition & 1 deletion src/pcre2_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ POSSIBILITY OF SUCH DAMAGE.
#define CHAR_OUTPUT_HEX(c) (c)
#define CHAR_INPUT(c) (c)
#define CHAR_INPUT_HEX(c) (c)
#include "pcre2_printint.c"
#include "pcre2_printint_inc.h"
#undef PRINTABLE
#undef CHAR_OUTPUT
#undef CHAR_OUTPUT_HEX
Expand Down
2 changes: 1 addition & 1 deletion src/pcre2_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1949,7 +1949,7 @@ pcre2_dfa_match.c that must be updated. */

/* This macro defines textual names for all the opcodes. These are used only
for debugging, and some of them are only partial names. The macro is referenced
only in pcre2_printint.c, which fills out the full names in many cases (and in
only in pcre2_printint_inc.h, which fills out the full names in many cases (and in
some cases doesn't actually use these names at all). */

#define OP_NAME_LIST \
Expand Down
2 changes: 1 addition & 1 deletion src/pcre2_intmodedep.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ to have access to the hidden structures at all supported widths.

Some of the mode-dependent macros are required at different widths for
different parts of the pcre2test code (in particular, the included
pcre2_printint.c file). We undefine them here so that they can be re-defined for
pcre2_printint_inc.h file). We undefine them here so that they can be re-defined for
multiple inclusions. Not all of these are used in pcre2test, but it's easier
just to undefine them all. */

Expand Down
4 changes: 2 additions & 2 deletions src/pcre2_jit_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -14129,7 +14129,7 @@ return 0;

#define INCLUDED_FROM_PCRE2_JIT_COMPILE

#include "pcre2_jit_match.c"
#include "pcre2_jit_misc.c"
#include "pcre2_jit_match_inc.h"
#include "pcre2_jit_misc_inc.h"

/* End of pcre2_jit_compile.c */
2 changes: 1 addition & 1 deletion src/pcre2_jit_match.c → src/pcre2_jit_match_inc.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,4 @@ return match_data->rc;
#endif /* SUPPORT_JIT */
}

/* End of pcre2_jit_match.c */
/* End of pcre2_jit_match_inc.h */
2 changes: 1 addition & 1 deletion src/pcre2_jit_misc.c → src/pcre2_jit_misc_inc.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,4 @@ return executable_sizes[0] + executable_sizes[1] + executable_sizes[2];
#endif
}

/* End of pcre2_jit_misc.c */
/* End of pcre2_jit_misc_inc.h */
2 changes: 1 addition & 1 deletion src/pcre2_printint.c → src/pcre2_printint_inc.h
Original file line number Diff line number Diff line change
Expand Up @@ -1125,4 +1125,4 @@ for(;;)
}
}

/* End of pcre2_printint.c */
/* End of pcre2_printint_inc.h */
Loading