1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-14 03:39:02 +00:00

Upgrade libpcre2 to 10.43

This commit is contained in:
dmiller
2024-02-28 16:06:30 +00:00
parent 38aa74ae83
commit 34da72b5f5
50 changed files with 20826 additions and 5158 deletions

6
.gitignore vendored
View File

@@ -1,3 +1,4 @@
*~
*.[oa] *.[oa]
*.[sl][oa] *.[sl][oa]
*.gc[dn][oa] *.gc[dn][oa]
@@ -15,6 +16,7 @@ libtool
.deps/ .deps/
.libs/ .libs/
.svn/ .svn/
.dirstamp
stamp-h1 stamp-h1
/libdnet-stripped/dnet-config /libdnet-stripped/dnet-config
/nbase/nbase_config.h /nbase/nbase_config.h
@@ -49,7 +51,9 @@ libpcap/pcap_version.h
libpcap/grammar.y libpcap/grammar.y
libssh2/src/libssh2_config.h libssh2/src/libssh2_config.h
libssh2/lib/ libssh2/lib/
libpcre/pcre-config libpcre/pcre2-config
libpcre/src/pcre2.h
libpcre/src/pcre2_chartables.c
ndiff/INSTALLED_FILES ndiff/INSTALLED_FILES
libz/contrib/vstudio/vc11/Debug_lib/ libz/contrib/vstudio/vc11/Debug_lib/
libz/contrib/vstudio/vc11/Release_lib/ libz/contrib/vstudio/vc11/Release_lib/

View File

@@ -1,6 +1,6 @@
#Nmap Changelog ($Id$); -*-text-*- #Nmap Changelog ($Id$); -*-text-*-
o Upgrade included libraries: Lua 5.4.6 o Upgrade included libraries: Lua 5.4.6, libpcre2 10.43
o [Zenmap][GH#2739] Fix a crash in Zenmap when changing a host comment. o [Zenmap][GH#2739] Fix a crash in Zenmap when changing a host comment.

View File

@@ -8,7 +8,7 @@ Email domain: gmail.com
Retired from University of Cambridge Computing Service, Retired from University of Cambridge Computing Service,
Cambridge, England. Cambridge, England.
Copyright (c) 1997-2022 University of Cambridge Copyright (c) 1997-2024 University of Cambridge
All rights reserved All rights reserved
@@ -19,7 +19,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester Email local part: hzmester
Emain domain: freemail.hu Emain domain: freemail.hu
Copyright(c) 2010-2022 Zoltan Herczeg Copyright(c) 2010-2024 Zoltan Herczeg
All rights reserved. All rights reserved.
@@ -30,7 +30,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester Email local part: hzmester
Emain domain: freemail.hu Emain domain: freemail.hu
Copyright(c) 2009-2022 Zoltan Herczeg Copyright(c) 2009-2024 Zoltan Herczeg
All rights reserved. All rights reserved.
#### ####

View File

@@ -100,11 +100,18 @@
# 2021-08-28 PH increased minimum version # 2021-08-28 PH increased minimum version
# 2021-08-28 PH added test for realpath() # 2021-08-28 PH added test for realpath()
# 2022-12-10 PH added support for pcre2posix_test # 2022-12-10 PH added support for pcre2posix_test
# 2023-01-15 Carlo added C99 as the minimum required
# 2023-08-06 PH added support for setting variable length lookbehind maximum
# Increased minimum to 2.8.5 to support GNUInstallDirs. # Increased minimum to 3.5 to workaround deprecated backward compatibility
# Increased minimum to 3.1 to support imported targets. # since 3.27.
CMAKE_MINIMUM_REQUIRED(VERSION 3.1) cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
PROJECT(PCRE2 C) project(PCRE2 C)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED TRUE)
set(CMAKE_C_VISIBILITY_PRESET hidden)
cmake_policy(SET CMP0063 NEW)
# Set policy CMP0026 to avoid warnings for the use of LOCATION in # Set policy CMP0026 to avoid warnings for the use of LOCATION in
# GET_TARGET_PROPERTY. This should no longer be required. # GET_TARGET_PROPERTY. This should no longer be required.
@@ -147,16 +154,37 @@ CHECK_SYMBOL_EXISTS(strerror "string.h" HAVE_STRERROR)
CHECK_C_SOURCE_COMPILES( CHECK_C_SOURCE_COMPILES(
"#include <stdlib.h> "#include <stdlib.h>
#include <limits.h> #include <limits.h>
int main(int c, char *v[]) { char buf[PATH_MAX]; realpath(v[1], buf); return 0; }" int main(int c, char *v[]) { char buf[PATH_MAX]; realpath(v[c], buf); return 0; }"
HAVE_REALPATH HAVE_REALPATH
) )
set(ORIG_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) set(ORIG_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror") set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror")
CHECK_C_SOURCE_COMPILES( CHECK_C_SOURCE_COMPILES(
"int main() { char buf[128] __attribute__((uninitialized)); (void)buf; return 0; }" "#include <stddef.h>
int main(void) { int a,b; size_t m; __builtin_mul_overflow(a,b,&m); return 0; }"
HAVE_BUILTIN_MUL_OVERFLOW
)
CHECK_C_SOURCE_COMPILES(
"int main(void) { char buf[128] __attribute__((uninitialized)); (void)buf; return 0; }"
HAVE_ATTRIBUTE_UNINITIALIZED HAVE_ATTRIBUTE_UNINITIALIZED
) )
CHECK_C_SOURCE_COMPILES([=[
extern __attribute__ ((visibility ("default"))) int f(void);
int main(void) { return f(); }
int f(void) { return 42; }
]=] HAVE_VISIBILITY
)
if (HAVE_VISIBILITY)
set(PCRE2_EXPORT [=[__attribute__ ((visibility ("default")))]=])
else()
set(PCRE2_EXPORT)
endif()
set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS}) set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
# Check whether Intel CET is enabled, and if so, adjust compiler flags. This # Check whether Intel CET is enabled, and if so, adjust compiler flags. This
@@ -175,8 +203,6 @@ IF (INTEL_CET_ENABLED)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mshstk") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mshstk")
ENDIF(INTEL_CET_ENABLED) ENDIF(INTEL_CET_ENABLED)
# User-configurable options # User-configurable options
# #
# Note: CMakeSetup displays these in alphabetical order, regardless of # Note: CMakeSetup displays these in alphabetical order, regardless of
@@ -213,6 +239,9 @@ SET(PCRE2_PARENS_NEST_LIMIT "250" CACHE STRING
SET(PCRE2_HEAP_LIMIT "20000000" CACHE STRING SET(PCRE2_HEAP_LIMIT "20000000" CACHE STRING
"Default limit on heap memory (kibibytes). See HEAP_LIMIT in config.h.in for details.") "Default limit on heap memory (kibibytes). See HEAP_LIMIT in config.h.in for details.")
SET(PCRE2_MAX_VARLOOKBEHIND "255" CACHE STRING
"Default limit on variable lookbehinds.")
SET(PCRE2_MATCH_LIMIT "10000000" CACHE STRING SET(PCRE2_MATCH_LIMIT "10000000" CACHE STRING
"Default limit on internal looping. See MATCH_LIMIT in config.h.in for details.") "Default limit on internal looping. See MATCH_LIMIT in config.h.in for details.")
@@ -389,38 +418,6 @@ IF(WIN32)
SET(CMAKE_DEBUG_POSTFIX "d") SET(CMAKE_DEBUG_POSTFIX "d")
ENDIF(WIN32) ENDIF(WIN32)
# Generate pkg-config files
SET(PACKAGE_VERSION "${PCRE2_MAJOR}.${PCRE2_MINOR}")
SET(prefix ${CMAKE_INSTALL_PREFIX})
SET(exec_prefix "\${prefix}")
SET(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
SET(includedir "\${prefix}/include")
IF(WIN32 AND (CMAKE_BUILD_TYPE MATCHES Debug))
SET(LIB_POSTFIX ${CMAKE_DEBUG_POSTFIX})
ENDIF()
IF(PCRE2_BUILD_PCRE2_8)
SET(enable_pcre2_8 "yes")
ELSE()
SET(enable_pcre2_8 "no")
ENDIF()
IF(PCRE2_BUILD_PCRE2_16)
SET(enable_pcre2_16 "yes")
ELSE()
SET(enable_pcre2_16 "no")
ENDIF()
IF(PCRE2_BUILD_PCRE2_32)
SET(enable_pcre2_32 "yes")
ELSE()
SET(enable_pcre2_32 "no")
ENDIF()
CONFIGURE_FILE(pcre2-config.in pcre2-config @ONLY)
# Character table generation # Character table generation
OPTION(PCRE2_REBUILD_CHARTABLES "Rebuild char tables" OFF) OPTION(PCRE2_REBUILD_CHARTABLES "Rebuild char tables" OFF)
@@ -446,6 +443,7 @@ SET(PCRE2_HEADERS ${PROJECT_BINARY_DIR}/pcre2.h)
SET(PCRE2_SOURCES SET(PCRE2_SOURCES
src/pcre2_auto_possess.c src/pcre2_auto_possess.c
${PROJECT_BINARY_DIR}/pcre2_chartables.c ${PROJECT_BINARY_DIR}/pcre2_chartables.c
src/pcre2_chkdint.c
src/pcre2_compile.c src/pcre2_compile.c
src/pcre2_config.c src/pcre2_config.c
src/pcre2_context.c src/pcre2_context.c
@@ -530,7 +528,7 @@ ENDIF(MSVC)
SET(CMAKE_INCLUDE_CURRENT_DIR 1) SET(CMAKE_INCLUDE_CURRENT_DIR 1)
SET(targets) set(targets)
# 8-bit library # 8-bit library
@@ -557,9 +555,8 @@ IF(PCRE2_BUILD_PCRE2_8)
VERSION ${LIBPCRE2_POSIX_VERSION} VERSION ${LIBPCRE2_POSIX_VERSION}
SOVERSION ${LIBPCRE2_POSIX_SOVERSION}) SOVERSION ${LIBPCRE2_POSIX_SOVERSION})
TARGET_LINK_LIBRARIES(pcre2-posix-static pcre2-8-static) TARGET_LINK_LIBRARIES(pcre2-posix-static pcre2-8-static)
TARGET_COMPILE_DEFINITIONS(pcre2-posix-static PUBLIC PCRE2_STATIC) TARGET_INCLUDE_DIRECTORIES(pcre2-posix-static PUBLIC ${PROJECT_SOURCE_DIR}/src)
TARGET_INCLUDE_DIRECTORIES(pcre2-posix-static PUBLIC ${PROJECT_BINARY_DIR}) set(targets ${targets} pcre2-posix-static)
SET(targets ${targets} pcre2-posix-static)
IF(MSVC) IF(MSVC)
SET_TARGET_PROPERTIES(pcre2-8-static PROPERTIES OUTPUT_NAME pcre2-8-static) SET_TARGET_PROPERTIES(pcre2-8-static PROPERTIES OUTPUT_NAME pcre2-8-static)
@@ -586,9 +583,10 @@ IF(PCRE2_BUILD_PCRE2_8)
IF(REQUIRE_PTHREAD) IF(REQUIRE_PTHREAD)
TARGET_LINK_LIBRARIES(pcre2-8-shared Threads::Threads) TARGET_LINK_LIBRARIES(pcre2-8-shared Threads::Threads)
ENDIF(REQUIRE_PTHREAD) ENDIF(REQUIRE_PTHREAD)
SET(targets ${targets} pcre2-8-shared) set(targets ${targets} pcre2-8-shared)
ADD_LIBRARY(pcre2-posix-shared SHARED ${PCRE2POSIX_HEADERS} ${PCRE2POSIX_SOURCES}) ADD_LIBRARY(pcre2-posix-shared SHARED ${PCRE2POSIX_HEADERS} ${PCRE2POSIX_SOURCES})
TARGET_INCLUDE_DIRECTORIES(pcre2-posix-shared PUBLIC ${PROJECT_BINARY_DIR}) TARGET_INCLUDE_DIRECTORIES(pcre2-posix-shared PUBLIC ${PROJECT_SOURCE_DIR}/src)
SET_TARGET_PROPERTIES(pcre2-posix-shared PROPERTIES SET_TARGET_PROPERTIES(pcre2-posix-shared PROPERTIES
COMPILE_DEFINITIONS PCRE2_CODE_UNIT_WIDTH=8 COMPILE_DEFINITIONS PCRE2_CODE_UNIT_WIDTH=8
MACHO_COMPATIBILITY_VERSION "${LIBPCRE2_POSIX_MACHO_COMPATIBILITY_VERSION}" MACHO_COMPATIBILITY_VERSION "${LIBPCRE2_POSIX_MACHO_COMPATIBILITY_VERSION}"
@@ -596,6 +594,8 @@ IF(PCRE2_BUILD_PCRE2_8)
VERSION ${LIBPCRE2_POSIX_VERSION} VERSION ${LIBPCRE2_POSIX_VERSION}
SOVERSION ${LIBPCRE2_POSIX_SOVERSION} SOVERSION ${LIBPCRE2_POSIX_SOVERSION}
OUTPUT_NAME pcre2-posix) OUTPUT_NAME pcre2-posix)
set(PCRE2POSIX_CFLAG "-DPCRE2POSIX_SHARED")
TARGET_COMPILE_DEFINITIONS(pcre2-posix-shared PUBLIC ${PCRE2POSIX_CFLAG})
TARGET_LINK_LIBRARIES(pcre2-posix-shared pcre2-8-shared) TARGET_LINK_LIBRARIES(pcre2-posix-shared pcre2-8-shared)
SET(targets ${targets} pcre2-posix-shared) SET(targets ${targets} pcre2-posix-shared)
SET(dll_pdb_files ${PROJECT_BINARY_DIR}/pcre2-8.pdb ${dll_pdb_files}) SET(dll_pdb_files ${PROJECT_BINARY_DIR}/pcre2-8.pdb ${dll_pdb_files})
@@ -626,7 +626,7 @@ IF(PCRE2_BUILD_PCRE2_16)
IF(BUILD_STATIC_LIBS) IF(BUILD_STATIC_LIBS)
ADD_LIBRARY(pcre2-16-static STATIC ${PCRE2_HEADERS} ${PCRE2_SOURCES} ${PROJECT_BINARY_DIR}/config.h) ADD_LIBRARY(pcre2-16-static STATIC ${PCRE2_HEADERS} ${PCRE2_SOURCES} ${PROJECT_BINARY_DIR}/config.h)
TARGET_INCLUDE_DIRECTORIES(pcre2-16-static PUBLIC ${PROJECT_BINARY_DIR}) TARGET_INCLUDE_DIRECTORIES(pcre2-16-static PUBLIC ${PROJECT_BINARY_DIR})
SET_TARGET_PROPERTIES(pcre2-16-static PROPERTIES SET_TARGET_PROPERTIES(pcre2-16-static PROPERTIES UNITY_BUILD OFF
COMPILE_DEFINITIONS PCRE2_CODE_UNIT_WIDTH=16 COMPILE_DEFINITIONS PCRE2_CODE_UNIT_WIDTH=16
MACHO_COMPATIBILITY_VERSION "${LIBPCRE2_32_MACHO_COMPATIBILITY_VERSION}" MACHO_COMPATIBILITY_VERSION "${LIBPCRE2_32_MACHO_COMPATIBILITY_VERSION}"
MACHO_CURRENT_VERSION "${LIBPCRE2_32_MACHO_CURRENT_VERSION}" MACHO_CURRENT_VERSION "${LIBPCRE2_32_MACHO_CURRENT_VERSION}"
@@ -636,7 +636,7 @@ IF(PCRE2_BUILD_PCRE2_16)
IF(REQUIRE_PTHREAD) IF(REQUIRE_PTHREAD)
TARGET_LINK_LIBRARIES(pcre2-16-static Threads::Threads) TARGET_LINK_LIBRARIES(pcre2-16-static Threads::Threads)
ENDIF(REQUIRE_PTHREAD) ENDIF(REQUIRE_PTHREAD)
SET(targets ${targets} pcre2-16-static) set(targets ${targets} pcre2-16-static)
IF(MSVC) IF(MSVC)
SET_TARGET_PROPERTIES(pcre2-16-static PROPERTIES OUTPUT_NAME pcre2-16-static) SET_TARGET_PROPERTIES(pcre2-16-static PROPERTIES OUTPUT_NAME pcre2-16-static)
@@ -651,7 +651,7 @@ IF(PCRE2_BUILD_PCRE2_16)
IF(BUILD_SHARED_LIBS) IF(BUILD_SHARED_LIBS)
ADD_LIBRARY(pcre2-16-shared SHARED ${PCRE2_HEADERS} ${PCRE2_SOURCES} ${PROJECT_BINARY_DIR}/config.h) ADD_LIBRARY(pcre2-16-shared SHARED ${PCRE2_HEADERS} ${PCRE2_SOURCES} ${PROJECT_BINARY_DIR}/config.h)
TARGET_INCLUDE_DIRECTORIES(pcre2-16-shared PUBLIC ${PROJECT_BINARY_DIR}) TARGET_INCLUDE_DIRECTORIES(pcre2-16-shared PUBLIC ${PROJECT_BINARY_DIR})
SET_TARGET_PROPERTIES(pcre2-16-shared PROPERTIES SET_TARGET_PROPERTIES(pcre2-16-shared PROPERTIES UNITY_BUILD OFF
COMPILE_DEFINITIONS PCRE2_CODE_UNIT_WIDTH=16 COMPILE_DEFINITIONS PCRE2_CODE_UNIT_WIDTH=16
MACHO_COMPATIBILITY_VERSION "${LIBPCRE2_32_MACHO_COMPATIBILITY_VERSION}" MACHO_COMPATIBILITY_VERSION "${LIBPCRE2_32_MACHO_COMPATIBILITY_VERSION}"
MACHO_CURRENT_VERSION "${LIBPCRE2_32_MACHO_CURRENT_VERSION}" MACHO_CURRENT_VERSION "${LIBPCRE2_32_MACHO_CURRENT_VERSION}"
@@ -661,7 +661,7 @@ IF(PCRE2_BUILD_PCRE2_16)
IF(REQUIRE_PTHREAD) IF(REQUIRE_PTHREAD)
TARGET_LINK_LIBRARIES(pcre2-16-shared Threads::Threads) TARGET_LINK_LIBRARIES(pcre2-16-shared Threads::Threads)
ENDIF(REQUIRE_PTHREAD) ENDIF(REQUIRE_PTHREAD)
SET(targets ${targets} pcre2-16-shared) set(targets ${targets} pcre2-16-shared)
SET(dll_pdb_files ${PROJECT_BINARY_DIR}/pcre2-16.pdb ${dll_pdb_files}) SET(dll_pdb_files ${PROJECT_BINARY_DIR}/pcre2-16.pdb ${dll_pdb_files})
SET(dll_pdb_debug_files ${PROJECT_BINARY_DIR}/pcre2-16d.pdb ${dll_pdb_debug_files}) SET(dll_pdb_debug_files ${PROJECT_BINARY_DIR}/pcre2-16d.pdb ${dll_pdb_debug_files})
@@ -688,7 +688,7 @@ IF(PCRE2_BUILD_PCRE2_32)
IF(BUILD_STATIC_LIBS) IF(BUILD_STATIC_LIBS)
ADD_LIBRARY(pcre2-32-static STATIC ${PCRE2_HEADERS} ${PCRE2_SOURCES} ${PROJECT_BINARY_DIR}/config.h) ADD_LIBRARY(pcre2-32-static STATIC ${PCRE2_HEADERS} ${PCRE2_SOURCES} ${PROJECT_BINARY_DIR}/config.h)
TARGET_INCLUDE_DIRECTORIES(pcre2-32-static PUBLIC ${PROJECT_BINARY_DIR}) TARGET_INCLUDE_DIRECTORIES(pcre2-32-static PUBLIC ${PROJECT_BINARY_DIR})
SET_TARGET_PROPERTIES(pcre2-32-static PROPERTIES SET_TARGET_PROPERTIES(pcre2-32-static PROPERTIES UNITY_BUILD OFF
COMPILE_DEFINITIONS PCRE2_CODE_UNIT_WIDTH=32 COMPILE_DEFINITIONS PCRE2_CODE_UNIT_WIDTH=32
MACHO_COMPATIBILITY_VERSION "${LIBPCRE2_32_MACHO_COMPATIBILITY_VERSION}" MACHO_COMPATIBILITY_VERSION "${LIBPCRE2_32_MACHO_COMPATIBILITY_VERSION}"
MACHO_CURRENT_VERSION "${LIBPCRE2_32_MACHO_CURRENT_VERSION}" MACHO_CURRENT_VERSION "${LIBPCRE2_32_MACHO_CURRENT_VERSION}"
@@ -698,7 +698,7 @@ IF(PCRE2_BUILD_PCRE2_32)
IF(REQUIRE_PTHREAD) IF(REQUIRE_PTHREAD)
TARGET_LINK_LIBRARIES(pcre2-32-static Threads::Threads) TARGET_LINK_LIBRARIES(pcre2-32-static Threads::Threads)
ENDIF(REQUIRE_PTHREAD) ENDIF(REQUIRE_PTHREAD)
SET(targets ${targets} pcre2-32-static) set(targets ${targets} pcre2-32-static)
IF(MSVC) IF(MSVC)
SET_TARGET_PROPERTIES(pcre2-32-static PROPERTIES OUTPUT_NAME pcre2-32-static) SET_TARGET_PROPERTIES(pcre2-32-static PROPERTIES OUTPUT_NAME pcre2-32-static)
@@ -713,7 +713,7 @@ IF(PCRE2_BUILD_PCRE2_32)
IF(BUILD_SHARED_LIBS) IF(BUILD_SHARED_LIBS)
ADD_LIBRARY(pcre2-32-shared SHARED ${PCRE2_HEADERS} ${PCRE2_SOURCES} ${PROJECT_BINARY_DIR}/config.h) ADD_LIBRARY(pcre2-32-shared SHARED ${PCRE2_HEADERS} ${PCRE2_SOURCES} ${PROJECT_BINARY_DIR}/config.h)
TARGET_INCLUDE_DIRECTORIES(pcre2-32-shared PUBLIC ${PROJECT_BINARY_DIR}) TARGET_INCLUDE_DIRECTORIES(pcre2-32-shared PUBLIC ${PROJECT_BINARY_DIR})
SET_TARGET_PROPERTIES(pcre2-32-shared PROPERTIES SET_TARGET_PROPERTIES(pcre2-32-shared PROPERTIES UNITY_BUILD OFF
COMPILE_DEFINITIONS PCRE2_CODE_UNIT_WIDTH=32 COMPILE_DEFINITIONS PCRE2_CODE_UNIT_WIDTH=32
MACHO_COMPATIBILITY_VERSION "${LIBPCRE2_32_MACHO_COMPATIBILITY_VERSION}" MACHO_COMPATIBILITY_VERSION "${LIBPCRE2_32_MACHO_COMPATIBILITY_VERSION}"
MACHO_CURRENT_VERSION "${LIBPCRE2_32_MACHO_CURRENT_VERSION}" MACHO_CURRENT_VERSION "${LIBPCRE2_32_MACHO_CURRENT_VERSION}"
@@ -723,7 +723,7 @@ IF(PCRE2_BUILD_PCRE2_32)
IF(REQUIRE_PTHREAD) IF(REQUIRE_PTHREAD)
TARGET_LINK_LIBRARIES(pcre2-32-shared Threads::Threads) TARGET_LINK_LIBRARIES(pcre2-32-shared Threads::Threads)
ENDIF(REQUIRE_PTHREAD) ENDIF(REQUIRE_PTHREAD)
SET(targets ${targets} pcre2-32-shared) set(targets ${targets} pcre2-32-shared)
SET(dll_pdb_files ${PROJECT_BINARY_DIR}/pcre2-32.pdb ${dll_pdb_files}) SET(dll_pdb_files ${PROJECT_BINARY_DIR}/pcre2-32.pdb ${dll_pdb_files})
SET(dll_pdb_debug_files ${PROJECT_BINARY_DIR}/pcre2-32d.pdb ${dll_pdb_debug_files}) SET(dll_pdb_debug_files ${PROJECT_BINARY_DIR}/pcre2-32d.pdb ${dll_pdb_debug_files})
@@ -744,6 +744,46 @@ IF(PCRE2_BUILD_PCRE2_32)
ENDIF(BUILD_STATIC_LIBS) ENDIF(BUILD_STATIC_LIBS)
ENDIF(PCRE2_BUILD_PCRE2_32) ENDIF(PCRE2_BUILD_PCRE2_32)
# Generate pkg-config files
set(PACKAGE_VERSION "${PCRE2_MAJOR}.${PCRE2_MINOR}")
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix "\${prefix}")
set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
set(includedir "\${prefix}/include")
if(WIN32 AND (CMAKE_BUILD_TYPE MATCHES Debug))
set(LIB_POSTFIX ${CMAKE_DEBUG_POSTFIX})
endif()
if(PCRE2_BUILD_PCRE2_8)
configure_file(libpcre2-posix.pc.in libpcre2-posix.pc @ONLY)
list(APPEND pkg_config_files "${CMAKE_CURRENT_BINARY_DIR}/libpcre2-posix.pc")
configure_file(libpcre2-8.pc.in libpcre2-8.pc @ONLY)
list(APPEND pkg_config_files "${CMAKE_CURRENT_BINARY_DIR}/libpcre2-8.pc")
set(enable_pcre2_8 "yes")
else()
set(enable_pcre2_8 "no")
endif()
if(PCRE2_BUILD_PCRE2_16)
configure_file(libpcre2-16.pc.in libpcre2-16.pc @ONLY)
list(APPEND pkg_config_files "${CMAKE_CURRENT_BINARY_DIR}/libpcre2-16.pc")
set(enable_pcre2_16 "yes")
else()
set(enable_pcre2_16 "no")
endif()
if(PCRE2_BUILD_PCRE2_32)
configure_file(libpcre2-32.pc.in libpcre2-32.pc @ONLY)
list(APPEND pkg_config_files "${CMAKE_CURRENT_BINARY_DIR}/libpcre2-32.pc")
set(enable_pcre2_32 "yes")
else()
set(enable_pcre2_32 "no")
endif()
configure_file(pcre2-config.in pcre2-config @ONLY NEWLINE_STYLE LF)
# Executables # Executables
# Testing # Testing
@@ -813,6 +853,7 @@ IF(PCRE2_SHOW_REPORT)
MESSAGE(STATUS " EBCDIC coding with NL=0x25 ...... : ${PCRE2_EBCDIC_NL25}") MESSAGE(STATUS " EBCDIC coding with NL=0x25 ...... : ${PCRE2_EBCDIC_NL25}")
MESSAGE(STATUS " Rebuild char tables ............. : ${PCRE2_REBUILD_CHARTABLES}") MESSAGE(STATUS " Rebuild char tables ............. : ${PCRE2_REBUILD_CHARTABLES}")
MESSAGE(STATUS " Internal link size .............. : ${PCRE2_LINK_SIZE}") MESSAGE(STATUS " Internal link size .............. : ${PCRE2_LINK_SIZE}")
MESSAGE(STATUS " Maximum variable lookbehind ..... : ${PCRE2_MAX_VARLOOKBEHIND}")
MESSAGE(STATUS " Parentheses nest limit .......... : ${PCRE2_PARENS_NEST_LIMIT}") MESSAGE(STATUS " Parentheses nest limit .......... : ${PCRE2_PARENS_NEST_LIMIT}")
MESSAGE(STATUS " Heap limit ...................... : ${PCRE2_HEAP_LIMIT}") MESSAGE(STATUS " Heap limit ...................... : ${PCRE2_HEAP_LIMIT}")
MESSAGE(STATUS " Match limit ..................... : ${PCRE2_MATCH_LIMIT}") MESSAGE(STATUS " Match limit ..................... : ${PCRE2_MATCH_LIMIT}")

View File

@@ -26,7 +26,7 @@ Email domain: gmail.com
Retired from University of Cambridge Computing Service, Retired from University of Cambridge Computing Service,
Cambridge, England. Cambridge, England.
Copyright (c) 1997-2022 University of Cambridge Copyright (c) 1997-2024 University of Cambridge
All rights reserved. All rights reserved.
@@ -37,7 +37,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester Email local part: hzmester
Email domain: freemail.hu Email domain: freemail.hu
Copyright(c) 2010-2022 Zoltan Herczeg Copyright(c) 2010-2024 Zoltan Herczeg
All rights reserved. All rights reserved.
@@ -48,7 +48,7 @@ Written by: Zoltan Herczeg
Email local part: hzmester Email local part: hzmester
Email domain: freemail.hu Email domain: freemail.hu
Copyright(c) 2009-2022 Zoltan Herczeg Copyright(c) 2009-2024 Zoltan Herczeg
All rights reserved. All rights reserved.

View File

@@ -75,8 +75,7 @@ src/pcre2.h.generic: src/pcre2.h.in configure.ac
# config.status out of the way while doing the default configuration. The # config.status out of the way while doing the default configuration. The
# resulting config.h is munged by perl to put #ifdefs round any #defines for # resulting config.h is munged by perl to put #ifdefs round any #defines for
# macros with values, and to #undef all boolean macros such as HAVE_xxx and # macros with values, and to #undef all boolean macros such as HAVE_xxx and
# SUPPORT_xxx. We also get rid of any gcc-specific visibility settings. Make # SUPPORT_xxx. We also get rid of any gcc-specific visibility settings.
# sure that PCRE2_EXP_DEFN is unset (in case it has visibility settings).
src/config.h.generic: configure.ac src/config.h.generic: configure.ac
rm -rf $@ _generic rm -rf $@ _generic
@@ -87,9 +86,7 @@ src/config.h.generic: configure.ac
test -f _generic/src/config.h test -f _generic/src/config.h
perl -n \ perl -n \
-e 'BEGIN{$$blank=0;}' \ -e 'BEGIN{$$blank=0;}' \
-e 'if(/PCRE2_EXP_DEFN/){print"/* #undef PCRE2_EXP_DEFN */\n";$$blank=0;next;}' \ -e 'if(/(.+?)\s*__attribute__ \(\(visibility/){print"$$1\n";$$blank=0;next;}' \
-e 'if(/to make a symbol visible/){next;}' \
-e 'if(/__attribute__ \(\(visibility/){next;}' \
-e 'if(/LT_OBJDIR/){print"/* This is ignored unless you are using libtool. */\n";}' \ -e 'if(/LT_OBJDIR/){print"/* This is ignored unless you are using libtool. */\n";}' \
-e 'if(/^#define\s((?:HAVE|SUPPORT|STDC)_\w+)/){print"/* #undef $$1 */\n";$$blank=0;next;}' \ -e 'if(/^#define\s((?:HAVE|SUPPORT|STDC)_\w+)/){print"/* #undef $$1 */\n";$$blank=0;next;}' \
-e 'if(/^#define\s(?!PACKAGE|VERSION)(\w+)/){print"#ifndef $$1\n$$_#endif\n";$$blank=0;next;}' \ -e 'if(/^#define\s(?!PACKAGE|VERSION)(\w+)/){print"#ifndef $$1\n$$_#endif\n";$$blank=0;next;}' \
@@ -136,6 +133,7 @@ NODIST_SOURCES = src/pcre2_chartables.c
COMMON_SOURCES = \ COMMON_SOURCES = \
src/pcre2_auto_possess.c \ src/pcre2_auto_possess.c \
src/pcre2_chkdint.c \
src/pcre2_compile.c \ src/pcre2_compile.c \
src/pcre2_config.c \ src/pcre2_config.c \
src/pcre2_context.c \ src/pcre2_context.c \
@@ -257,7 +255,7 @@ if WITH_PCRE2_8
lib_LTLIBRARIES += libpcre2-posix.la lib_LTLIBRARIES += libpcre2-posix.la
libpcre2_posix_la_SOURCES = src/pcre2posix.c libpcre2_posix_la_SOURCES = src/pcre2posix.c
libpcre2_posix_la_CFLAGS = \ libpcre2_posix_la_CFLAGS = \
-DPCRE2_CODE_UNIT_WIDTH=8 \ -DPCRE2_CODE_UNIT_WIDTH=8 @PCRE2POSIX_CFLAG@ \
$(VISIBILITY_CFLAGS) $(AM_CFLAGS) $(VISIBILITY_CFLAGS) $(AM_CFLAGS)
libpcre2_posix_la_LDFLAGS = $(EXTRA_LIBPCRE2_POSIX_LDFLAGS) libpcre2_posix_la_LDFLAGS = $(EXTRA_LIBPCRE2_POSIX_LDFLAGS)
libpcre2_posix_la_LIBADD = libpcre2-8.la libpcre2_posix_la_LIBADD = libpcre2-8.la

View File

@@ -162,9 +162,9 @@ am__uninstall_files_from_dir = { \
LTLIBRARIES = $(lib_LTLIBRARIES) LTLIBRARIES = $(lib_LTLIBRARIES)
libpcre2_16_la_DEPENDENCIES = libpcre2_16_la_DEPENDENCIES =
am__libpcre2_16_la_SOURCES_DIST = src/pcre2_auto_possess.c \ am__libpcre2_16_la_SOURCES_DIST = src/pcre2_auto_possess.c \
src/pcre2_compile.c src/pcre2_config.c src/pcre2_context.c \ src/pcre2_chkdint.c src/pcre2_compile.c src/pcre2_config.c \
src/pcre2_convert.c src/pcre2_dfa_match.c src/pcre2_error.c \ src/pcre2_context.c src/pcre2_convert.c src/pcre2_dfa_match.c \
src/pcre2_extuni.c src/pcre2_find_bracket.c \ src/pcre2_error.c src/pcre2_extuni.c src/pcre2_find_bracket.c \
src/pcre2_internal.h src/pcre2_intmodedep.h \ src/pcre2_internal.h src/pcre2_intmodedep.h \
src/pcre2_jit_compile.c src/pcre2_maketables.c \ src/pcre2_jit_compile.c src/pcre2_maketables.c \
src/pcre2_match.c src/pcre2_match_data.c src/pcre2_newline.c \ src/pcre2_match.c src/pcre2_match_data.c src/pcre2_newline.c \
@@ -176,6 +176,7 @@ am__libpcre2_16_la_SOURCES_DIST = src/pcre2_auto_possess.c \
src/pcre2_valid_utf.c src/pcre2_xclass.c src/pcre2_valid_utf.c src/pcre2_xclass.c
am__dirstamp = $(am__leading_dot)dirstamp am__dirstamp = $(am__leading_dot)dirstamp
am__objects_1 = src/libpcre2_16_la-pcre2_auto_possess.lo \ am__objects_1 = src/libpcre2_16_la-pcre2_auto_possess.lo \
src/libpcre2_16_la-pcre2_chkdint.lo \
src/libpcre2_16_la-pcre2_compile.lo \ src/libpcre2_16_la-pcre2_compile.lo \
src/libpcre2_16_la-pcre2_config.lo \ src/libpcre2_16_la-pcre2_config.lo \
src/libpcre2_16_la-pcre2_context.lo \ src/libpcre2_16_la-pcre2_context.lo \
@@ -217,9 +218,9 @@ libpcre2_16_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
@WITH_PCRE2_16_TRUE@am_libpcre2_16_la_rpath = -rpath $(libdir) @WITH_PCRE2_16_TRUE@am_libpcre2_16_la_rpath = -rpath $(libdir)
libpcre2_32_la_DEPENDENCIES = libpcre2_32_la_DEPENDENCIES =
am__libpcre2_32_la_SOURCES_DIST = src/pcre2_auto_possess.c \ am__libpcre2_32_la_SOURCES_DIST = src/pcre2_auto_possess.c \
src/pcre2_compile.c src/pcre2_config.c src/pcre2_context.c \ src/pcre2_chkdint.c src/pcre2_compile.c src/pcre2_config.c \
src/pcre2_convert.c src/pcre2_dfa_match.c src/pcre2_error.c \ src/pcre2_context.c src/pcre2_convert.c src/pcre2_dfa_match.c \
src/pcre2_extuni.c src/pcre2_find_bracket.c \ src/pcre2_error.c src/pcre2_extuni.c src/pcre2_find_bracket.c \
src/pcre2_internal.h src/pcre2_intmodedep.h \ src/pcre2_internal.h src/pcre2_intmodedep.h \
src/pcre2_jit_compile.c src/pcre2_maketables.c \ src/pcre2_jit_compile.c src/pcre2_maketables.c \
src/pcre2_match.c src/pcre2_match_data.c src/pcre2_newline.c \ src/pcre2_match.c src/pcre2_match_data.c src/pcre2_newline.c \
@@ -230,6 +231,7 @@ am__libpcre2_32_la_SOURCES_DIST = src/pcre2_auto_possess.c \
src/pcre2_tables.c src/pcre2_ucd.c src/pcre2_ucp.h \ src/pcre2_tables.c src/pcre2_ucd.c src/pcre2_ucp.h \
src/pcre2_valid_utf.c src/pcre2_xclass.c src/pcre2_valid_utf.c src/pcre2_xclass.c
am__objects_3 = src/libpcre2_32_la-pcre2_auto_possess.lo \ am__objects_3 = src/libpcre2_32_la-pcre2_auto_possess.lo \
src/libpcre2_32_la-pcre2_chkdint.lo \
src/libpcre2_32_la-pcre2_compile.lo \ src/libpcre2_32_la-pcre2_compile.lo \
src/libpcre2_32_la-pcre2_config.lo \ src/libpcre2_32_la-pcre2_config.lo \
src/libpcre2_32_la-pcre2_context.lo \ src/libpcre2_32_la-pcre2_context.lo \
@@ -267,9 +269,9 @@ libpcre2_32_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
@WITH_PCRE2_32_TRUE@am_libpcre2_32_la_rpath = -rpath $(libdir) @WITH_PCRE2_32_TRUE@am_libpcre2_32_la_rpath = -rpath $(libdir)
libpcre2_8_la_DEPENDENCIES = libpcre2_8_la_DEPENDENCIES =
am__libpcre2_8_la_SOURCES_DIST = src/pcre2_auto_possess.c \ am__libpcre2_8_la_SOURCES_DIST = src/pcre2_auto_possess.c \
src/pcre2_compile.c src/pcre2_config.c src/pcre2_context.c \ src/pcre2_chkdint.c src/pcre2_compile.c src/pcre2_config.c \
src/pcre2_convert.c src/pcre2_dfa_match.c src/pcre2_error.c \ src/pcre2_context.c src/pcre2_convert.c src/pcre2_dfa_match.c \
src/pcre2_extuni.c src/pcre2_find_bracket.c \ src/pcre2_error.c src/pcre2_extuni.c src/pcre2_find_bracket.c \
src/pcre2_internal.h src/pcre2_intmodedep.h \ src/pcre2_internal.h src/pcre2_intmodedep.h \
src/pcre2_jit_compile.c src/pcre2_maketables.c \ src/pcre2_jit_compile.c src/pcre2_maketables.c \
src/pcre2_match.c src/pcre2_match_data.c src/pcre2_newline.c \ src/pcre2_match.c src/pcre2_match_data.c src/pcre2_newline.c \
@@ -280,6 +282,7 @@ am__libpcre2_8_la_SOURCES_DIST = src/pcre2_auto_possess.c \
src/pcre2_tables.c src/pcre2_ucd.c src/pcre2_ucp.h \ src/pcre2_tables.c src/pcre2_ucd.c src/pcre2_ucp.h \
src/pcre2_valid_utf.c src/pcre2_xclass.c src/pcre2_valid_utf.c src/pcre2_xclass.c
am__objects_5 = src/libpcre2_8_la-pcre2_auto_possess.lo \ am__objects_5 = src/libpcre2_8_la-pcre2_auto_possess.lo \
src/libpcre2_8_la-pcre2_chkdint.lo \
src/libpcre2_8_la-pcre2_compile.lo \ src/libpcre2_8_la-pcre2_compile.lo \
src/libpcre2_8_la-pcre2_config.lo \ src/libpcre2_8_la-pcre2_config.lo \
src/libpcre2_8_la-pcre2_context.lo \ src/libpcre2_8_la-pcre2_context.lo \
@@ -348,6 +351,7 @@ am__maybe_remake_depfiles = depfiles
am__depfiles_remade = \ am__depfiles_remade = \
src/$(DEPDIR)/libpcre2_16_la-pcre2_auto_possess.Plo \ src/$(DEPDIR)/libpcre2_16_la-pcre2_auto_possess.Plo \
src/$(DEPDIR)/libpcre2_16_la-pcre2_chartables.Plo \ src/$(DEPDIR)/libpcre2_16_la-pcre2_chartables.Plo \
src/$(DEPDIR)/libpcre2_16_la-pcre2_chkdint.Plo \
src/$(DEPDIR)/libpcre2_16_la-pcre2_compile.Plo \ src/$(DEPDIR)/libpcre2_16_la-pcre2_compile.Plo \
src/$(DEPDIR)/libpcre2_16_la-pcre2_config.Plo \ src/$(DEPDIR)/libpcre2_16_la-pcre2_config.Plo \
src/$(DEPDIR)/libpcre2_16_la-pcre2_context.Plo \ src/$(DEPDIR)/libpcre2_16_la-pcre2_context.Plo \
@@ -375,6 +379,7 @@ am__depfiles_remade = \
src/$(DEPDIR)/libpcre2_16_la-pcre2_xclass.Plo \ src/$(DEPDIR)/libpcre2_16_la-pcre2_xclass.Plo \
src/$(DEPDIR)/libpcre2_32_la-pcre2_auto_possess.Plo \ src/$(DEPDIR)/libpcre2_32_la-pcre2_auto_possess.Plo \
src/$(DEPDIR)/libpcre2_32_la-pcre2_chartables.Plo \ src/$(DEPDIR)/libpcre2_32_la-pcre2_chartables.Plo \
src/$(DEPDIR)/libpcre2_32_la-pcre2_chkdint.Plo \
src/$(DEPDIR)/libpcre2_32_la-pcre2_compile.Plo \ src/$(DEPDIR)/libpcre2_32_la-pcre2_compile.Plo \
src/$(DEPDIR)/libpcre2_32_la-pcre2_config.Plo \ src/$(DEPDIR)/libpcre2_32_la-pcre2_config.Plo \
src/$(DEPDIR)/libpcre2_32_la-pcre2_context.Plo \ src/$(DEPDIR)/libpcre2_32_la-pcre2_context.Plo \
@@ -402,6 +407,7 @@ am__depfiles_remade = \
src/$(DEPDIR)/libpcre2_32_la-pcre2_xclass.Plo \ src/$(DEPDIR)/libpcre2_32_la-pcre2_xclass.Plo \
src/$(DEPDIR)/libpcre2_8_la-pcre2_auto_possess.Plo \ src/$(DEPDIR)/libpcre2_8_la-pcre2_auto_possess.Plo \
src/$(DEPDIR)/libpcre2_8_la-pcre2_chartables.Plo \ src/$(DEPDIR)/libpcre2_8_la-pcre2_chartables.Plo \
src/$(DEPDIR)/libpcre2_8_la-pcre2_chkdint.Plo \
src/$(DEPDIR)/libpcre2_8_la-pcre2_compile.Plo \ src/$(DEPDIR)/libpcre2_8_la-pcre2_compile.Plo \
src/$(DEPDIR)/libpcre2_8_la-pcre2_config.Plo \ src/$(DEPDIR)/libpcre2_8_la-pcre2_config.Plo \
src/$(DEPDIR)/libpcre2_8_la-pcre2_context.Plo \ src/$(DEPDIR)/libpcre2_8_la-pcre2_context.Plo \
@@ -715,7 +721,6 @@ EXTRA_LIBPCRE2_32_LDFLAGS = @EXTRA_LIBPCRE2_32_LDFLAGS@
EXTRA_LIBPCRE2_8_LDFLAGS = @EXTRA_LIBPCRE2_8_LDFLAGS@ EXTRA_LIBPCRE2_8_LDFLAGS = @EXTRA_LIBPCRE2_8_LDFLAGS@
EXTRA_LIBPCRE2_POSIX_LDFLAGS = @EXTRA_LIBPCRE2_POSIX_LDFLAGS@ EXTRA_LIBPCRE2_POSIX_LDFLAGS = @EXTRA_LIBPCRE2_POSIX_LDFLAGS@
FGREP = @FGREP@ FGREP = @FGREP@
FILECMD = @FILECMD@
GCOV_CFLAGS = @GCOV_CFLAGS@ GCOV_CFLAGS = @GCOV_CFLAGS@
GCOV_CXXFLAGS = @GCOV_CXXFLAGS@ GCOV_CXXFLAGS = @GCOV_CXXFLAGS@
GCOV_LIBS = @GCOV_LIBS@ GCOV_LIBS = @GCOV_LIBS@
@@ -755,6 +760,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@ PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@ PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@ PATH_SEPARATOR = @PATH_SEPARATOR@
PCRE2POSIX_CFLAG = @PCRE2POSIX_CFLAG@
PCRE2_DATE = @PCRE2_DATE@ PCRE2_DATE = @PCRE2_DATE@
PCRE2_MAJOR = @PCRE2_MAJOR@ PCRE2_MAJOR = @PCRE2_MAJOR@
PCRE2_MINOR = @PCRE2_MINOR@ PCRE2_MINOR = @PCRE2_MINOR@
@@ -879,6 +885,7 @@ BUILT_SOURCES = src/pcre2_chartables.c
NODIST_SOURCES = src/pcre2_chartables.c NODIST_SOURCES = src/pcre2_chartables.c
COMMON_SOURCES = \ COMMON_SOURCES = \
src/pcre2_auto_possess.c \ src/pcre2_auto_possess.c \
src/pcre2_chkdint.c \
src/pcre2_compile.c \ src/pcre2_compile.c \
src/pcre2_config.c \ src/pcre2_config.c \
src/pcre2_context.c \ src/pcre2_context.c \
@@ -949,8 +956,8 @@ COMMON_SOURCES = \
@WITH_PCRE2_8_TRUE@libpcre2_posix_la_SOURCES = src/pcre2posix.c @WITH_PCRE2_8_TRUE@libpcre2_posix_la_SOURCES = src/pcre2posix.c
@WITH_PCRE2_8_TRUE@libpcre2_posix_la_CFLAGS = \ @WITH_PCRE2_8_TRUE@libpcre2_posix_la_CFLAGS = \
@WITH_PCRE2_8_TRUE@ -DPCRE2_CODE_UNIT_WIDTH=8 \ @WITH_PCRE2_8_TRUE@ -DPCRE2_CODE_UNIT_WIDTH=8 \
@WITH_PCRE2_8_TRUE@ $(VISIBILITY_CFLAGS) $(AM_CFLAGS) \ @WITH_PCRE2_8_TRUE@ @PCRE2POSIX_CFLAG@ $(VISIBILITY_CFLAGS) \
@WITH_PCRE2_8_TRUE@ $(am__append_12) @WITH_PCRE2_8_TRUE@ $(AM_CFLAGS) $(am__append_12)
@WITH_PCRE2_8_TRUE@libpcre2_posix_la_LDFLAGS = $(EXTRA_LIBPCRE2_POSIX_LDFLAGS) @WITH_PCRE2_8_TRUE@libpcre2_posix_la_LDFLAGS = $(EXTRA_LIBPCRE2_POSIX_LDFLAGS)
@WITH_PCRE2_8_TRUE@libpcre2_posix_la_LIBADD = libpcre2-8.la @WITH_PCRE2_8_TRUE@libpcre2_posix_la_LIBADD = libpcre2-8.la
@@ -1135,6 +1142,8 @@ src/$(DEPDIR)/$(am__dirstamp):
@: > src/$(DEPDIR)/$(am__dirstamp) @: > src/$(DEPDIR)/$(am__dirstamp)
src/libpcre2_16_la-pcre2_auto_possess.lo: src/$(am__dirstamp) \ src/libpcre2_16_la-pcre2_auto_possess.lo: src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
src/libpcre2_16_la-pcre2_chkdint.lo: src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp)
src/libpcre2_16_la-pcre2_compile.lo: src/$(am__dirstamp) \ src/libpcre2_16_la-pcre2_compile.lo: src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
src/libpcre2_16_la-pcre2_config.lo: src/$(am__dirstamp) \ src/libpcre2_16_la-pcre2_config.lo: src/$(am__dirstamp) \
@@ -1192,6 +1201,8 @@ libpcre2-16.la: $(libpcre2_16_la_OBJECTS) $(libpcre2_16_la_DEPENDENCIES) $(EXTRA
$(AM_V_CCLD)$(libpcre2_16_la_LINK) $(am_libpcre2_16_la_rpath) $(libpcre2_16_la_OBJECTS) $(libpcre2_16_la_LIBADD) $(LIBS) $(AM_V_CCLD)$(libpcre2_16_la_LINK) $(am_libpcre2_16_la_rpath) $(libpcre2_16_la_OBJECTS) $(libpcre2_16_la_LIBADD) $(LIBS)
src/libpcre2_32_la-pcre2_auto_possess.lo: src/$(am__dirstamp) \ src/libpcre2_32_la-pcre2_auto_possess.lo: src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
src/libpcre2_32_la-pcre2_chkdint.lo: src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp)
src/libpcre2_32_la-pcre2_compile.lo: src/$(am__dirstamp) \ src/libpcre2_32_la-pcre2_compile.lo: src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
src/libpcre2_32_la-pcre2_config.lo: src/$(am__dirstamp) \ src/libpcre2_32_la-pcre2_config.lo: src/$(am__dirstamp) \
@@ -1249,6 +1260,8 @@ libpcre2-32.la: $(libpcre2_32_la_OBJECTS) $(libpcre2_32_la_DEPENDENCIES) $(EXTRA
$(AM_V_CCLD)$(libpcre2_32_la_LINK) $(am_libpcre2_32_la_rpath) $(libpcre2_32_la_OBJECTS) $(libpcre2_32_la_LIBADD) $(LIBS) $(AM_V_CCLD)$(libpcre2_32_la_LINK) $(am_libpcre2_32_la_rpath) $(libpcre2_32_la_OBJECTS) $(libpcre2_32_la_LIBADD) $(LIBS)
src/libpcre2_8_la-pcre2_auto_possess.lo: src/$(am__dirstamp) \ src/libpcre2_8_la-pcre2_auto_possess.lo: src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
src/libpcre2_8_la-pcre2_chkdint.lo: src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp)
src/libpcre2_8_la-pcre2_compile.lo: src/$(am__dirstamp) \ src/libpcre2_8_la-pcre2_compile.lo: src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp) src/$(DEPDIR)/$(am__dirstamp)
src/libpcre2_8_la-pcre2_config.lo: src/$(am__dirstamp) \ src/libpcre2_8_la-pcre2_config.lo: src/$(am__dirstamp) \
@@ -1361,6 +1374,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_auto_possess.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_auto_possess.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_chartables.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_chartables.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_chkdint.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_compile.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_compile.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_config.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_config.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_context.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_context.Plo@am__quote@ # am--include-marker
@@ -1388,6 +1402,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_xclass.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_16_la-pcre2_xclass.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_auto_possess.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_auto_possess.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_chartables.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_chartables.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_chkdint.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_compile.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_compile.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_config.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_config.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_context.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_context.Plo@am__quote@ # am--include-marker
@@ -1415,6 +1430,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_xclass.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_32_la-pcre2_xclass.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_auto_possess.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_auto_possess.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_chartables.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_chartables.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_chkdint.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_compile.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_compile.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_config.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_config.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_context.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/libpcre2_8_la-pcre2_context.Plo@am__quote@ # am--include-marker
@@ -1480,6 +1496,13 @@ src/libpcre2_16_la-pcre2_auto_possess.lo: src/pcre2_auto_possess.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_16_la_CFLAGS) $(CFLAGS) -c -o src/libpcre2_16_la-pcre2_auto_possess.lo `test -f 'src/pcre2_auto_possess.c' || echo '$(srcdir)/'`src/pcre2_auto_possess.c @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_16_la_CFLAGS) $(CFLAGS) -c -o src/libpcre2_16_la-pcre2_auto_possess.lo `test -f 'src/pcre2_auto_possess.c' || echo '$(srcdir)/'`src/pcre2_auto_possess.c
src/libpcre2_16_la-pcre2_chkdint.lo: src/pcre2_chkdint.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_16_la_CFLAGS) $(CFLAGS) -MT src/libpcre2_16_la-pcre2_chkdint.lo -MD -MP -MF src/$(DEPDIR)/libpcre2_16_la-pcre2_chkdint.Tpo -c -o src/libpcre2_16_la-pcre2_chkdint.lo `test -f 'src/pcre2_chkdint.c' || echo '$(srcdir)/'`src/pcre2_chkdint.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/libpcre2_16_la-pcre2_chkdint.Tpo src/$(DEPDIR)/libpcre2_16_la-pcre2_chkdint.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/pcre2_chkdint.c' object='src/libpcre2_16_la-pcre2_chkdint.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_16_la_CFLAGS) $(CFLAGS) -c -o src/libpcre2_16_la-pcre2_chkdint.lo `test -f 'src/pcre2_chkdint.c' || echo '$(srcdir)/'`src/pcre2_chkdint.c
src/libpcre2_16_la-pcre2_compile.lo: src/pcre2_compile.c src/libpcre2_16_la-pcre2_compile.lo: src/pcre2_compile.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_16_la_CFLAGS) $(CFLAGS) -MT src/libpcre2_16_la-pcre2_compile.lo -MD -MP -MF src/$(DEPDIR)/libpcre2_16_la-pcre2_compile.Tpo -c -o src/libpcre2_16_la-pcre2_compile.lo `test -f 'src/pcre2_compile.c' || echo '$(srcdir)/'`src/pcre2_compile.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_16_la_CFLAGS) $(CFLAGS) -MT src/libpcre2_16_la-pcre2_compile.lo -MD -MP -MF src/$(DEPDIR)/libpcre2_16_la-pcre2_compile.Tpo -c -o src/libpcre2_16_la-pcre2_compile.lo `test -f 'src/pcre2_compile.c' || echo '$(srcdir)/'`src/pcre2_compile.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/libpcre2_16_la-pcre2_compile.Tpo src/$(DEPDIR)/libpcre2_16_la-pcre2_compile.Plo @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/libpcre2_16_la-pcre2_compile.Tpo src/$(DEPDIR)/libpcre2_16_la-pcre2_compile.Plo
@@ -1669,6 +1692,13 @@ src/libpcre2_32_la-pcre2_auto_possess.lo: src/pcre2_auto_possess.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_32_la_CFLAGS) $(CFLAGS) -c -o src/libpcre2_32_la-pcre2_auto_possess.lo `test -f 'src/pcre2_auto_possess.c' || echo '$(srcdir)/'`src/pcre2_auto_possess.c @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_32_la_CFLAGS) $(CFLAGS) -c -o src/libpcre2_32_la-pcre2_auto_possess.lo `test -f 'src/pcre2_auto_possess.c' || echo '$(srcdir)/'`src/pcre2_auto_possess.c
src/libpcre2_32_la-pcre2_chkdint.lo: src/pcre2_chkdint.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_32_la_CFLAGS) $(CFLAGS) -MT src/libpcre2_32_la-pcre2_chkdint.lo -MD -MP -MF src/$(DEPDIR)/libpcre2_32_la-pcre2_chkdint.Tpo -c -o src/libpcre2_32_la-pcre2_chkdint.lo `test -f 'src/pcre2_chkdint.c' || echo '$(srcdir)/'`src/pcre2_chkdint.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/libpcre2_32_la-pcre2_chkdint.Tpo src/$(DEPDIR)/libpcre2_32_la-pcre2_chkdint.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/pcre2_chkdint.c' object='src/libpcre2_32_la-pcre2_chkdint.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_32_la_CFLAGS) $(CFLAGS) -c -o src/libpcre2_32_la-pcre2_chkdint.lo `test -f 'src/pcre2_chkdint.c' || echo '$(srcdir)/'`src/pcre2_chkdint.c
src/libpcre2_32_la-pcre2_compile.lo: src/pcre2_compile.c src/libpcre2_32_la-pcre2_compile.lo: src/pcre2_compile.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_32_la_CFLAGS) $(CFLAGS) -MT src/libpcre2_32_la-pcre2_compile.lo -MD -MP -MF src/$(DEPDIR)/libpcre2_32_la-pcre2_compile.Tpo -c -o src/libpcre2_32_la-pcre2_compile.lo `test -f 'src/pcre2_compile.c' || echo '$(srcdir)/'`src/pcre2_compile.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_32_la_CFLAGS) $(CFLAGS) -MT src/libpcre2_32_la-pcre2_compile.lo -MD -MP -MF src/$(DEPDIR)/libpcre2_32_la-pcre2_compile.Tpo -c -o src/libpcre2_32_la-pcre2_compile.lo `test -f 'src/pcre2_compile.c' || echo '$(srcdir)/'`src/pcre2_compile.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/libpcre2_32_la-pcre2_compile.Tpo src/$(DEPDIR)/libpcre2_32_la-pcre2_compile.Plo @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/libpcre2_32_la-pcre2_compile.Tpo src/$(DEPDIR)/libpcre2_32_la-pcre2_compile.Plo
@@ -1858,6 +1888,13 @@ src/libpcre2_8_la-pcre2_auto_possess.lo: src/pcre2_auto_possess.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_8_la_CFLAGS) $(CFLAGS) -c -o src/libpcre2_8_la-pcre2_auto_possess.lo `test -f 'src/pcre2_auto_possess.c' || echo '$(srcdir)/'`src/pcre2_auto_possess.c @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_8_la_CFLAGS) $(CFLAGS) -c -o src/libpcre2_8_la-pcre2_auto_possess.lo `test -f 'src/pcre2_auto_possess.c' || echo '$(srcdir)/'`src/pcre2_auto_possess.c
src/libpcre2_8_la-pcre2_chkdint.lo: src/pcre2_chkdint.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_8_la_CFLAGS) $(CFLAGS) -MT src/libpcre2_8_la-pcre2_chkdint.lo -MD -MP -MF src/$(DEPDIR)/libpcre2_8_la-pcre2_chkdint.Tpo -c -o src/libpcre2_8_la-pcre2_chkdint.lo `test -f 'src/pcre2_chkdint.c' || echo '$(srcdir)/'`src/pcre2_chkdint.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/libpcre2_8_la-pcre2_chkdint.Tpo src/$(DEPDIR)/libpcre2_8_la-pcre2_chkdint.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/pcre2_chkdint.c' object='src/libpcre2_8_la-pcre2_chkdint.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_8_la_CFLAGS) $(CFLAGS) -c -o src/libpcre2_8_la-pcre2_chkdint.lo `test -f 'src/pcre2_chkdint.c' || echo '$(srcdir)/'`src/pcre2_chkdint.c
src/libpcre2_8_la-pcre2_compile.lo: src/pcre2_compile.c src/libpcre2_8_la-pcre2_compile.lo: src/pcre2_compile.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_8_la_CFLAGS) $(CFLAGS) -MT src/libpcre2_8_la-pcre2_compile.lo -MD -MP -MF src/$(DEPDIR)/libpcre2_8_la-pcre2_compile.Tpo -c -o src/libpcre2_8_la-pcre2_compile.lo `test -f 'src/pcre2_compile.c' || echo '$(srcdir)/'`src/pcre2_compile.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpcre2_8_la_CFLAGS) $(CFLAGS) -MT src/libpcre2_8_la-pcre2_compile.lo -MD -MP -MF src/$(DEPDIR)/libpcre2_8_la-pcre2_compile.Tpo -c -o src/libpcre2_8_la-pcre2_compile.lo `test -f 'src/pcre2_compile.c' || echo '$(srcdir)/'`src/pcre2_compile.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/libpcre2_8_la-pcre2_compile.Tpo src/$(DEPDIR)/libpcre2_8_la-pcre2_compile.Plo @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/libpcre2_8_la-pcre2_compile.Tpo src/$(DEPDIR)/libpcre2_8_la-pcre2_compile.Plo
@@ -2591,6 +2628,7 @@ distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_auto_possess.Plo -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_auto_possess.Plo
-rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_chartables.Plo -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_chartables.Plo
-rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_chkdint.Plo
-rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_compile.Plo -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_compile.Plo
-rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_config.Plo -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_config.Plo
-rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_context.Plo -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_context.Plo
@@ -2618,6 +2656,7 @@ distclean: distclean-am
-rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_xclass.Plo -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_xclass.Plo
-rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_auto_possess.Plo -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_auto_possess.Plo
-rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_chartables.Plo -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_chartables.Plo
-rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_chkdint.Plo
-rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_compile.Plo -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_compile.Plo
-rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_config.Plo -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_config.Plo
-rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_context.Plo -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_context.Plo
@@ -2645,6 +2684,7 @@ distclean: distclean-am
-rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_xclass.Plo -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_xclass.Plo
-rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_auto_possess.Plo -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_auto_possess.Plo
-rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_chartables.Plo -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_chartables.Plo
-rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_chkdint.Plo
-rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_compile.Plo -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_compile.Plo
-rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_config.Plo -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_config.Plo
-rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_context.Plo -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_context.Plo
@@ -2723,6 +2763,7 @@ maintainer-clean: maintainer-clean-am
-rm -rf $(top_srcdir)/autom4te.cache -rm -rf $(top_srcdir)/autom4te.cache
-rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_auto_possess.Plo -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_auto_possess.Plo
-rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_chartables.Plo -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_chartables.Plo
-rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_chkdint.Plo
-rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_compile.Plo -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_compile.Plo
-rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_config.Plo -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_config.Plo
-rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_context.Plo -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_context.Plo
@@ -2750,6 +2791,7 @@ maintainer-clean: maintainer-clean-am
-rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_xclass.Plo -rm -f src/$(DEPDIR)/libpcre2_16_la-pcre2_xclass.Plo
-rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_auto_possess.Plo -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_auto_possess.Plo
-rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_chartables.Plo -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_chartables.Plo
-rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_chkdint.Plo
-rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_compile.Plo -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_compile.Plo
-rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_config.Plo -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_config.Plo
-rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_context.Plo -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_context.Plo
@@ -2777,6 +2819,7 @@ maintainer-clean: maintainer-clean-am
-rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_xclass.Plo -rm -f src/$(DEPDIR)/libpcre2_32_la-pcre2_xclass.Plo
-rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_auto_possess.Plo -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_auto_possess.Plo
-rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_chartables.Plo -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_chartables.Plo
-rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_chkdint.Plo
-rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_compile.Plo -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_compile.Plo
-rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_config.Plo -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_config.Plo
-rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_context.Plo -rm -f src/$(DEPDIR)/libpcre2_8_la-pcre2_context.Plo
@@ -2873,8 +2916,7 @@ src/pcre2.h.generic: src/pcre2.h.in configure.ac
# config.status out of the way while doing the default configuration. The # config.status out of the way while doing the default configuration. The
# resulting config.h is munged by perl to put #ifdefs round any #defines for # resulting config.h is munged by perl to put #ifdefs round any #defines for
# macros with values, and to #undef all boolean macros such as HAVE_xxx and # macros with values, and to #undef all boolean macros such as HAVE_xxx and
# SUPPORT_xxx. We also get rid of any gcc-specific visibility settings. Make # SUPPORT_xxx. We also get rid of any gcc-specific visibility settings.
# sure that PCRE2_EXP_DEFN is unset (in case it has visibility settings).
src/config.h.generic: configure.ac src/config.h.generic: configure.ac
rm -rf $@ _generic rm -rf $@ _generic
@@ -2885,9 +2927,7 @@ src/config.h.generic: configure.ac
test -f _generic/src/config.h test -f _generic/src/config.h
perl -n \ perl -n \
-e 'BEGIN{$$blank=0;}' \ -e 'BEGIN{$$blank=0;}' \
-e 'if(/PCRE2_EXP_DEFN/){print"/* #undef PCRE2_EXP_DEFN */\n";$$blank=0;next;}' \ -e 'if(/(.+?)\s*__attribute__ \(\(visibility/){print"$$1\n";$$blank=0;next;}' \
-e 'if(/to make a symbol visible/){next;}' \
-e 'if(/__attribute__ \(\(visibility/){next;}' \
-e 'if(/LT_OBJDIR/){print"/* This is ignored unless you are using libtool. */\n";}' \ -e 'if(/LT_OBJDIR/){print"/* This is ignored unless you are using libtool. */\n";}' \
-e 'if(/^#define\s((?:HAVE|SUPPORT|STDC)_\w+)/){print"/* #undef $$1 */\n";$$blank=0;next;}' \ -e 'if(/^#define\s((?:HAVE|SUPPORT|STDC)_\w+)/){print"/* #undef $$1 */\n";$$blank=0;next;}' \
-e 'if(/^#define\s(?!PACKAGE|VERSION)(\w+)/){print"#ifndef $$1\n$$_#endif\n";$$blank=0;next;}' \ -e 'if(/^#define\s(?!PACKAGE|VERSION)(\w+)/){print"#ifndef $$1\n$$_#endif\n";$$blank=0;next;}' \

View File

@@ -47,5 +47,5 @@ README
INSTALL INSTALL
NON-AUTOTOOLS-BUILDS NON-AUTOTOOLS-BUILDS
o Made relevant changes to Makefile.am, configure.ac, and CMakeFiles.txt to o Made relevant changes to Makefile.am, configure.ac, CMakeLists.txt, and
accommodate our smaller, non-JIT build. src/pcre2_jit_compile.c to accommodate our smaller, non-JIT build.

View File

@@ -52,9 +52,9 @@ else ()
endif () endif ()
endif () endif ()
find_library(PCRE2_8BIT_LIBRARY NAMES ${PCRE2_PREFIX}${PCRE2_8BIT_NAME}${PCRE2_SUFFIX} ${PCRE2_PREFIX}${PCRE2_8BIT_NAME}d${PCRE2_SUFFIX} DOC "8 bit PCRE2 library") find_library(PCRE2_8BIT_LIBRARY NAMES ${PCRE2_PREFIX}${PCRE2_8BIT_NAME}${PCRE2_SUFFIX} ${PCRE2_PREFIX}${PCRE2_8BIT_NAME}d${PCRE2_SUFFIX} DOC "8 bit PCRE2 library")
find_library(PCRE2_16BIT_LIBRARY NAMES ${PCRE2_PREFIX}${PCRE2_16BIT_NAME}${PCRE2_SUFFIX} ${PCRE2_PREFIX}${PCRE2_8BIT_NAME}d${PCRE2_SUFFIX} DOC "16 bit PCRE2 library") find_library(PCRE2_16BIT_LIBRARY NAMES ${PCRE2_PREFIX}${PCRE2_16BIT_NAME}${PCRE2_SUFFIX} ${PCRE2_PREFIX}${PCRE2_16BIT_NAME}d${PCRE2_SUFFIX} DOC "16 bit PCRE2 library")
find_library(PCRE2_32BIT_LIBRARY NAMES ${PCRE2_PREFIX}${PCRE2_32BIT_NAME}${PCRE2_SUFFIX} ${PCRE2_PREFIX}${PCRE2_8BIT_NAME}d${PCRE2_SUFFIX} DOC "32 bit PCRE2 library") find_library(PCRE2_32BIT_LIBRARY NAMES ${PCRE2_PREFIX}${PCRE2_32BIT_NAME}${PCRE2_SUFFIX} ${PCRE2_PREFIX}${PCRE2_32BIT_NAME}d${PCRE2_SUFFIX} DOC "32 bit PCRE2 library")
find_library(PCRE2_POSIX_LIBRARY NAMES ${PCRE2_PREFIX}${PCRE2_POSIX_NAME}${PCRE2_SUFFIX} ${PCRE2_PREFIX}${PCRE2_8BIT_NAME}d${PCRE2_SUFFIX} DOC "8 bit POSIX PCRE2 library") find_library(PCRE2_POSIX_LIBRARY NAMES ${PCRE2_PREFIX}${PCRE2_POSIX_NAME}${PCRE2_SUFFIX} ${PCRE2_PREFIX}${PCRE2_POSIX_NAME}d${PCRE2_SUFFIX} DOC "8 bit POSIX PCRE2 library")
unset(PCRE2_NON_STANDARD_LIB_PREFIX) unset(PCRE2_NON_STANDARD_LIB_PREFIX)
unset(PCRE2_NON_STANDARD_LIB_SUFFIX) unset(PCRE2_NON_STANDARD_LIB_SUFFIX)
unset(PCRE2_8BIT_NAME) unset(PCRE2_8BIT_NAME)
@@ -126,6 +126,7 @@ if (PCRE2_FOUND)
endif () endif ()
set_target_properties(PCRE2::${component} PROPERTIES set_target_properties(PCRE2::${component} PROPERTIES
IMPORTED_LOCATION "${PCRE2_${component}_LIBRARY}" IMPORTED_LOCATION "${PCRE2_${component}_LIBRARY}"
IMPORTED_IMPLIB "${PCRE2_${component}_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${PCRE2_INCLUDE_DIR}" INTERFACE_INCLUDE_DIRECTORIES "${PCRE2_INCLUDE_DIR}"
) )
if (component STREQUAL "POSIX") if (component STREQUAL "POSIX")

View File

@@ -1,8 +1,8 @@
/* config.h for CMake builds */ /* config.h for CMake builds */
#cmakedefine HAVE_BUILTIN_MUL_OVERFLOW 1
#cmakedefine HAVE_ATTRIBUTE_UNINITIALIZED 1 #cmakedefine HAVE_ATTRIBUTE_UNINITIALIZED 1
#cmakedefine HAVE_DIRENT_H 1 #cmakedefine HAVE_DIRENT_H 1
#cmakedefine HAVE_STRERROR 1
#cmakedefine HAVE_SYS_STAT_H 1 #cmakedefine HAVE_SYS_STAT_H 1
#cmakedefine HAVE_SYS_TYPES_H 1 #cmakedefine HAVE_SYS_TYPES_H 1
#cmakedefine HAVE_UNISTD_H 1 #cmakedefine HAVE_UNISTD_H 1
@@ -20,7 +20,16 @@
#cmakedefine PCRE2_DEBUG 1 #cmakedefine PCRE2_DEBUG 1
#cmakedefine DISABLE_PERCENT_ZT 1 #cmakedefine DISABLE_PERCENT_ZT 1
#cmakedefine SUPPORT_LIBBZ2 1
#cmakedefine SUPPORT_LIBEDIT 1
#cmakedefine SUPPORT_LIBREADLINE 1
#cmakedefine SUPPORT_LIBZ 1
#cmakedefine SUPPORT_JIT 1
#cmakedefine SLJIT_PROT_EXECUTABLE_ALLOCATOR 1
#cmakedefine SUPPORT_PCRE2GREP_JIT 1
#cmakedefine SUPPORT_PCRE2GREP_CALLOUT 1
#cmakedefine SUPPORT_PCRE2GREP_CALLOUT_FORK 1
#cmakedefine SUPPORT_UNICODE 1 #cmakedefine SUPPORT_UNICODE 1
#cmakedefine SUPPORT_VALGRIND 1 #cmakedefine SUPPORT_VALGRIND 1
@@ -30,12 +39,16 @@
#cmakedefine HEAP_MATCH_RECURSE 1 #cmakedefine HEAP_MATCH_RECURSE 1
#cmakedefine NEVER_BACKSLASH_C 1 #cmakedefine NEVER_BACKSLASH_C 1
#define PCRE2_EXPORT @PCRE2_EXPORT@
#define LINK_SIZE @PCRE2_LINK_SIZE@ #define LINK_SIZE @PCRE2_LINK_SIZE@
#define HEAP_LIMIT @PCRE2_HEAP_LIMIT@ #define HEAP_LIMIT @PCRE2_HEAP_LIMIT@
#define MATCH_LIMIT @PCRE2_MATCH_LIMIT@ #define MATCH_LIMIT @PCRE2_MATCH_LIMIT@
#define MATCH_LIMIT_DEPTH @PCRE2_MATCH_LIMIT_DEPTH@ #define MATCH_LIMIT_DEPTH @PCRE2_MATCH_LIMIT_DEPTH@
#define MAX_VARLOOKBEHIND @PCRE2_MAX_VARLOOKBEHIND@
#define NEWLINE_DEFAULT @NEWLINE_DEFAULT@ #define NEWLINE_DEFAULT @NEWLINE_DEFAULT@
#define PARENS_NEST_LIMIT @PCRE2_PARENS_NEST_LIMIT@ #define PARENS_NEST_LIMIT @PCRE2_PARENS_NEST_LIMIT@
#define PCRE2GREP_BUFSIZE @PCRE2GREP_BUFSIZE@
#define PCRE2GREP_MAX_BUFSIZE @PCRE2GREP_MAX_BUFSIZE@
#define MAX_NAME_SIZE 32 #define MAX_NAME_SIZE 32
#define MAX_NAME_COUNT 10000 #define MAX_NAME_COUNT 10000

462
libpcre/configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -9,20 +9,20 @@ dnl The PCRE2_PRERELEASE feature is for identifying release candidates. It might
dnl be defined as -RC2, for example. For real releases, it should be empty. dnl be defined as -RC2, for example. For real releases, it should be empty.
m4_define(pcre2_major, [10]) m4_define(pcre2_major, [10])
m4_define(pcre2_minor, [42]) m4_define(pcre2_minor, [43])
m4_define(pcre2_prerelease, []) m4_define(pcre2_prerelease, [])
m4_define(pcre2_date, [2022-12-11]) m4_define(pcre2_date, [2024-02-16])
# Libtool shared library interface versions (current:revision:age) # Libtool shared library interface versions (current:revision:age)
m4_define(libpcre2_8_version, [11:2:11]) m4_define(libpcre2_8_version, [12:0:12])
m4_define(libpcre2_16_version, [11:2:11]) m4_define(libpcre2_16_version, [12:0:12])
m4_define(libpcre2_32_version, [11:2:11]) m4_define(libpcre2_32_version, [12:0:12])
m4_define(libpcre2_posix_version, [3:4:0]) m4_define(libpcre2_posix_version, [3:5:0])
# NOTE: The CMakeLists.txt file searches for the above variables in the first # NOTE: The CMakeLists.txt file searches for the above variables in the first
# 50 lines of this file. Please update that if the variables above are moved. # 50 lines of this file. Please update that if the variables above are moved.
AC_PREREQ([2.60]) AC_PREREQ([2.62])
AC_INIT([PCRE2],pcre2_major.pcre2_minor[]pcre2_prerelease,[],[pcre2]) AC_INIT([PCRE2],pcre2_major.pcre2_minor[]pcre2_prerelease,[],[pcre2])
AC_CONFIG_SRCDIR([src/pcre2.h.in]) AC_CONFIG_SRCDIR([src/pcre2.h.in])
AM_INIT_AUTOMAKE([foreign]) AM_INIT_AUTOMAKE([foreign])
@@ -42,7 +42,7 @@ AC_CONFIG_MACRO_DIR([m4])
remember_set_CFLAGS="$CFLAGS" remember_set_CFLAGS="$CFLAGS"
AC_PROG_CC m4_version_prereq(2.70, [AC_PROG_CC], [AC_PROG_CC_C99])
AM_PROG_CC_C_O AM_PROG_CC_C_O
AC_USE_SYSTEM_EXTENSIONS AC_USE_SYSTEM_EXTENSIONS
@@ -73,6 +73,28 @@ AC_SYS_LARGEFILE
PCRE2_VISIBILITY PCRE2_VISIBILITY
# Check for the mul_overflow() builtin
AC_MSG_CHECKING([for __builtin_mul_overflow()])
AC_LANG_PUSH([C])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <stddef.h>
int a, b;
size_t m;
]], [[__builtin_mul_overflow(a, b, &m)]])],
[pcre2_cc_cv_builtin_mul_overflow=yes],
[pcre2_cc_cv_builtin_mul_overflow=no])
AC_MSG_RESULT([$pcre2_cc_cv_builtin_mul_overflow])
if test "$pcre2_cc_cv_builtin_mul_overflow" = yes; then
AC_DEFINE([HAVE_BUILTIN_MUL_OVERFLOW], 1,
[Define this if your compiler provides __builtin_mul_overflow()])
fi
AC_LANG_POP([C])
# Check for Clang __attribute__((uninitialized)) feature # Check for Clang __attribute__((uninitialized)) feature
AC_MSG_CHECKING([for __attribute__((uninitialized))]) AC_MSG_CHECKING([for __attribute__((uninitialized))])
@@ -226,6 +248,12 @@ AC_ARG_WITH(link-size,
[internal link size (2, 3, or 4 allowed; default=2)]), [internal link size (2, 3, or 4 allowed; default=2)]),
, with_link_size=2) , with_link_size=2)
# Handle --with-max-varlookbehind=N
AC_ARG_WITH(max-varlookbehind,
AS_HELP_STRING([--with-max-varlookbehind=N],
[maximum length of variable lookbehind (default=255)]),
, with_max_varlookbehind=255)
# Handle --with-parens-nest-limit=N # Handle --with-parens-nest-limit=N
AC_ARG_WITH(parens-nest-limit, AC_ARG_WITH(parens-nest-limit,
AS_HELP_STRING([--with-parens-nest-limit=N], AS_HELP_STRING([--with-parens-nest-limit=N],
@@ -436,6 +464,12 @@ if test "x$enable_shared" = "xno" ; then
fi fi
AC_SUBST(PCRE2_STATIC_CFLAG) AC_SUBST(PCRE2_STATIC_CFLAG)
PCRE2POSIX_CFLAG=""
if test "x$enable_shared" = "xyes" ; then
PCRE2POSIX_CFLAG="-DPCRE2POSIX_SHARED"
fi
AC_SUBST(PCRE2POSIX_CFLAG)
# Here is where PCRE2-specific defines are handled # Here is where PCRE2-specific defines are handled
if test "$enable_pcre2_8" = "yes"; then if test "$enable_pcre2_8" = "yes"; then
@@ -500,6 +534,10 @@ AC_DEFINE_UNQUOTED([LINK_SIZE], [$with_link_size], [
vast majority of cases. However, PCRE2 can also be compiled to use 3 or 4 vast majority of cases. However, PCRE2 can also be compiled to use 3 or 4
bytes instead. This allows for longer patterns in extreme cases.]) bytes instead. This allows for longer patterns in extreme cases.])
AC_DEFINE_UNQUOTED([MAX_VARLOOKBEHIND], [$with_max_varlookbehind], [
The value of MAX_VARLOOKBEHIND specifies the default maximum length, in
characters, for a variable-length lookbehind assertion.])
AC_DEFINE_UNQUOTED([PARENS_NEST_LIMIT], [$with_parens_nest_limit], [ AC_DEFINE_UNQUOTED([PARENS_NEST_LIMIT], [$with_parens_nest_limit], [
The value of PARENS_NEST_LIMIT specifies the maximum depth of nested The value of PARENS_NEST_LIMIT specifies the maximum depth of nested
parentheses (of any kind) in a pattern. This limits the amount of system parentheses (of any kind) in a pattern. This limits the amount of system
@@ -511,7 +549,7 @@ AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with_match_limit], [
matching attempt. The value is also used to limit a loop counter in matching attempt. The value is also used to limit a loop counter in
pcre2_dfa_match(). There is a runtime interface for setting a different pcre2_dfa_match(). There is a runtime interface for setting a different
limit. The limit exists in order to catch runaway regular expressions that limit. The limit exists in order to catch runaway regular expressions that
take for ever to determine that they do not match. The default is set very take forever to determine that they do not match. The default is set very
large so that it does not accidentally catch legitimate cases.]) large so that it does not accidentally catch legitimate cases.])
# --with-match-limit-recursion is an obsolete synonym for --with-match-limit-depth # --with-match-limit-recursion is an obsolete synonym for --with-match-limit-depth
@@ -561,8 +599,9 @@ AH_VERBATIM([PCRE2_EXP_DEFN], [
Win32, and it needs some magic to be inserted before the definition Win32, and it needs some magic to be inserted before the definition
of a function that is exported by the library, define this macro to of a function that is exported by the library, define this macro to
contain the relevant magic. If you do not define this macro, a suitable contain the relevant magic. If you do not define this macro, a suitable
__declspec value is used for Windows systems; in other environments __declspec value is used for Windows systems; in other environments
"extern" is used for a C compiler and "extern C" for a C++ compiler. a compiler relevant "extern" is used with any "visibility" related
attributes from PCRE2_EXPORT included.
This macro apears at the start of every exported function that is part This macro apears at the start of every exported function that is part
of the external API. It does not appear on functions that are "external" of the external API. It does not appear on functions that are "external"
in the C sense, but which are internal to the library. */ in the C sense, but which are internal to the library. */
@@ -757,6 +796,7 @@ $PACKAGE-$VERSION configuration summary:
EBCDIC code for NL ................. : ${ebcdic_nl_code} EBCDIC code for NL ................. : ${ebcdic_nl_code}
Rebuild char tables ................ : ${enable_rebuild_chartables} Rebuild char tables ................ : ${enable_rebuild_chartables}
Internal link size ................. : ${with_link_size} Internal link size ................. : ${with_link_size}
Maximum variable lookbehind ........ : ${with_max_varlookbehind}
Nested parentheses limit ........... : ${with_parens_nest_limit} Nested parentheses limit ........... : ${with_parens_nest_limit}
Heap limit ......................... : ${with_heap_limit} kibibytes Heap limit ......................... : ${with_heap_limit} kibibytes
Match limit ........................ : ${with_match_limit} Match limit ........................ : ${with_match_limit}

File diff suppressed because it is too large Load Diff

255
libpcre/m4/libtool.m4 vendored
View File

@@ -1,7 +1,6 @@
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
# #
# Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software # Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
# Foundation, Inc.
# Written by Gordon Matzigkeit, 1996 # Written by Gordon Matzigkeit, 1996
# #
# This file is free software; the Free Software Foundation gives # This file is free software; the Free Software Foundation gives
@@ -32,7 +31,7 @@ m4_define([_LT_COPYING], [dnl
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
]) ])
# serial 59 LT_INIT # serial 58 LT_INIT
# LT_PREREQ(VERSION) # LT_PREREQ(VERSION)
@@ -182,7 +181,6 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl
m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CMD_RELOAD])dnl
m4_require([_LT_DECL_FILECMD])dnl
m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl
m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl
@@ -221,8 +219,8 @@ esac
ofile=libtool ofile=libtool
can_build_shared=yes can_build_shared=yes
# All known linkers require a '.a' archive for static linking (except MSVC and # All known linkers require a '.a' archive for static linking (except MSVC,
# ICC, which need '.lib'). # which needs '.lib').
libext=a libext=a
with_gnu_ld=$lt_cv_prog_gnu_ld with_gnu_ld=$lt_cv_prog_gnu_ld
@@ -730,6 +728,7 @@ _LT_CONFIG_SAVE_COMMANDS([
cat <<_LT_EOF >> "$cfgfile" cat <<_LT_EOF >> "$cfgfile"
#! $SHELL #! $SHELL
# Generated automatically by $as_me ($PACKAGE) $VERSION # Generated automatically by $as_me ($PACKAGE) $VERSION
# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
# NOTE: Changes made to this file will be lost: look at ltmain.sh. # NOTE: Changes made to this file will be lost: look at ltmain.sh.
# Provide generalized library-building support services. # Provide generalized library-building support services.
@@ -779,7 +778,7 @@ _LT_EOF
# if finds mixed CR/LF and LF-only lines. Since sed operates in # if finds mixed CR/LF and LF-only lines. Since sed operates in
# text mode, it properly converts lines to CR/LF. This bash problem # text mode, it properly converts lines to CR/LF. This bash problem
# is reportedly fixed, but why not run on old versions too? # is reportedly fixed, but why not run on old versions too?
$SED '$q' "$ltmain" >> "$cfgfile" \ sed '$q' "$ltmain" >> "$cfgfile" \
|| (rm -f "$cfgfile"; exit 1) || (rm -f "$cfgfile"; exit 1)
mv -f "$cfgfile" "$ofile" || mv -f "$cfgfile" "$ofile" ||
@@ -1043,8 +1042,8 @@ int forced_loaded() { return 2;}
_LT_EOF _LT_EOF
echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
$LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
$AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
$RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
cat > conftest.c << _LT_EOF cat > conftest.c << _LT_EOF
@@ -1068,12 +1067,17 @@ _LT_EOF
_lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
darwin1.*) darwin1.*)
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
darwin*) darwin*) # darwin 5.x on
case $MACOSX_DEPLOYMENT_TARGET,$host in # if running on 10.5 or later, the deployment target defaults
10.[[012]],*|,*powerpc*-darwin[[5-8]]*) # to the OS version, if on x86, and 10.4, the deployment
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; # target defaults to 10.4. Don't you love it?
*) case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
10.[[012]][[,.]]*)
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
10.*)
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
esac esac
;; ;;
esac esac
@@ -1122,12 +1126,12 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
output_verbose_link_cmd=func_echo_all output_verbose_link_cmd=func_echo_all
_LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
_LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
_LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
_LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
m4_if([$1], [CXX], m4_if([$1], [CXX],
[ if test yes != "$lt_cv_apple_cc_single_mod"; then [ if test yes != "$lt_cv_apple_cc_single_mod"; then
_LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
_LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
fi fi
],[]) ],[])
else else
@@ -1241,8 +1245,7 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
# _LT_WITH_SYSROOT # _LT_WITH_SYSROOT
# ---------------- # ----------------
AC_DEFUN([_LT_WITH_SYSROOT], AC_DEFUN([_LT_WITH_SYSROOT],
[m4_require([_LT_DECL_SED])dnl [AC_MSG_CHECKING([for sysroot])
AC_MSG_CHECKING([for sysroot])
AC_ARG_WITH([sysroot], AC_ARG_WITH([sysroot],
[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
[Search for dependent libraries within DIR (or the compiler's sysroot [Search for dependent libraries within DIR (or the compiler's sysroot
@@ -1259,7 +1262,7 @@ case $with_sysroot in #(
fi fi
;; #( ;; #(
/*) /*)
lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
;; #( ;; #(
no|'') no|'')
;; #( ;; #(
@@ -1289,7 +1292,7 @@ ia64-*-hpux*)
# options accordingly. # options accordingly.
echo 'int i;' > conftest.$ac_ext echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then if AC_TRY_EVAL(ac_compile); then
case `$FILECMD conftest.$ac_objext` in case `/usr/bin/file conftest.$ac_objext` in
*ELF-32*) *ELF-32*)
HPUX_IA64_MODE=32 HPUX_IA64_MODE=32
;; ;;
@@ -1306,7 +1309,7 @@ ia64-*-hpux*)
echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then if AC_TRY_EVAL(ac_compile); then
if test yes = "$lt_cv_prog_gnu_ld"; then if test yes = "$lt_cv_prog_gnu_ld"; then
case `$FILECMD conftest.$ac_objext` in case `/usr/bin/file conftest.$ac_objext` in
*32-bit*) *32-bit*)
LD="${LD-ld} -melf32bsmip" LD="${LD-ld} -melf32bsmip"
;; ;;
@@ -1318,7 +1321,7 @@ ia64-*-hpux*)
;; ;;
esac esac
else else
case `$FILECMD conftest.$ac_objext` in case `/usr/bin/file conftest.$ac_objext` in
*32-bit*) *32-bit*)
LD="${LD-ld} -32" LD="${LD-ld} -32"
;; ;;
@@ -1340,7 +1343,7 @@ mips64*-*linux*)
echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then if AC_TRY_EVAL(ac_compile); then
emul=elf emul=elf
case `$FILECMD conftest.$ac_objext` in case `/usr/bin/file conftest.$ac_objext` in
*32-bit*) *32-bit*)
emul="${emul}32" emul="${emul}32"
;; ;;
@@ -1348,7 +1351,7 @@ mips64*-*linux*)
emul="${emul}64" emul="${emul}64"
;; ;;
esac esac
case `$FILECMD conftest.$ac_objext` in case `/usr/bin/file conftest.$ac_objext` in
*MSB*) *MSB*)
emul="${emul}btsmip" emul="${emul}btsmip"
;; ;;
@@ -1356,7 +1359,7 @@ mips64*-*linux*)
emul="${emul}ltsmip" emul="${emul}ltsmip"
;; ;;
esac esac
case `$FILECMD conftest.$ac_objext` in case `/usr/bin/file conftest.$ac_objext` in
*N32*) *N32*)
emul="${emul}n32" emul="${emul}n32"
;; ;;
@@ -1376,14 +1379,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# not appear in the list. # not appear in the list.
echo 'int i;' > conftest.$ac_ext echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then if AC_TRY_EVAL(ac_compile); then
case `$FILECMD conftest.o` in case `/usr/bin/file conftest.o` in
*32-bit*) *32-bit*)
case $host in case $host in
x86_64-*kfreebsd*-gnu) x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_i386_fbsd" LD="${LD-ld} -m elf_i386_fbsd"
;; ;;
x86_64-*linux*) x86_64-*linux*)
case `$FILECMD conftest.o` in case `/usr/bin/file conftest.o` in
*x86-64*) *x86-64*)
LD="${LD-ld} -m elf32_x86_64" LD="${LD-ld} -m elf32_x86_64"
;; ;;
@@ -1451,7 +1454,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# options accordingly. # options accordingly.
echo 'int i;' > conftest.$ac_ext echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then if AC_TRY_EVAL(ac_compile); then
case `$FILECMD conftest.o` in case `/usr/bin/file conftest.o` in
*64-bit*) *64-bit*)
case $lt_cv_prog_gnu_ld in case $lt_cv_prog_gnu_ld in
yes*) yes*)
@@ -1490,22 +1493,9 @@ need_locks=$enable_libtool_lock
m4_defun([_LT_PROG_AR], m4_defun([_LT_PROG_AR],
[AC_CHECK_TOOLS(AR, [ar], false) [AC_CHECK_TOOLS(AR, [ar], false)
: ${AR=ar} : ${AR=ar}
: ${AR_FLAGS=cru}
_LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR], [1], [The archiver])
_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
# Use ARFLAGS variable as AR's operation code to sync the variable naming with
# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
# higher priority because thats what people were doing historically (setting
# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS
# variable obsoleted/removed.
test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
lt_ar_flags=$AR_FLAGS
_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)])
# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override
# by AR_FLAGS because that was never working and AR_FLAGS is about to die.
_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}],
[Flags to create an archive])
AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
[lt_cv_ar_at_file=no [lt_cv_ar_at_file=no
@@ -1724,7 +1714,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
lt_cv_sys_max_cmd_len=8192; lt_cv_sys_max_cmd_len=8192;
;; ;;
bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
# This has been around since 386BSD, at least. Likely further. # This has been around since 386BSD, at least. Likely further.
if test -x /sbin/sysctl; then if test -x /sbin/sysctl; then
lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@@ -1767,7 +1757,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
sysv5* | sco5v6* | sysv4.2uw2*) sysv5* | sco5v6* | sysv4.2uw2*)
kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
if test -n "$kargmax"; then if test -n "$kargmax"; then
lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[ ]]//'` lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
else else
lt_cv_sys_max_cmd_len=32768 lt_cv_sys_max_cmd_len=32768
fi fi
@@ -2217,35 +2207,26 @@ m4_defun([_LT_CMD_STRIPLIB],
striplib= striplib=
old_striplib= old_striplib=
AC_MSG_CHECKING([whether stripping libraries is possible]) AC_MSG_CHECKING([whether stripping libraries is possible])
if test -z "$STRIP"; then if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
AC_MSG_RESULT([no]) test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
test -z "$striplib" && striplib="$STRIP --strip-unneeded"
AC_MSG_RESULT([yes])
else else
if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then # FIXME - insert some real tests, host_os isn't really good enough
old_striplib="$STRIP --strip-debug" case $host_os in
striplib="$STRIP --strip-unneeded" darwin*)
AC_MSG_RESULT([yes]) if test -n "$STRIP"; then
else
case $host_os in
darwin*)
# FIXME - insert some real tests, host_os isn't really good enough
striplib="$STRIP -x" striplib="$STRIP -x"
old_striplib="$STRIP -S" old_striplib="$STRIP -S"
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
;; else
freebsd*)
if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
old_striplib="$STRIP --strip-debug"
striplib="$STRIP --strip-unneeded"
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
;;
*)
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
;; fi
esac ;;
fi *)
AC_MSG_RESULT([no])
;;
esac
fi fi
_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
_LT_DECL([], [striplib], [1]) _LT_DECL([], [striplib], [1])
@@ -2568,7 +2549,7 @@ cygwin* | mingw* | pw32* | cegcc*)
case $host_os in case $host_os in
cygwin*) cygwin*)
# Cygwin DLLs use 'cyg' prefix rather than 'lib' # Cygwin DLLs use 'cyg' prefix rather than 'lib'
soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
m4_if([$1], [],[ m4_if([$1], [],[
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
;; ;;
@@ -2578,14 +2559,14 @@ m4_if([$1], [],[
;; ;;
pw32*) pw32*)
# pw32 DLLs use 'pw' prefix rather than 'lib' # pw32 DLLs use 'pw' prefix rather than 'lib'
library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
;; ;;
esac esac
dynamic_linker='Win32 ld.exe' dynamic_linker='Win32 ld.exe'
;; ;;
*,cl* | *,icl*) *,cl*)
# Native MSVC or ICC # Native MSVC
libname_spec='$name' libname_spec='$name'
soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
library_names_spec='$libname.dll.lib' library_names_spec='$libname.dll.lib'
@@ -2604,7 +2585,7 @@ m4_if([$1], [],[
done done
IFS=$lt_save_ifs IFS=$lt_save_ifs
# Convert to MSYS style. # Convert to MSYS style.
sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
;; ;;
cygwin*) cygwin*)
# Convert to unix form, then to dos form, then back to unix form # Convert to unix form, then to dos form, then back to unix form
@@ -2641,7 +2622,7 @@ m4_if([$1], [],[
;; ;;
*) *)
# Assume MSVC and ICC wrapper # Assume MSVC wrapper
library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
dynamic_linker='Win32 ld.exe' dynamic_linker='Win32 ld.exe'
;; ;;
@@ -2674,7 +2655,7 @@ dgux*)
shlibpath_var=LD_LIBRARY_PATH shlibpath_var=LD_LIBRARY_PATH
;; ;;
freebsd* | dragonfly* | midnightbsd*) freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new # DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this. # versioning mechanism, adjust this.
if test -x /usr/bin/objformat; then if test -x /usr/bin/objformat; then
@@ -2906,6 +2887,18 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
dynamic_linker='GNU/Linux ld.so' dynamic_linker='GNU/Linux ld.so'
;; ;;
netbsdelf*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
dynamic_linker='NetBSD ld.elf_so'
;;
netbsd*) netbsd*)
version_type=sunos version_type=sunos
need_lib_prefix=no need_lib_prefix=no
@@ -3473,7 +3466,7 @@ beos*)
bsdi[[45]]*) bsdi[[45]]*)
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_cmd='/usr/bin/file -L'
lt_cv_file_magic_test_file=/shlib/libc.so lt_cv_file_magic_test_file=/shlib/libc.so
;; ;;
@@ -3507,14 +3500,14 @@ darwin* | rhapsody*)
lt_cv_deplibs_check_method=pass_all lt_cv_deplibs_check_method=pass_all
;; ;;
freebsd* | dragonfly* | midnightbsd*) freebsd* | dragonfly*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
case $host_cpu in case $host_cpu in
i*86 ) i*86 )
# Not sure whether the presence of OpenBSD here was a mistake. # Not sure whether the presence of OpenBSD here was a mistake.
# Let's accept both of them until this is cleared up. # Let's accept both of them until this is cleared up.
lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
;; ;;
esac esac
@@ -3528,7 +3521,7 @@ haiku*)
;; ;;
hpux10.20* | hpux11*) hpux10.20* | hpux11*)
lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_cmd=/usr/bin/file
case $host_cpu in case $host_cpu in
ia64*) ia64*)
lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
@@ -3565,7 +3558,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
lt_cv_deplibs_check_method=pass_all lt_cv_deplibs_check_method=pass_all
;; ;;
netbsd*) netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
else else
@@ -3575,7 +3568,7 @@ netbsd*)
newos6*) newos6*)
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=/usr/lib/libnls.so lt_cv_file_magic_test_file=/usr/lib/libnls.so
;; ;;
@@ -3702,13 +3695,13 @@ else
mingw*) lt_bad_file=conftest.nm/nofile ;; mingw*) lt_bad_file=conftest.nm/nofile ;;
*) lt_bad_file=/dev/null ;; *) lt_bad_file=/dev/null ;;
esac esac
case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
*$lt_bad_file* | *'Invalid file or object type'*) *$lt_bad_file* | *'Invalid file or object type'*)
lt_cv_path_NM="$tmp_nm -B" lt_cv_path_NM="$tmp_nm -B"
break 2 break 2
;; ;;
*) *)
case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
*/dev/null*) */dev/null*)
lt_cv_path_NM="$tmp_nm -p" lt_cv_path_NM="$tmp_nm -p"
break 2 break 2
@@ -3734,7 +3727,7 @@ else
# Let the user override the test. # Let the user override the test.
else else
AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
*COFF*) *COFF*)
DUMPBIN="$DUMPBIN -symbols -headers" DUMPBIN="$DUMPBIN -symbols -headers"
;; ;;
@@ -3974,7 +3967,7 @@ esac
if test "$lt_cv_nm_interface" = "MS dumpbin"; then if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Gets list of data symbols to import. # Gets list of data symbols to import.
lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
# Adjust the below global symbol transforms to fixup imported variables. # Adjust the below global symbol transforms to fixup imported variables.
lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
@@ -3992,20 +3985,20 @@ fi
# Transform an extracted symbol line into a proper C declaration. # Transform an extracted symbol line into a proper C declaration.
# Some systems (esp. on ia64) link data and code symbols differently, # Some systems (esp. on ia64) link data and code symbols differently,
# so use this general approach. # so use this general approach.
lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ lt_cv_sys_global_symbol_to_cdecl="sed -n"\
$lt_cdecl_hook\ $lt_cdecl_hook\
" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\
" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
# Transform an extracted symbol line into symbol name and symbol address # Transform an extracted symbol line into symbol name and symbol address
lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
$lt_c_name_hook\ $lt_c_name_hook\
" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
# Transform an extracted symbol line into symbol name with lib prefix and # Transform an extracted symbol line into symbol name with lib prefix and
# symbol address. # symbol address.
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
$lt_c_name_lib_hook\ $lt_c_name_lib_hook\
" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
@@ -4029,7 +4022,7 @@ for ac_symprfx in "" "_"; do
if test "$lt_cv_nm_interface" = "MS dumpbin"; then if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Fake it for dumpbin and say T for any non-static function, # Fake it for dumpbin and say T for any non-static function,
# D for any global variable and I for any imported variable. # D for any global variable and I for any imported variable.
# Also find C++ and __fastcall symbols from MSVC++ or ICC, # Also find C++ and __fastcall symbols from MSVC++,
# which start with @ or ?. # which start with @ or ?.
lt_cv_sys_global_symbol_pipe="$AWK ['"\ lt_cv_sys_global_symbol_pipe="$AWK ['"\
" {last_section=section; section=\$ 3};"\ " {last_section=section; section=\$ 3};"\
@@ -4047,9 +4040,9 @@ for ac_symprfx in "" "_"; do
" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
" ' prfx=^$ac_symprfx]" " ' prfx=^$ac_symprfx]"
else else
lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
fi fi
lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
# Check to see that the pipe works correctly. # Check to see that the pipe works correctly.
pipe_works=no pipe_works=no
@@ -4336,7 +4329,7 @@ m4_if([$1], [CXX], [
;; ;;
esac esac
;; ;;
freebsd* | dragonfly* | midnightbsd*) freebsd* | dragonfly*)
# FreeBSD uses GNU C++ # FreeBSD uses GNU C++
;; ;;
hpux9* | hpux10* | hpux11*) hpux9* | hpux10* | hpux11*)
@@ -4419,7 +4412,7 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
;; ;;
*) *)
case `$CC -V 2>&1 | $SED 5q` in case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*) *Sun\ C*)
# Sun C++ 5.9 # Sun C++ 5.9
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
@@ -4443,7 +4436,7 @@ m4_if([$1], [CXX], [
;; ;;
esac esac
;; ;;
netbsd*) netbsd* | netbsdelf*-gnu)
;; ;;
*qnx* | *nto*) *qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise # QNX uses GNU C++, but need to define -shared option too, otherwise
@@ -4755,7 +4748,7 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
;; ;;
*) *)
case `$CC -V 2>&1 | $SED 5q` in case `$CC -V 2>&1 | sed 5q` in
*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
# Sun Fortran 8.3 passes all unrecognized flags to the linker # Sun Fortran 8.3 passes all unrecognized flags to the linker
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
@@ -4938,7 +4931,7 @@ m4_if([$1], [CXX], [
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else else
_LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi fi
;; ;;
pw32*) pw32*)
@@ -4946,7 +4939,7 @@ m4_if([$1], [CXX], [
;; ;;
cygwin* | mingw* | cegcc*) cygwin* | mingw* | cegcc*)
case $cc_basename in case $cc_basename in
cl* | icl*) cl*)
_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
;; ;;
*) *)
@@ -4955,6 +4948,9 @@ m4_if([$1], [CXX], [
;; ;;
esac esac
;; ;;
linux* | k*bsd*-gnu | gnu*)
_LT_TAGVAR(link_all_deplibs, $1)=no
;;
*) *)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;; ;;
@@ -5003,20 +4999,23 @@ dnl Note also adjust exclude_expsyms for C++ above.
case $host_os in case $host_os in
cygwin* | mingw* | pw32* | cegcc*) cygwin* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using # When not using gcc, we currently assume that we are using
# Microsoft Visual C++ or Intel C++ Compiler. # Microsoft Visual C++.
if test yes != "$GCC"; then if test yes != "$GCC"; then
with_gnu_ld=no with_gnu_ld=no
fi fi
;; ;;
interix*) interix*)
# we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) # we just hope/assume this is gcc and not c89 (= MSVC++)
with_gnu_ld=yes with_gnu_ld=yes
;; ;;
openbsd* | bitrig*) openbsd* | bitrig*)
with_gnu_ld=no with_gnu_ld=no
;; ;;
linux* | k*bsd*-gnu | gnu*)
_LT_TAGVAR(link_all_deplibs, $1)=no
;;
esac esac
_LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(ld_shlibs, $1)=yes
@@ -5063,7 +5062,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
_LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)=
fi fi
supports_anon_versioning=no supports_anon_versioning=no
case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
*GNU\ gold*) supports_anon_versioning=yes ;; *GNU\ gold*) supports_anon_versioning=yes ;;
*\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
@@ -5175,7 +5174,6 @@ _LT_EOF
emximp -o $lib $output_objdir/$libname.def' emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='@'
;; ;;
interix[[3-9]]*) interix[[3-9]]*)
@@ -5190,7 +5188,7 @@ _LT_EOF
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
# time. Moving up from 0x10000000 also allows more sbrk(2) space. # time. Moving up from 0x10000000 also allows more sbrk(2) space.
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;; ;;
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
@@ -5233,7 +5231,7 @@ _LT_EOF
_LT_TAGVAR(compiler_needs_object, $1)=yes _LT_TAGVAR(compiler_needs_object, $1)=yes
;; ;;
esac esac
case `$CC -V 2>&1 | $SED 5q` in case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*) # Sun C 5.9 *Sun\ C*) # Sun C 5.9
_LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
_LT_TAGVAR(compiler_needs_object, $1)=yes _LT_TAGVAR(compiler_needs_object, $1)=yes
@@ -5245,7 +5243,7 @@ _LT_EOF
if test yes = "$supports_anon_versioning"; then if test yes = "$supports_anon_versioning"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~
$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
fi fi
@@ -5261,7 +5259,7 @@ _LT_EOF
_LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
if test yes = "$supports_anon_versioning"; then if test yes = "$supports_anon_versioning"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~
$LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
fi fi
@@ -5272,7 +5270,7 @@ _LT_EOF
fi fi
;; ;;
netbsd*) netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc= wlarc=
@@ -5393,7 +5391,7 @@ _LT_EOF
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else else
_LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi fi
aix_use_runtimelinking=no aix_use_runtimelinking=no
@@ -5576,12 +5574,12 @@ _LT_EOF
cygwin* | mingw* | pw32* | cegcc*) cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using # When not using gcc, we currently assume that we are using
# Microsoft Visual C++ or Intel C++ Compiler. # Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is # hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs. # no search path for DLLs.
case $cc_basename in case $cc_basename in
cl* | icl*) cl*)
# Native MSVC or ICC # Native MSVC
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(always_export_symbols, $1)=yes
@@ -5622,7 +5620,7 @@ _LT_EOF
fi' fi'
;; ;;
*) *)
# Assume MSVC and ICC wrapper # Assume MSVC wrapper
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
# Tell ltmain to make .lib files, not .a files. # Tell ltmain to make .lib files, not .a files.
@@ -5670,7 +5668,7 @@ _LT_EOF
;; ;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries. # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
freebsd* | dragonfly* | midnightbsd*) freebsd* | dragonfly*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct, $1)=yes
@@ -5793,6 +5791,7 @@ _LT_EOF
if test yes = "$lt_cv_irix_exported_symbol"; then if test yes = "$lt_cv_irix_exported_symbol"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
fi fi
_LT_TAGVAR(link_all_deplibs, $1)=no
else else
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
@@ -5814,7 +5813,7 @@ _LT_EOF
esac esac
;; ;;
netbsd*) netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else else
@@ -5881,7 +5880,6 @@ _LT_EOF
emximp -o $lib $output_objdir/$libname.def' emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='@'
;; ;;
osf3*) osf3*)
@@ -6652,8 +6650,8 @@ if test yes != "$_lt_caught_CXX_error"; then
cygwin* | mingw* | pw32* | cegcc*) cygwin* | mingw* | pw32* | cegcc*)
case $GXX,$cc_basename in case $GXX,$cc_basename in
,cl* | no,cl* | ,icl* | no,icl*) ,cl* | no,cl*)
# Native MSVC or ICC # Native MSVC
# hardcode_libdir_flag_spec is actually meaningless, as there is # hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs. # no search path for DLLs.
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
@@ -6751,7 +6749,6 @@ if test yes != "$_lt_caught_CXX_error"; then
emximp -o $lib $output_objdir/$libname.def' emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='@'
;; ;;
dgux*) dgux*)
@@ -6782,7 +6779,7 @@ if test yes != "$_lt_caught_CXX_error"; then
_LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(archive_cmds_need_lc, $1)=no
;; ;;
freebsd* | dragonfly* | midnightbsd*) freebsd* | dragonfly*)
# FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
# conventions # conventions
_LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(ld_shlibs, $1)=yes
@@ -6919,7 +6916,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
# time. Moving up from 0x10000000 also allows more sbrk(2) space. # time. Moving up from 0x10000000 also allows more sbrk(2) space.
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;; ;;
irix5* | irix6*) irix5* | irix6*)
case $cc_basename in case $cc_basename in
@@ -7059,13 +7056,13 @@ if test yes != "$_lt_caught_CXX_error"; then
_LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
if test yes = "$supports_anon_versioning"; then if test yes = "$supports_anon_versioning"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~
$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
fi fi
;; ;;
*) *)
case `$CC -V 2>&1 | $SED 5q` in case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*) *Sun\ C*)
# Sun C++ 5.9 # Sun C++ 5.9
_LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
@@ -8211,14 +8208,6 @@ _LT_DECL([], [DLLTOOL], [1], [DLL creation program])
AC_SUBST([DLLTOOL]) AC_SUBST([DLLTOOL])
]) ])
# _LT_DECL_FILECMD
# ----------------
# Check for a file(cmd) program that can be used to detect file type and magic
m4_defun([_LT_DECL_FILECMD],
[AC_CHECK_TOOL([FILECMD], [file], [:])
_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types])
])# _LD_DECL_FILECMD
# _LT_DECL_SED # _LT_DECL_SED
# ------------ # ------------
# Check for a fully-functional sed program, that truncates # Check for a fully-functional sed program, that truncates

View File

@@ -1,7 +1,7 @@
# Helper functions for option handling. -*- Autoconf -*- # Helper functions for option handling. -*- Autoconf -*-
# #
# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free # Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
# Software Foundation, Inc. # Foundation, Inc.
# Written by Gary V. Vaughan, 2004 # Written by Gary V. Vaughan, 2004
# #
# This file is free software; the Free Software Foundation gives # This file is free software; the Free Software Foundation gives

View File

@@ -1,6 +1,6 @@
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
# #
# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
# Foundation, Inc. # Foundation, Inc.
# Written by Gary V. Vaughan, 2004 # Written by Gary V. Vaughan, 2004
# #

View File

@@ -1,7 +1,6 @@
# ltversion.m4 -- version numbers -*- Autoconf -*- # ltversion.m4 -- version numbers -*- Autoconf -*-
# #
# Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
# Inc.
# Written by Scott James Remnant, 2004 # Written by Scott James Remnant, 2004
# #
# This file is free software; the Free Software Foundation gives # This file is free software; the Free Software Foundation gives
@@ -10,15 +9,15 @@
# @configure_input@ # @configure_input@
# serial 4245 ltversion.m4 # serial 4179 ltversion.m4
# This file is part of GNU Libtool # This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.4.7-dirty]) m4_define([LT_PACKAGE_VERSION], [2.4.6])
m4_define([LT_PACKAGE_REVISION], [2.4.7]) m4_define([LT_PACKAGE_REVISION], [2.4.6])
AC_DEFUN([LTVERSION_VERSION], AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.4.7-dirty' [macro_version='2.4.6'
macro_revision='2.4.7' macro_revision='2.4.6'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0) _LT_DECL(, macro_revision, 0)
]) ])

View File

@@ -1,7 +1,7 @@
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
# #
# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
# Software Foundation, Inc. # Foundation, Inc.
# Written by Scott James Remnant, 2004. # Written by Scott James Remnant, 2004.
# #
# This file is free software; the Free Software Foundation gives # This file is free software; the Free Software Foundation gives

View File

@@ -73,10 +73,9 @@ AC_DEFUN([PCRE2_VISIBILITY],
VISIBILITY_CFLAGS="-fvisibility=hidden" VISIBILITY_CFLAGS="-fvisibility=hidden"
VISIBILITY_CXXFLAGS="-fvisibility=hidden -fvisibility-inlines-hidden" VISIBILITY_CXXFLAGS="-fvisibility=hidden -fvisibility-inlines-hidden"
HAVE_VISIBILITY=1 HAVE_VISIBILITY=1
AC_DEFINE(PCRE2_EXP_DECL, [extern __attribute__ ((visibility ("default")))], [to make a symbol visible]) AC_DEFINE(PCRE2_EXPORT, [__attribute__ ((visibility ("default")))], [to make a symbol visible])
AC_DEFINE(PCRE2_EXP_DEFN, [__attribute__ ((visibility ("default")))], [to make a symbol visible]) else
AC_DEFINE(PCRE2POSIX_EXP_DECL, [extern __attribute__ ((visibility ("default")))], [to make a symbol visible]) AC_DEFINE(PCRE2_EXPORT, [], [to make a symbol visible])
AC_DEFINE(PCRE2POSIX_EXP_DEFN, [extern __attribute__ ((visibility ("default")))], [to make a symbol visible])
fi fi
fi fi
AC_SUBST([VISIBILITY_CFLAGS]) AC_SUBST([VISIBILITY_CFLAGS])

View File

@@ -79,7 +79,7 @@ while test $# -gt 0; do
if test @includedir@ != /usr/include ; then if test @includedir@ != /usr/include ; then
includes=-I@includedir@ includes=-I@includedir@
fi fi
echo $includes @PCRE2_STATIC_CFLAG@ echo $includes @PCRE2POSIX_CFLAG@
else else
echo "${usage}" 1>&2 echo "${usage}" 1>&2
fi fi

View File

@@ -55,31 +55,43 @@ sure both macros are undefined; an emulation function will then be used. */
/* Define this if your compiler supports __attribute__((uninitialized)) */ /* Define this if your compiler supports __attribute__((uninitialized)) */
/* #undef HAVE_ATTRIBUTE_UNINITIALIZED */ /* #undef HAVE_ATTRIBUTE_UNINITIALIZED */
/* Define to 1 if you have the `bcopy' function. */ /* Define to 1 if you have the 'bcopy' function. */
/* #undef HAVE_BCOPY */ /* #undef HAVE_BCOPY */
/* Define this if your compiler provides __builtin_mul_overflow() */
/* #undef HAVE_BUILTIN_MUL_OVERFLOW */
/* Define to 1 if you have the <bzlib.h> header file. */
/* #undef HAVE_BZLIB_H */
/* Define to 1 if you have the <dirent.h> header file. */ /* Define to 1 if you have the <dirent.h> header file. */
/* #undef HAVE_DIRENT_H */ /* #undef HAVE_DIRENT_H */
/* Define to 1 if you have the <dlfcn.h> header file. */ /* Define to 1 if you have the <dlfcn.h> header file. */
/* #undef HAVE_DLFCN_H */ /* #undef HAVE_DLFCN_H */
/* Define to 1 if you have the <editline/readline.h> header file. */
/* #undef HAVE_EDITLINE_READLINE_H */
/* Define to 1 if you have the <edit/readline/readline.h> header file. */
/* #undef HAVE_EDIT_READLINE_READLINE_H */
/* Define to 1 if you have the <inttypes.h> header file. */ /* Define to 1 if you have the <inttypes.h> header file. */
/* #undef HAVE_INTTYPES_H */ /* #undef HAVE_INTTYPES_H */
/* Define to 1 if you have the <limits.h> header file. */ /* Define to 1 if you have the <limits.h> header file. */
/* #undef HAVE_LIMITS_H */ /* #undef HAVE_LIMITS_H */
/* Define to 1 if you have the `memfd_create' function. */ /* Define to 1 if you have the 'memfd_create' function. */
/* #undef HAVE_MEMFD_CREATE */ /* #undef HAVE_MEMFD_CREATE */
/* Define to 1 if you have the `memmove' function. */ /* Define to 1 if you have the 'memmove' function. */
/* #undef HAVE_MEMMOVE */ /* #undef HAVE_MEMMOVE */
/* Define to 1 if you have the <minix/config.h> header file. */ /* Define to 1 if you have the <minix/config.h> header file. */
/* #undef HAVE_MINIX_CONFIG_H */ /* #undef HAVE_MINIX_CONFIG_H */
/* Define to 1 if you have the `mkostemp' function. */ /* Define to 1 if you have the 'mkostemp' function. */
/* #undef HAVE_MKOSTEMP */ /* #undef HAVE_MKOSTEMP */
/* Define if you have POSIX threads libraries and header files. */ /* Define if you have POSIX threads libraries and header files. */
@@ -100,7 +112,7 @@ sure both macros are undefined; an emulation function will then be used. */
/* Define to 1 if you have the `realpath' function. */ /* Define to 1 if you have the `realpath' function. */
/* #undef HAVE_REALPATH */ /* #undef HAVE_REALPATH */
/* Define to 1 if you have the `secure_getenv' function. */ /* Define to 1 if you have the 'secure_getenv' function. */
/* #undef HAVE_SECURE_GETENV */ /* #undef HAVE_SECURE_GETENV */
/* Define to 1 if you have the <stdint.h> header file. */ /* Define to 1 if you have the <stdint.h> header file. */
@@ -112,7 +124,7 @@ sure both macros are undefined; an emulation function will then be used. */
/* Define to 1 if you have the <stdlib.h> header file. */ /* Define to 1 if you have the <stdlib.h> header file. */
/* #undef HAVE_STDLIB_H */ /* #undef HAVE_STDLIB_H */
/* Define to 1 if you have the `strerror' function. */ /* Define to 1 if you have the 'strerror' function. */
/* #undef HAVE_STRERROR */ /* #undef HAVE_STRERROR */
/* Define to 1 if you have the <strings.h> header file. */ /* Define to 1 if you have the <strings.h> header file. */
@@ -142,6 +154,9 @@ sure both macros are undefined; an emulation function will then be used. */
/* Define to 1 if you have the <windows.h> header file. */ /* Define to 1 if you have the <windows.h> header file. */
/* #undef HAVE_WINDOWS_H */ /* #undef HAVE_WINDOWS_H */
/* Define to 1 if you have the <zlib.h> header file. */
/* #undef HAVE_ZLIB_H */
/* This limits the amount of memory that may be used while matching a pattern. /* This limits the amount of memory that may be used while matching a pattern.
It applies to both pcre2_match() and pcre2_dfa_match(). It does not apply It applies to both pcre2_match() and pcre2_dfa_match(). It does not apply
to JIT matching. The value is in kibibytes (units of 1024 bytes). */ to JIT matching. The value is in kibibytes (units of 1024 bytes). */
@@ -169,7 +184,7 @@ sure both macros are undefined; an emulation function will then be used. */
matching attempt. The value is also used to limit a loop counter in matching attempt. The value is also used to limit a loop counter in
pcre2_dfa_match(). There is a runtime interface for setting a different pcre2_dfa_match(). There is a runtime interface for setting a different
limit. The limit exists in order to catch runaway regular expressions that limit. The limit exists in order to catch runaway regular expressions that
take for ever to determine that they do not match. The default is set very take forever to determine that they do not match. The default is set very
large so that it does not accidentally catch legitimate cases. */ large so that it does not accidentally catch legitimate cases. */
#ifndef MATCH_LIMIT #ifndef MATCH_LIMIT
#define MATCH_LIMIT 10000000 #define MATCH_LIMIT 10000000
@@ -203,6 +218,12 @@ sure both macros are undefined; an emulation function will then be used. */
#define MAX_NAME_SIZE 32 #define MAX_NAME_SIZE 32
#endif #endif
/* The value of MAX_VARLOOKBEHIND specifies the default maximum length, in
characters, for a variable-length lookbehind assertion. */
#ifndef MAX_VARLOOKBEHIND
#define MAX_VARLOOKBEHIND 255
#endif
/* Defining NEVER_BACKSLASH_C locks out the use of \C in all patterns. */ /* Defining NEVER_BACKSLASH_C locks out the use of \C in all patterns. */
/* #undef NEVER_BACKSLASH_C */ /* #undef NEVER_BACKSLASH_C */
@@ -224,7 +245,7 @@ sure both macros are undefined; an emulation function will then be used. */
#define PACKAGE_NAME "PCRE2" #define PACKAGE_NAME "PCRE2"
/* Define to the full name and version of this package. */ /* Define to the full name and version of this package. */
#define PACKAGE_STRING "PCRE2 10.42" #define PACKAGE_STRING "PCRE2 10.43"
/* Define to the one symbol short name of this package. */ /* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "pcre2" #define PACKAGE_TARNAME "pcre2"
@@ -233,7 +254,7 @@ sure both macros are undefined; an emulation function will then be used. */
#define PACKAGE_URL "" #define PACKAGE_URL ""
/* Define to the version of this package. */ /* Define to the version of this package. */
#define PACKAGE_VERSION "10.42" #define PACKAGE_VERSION "10.43"
/* The value of PARENS_NEST_LIMIT specifies the maximum depth of nested /* The value of PARENS_NEST_LIMIT specifies the maximum depth of nested
parentheses (of any kind) in a pattern. This limits the amount of system parentheses (of any kind) in a pattern. This limits the amount of system
@@ -242,15 +263,37 @@ sure both macros are undefined; an emulation function will then be used. */
#define PARENS_NEST_LIMIT 250 #define PARENS_NEST_LIMIT 250
#endif #endif
/* The value of PCRE2GREP_BUFSIZE is the starting size of the buffer used by
pcre2grep to hold parts of the file it is searching. The buffer will be
expanded up to PCRE2GREP_MAX_BUFSIZE if necessary, for files containing
very long lines. The actual amount of memory used by pcre2grep is three
times this number, because it allows for the buffering of "before" and
"after" lines. */
#ifndef PCRE2GREP_BUFSIZE
#define PCRE2GREP_BUFSIZE 20480
#endif
/* The value of PCRE2GREP_MAX_BUFSIZE specifies the maximum size of the buffer
used by pcre2grep to hold parts of the file it is searching. The actual
amount of memory used by pcre2grep is three times this number, because it
allows for the buffering of "before" and "after" lines. */
#ifndef PCRE2GREP_MAX_BUFSIZE
#define PCRE2GREP_MAX_BUFSIZE 1048576
#endif
/* Define to any value to include debugging code. */ /* Define to any value to include debugging code. */
/* #undef PCRE2_DEBUG */ /* #undef PCRE2_DEBUG */
/* to make a symbol visible */
#define PCRE2_EXPORT
/* If you are compiling for a system other than a Unix-like system or /* If you are compiling for a system other than a Unix-like system or
Win32, and it needs some magic to be inserted before the definition Win32, and it needs some magic to be inserted before the definition
of a function that is exported by the library, define this macro to of a function that is exported by the library, define this macro to
contain the relevant magic. If you do not define this macro, a suitable contain the relevant magic. If you do not define this macro, a suitable
__declspec value is used for Windows systems; in other environments __declspec value is used for Windows systems; in other environments
"extern" is used for a C compiler and "extern C" for a C++ compiler. a compiler relevant "extern" is used with any "visibility" related
attributes from PCRE2_EXPORT included.
This macro apears at the start of every exported function that is part This macro apears at the start of every exported function that is part
of the external API. It does not appear on functions that are "external" of the external API. It does not appear on functions that are "external"
in the C sense, but which are internal to the library. */ in the C sense, but which are internal to the library. */
@@ -263,11 +306,48 @@ sure both macros are undefined; an emulation function will then be used. */
your system. */ your system. */
/* #undef PTHREAD_CREATE_JOINABLE */ /* #undef PTHREAD_CREATE_JOINABLE */
/* Define to 1 if all of the C90 standard headers exist (not just the ones /* Define to any non-zero number to enable support for SELinux compatible
executable memory allocator in JIT. Note that this will have no effect
unless SUPPORT_JIT is also defined. */
/* #undef SLJIT_PROT_EXECUTABLE_ALLOCATOR */
/* Define to 1 if all of the C89 standard headers exist (not just the ones
required in a freestanding environment). This macro is provided for required in a freestanding environment). This macro is provided for
backward compatibility; new code need not use it. */ backward compatibility; new code need not use it. */
/* #undef STDC_HEADERS */ /* #undef STDC_HEADERS */
/* Define to any value to enable differential fuzzing support. */
/* #undef SUPPORT_DIFF_FUZZ */
/* Define to any value to enable support for Just-In-Time compiling. */
/* #undef SUPPORT_JIT */
/* Define to any value to allow pcre2grep to be linked with libbz2, so that it
is able to handle .bz2 files. */
/* #undef SUPPORT_LIBBZ2 */
/* Define to any value to allow pcre2test to be linked with libedit. */
/* #undef SUPPORT_LIBEDIT */
/* Define to any value to allow pcre2test to be linked with libreadline. */
/* #undef SUPPORT_LIBREADLINE */
/* Define to any value to allow pcre2grep to be linked with libz, so that it
is able to handle .gz files. */
/* #undef SUPPORT_LIBZ */
/* Define to any value to enable callout script support in pcre2grep. */
/* #undef SUPPORT_PCRE2GREP_CALLOUT */
/* Define to any value to enable fork support in pcre2grep callout scripts.
This will have no effect unless SUPPORT_PCRE2GREP_CALLOUT is also defined.
*/
/* #undef SUPPORT_PCRE2GREP_CALLOUT_FORK */
/* Define to any value to enable JIT support in pcre2grep. Note that this will
have no effect unless SUPPORT_JIT is also defined. */
/* #undef SUPPORT_PCRE2GREP_JIT */
/* Define to any value to enable the 16 bit PCRE2 library. */ /* Define to any value to enable the 16 bit PCRE2 library. */
/* #undef SUPPORT_PCRE2_16 */ /* #undef SUPPORT_PCRE2_16 */
@@ -286,7 +366,7 @@ sure both macros are undefined; an emulation function will then be used. */
/* Define to any value for valgrind support to find invalid memory reads. */ /* Define to any value for valgrind support to find invalid memory reads. */
/* #undef SUPPORT_VALGRIND */ /* #undef SUPPORT_VALGRIND */
/* Enable extensions on AIX 3, Interix. */ /* Enable extensions on AIX, Interix, z/OS. */
#ifndef _ALL_SOURCE #ifndef _ALL_SOURCE
# define _ALL_SOURCE 1 # define _ALL_SOURCE 1
#endif #endif
@@ -347,11 +427,15 @@ sure both macros are undefined; an emulation function will then be used. */
#ifndef __STDC_WANT_IEC_60559_DFP_EXT__ #ifndef __STDC_WANT_IEC_60559_DFP_EXT__
# define __STDC_WANT_IEC_60559_DFP_EXT__ 1 # define __STDC_WANT_IEC_60559_DFP_EXT__ 1
#endif #endif
/* Enable extensions specified by C23 Annex F. */
#ifndef __STDC_WANT_IEC_60559_EXT__
# define __STDC_WANT_IEC_60559_EXT__ 1
#endif
/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ /* Enable extensions specified by ISO/IEC TS 18661-4:2015. */
#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ #ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
# define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1 # define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1
#endif #endif
/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ /* Enable extensions specified by C23 Annex H and ISO/IEC TS 18661-3:2015. */
#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ #ifndef __STDC_WANT_IEC_60559_TYPES_EXT__
# define __STDC_WANT_IEC_60559_TYPES_EXT__ 1 # define __STDC_WANT_IEC_60559_TYPES_EXT__ 1
#endif #endif
@@ -374,20 +458,26 @@ sure both macros are undefined; an emulation function will then be used. */
#endif #endif
/* Version number of package */ /* Version number of package */
#define VERSION "10.42" #define VERSION "10.43"
/* Number of bits in a file offset, on hosts where this is settable. */ /* Number of bits in a file offset, on hosts where this is settable. */
/* #undef _FILE_OFFSET_BITS */ /* #undef _FILE_OFFSET_BITS */
/* Define for large files, on AIX-style hosts. */ /* Define to 1 on platforms where this makes off_t a 64-bit type. */
/* #undef _LARGE_FILES */ /* #undef _LARGE_FILES */
/* Define to empty if `const' does not conform to ANSI C. */ /* Number of bits in time_t, on hosts where this is settable. */
/* #undef _TIME_BITS */
/* Define to 1 on platforms where this makes time_t a 64-bit type. */
/* #undef __MINGW_USE_VC2005_COMPAT */
/* Define to empty if 'const' does not conform to ANSI C. */
/* #undef const */ /* #undef const */
/* Define to the type of a signed integer type of width exactly 64 bits if /* Define to the type of a signed integer type of width exactly 64 bits if
such a type exists and the standard includes do not define it. */ such a type exists and the standard includes do not define it. */
/* #undef int64_t */ /* #undef int64_t */
/* Define to `unsigned int' if <sys/types.h> does not define. */ /* Define as 'unsigned int' if <stddef.h> doesn't define. */
/* #undef size_t */ /* #undef size_t */

View File

@@ -58,6 +58,9 @@ sure both macros are undefined; an emulation function will then be used. */
/* Define to 1 if you have the `bcopy' function. */ /* Define to 1 if you have the `bcopy' function. */
#undef HAVE_BCOPY #undef HAVE_BCOPY
/* Define this if your compiler provides __builtin_mul_overflow() */
#undef HAVE_BUILTIN_MUL_OVERFLOW
/* Define to 1 if you have the <dirent.h> header file. */ /* Define to 1 if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H #undef HAVE_DIRENT_H
@@ -147,7 +150,7 @@ sure both macros are undefined; an emulation function will then be used. */
matching attempt. The value is also used to limit a loop counter in matching attempt. The value is also used to limit a loop counter in
pcre2_dfa_match(). There is a runtime interface for setting a different pcre2_dfa_match(). There is a runtime interface for setting a different
limit. The limit exists in order to catch runaway regular expressions that limit. The limit exists in order to catch runaway regular expressions that
take for ever to determine that they do not match. The default is set very take forever to determine that they do not match. The default is set very
large so that it does not accidentally catch legitimate cases. */ large so that it does not accidentally catch legitimate cases. */
#undef MATCH_LIMIT #undef MATCH_LIMIT
@@ -173,6 +176,10 @@ sure both macros are undefined; an emulation function will then be used. */
overflow caused by enormously large patterns. */ overflow caused by enormously large patterns. */
#undef MAX_NAME_SIZE #undef MAX_NAME_SIZE
/* The value of MAX_VARLOOKBEHIND specifies the default maximum length, in
characters, for a variable-length lookbehind assertion. */
#undef MAX_VARLOOKBEHIND
/* Defining NEVER_BACKSLASH_C locks out the use of \C in all patterns. */ /* Defining NEVER_BACKSLASH_C locks out the use of \C in all patterns. */
#undef NEVER_BACKSLASH_C #undef NEVER_BACKSLASH_C
@@ -208,25 +215,20 @@ sure both macros are undefined; an emulation function will then be used. */
stack that is used while compiling a pattern. */ stack that is used while compiling a pattern. */
#undef PARENS_NEST_LIMIT #undef PARENS_NEST_LIMIT
/* to make a symbol visible */
#undef PCRE2POSIX_EXP_DECL
/* to make a symbol visible */
#undef PCRE2POSIX_EXP_DEFN
/* Define to any value to include debugging code. */ /* Define to any value to include debugging code. */
#undef PCRE2_DEBUG #undef PCRE2_DEBUG
/* to make a symbol visible */ /* to make a symbol visible */
#undef PCRE2_EXP_DECL #undef PCRE2_EXPORT
/* If you are compiling for a system other than a Unix-like system or /* If you are compiling for a system other than a Unix-like system or
Win32, and it needs some magic to be inserted before the definition Win32, and it needs some magic to be inserted before the definition
of a function that is exported by the library, define this macro to of a function that is exported by the library, define this macro to
contain the relevant magic. If you do not define this macro, a suitable contain the relevant magic. If you do not define this macro, a suitable
__declspec value is used for Windows systems; in other environments __declspec value is used for Windows systems; in other environments
"extern" is used for a C compiler and "extern C" for a C++ compiler. a compiler relevant "extern" is used with any "visibility" related
attributes from PCRE2_EXPORT included.
This macro apears at the start of every exported function that is part This macro apears at the start of every exported function that is part
of the external API. It does not appear on functions that are "external" of the external API. It does not appear on functions that are "external"
in the C sense, but which are internal to the library. */ in the C sense, but which are internal to the library. */

View File

@@ -5,7 +5,7 @@
/* This is the public header file for the PCRE library, second API, to be /* This is the public header file for the PCRE library, second API, to be
#included by applications that call PCRE2 functions. #included by applications that call PCRE2 functions.
Copyright (c) 2016-2021 University of Cambridge Copyright (c) 2016-2024 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@@ -42,9 +42,9 @@ POSSIBILITY OF SUCH DAMAGE.
/* The current PCRE version information. */ /* The current PCRE version information. */
#define PCRE2_MAJOR 10 #define PCRE2_MAJOR 10
#define PCRE2_MINOR 42 #define PCRE2_MINOR 43
#define PCRE2_PRERELEASE #define PCRE2_PRERELEASE
#define PCRE2_DATE 2022-12-11 #define PCRE2_DATE 2024-02-16
/* When an application links to a PCRE DLL in Windows, the symbols that are /* When an application links to a PCRE DLL in Windows, the symbols that are
imported have to be identified as such. When building PCRE2, the appropriate imported have to be identified as such. When building PCRE2, the appropriate
@@ -153,6 +153,12 @@ D is inspected during pcre2_dfa_match() execution
#define PCRE2_EXTRA_ESCAPED_CR_IS_LF 0x00000010u /* C */ #define PCRE2_EXTRA_ESCAPED_CR_IS_LF 0x00000010u /* C */
#define PCRE2_EXTRA_ALT_BSUX 0x00000020u /* C */ #define PCRE2_EXTRA_ALT_BSUX 0x00000020u /* C */
#define PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK 0x00000040u /* C */ #define PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK 0x00000040u /* C */
#define PCRE2_EXTRA_CASELESS_RESTRICT 0x00000080u /* C */
#define PCRE2_EXTRA_ASCII_BSD 0x00000100u /* C */
#define PCRE2_EXTRA_ASCII_BSS 0x00000200u /* C */
#define PCRE2_EXTRA_ASCII_BSW 0x00000400u /* C */
#define PCRE2_EXTRA_ASCII_POSIX 0x00000800u /* C */
#define PCRE2_EXTRA_ASCII_DIGIT 0x00001000u /* C */
/* These are for pcre2_jit_compile(). */ /* These are for pcre2_jit_compile(). */
@@ -180,11 +186,12 @@ pcre2_jit_match() ignores the latter since it bypasses all sanity checks). */
#define PCRE2_SUBSTITUTE_UNSET_EMPTY 0x00000400u /* pcre2_substitute() only */ #define PCRE2_SUBSTITUTE_UNSET_EMPTY 0x00000400u /* pcre2_substitute() only */
#define PCRE2_SUBSTITUTE_UNKNOWN_UNSET 0x00000800u /* pcre2_substitute() only */ #define PCRE2_SUBSTITUTE_UNKNOWN_UNSET 0x00000800u /* pcre2_substitute() only */
#define PCRE2_SUBSTITUTE_OVERFLOW_LENGTH 0x00001000u /* pcre2_substitute() only */ #define PCRE2_SUBSTITUTE_OVERFLOW_LENGTH 0x00001000u /* pcre2_substitute() only */
#define PCRE2_NO_JIT 0x00002000u /* Not for pcre2_dfa_match() */ #define PCRE2_NO_JIT 0x00002000u /* not for pcre2_dfa_match() */
#define PCRE2_COPY_MATCHED_SUBJECT 0x00004000u #define PCRE2_COPY_MATCHED_SUBJECT 0x00004000u
#define PCRE2_SUBSTITUTE_LITERAL 0x00008000u /* pcre2_substitute() only */ #define PCRE2_SUBSTITUTE_LITERAL 0x00008000u /* pcre2_substitute() only */
#define PCRE2_SUBSTITUTE_MATCHED 0x00010000u /* pcre2_substitute() only */ #define PCRE2_SUBSTITUTE_MATCHED 0x00010000u /* pcre2_substitute() only */
#define PCRE2_SUBSTITUTE_REPLACEMENT_ONLY 0x00020000u /* pcre2_substitute() only */ #define PCRE2_SUBSTITUTE_REPLACEMENT_ONLY 0x00020000u /* pcre2_substitute() only */
#define PCRE2_DISABLE_RECURSELOOP_CHECK 0x00040000u /* not for pcre2_dfa_match() or pcre2_jit_match() */
/* Options for pcre2_pattern_convert(). */ /* Options for pcre2_pattern_convert(). */
@@ -399,6 +406,7 @@ released, the numbers must not be changed. */
#define PCRE2_ERROR_CONVERT_SYNTAX (-64) #define PCRE2_ERROR_CONVERT_SYNTAX (-64)
#define PCRE2_ERROR_INTERNAL_DUPMATCH (-65) #define PCRE2_ERROR_INTERNAL_DUPMATCH (-65)
#define PCRE2_ERROR_DFA_UINVALID_UTF (-66) #define PCRE2_ERROR_DFA_UINVALID_UTF (-66)
#define PCRE2_ERROR_INVALIDOFFSET (-67)
/* Request types for pcre2_pattern_info() */ /* Request types for pcre2_pattern_info() */
@@ -575,7 +583,7 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION pcre2_config(uint32_t, void *);
PCRE2_EXP_DECL pcre2_general_context *PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL pcre2_general_context *PCRE2_CALL_CONVENTION \
pcre2_general_context_copy(pcre2_general_context *); \ pcre2_general_context_copy(pcre2_general_context *); \
PCRE2_EXP_DECL pcre2_general_context *PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL pcre2_general_context *PCRE2_CALL_CONVENTION \
pcre2_general_context_create(void *(*)(PCRE2_SIZE, void *), \ pcre2_general_context_create(void *(*)(size_t, void *), \
void (*)(void *, void *), void *); \ void (*)(void *, void *), void *); \
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
pcre2_general_context_free(pcre2_general_context *); pcre2_general_context_free(pcre2_general_context *);
@@ -595,6 +603,8 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
pcre2_set_compile_extra_options(pcre2_compile_context *, uint32_t); \ pcre2_set_compile_extra_options(pcre2_compile_context *, uint32_t); \
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
pcre2_set_max_pattern_length(pcre2_compile_context *, PCRE2_SIZE); \ pcre2_set_max_pattern_length(pcre2_compile_context *, PCRE2_SIZE); \
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
pcre2_set_max_varlookbehind(pcre2_compile_context *, uint32_t); \
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
pcre2_set_newline(pcre2_compile_context *, uint32_t); \ pcre2_set_newline(pcre2_compile_context *, uint32_t); \
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
@@ -628,7 +638,7 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
pcre2_set_recursion_limit(pcre2_match_context *, uint32_t); \ pcre2_set_recursion_limit(pcre2_match_context *, uint32_t); \
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
pcre2_set_recursion_memory_management(pcre2_match_context *, \ pcre2_set_recursion_memory_management(pcre2_match_context *, \
void *(*)(PCRE2_SIZE, void *), void (*)(void *, void *), void *); void *(*)(size_t, void *), void (*)(void *, void *), void *);
#define PCRE2_CONVERT_CONTEXT_FUNCTIONS \ #define PCRE2_CONVERT_CONTEXT_FUNCTIONS \
PCRE2_EXP_DECL pcre2_convert_context *PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL pcre2_convert_context *PCRE2_CALL_CONVENTION \
@@ -687,6 +697,8 @@ PCRE2_EXP_DECL PCRE2_SPTR PCRE2_CALL_CONVENTION \
pcre2_get_mark(pcre2_match_data *); \ pcre2_get_mark(pcre2_match_data *); \
PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \
pcre2_get_match_data_size(pcre2_match_data *); \ pcre2_get_match_data_size(pcre2_match_data *); \
PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \
pcre2_get_match_data_heapframes_size(pcre2_match_data *); \
PCRE2_EXP_DECL uint32_t PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL uint32_t PCRE2_CALL_CONVENTION \
pcre2_get_ovector_count(pcre2_match_data *); \ pcre2_get_ovector_count(pcre2_match_data *); \
PCRE2_EXP_DECL PCRE2_SIZE *PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL PCRE2_SIZE *PCRE2_CALL_CONVENTION \
@@ -722,7 +734,7 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
pcre2_substring_number_from_name(const pcre2_code *, PCRE2_SPTR); \ pcre2_substring_number_from_name(const pcre2_code *, PCRE2_SPTR); \
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
pcre2_substring_list_free(PCRE2_SPTR *); \ pcre2_substring_list_free(PCRE2_UCHAR **); \
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
pcre2_substring_list_get(pcre2_match_data *, PCRE2_UCHAR ***, PCRE2_SIZE **); pcre2_substring_list_get(pcre2_match_data *, PCRE2_UCHAR ***, PCRE2_SIZE **);
@@ -771,7 +783,7 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
pcre2_jit_free_unused_memory(pcre2_general_context *); \ pcre2_jit_free_unused_memory(pcre2_general_context *); \
PCRE2_EXP_DECL pcre2_jit_stack *PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL pcre2_jit_stack *PCRE2_CALL_CONVENTION \
pcre2_jit_stack_create(PCRE2_SIZE, PCRE2_SIZE, pcre2_general_context *); \ pcre2_jit_stack_create(size_t, size_t, pcre2_general_context *); \
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
pcre2_jit_stack_assign(pcre2_match_context *, pcre2_jit_callback, void *); \ pcre2_jit_stack_assign(pcre2_match_context *, pcre2_jit_callback, void *); \
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
@@ -851,6 +863,7 @@ pcre2_compile are called by application code. */
#define pcre2_general_context_free PCRE2_SUFFIX(pcre2_general_context_free_) #define pcre2_general_context_free PCRE2_SUFFIX(pcre2_general_context_free_)
#define pcre2_get_error_message PCRE2_SUFFIX(pcre2_get_error_message_) #define pcre2_get_error_message PCRE2_SUFFIX(pcre2_get_error_message_)
#define pcre2_get_mark PCRE2_SUFFIX(pcre2_get_mark_) #define pcre2_get_mark PCRE2_SUFFIX(pcre2_get_mark_)
#define pcre2_get_match_data_heapframes_size PCRE2_SUFFIX(pcre2_get_match_data_heapframes_size_)
#define pcre2_get_match_data_size PCRE2_SUFFIX(pcre2_get_match_data_size_) #define pcre2_get_match_data_size PCRE2_SUFFIX(pcre2_get_match_data_size_)
#define pcre2_get_ovector_pointer PCRE2_SUFFIX(pcre2_get_ovector_pointer_) #define pcre2_get_ovector_pointer PCRE2_SUFFIX(pcre2_get_ovector_pointer_)
#define pcre2_get_ovector_count PCRE2_SUFFIX(pcre2_get_ovector_count_) #define pcre2_get_ovector_count PCRE2_SUFFIX(pcre2_get_ovector_count_)
@@ -886,6 +899,7 @@ pcre2_compile are called by application code. */
#define pcre2_set_glob_separator PCRE2_SUFFIX(pcre2_set_glob_separator_) #define pcre2_set_glob_separator PCRE2_SUFFIX(pcre2_set_glob_separator_)
#define pcre2_set_heap_limit PCRE2_SUFFIX(pcre2_set_heap_limit_) #define pcre2_set_heap_limit PCRE2_SUFFIX(pcre2_set_heap_limit_)
#define pcre2_set_match_limit PCRE2_SUFFIX(pcre2_set_match_limit_) #define pcre2_set_match_limit PCRE2_SUFFIX(pcre2_set_match_limit_)
#define pcre2_set_max_varlookbehind PCRE2_SUFFIX(pcre2_set_max_varlookbehind_)
#define pcre2_set_max_pattern_length PCRE2_SUFFIX(pcre2_set_max_pattern_length_) #define pcre2_set_max_pattern_length PCRE2_SUFFIX(pcre2_set_max_pattern_length_)
#define pcre2_set_newline PCRE2_SUFFIX(pcre2_set_newline_) #define pcre2_set_newline PCRE2_SUFFIX(pcre2_set_newline_)
#define pcre2_set_parens_nest_limit PCRE2_SUFFIX(pcre2_set_parens_nest_limit_) #define pcre2_set_parens_nest_limit PCRE2_SUFFIX(pcre2_set_parens_nest_limit_)

View File

@@ -5,7 +5,7 @@
/* This is the public header file for the PCRE library, second API, to be /* This is the public header file for the PCRE library, second API, to be
#included by applications that call PCRE2 functions. #included by applications that call PCRE2 functions.
Copyright (c) 2016-2021 University of Cambridge Copyright (c) 2016-2024 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@@ -153,6 +153,12 @@ D is inspected during pcre2_dfa_match() execution
#define PCRE2_EXTRA_ESCAPED_CR_IS_LF 0x00000010u /* C */ #define PCRE2_EXTRA_ESCAPED_CR_IS_LF 0x00000010u /* C */
#define PCRE2_EXTRA_ALT_BSUX 0x00000020u /* C */ #define PCRE2_EXTRA_ALT_BSUX 0x00000020u /* C */
#define PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK 0x00000040u /* C */ #define PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK 0x00000040u /* C */
#define PCRE2_EXTRA_CASELESS_RESTRICT 0x00000080u /* C */
#define PCRE2_EXTRA_ASCII_BSD 0x00000100u /* C */
#define PCRE2_EXTRA_ASCII_BSS 0x00000200u /* C */
#define PCRE2_EXTRA_ASCII_BSW 0x00000400u /* C */
#define PCRE2_EXTRA_ASCII_POSIX 0x00000800u /* C */
#define PCRE2_EXTRA_ASCII_DIGIT 0x00001000u /* C */
/* These are for pcre2_jit_compile(). */ /* These are for pcre2_jit_compile(). */
@@ -180,11 +186,12 @@ pcre2_jit_match() ignores the latter since it bypasses all sanity checks). */
#define PCRE2_SUBSTITUTE_UNSET_EMPTY 0x00000400u /* pcre2_substitute() only */ #define PCRE2_SUBSTITUTE_UNSET_EMPTY 0x00000400u /* pcre2_substitute() only */
#define PCRE2_SUBSTITUTE_UNKNOWN_UNSET 0x00000800u /* pcre2_substitute() only */ #define PCRE2_SUBSTITUTE_UNKNOWN_UNSET 0x00000800u /* pcre2_substitute() only */
#define PCRE2_SUBSTITUTE_OVERFLOW_LENGTH 0x00001000u /* pcre2_substitute() only */ #define PCRE2_SUBSTITUTE_OVERFLOW_LENGTH 0x00001000u /* pcre2_substitute() only */
#define PCRE2_NO_JIT 0x00002000u /* Not for pcre2_dfa_match() */ #define PCRE2_NO_JIT 0x00002000u /* not for pcre2_dfa_match() */
#define PCRE2_COPY_MATCHED_SUBJECT 0x00004000u #define PCRE2_COPY_MATCHED_SUBJECT 0x00004000u
#define PCRE2_SUBSTITUTE_LITERAL 0x00008000u /* pcre2_substitute() only */ #define PCRE2_SUBSTITUTE_LITERAL 0x00008000u /* pcre2_substitute() only */
#define PCRE2_SUBSTITUTE_MATCHED 0x00010000u /* pcre2_substitute() only */ #define PCRE2_SUBSTITUTE_MATCHED 0x00010000u /* pcre2_substitute() only */
#define PCRE2_SUBSTITUTE_REPLACEMENT_ONLY 0x00020000u /* pcre2_substitute() only */ #define PCRE2_SUBSTITUTE_REPLACEMENT_ONLY 0x00020000u /* pcre2_substitute() only */
#define PCRE2_DISABLE_RECURSELOOP_CHECK 0x00040000u /* not for pcre2_dfa_match() or pcre2_jit_match() */
/* Options for pcre2_pattern_convert(). */ /* Options for pcre2_pattern_convert(). */
@@ -399,6 +406,7 @@ released, the numbers must not be changed. */
#define PCRE2_ERROR_CONVERT_SYNTAX (-64) #define PCRE2_ERROR_CONVERT_SYNTAX (-64)
#define PCRE2_ERROR_INTERNAL_DUPMATCH (-65) #define PCRE2_ERROR_INTERNAL_DUPMATCH (-65)
#define PCRE2_ERROR_DFA_UINVALID_UTF (-66) #define PCRE2_ERROR_DFA_UINVALID_UTF (-66)
#define PCRE2_ERROR_INVALIDOFFSET (-67)
/* Request types for pcre2_pattern_info() */ /* Request types for pcre2_pattern_info() */
@@ -575,7 +583,7 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION pcre2_config(uint32_t, void *);
PCRE2_EXP_DECL pcre2_general_context *PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL pcre2_general_context *PCRE2_CALL_CONVENTION \
pcre2_general_context_copy(pcre2_general_context *); \ pcre2_general_context_copy(pcre2_general_context *); \
PCRE2_EXP_DECL pcre2_general_context *PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL pcre2_general_context *PCRE2_CALL_CONVENTION \
pcre2_general_context_create(void *(*)(PCRE2_SIZE, void *), \ pcre2_general_context_create(void *(*)(size_t, void *), \
void (*)(void *, void *), void *); \ void (*)(void *, void *), void *); \
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
pcre2_general_context_free(pcre2_general_context *); pcre2_general_context_free(pcre2_general_context *);
@@ -595,6 +603,8 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
pcre2_set_compile_extra_options(pcre2_compile_context *, uint32_t); \ pcre2_set_compile_extra_options(pcre2_compile_context *, uint32_t); \
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
pcre2_set_max_pattern_length(pcre2_compile_context *, PCRE2_SIZE); \ pcre2_set_max_pattern_length(pcre2_compile_context *, PCRE2_SIZE); \
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
pcre2_set_max_varlookbehind(pcre2_compile_context *, uint32_t); \
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
pcre2_set_newline(pcre2_compile_context *, uint32_t); \ pcre2_set_newline(pcre2_compile_context *, uint32_t); \
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
@@ -628,7 +638,7 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
pcre2_set_recursion_limit(pcre2_match_context *, uint32_t); \ pcre2_set_recursion_limit(pcre2_match_context *, uint32_t); \
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
pcre2_set_recursion_memory_management(pcre2_match_context *, \ pcre2_set_recursion_memory_management(pcre2_match_context *, \
void *(*)(PCRE2_SIZE, void *), void (*)(void *, void *), void *); void *(*)(size_t, void *), void (*)(void *, void *), void *);
#define PCRE2_CONVERT_CONTEXT_FUNCTIONS \ #define PCRE2_CONVERT_CONTEXT_FUNCTIONS \
PCRE2_EXP_DECL pcre2_convert_context *PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL pcre2_convert_context *PCRE2_CALL_CONVENTION \
@@ -687,6 +697,8 @@ PCRE2_EXP_DECL PCRE2_SPTR PCRE2_CALL_CONVENTION \
pcre2_get_mark(pcre2_match_data *); \ pcre2_get_mark(pcre2_match_data *); \
PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \
pcre2_get_match_data_size(pcre2_match_data *); \ pcre2_get_match_data_size(pcre2_match_data *); \
PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \
pcre2_get_match_data_heapframes_size(pcre2_match_data *); \
PCRE2_EXP_DECL uint32_t PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL uint32_t PCRE2_CALL_CONVENTION \
pcre2_get_ovector_count(pcre2_match_data *); \ pcre2_get_ovector_count(pcre2_match_data *); \
PCRE2_EXP_DECL PCRE2_SIZE *PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL PCRE2_SIZE *PCRE2_CALL_CONVENTION \
@@ -722,7 +734,7 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
pcre2_substring_number_from_name(const pcre2_code *, PCRE2_SPTR); \ pcre2_substring_number_from_name(const pcre2_code *, PCRE2_SPTR); \
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
pcre2_substring_list_free(PCRE2_SPTR *); \ pcre2_substring_list_free(PCRE2_UCHAR **); \
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
pcre2_substring_list_get(pcre2_match_data *, PCRE2_UCHAR ***, PCRE2_SIZE **); pcre2_substring_list_get(pcre2_match_data *, PCRE2_UCHAR ***, PCRE2_SIZE **);
@@ -771,7 +783,7 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
pcre2_jit_free_unused_memory(pcre2_general_context *); \ pcre2_jit_free_unused_memory(pcre2_general_context *); \
PCRE2_EXP_DECL pcre2_jit_stack *PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL pcre2_jit_stack *PCRE2_CALL_CONVENTION \
pcre2_jit_stack_create(PCRE2_SIZE, PCRE2_SIZE, pcre2_general_context *); \ pcre2_jit_stack_create(size_t, size_t, pcre2_general_context *); \
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
pcre2_jit_stack_assign(pcre2_match_context *, pcre2_jit_callback, void *); \ pcre2_jit_stack_assign(pcre2_match_context *, pcre2_jit_callback, void *); \
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
@@ -851,6 +863,7 @@ pcre2_compile are called by application code. */
#define pcre2_general_context_free PCRE2_SUFFIX(pcre2_general_context_free_) #define pcre2_general_context_free PCRE2_SUFFIX(pcre2_general_context_free_)
#define pcre2_get_error_message PCRE2_SUFFIX(pcre2_get_error_message_) #define pcre2_get_error_message PCRE2_SUFFIX(pcre2_get_error_message_)
#define pcre2_get_mark PCRE2_SUFFIX(pcre2_get_mark_) #define pcre2_get_mark PCRE2_SUFFIX(pcre2_get_mark_)
#define pcre2_get_match_data_heapframes_size PCRE2_SUFFIX(pcre2_get_match_data_heapframes_size_)
#define pcre2_get_match_data_size PCRE2_SUFFIX(pcre2_get_match_data_size_) #define pcre2_get_match_data_size PCRE2_SUFFIX(pcre2_get_match_data_size_)
#define pcre2_get_ovector_pointer PCRE2_SUFFIX(pcre2_get_ovector_pointer_) #define pcre2_get_ovector_pointer PCRE2_SUFFIX(pcre2_get_ovector_pointer_)
#define pcre2_get_ovector_count PCRE2_SUFFIX(pcre2_get_ovector_count_) #define pcre2_get_ovector_count PCRE2_SUFFIX(pcre2_get_ovector_count_)
@@ -886,6 +899,7 @@ pcre2_compile are called by application code. */
#define pcre2_set_glob_separator PCRE2_SUFFIX(pcre2_set_glob_separator_) #define pcre2_set_glob_separator PCRE2_SUFFIX(pcre2_set_glob_separator_)
#define pcre2_set_heap_limit PCRE2_SUFFIX(pcre2_set_heap_limit_) #define pcre2_set_heap_limit PCRE2_SUFFIX(pcre2_set_heap_limit_)
#define pcre2_set_match_limit PCRE2_SUFFIX(pcre2_set_match_limit_) #define pcre2_set_match_limit PCRE2_SUFFIX(pcre2_set_match_limit_)
#define pcre2_set_max_varlookbehind PCRE2_SUFFIX(pcre2_set_max_varlookbehind_)
#define pcre2_set_max_pattern_length PCRE2_SUFFIX(pcre2_set_max_pattern_length_) #define pcre2_set_max_pattern_length PCRE2_SUFFIX(pcre2_set_max_pattern_length_)
#define pcre2_set_newline PCRE2_SUFFIX(pcre2_set_newline_) #define pcre2_set_newline PCRE2_SUFFIX(pcre2_set_newline_)
#define pcre2_set_parens_nest_limit PCRE2_SUFFIX(pcre2_set_parens_nest_limit_) #define pcre2_set_parens_nest_limit PCRE2_SUFFIX(pcre2_set_parens_nest_limit_)

View File

@@ -560,6 +560,8 @@ matches to an empty string (also represented by a non-zero value). */
for(;;) for(;;)
{ {
PCRE2_SPTR bracode;
/* All operations move the code pointer forward. /* All operations move the code pointer forward.
Therefore infinite recursions are not possible. */ Therefore infinite recursions are not possible. */
@@ -617,7 +619,8 @@ for(;;)
recursions. (This could be improved by keeping a list of group numbers that recursions. (This could be improved by keeping a list of group numbers that
are called by recursion.) */ are called by recursion.) */
switch(*(code - GET(code, 1))) bracode = code - GET(code, 1);
switch(*bracode)
{ {
case OP_CBRA: case OP_CBRA:
case OP_SCBRA: case OP_SCBRA:
@@ -636,16 +639,19 @@ for(;;)
break; break;
/* Atomic sub-patterns and assertions can always auto-possessify their /* Atomic sub-patterns and assertions can always auto-possessify their
last iterator. However, if the group was entered as a result of checking last iterator except for variable length lookbehinds. However, if the
a previous iterator, this is not possible. */ group was entered as a result of checking a previous iterator, this is
not possible. */
case OP_ASSERT: case OP_ASSERT:
case OP_ASSERT_NOT: case OP_ASSERT_NOT:
case OP_ASSERTBACK:
case OP_ASSERTBACK_NOT:
case OP_ONCE: case OP_ONCE:
return !entered_a_group; return !entered_a_group;
case OP_ASSERTBACK:
case OP_ASSERTBACK_NOT:
return (bracode[1+LINK_SIZE] == OP_VREVERSE)? FALSE : !entered_a_group;
/* Non-atomic assertions - don't possessify last iterator. This needs /* Non-atomic assertions - don't possessify last iterator. This needs
more thought. */ more thought. */

View File

@@ -5,7 +5,8 @@
/* This file was automatically written by the pcre2_dftables auxiliary /* This file was automatically written by the pcre2_dftables auxiliary
program. It contains character tables that are used when no external program. It contains character tables that are used when no external
tables are passed to PCRE2 by the application that calls it. The tables tables are passed to PCRE2 by the application that calls it. The tables
are used only for characters whose code values are less than 256. */ are used only for characters whose code values are less than 256, and
only relevant if not in UCP mode. */
/* This set of tables was written in the C locale. */ /* This set of tables was written in the C locale. */
@@ -18,13 +19,6 @@ PCRE2 is configured with --enable-rebuild-chartables. However, you can run
pcre2_dftables manually with the -L option to build tables using the LC_ALL pcre2_dftables manually with the -L option to build tables using the LC_ALL
locale. */ locale. */
/* The following #include is present because without it gcc 4.x may remove
the array definition from the final binary if PCRE2 is built into a static
library and dead code stripping is activated. This leads to link errors.
Pulling in the header ensures that the array gets flagged as "someone
outside this compilation unit might reference this" and so it will always
be supplied to the linker. */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
@@ -163,7 +157,7 @@ graph, print, punct, and cntrl. Other classes are built from combinations. */
0x02 letter 0x02 letter
0x04 lower case letter 0x04 lower case letter
0x08 decimal digit 0x08 decimal digit
0x10 alphanumeric or '_' 0x10 word (alphanumeric or '_')
*/ */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 */

View File

@@ -0,0 +1,96 @@
/*************************************************
* Perl-Compatible Regular Expressions *
*************************************************/
/* PCRE 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
Copyright (c) 2023 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.
-----------------------------------------------------------------------------
*/
/* This file contains functions to implement checked integer operation */
#ifndef PCRE2_PCRE2TEST
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "pcre2_internal.h"
#endif
/*************************************************
* Checked Integer Multiplication *
*************************************************/
/*
Arguments:
r A pointer to PCRE2_SIZE to store the answer
a, b Two integers
Returns: Bool indicating if the operation overflows
It is modeled after C23's <stdckdint.h> interface
The INT64_OR_DOUBLE type is a 64-bit integer type when available,
otherwise double. */
BOOL
PRIV(ckd_smul)(PCRE2_SIZE *r, int a, int b)
{
#ifdef HAVE_BUILTIN_MUL_OVERFLOW
PCRE2_SIZE m;
if (__builtin_mul_overflow(a, b, &m)) return TRUE;
*r = m;
#else
INT64_OR_DOUBLE m;
#ifdef PCRE2_DEBUG
if (a < 0 || b < 0) abort();
#endif
m = (INT64_OR_DOUBLE)a * (INT64_OR_DOUBLE)b;
#if defined INT64_MAX || defined int64_t
if (sizeof(m) > sizeof(*r) && m > (INT64_OR_DOUBLE)PCRE2_SIZE_MAX) return TRUE;
*r = (PCRE2_SIZE)m;
#else
if (m > PCRE2_SIZE_MAX) return TRUE;
*r = m;
#endif
#endif
return FALSE;
}
/* End of pcre_chkdint.c */

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge Original API code Copyright (c) 1997-2012 University of Cambridge
New API code Copyright (c) 2016-2022 University of Cambridge New API code Copyright (c) 2016-2023 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@@ -139,7 +139,9 @@ const pcre2_compile_context PRIV(default_compile_context) = {
BSR_DEFAULT, /* Backslash R default */ BSR_DEFAULT, /* Backslash R default */
NEWLINE_DEFAULT, /* Newline convention */ NEWLINE_DEFAULT, /* Newline convention */
PARENS_NEST_LIMIT, /* As it says */ PARENS_NEST_LIMIT, /* As it says */
0 }; /* Extra options */ 0, /* Extra options */
MAX_VARLOOKBEHIND /* As it says */
};
/* The create function copies the default into the new memory, but must /* The create function copies the default into the new memory, but must
override the default memory handling functions if a gcontext was provided. */ override the default memory handling functions if a gcontext was provided. */
@@ -228,49 +230,48 @@ return ccontext;
PCRE2_EXP_DEFN pcre2_general_context * PCRE2_CALL_CONVENTION PCRE2_EXP_DEFN pcre2_general_context * PCRE2_CALL_CONVENTION
pcre2_general_context_copy(pcre2_general_context *gcontext) pcre2_general_context_copy(pcre2_general_context *gcontext)
{ {
pcre2_general_context *new = pcre2_general_context *newcontext =
gcontext->memctl.malloc(sizeof(pcre2_real_general_context), gcontext->memctl.malloc(sizeof(pcre2_real_general_context),
gcontext->memctl.memory_data); gcontext->memctl.memory_data);
if (new == NULL) return NULL; if (newcontext == NULL) return NULL;
memcpy(new, gcontext, sizeof(pcre2_real_general_context)); memcpy(newcontext, gcontext, sizeof(pcre2_real_general_context));
return new; return newcontext;
} }
PCRE2_EXP_DEFN pcre2_compile_context * PCRE2_CALL_CONVENTION PCRE2_EXP_DEFN pcre2_compile_context * PCRE2_CALL_CONVENTION
pcre2_compile_context_copy(pcre2_compile_context *ccontext) pcre2_compile_context_copy(pcre2_compile_context *ccontext)
{ {
pcre2_compile_context *new = pcre2_compile_context *newcontext =
ccontext->memctl.malloc(sizeof(pcre2_real_compile_context), ccontext->memctl.malloc(sizeof(pcre2_real_compile_context),
ccontext->memctl.memory_data); ccontext->memctl.memory_data);
if (new == NULL) return NULL; if (newcontext == NULL) return NULL;
memcpy(new, ccontext, sizeof(pcre2_real_compile_context)); memcpy(newcontext, ccontext, sizeof(pcre2_real_compile_context));
return new; return newcontext;
} }
PCRE2_EXP_DEFN pcre2_match_context * PCRE2_CALL_CONVENTION PCRE2_EXP_DEFN pcre2_match_context * PCRE2_CALL_CONVENTION
pcre2_match_context_copy(pcre2_match_context *mcontext) pcre2_match_context_copy(pcre2_match_context *mcontext)
{ {
pcre2_match_context *new = pcre2_match_context *newcontext =
mcontext->memctl.malloc(sizeof(pcre2_real_match_context), mcontext->memctl.malloc(sizeof(pcre2_real_match_context),
mcontext->memctl.memory_data); mcontext->memctl.memory_data);
if (new == NULL) return NULL; if (newcontext == NULL) return NULL;
memcpy(new, mcontext, sizeof(pcre2_real_match_context)); memcpy(newcontext, mcontext, sizeof(pcre2_real_match_context));
return new; return newcontext;
} }
PCRE2_EXP_DEFN pcre2_convert_context * PCRE2_CALL_CONVENTION PCRE2_EXP_DEFN pcre2_convert_context * PCRE2_CALL_CONVENTION
pcre2_convert_context_copy(pcre2_convert_context *ccontext) pcre2_convert_context_copy(pcre2_convert_context *ccontext)
{ {
pcre2_convert_context *new = pcre2_convert_context *newcontext =
ccontext->memctl.malloc(sizeof(pcre2_real_convert_context), ccontext->memctl.malloc(sizeof(pcre2_real_convert_context),
ccontext->memctl.memory_data); ccontext->memctl.memory_data);
if (new == NULL) return NULL; if (newcontext == NULL) return NULL;
memcpy(new, ccontext, sizeof(pcre2_real_convert_context)); memcpy(newcontext, ccontext, sizeof(pcre2_real_convert_context));
return new; return newcontext;
} }
@@ -370,6 +371,13 @@ switch(newline)
} }
} }
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_set_max_varlookbehind(pcre2_compile_context *ccontext, uint32_t limit)
{
ccontext->max_varlookbehind = limit;
return 0;
}
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_set_parens_nest_limit(pcre2_compile_context *ccontext, uint32_t limit) pcre2_set_parens_nest_limit(pcre2_compile_context *ccontext, uint32_t limit)
{ {

View File

@@ -540,6 +540,14 @@ Returns: !0 => character is found in the class
static BOOL static BOOL
convert_glob_char_in_class(int class_index, PCRE2_UCHAR c) convert_glob_char_in_class(int class_index, PCRE2_UCHAR c)
{ {
#if PCRE2_CODE_UNIT_WIDTH != 8
if (c > 0xff)
{
/* ctype functions are not sane for c > 0xff */
return 0;
}
#endif
switch (class_index) switch (class_index)
{ {
case 1: return isalnum(c); case 1: return isalnum(c);

View File

@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge Original API code Copyright (c) 1997-2012 University of Cambridge
New API code Copyright (c) 2016-2022 University of Cambridge New API code Copyright (c) 2016-2023 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@@ -168,7 +168,7 @@ static const uint8_t coptable[] = {
0, /* KetRmax */ 0, /* KetRmax */
0, /* KetRmin */ 0, /* KetRmin */
0, /* KetRpos */ 0, /* KetRpos */
0, /* Reverse */ 0, 0, /* Reverse, Vreverse */
0, /* Assert */ 0, /* Assert */
0, /* Assert not */ 0, /* Assert not */
0, /* Assert behind */ 0, /* Assert behind */
@@ -187,7 +187,8 @@ static const uint8_t coptable[] = {
0, 0, 0, 0, /* SKIP, SKIP_ARG, THEN, THEN_ARG */ 0, 0, 0, 0, /* SKIP, SKIP_ARG, THEN, THEN_ARG */
0, 0, /* COMMIT, COMMIT_ARG */ 0, 0, /* COMMIT, COMMIT_ARG */
0, 0, 0, /* FAIL, ACCEPT, ASSERT_ACCEPT */ 0, 0, 0, /* FAIL, ACCEPT, ASSERT_ACCEPT */
0, 0, 0 /* CLOSE, SKIPZERO, DEFINE */ 0, 0, 0, /* CLOSE, SKIPZERO, DEFINE */
0, 0 /* \B and \b in UCP mode */
}; };
/* This table identifies those opcodes that inspect a character. It is used to /* This table identifies those opcodes that inspect a character. It is used to
@@ -245,7 +246,7 @@ static const uint8_t poptable[] = {
0, /* KetRmax */ 0, /* KetRmax */
0, /* KetRmin */ 0, /* KetRmin */
0, /* KetRpos */ 0, /* KetRpos */
0, /* Reverse */ 0, 0, /* Reverse, Vreverse */
0, /* Assert */ 0, /* Assert */
0, /* Assert not */ 0, /* Assert not */
0, /* Assert behind */ 0, /* Assert behind */
@@ -264,7 +265,8 @@ static const uint8_t poptable[] = {
0, 0, 0, 0, /* SKIP, SKIP_ARG, THEN, THEN_ARG */ 0, 0, 0, 0, /* SKIP, SKIP_ARG, THEN, THEN_ARG */
0, 0, /* COMMIT, COMMIT_ARG */ 0, 0, /* COMMIT, COMMIT_ARG */
0, 0, 0, /* FAIL, ACCEPT, ASSERT_ACCEPT */ 0, 0, 0, /* FAIL, ACCEPT, ASSERT_ACCEPT */
0, 0, 0 /* CLOSE, SKIPZERO, DEFINE */ 0, 0, 0, /* CLOSE, SKIPZERO, DEFINE */
1, 1 /* \B and \b in UCP mode */
}; };
/* These 2 tables allow for compact code for testing for \D, \d, \S, \s, \W, /* These 2 tables allow for compact code for testing for \D, \d, \S, \s, \W,
@@ -426,7 +428,7 @@ overflow. */
else else
{ {
uint32_t newsize = (rws->size >= UINT32_MAX/2)? UINT32_MAX/2 : rws->size * 2; uint32_t newsize = (rws->size >= UINT32_MAX/(sizeof(int)*2))? UINT32_MAX/sizeof(int) : rws->size * 2;
uint32_t newsizeK = newsize/(1024/sizeof(int)); uint32_t newsizeK = newsize/(1024/sizeof(int));
if (newsizeK + mb->heap_used > mb->heap_limit) if (newsizeK + mb->heap_used > mb->heap_limit)
@@ -589,7 +591,7 @@ if (*this_start_code == OP_ASSERTBACK || *this_start_code == OP_ASSERTBACK_NOT)
end_code = this_start_code; end_code = this_start_code;
do do
{ {
size_t back = (size_t)GET(end_code, 2+LINK_SIZE); size_t back = (size_t)GET2(end_code, 2+LINK_SIZE);
if (back > max_back) max_back = back; if (back > max_back) max_back = back;
end_code += GET(end_code, 1); end_code += GET(end_code, 1);
} }
@@ -633,8 +635,8 @@ if (*this_start_code == OP_ASSERTBACK || *this_start_code == OP_ASSERTBACK_NOT)
end_code = this_start_code; end_code = this_start_code;
do do
{ {
uint32_t revlen = (end_code[1+LINK_SIZE] == OP_REVERSE)? 1 + LINK_SIZE : 0; uint32_t revlen = (end_code[1+LINK_SIZE] == OP_REVERSE)? 1 + IMM2_SIZE : 0;
size_t back = (revlen == 0)? 0 : (size_t)GET(end_code, 2+LINK_SIZE); size_t back = (revlen == 0)? 0 : (size_t)GET2(end_code, 2+LINK_SIZE);
if (back <= gone_back) if (back <= gone_back)
{ {
int bstate = (int)(end_code - start_code + 1 + LINK_SIZE + revlen); int bstate = (int)(end_code - start_code + 1 + LINK_SIZE + revlen);
@@ -1100,6 +1102,8 @@ for (;;)
/*-----------------------------------------------------------------*/ /*-----------------------------------------------------------------*/
case OP_WORD_BOUNDARY: case OP_WORD_BOUNDARY:
case OP_NOT_WORD_BOUNDARY: case OP_NOT_WORD_BOUNDARY:
case OP_NOT_UCP_WORD_BOUNDARY:
case OP_UCP_WORD_BOUNDARY:
{ {
int left_word, right_word; int left_word, right_word;
@@ -1112,13 +1116,13 @@ for (;;)
#endif #endif
GETCHARTEST(d, temp); GETCHARTEST(d, temp);
#ifdef SUPPORT_UNICODE #ifdef SUPPORT_UNICODE
if ((mb->poptions & PCRE2_UCP) != 0) if (codevalue == OP_UCP_WORD_BOUNDARY ||
codevalue == OP_NOT_UCP_WORD_BOUNDARY)
{ {
if (d == '_') left_word = TRUE; else int chartype = UCD_CHARTYPE(d);
{ int category = PRIV(ucp_gentype)[chartype];
uint32_t cat = UCD_CATEGORY(d); left_word = (category == ucp_L || category == ucp_N ||
left_word = (cat == ucp_L || cat == ucp_N); chartype == ucp_Mn || chartype == ucp_Pc);
}
} }
else else
#endif #endif
@@ -1137,13 +1141,13 @@ for (;;)
mb->last_used_ptr = temp; mb->last_used_ptr = temp;
} }
#ifdef SUPPORT_UNICODE #ifdef SUPPORT_UNICODE
if ((mb->poptions & PCRE2_UCP) != 0) if (codevalue == OP_UCP_WORD_BOUNDARY ||
codevalue == OP_NOT_UCP_WORD_BOUNDARY)
{ {
if (c == '_') right_word = TRUE; else int chartype = UCD_CHARTYPE(c);
{ int category = PRIV(ucp_gentype)[chartype];
uint32_t cat = UCD_CATEGORY(c); right_word = (category == ucp_L || category == ucp_N ||
right_word = (cat == ucp_L || cat == ucp_N); chartype == ucp_Mn || chartype == ucp_Pc);
}
} }
else else
#endif #endif
@@ -1151,7 +1155,9 @@ for (;;)
} }
else right_word = FALSE; else right_word = FALSE;
if ((left_word == right_word) == (codevalue == OP_NOT_WORD_BOUNDARY)) if ((left_word == right_word) ==
(codevalue == OP_NOT_WORD_BOUNDARY ||
codevalue == OP_NOT_UCP_WORD_BOUNDARY))
{ ADD_ACTIVE(state_offset + 1, 0); } { ADD_ACTIVE(state_offset + 1, 0); }
} }
break; break;
@@ -1168,6 +1174,7 @@ for (;;)
if (clen > 0) if (clen > 0)
{ {
BOOL OK; BOOL OK;
int chartype;
const uint32_t *cp; const uint32_t *cp;
const ucd_record * prop = GET_UCD(c); const ucd_record * prop = GET_UCD(c);
switch(code[1]) switch(code[1])
@@ -1177,8 +1184,9 @@ for (;;)
break; break;
case PT_LAMP: case PT_LAMP:
OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll || chartype = prop->chartype;
prop->chartype == ucp_Lt; OK = chartype == ucp_Lu || chartype == ucp_Ll ||
chartype == ucp_Lt;
break; break;
case PT_GC: case PT_GC:
@@ -1201,8 +1209,9 @@ for (;;)
/* These are specials for combination cases. */ /* These are specials for combination cases. */
case PT_ALNUM: case PT_ALNUM:
OK = PRIV(ucp_gentype)[prop->chartype] == ucp_L || chartype = prop->chartype;
PRIV(ucp_gentype)[prop->chartype] == ucp_N; OK = PRIV(ucp_gentype)[chartype] == ucp_L ||
PRIV(ucp_gentype)[chartype] == ucp_N;
break; break;
/* Perl space used to exclude VT, but from Perl 5.18 it is included, /* Perl space used to exclude VT, but from Perl 5.18 it is included,
@@ -1225,12 +1234,20 @@ for (;;)
break; break;
case PT_WORD: case PT_WORD:
OK = PRIV(ucp_gentype)[prop->chartype] == ucp_L || chartype = prop->chartype;
PRIV(ucp_gentype)[prop->chartype] == ucp_N || OK = PRIV(ucp_gentype)[chartype] == ucp_L ||
c == CHAR_UNDERSCORE; PRIV(ucp_gentype)[chartype] == ucp_N ||
chartype == ucp_Mn || chartype == ucp_Pc;
break; break;
case PT_CLIST: case PT_CLIST:
#if PCRE2_CODE_UNIT_WIDTH == 32
if (c > MAX_UTF_CODE_POINT)
{
OK = FALSE;
break;
}
#endif
cp = PRIV(ucd_caseless_sets) + code[2]; cp = PRIV(ucd_caseless_sets) + code[2];
for (;;) for (;;)
{ {
@@ -1440,6 +1457,7 @@ for (;;)
if (clen > 0) if (clen > 0)
{ {
BOOL OK; BOOL OK;
int chartype;
const uint32_t *cp; const uint32_t *cp;
const ucd_record * prop = GET_UCD(c); const ucd_record * prop = GET_UCD(c);
switch(code[2]) switch(code[2])
@@ -1449,8 +1467,8 @@ for (;;)
break; break;
case PT_LAMP: case PT_LAMP:
OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll || chartype = prop->chartype;
prop->chartype == ucp_Lt; OK = chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt;
break; break;
case PT_GC: case PT_GC:
@@ -1473,8 +1491,9 @@ for (;;)
/* These are specials for combination cases. */ /* These are specials for combination cases. */
case PT_ALNUM: case PT_ALNUM:
OK = PRIV(ucp_gentype)[prop->chartype] == ucp_L || chartype = prop->chartype;
PRIV(ucp_gentype)[prop->chartype] == ucp_N; OK = PRIV(ucp_gentype)[chartype] == ucp_L ||
PRIV(ucp_gentype)[chartype] == ucp_N;
break; break;
/* Perl space used to exclude VT, but from Perl 5.18 it is included, /* Perl space used to exclude VT, but from Perl 5.18 it is included,
@@ -1497,12 +1516,20 @@ for (;;)
break; break;
case PT_WORD: case PT_WORD:
OK = PRIV(ucp_gentype)[prop->chartype] == ucp_L || chartype = prop->chartype;
PRIV(ucp_gentype)[prop->chartype] == ucp_N || OK = PRIV(ucp_gentype)[chartype] == ucp_L ||
c == CHAR_UNDERSCORE; PRIV(ucp_gentype)[chartype] == ucp_N ||
chartype == ucp_Mn || chartype == ucp_Pc;
break; break;
case PT_CLIST: case PT_CLIST:
#if PCRE2_CODE_UNIT_WIDTH == 32
if (c > MAX_UTF_CODE_POINT)
{
OK = FALSE;
break;
}
#endif
cp = PRIV(ucd_caseless_sets) + code[3]; cp = PRIV(ucd_caseless_sets) + code[3];
for (;;) for (;;)
{ {
@@ -1695,6 +1722,7 @@ for (;;)
if (clen > 0) if (clen > 0)
{ {
BOOL OK; BOOL OK;
int chartype;
const uint32_t *cp; const uint32_t *cp;
const ucd_record * prop = GET_UCD(c); const ucd_record * prop = GET_UCD(c);
switch(code[2]) switch(code[2])
@@ -1704,8 +1732,8 @@ for (;;)
break; break;
case PT_LAMP: case PT_LAMP:
OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll || chartype = prop->chartype;
prop->chartype == ucp_Lt; OK = chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt;
break; break;
case PT_GC: case PT_GC:
@@ -1728,8 +1756,9 @@ for (;;)
/* These are specials for combination cases. */ /* These are specials for combination cases. */
case PT_ALNUM: case PT_ALNUM:
OK = PRIV(ucp_gentype)[prop->chartype] == ucp_L || chartype = prop->chartype;
PRIV(ucp_gentype)[prop->chartype] == ucp_N; OK = PRIV(ucp_gentype)[chartype] == ucp_L ||
PRIV(ucp_gentype)[chartype] == ucp_N;
break; break;
/* Perl space used to exclude VT, but from Perl 5.18 it is included, /* Perl space used to exclude VT, but from Perl 5.18 it is included,
@@ -1752,12 +1781,20 @@ for (;;)
break; break;
case PT_WORD: case PT_WORD:
OK = PRIV(ucp_gentype)[prop->chartype] == ucp_L || chartype = prop->chartype;
PRIV(ucp_gentype)[prop->chartype] == ucp_N || OK = PRIV(ucp_gentype)[chartype] == ucp_L ||
c == CHAR_UNDERSCORE; PRIV(ucp_gentype)[chartype] == ucp_N ||
chartype == ucp_Mn || chartype == ucp_Pc;
break; break;
case PT_CLIST: case PT_CLIST:
#if PCRE2_CODE_UNIT_WIDTH == 32
if (c > MAX_UTF_CODE_POINT)
{
OK = FALSE;
break;
}
#endif
cp = PRIV(ucd_caseless_sets) + code[3]; cp = PRIV(ucd_caseless_sets) + code[3];
for (;;) for (;;)
{ {
@@ -1975,6 +2012,7 @@ for (;;)
if (clen > 0) if (clen > 0)
{ {
BOOL OK; BOOL OK;
int chartype;
const uint32_t *cp; const uint32_t *cp;
const ucd_record * prop = GET_UCD(c); const ucd_record * prop = GET_UCD(c);
switch(code[1 + IMM2_SIZE + 1]) switch(code[1 + IMM2_SIZE + 1])
@@ -1984,8 +2022,8 @@ for (;;)
break; break;
case PT_LAMP: case PT_LAMP:
OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll || chartype = prop->chartype;
prop->chartype == ucp_Lt; OK = chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt;
break; break;
case PT_GC: case PT_GC:
@@ -2009,8 +2047,9 @@ for (;;)
/* These are specials for combination cases. */ /* These are specials for combination cases. */
case PT_ALNUM: case PT_ALNUM:
OK = PRIV(ucp_gentype)[prop->chartype] == ucp_L || chartype = prop->chartype;
PRIV(ucp_gentype)[prop->chartype] == ucp_N; OK = PRIV(ucp_gentype)[chartype] == ucp_L ||
PRIV(ucp_gentype)[chartype] == ucp_N;
break; break;
/* Perl space used to exclude VT, but from Perl 5.18 it is included, /* Perl space used to exclude VT, but from Perl 5.18 it is included,
@@ -2033,12 +2072,20 @@ for (;;)
break; break;
case PT_WORD: case PT_WORD:
OK = PRIV(ucp_gentype)[prop->chartype] == ucp_L || chartype = prop->chartype;
PRIV(ucp_gentype)[prop->chartype] == ucp_N || OK = PRIV(ucp_gentype)[chartype] == ucp_L ||
c == CHAR_UNDERSCORE; PRIV(ucp_gentype)[chartype] == ucp_N ||
chartype == ucp_Mn || chartype == ucp_Pc;
break; break;
case PT_CLIST: case PT_CLIST:
#if PCRE2_CODE_UNIT_WIDTH == 32
if (c > MAX_UTF_CODE_POINT)
{
OK = FALSE;
break;
}
#endif
cp = PRIV(ucd_caseless_sets) + code[1 + IMM2_SIZE + 2]; cp = PRIV(ucd_caseless_sets) + code[1 + IMM2_SIZE + 2];
for (;;) for (;;)
{ {
@@ -2894,7 +2941,6 @@ for (;;)
int *local_workspace; int *local_workspace;
PCRE2_SIZE *local_offsets; PCRE2_SIZE *local_offsets;
RWS_anchor *rws = (RWS_anchor *)RWS; RWS_anchor *rws = (RWS_anchor *)RWS;
dfa_recursion_info *ri;
PCRE2_SPTR callpat = start_code + GET(code, 1); PCRE2_SPTR callpat = start_code + GET(code, 1);
uint32_t recno = (callpat == mb->start_code)? 0 : uint32_t recno = (callpat == mb->start_code)? 0 :
GET2(callpat, 1 + LINK_SIZE); GET2(callpat, 1 + LINK_SIZE);
@@ -2911,18 +2957,24 @@ for (;;)
rws->free -= RWS_RSIZE + RWS_OVEC_RSIZE; rws->free -= RWS_RSIZE + RWS_OVEC_RSIZE;
/* Check for repeating a recursion without advancing the subject /* Check for repeating a recursion without advancing the subject
pointer. This should catch convoluted mutual recursions. (Some simple pointer or last used character. This should catch convoluted mutual
cases are caught at compile time.) */ recursions. (Some simple cases are caught at compile time.) */
for (ri = mb->recursive; ri != NULL; ri = ri->prevrec) for (dfa_recursion_info *ri = mb->recursive;
if (recno == ri->group_num && ptr == ri->subject_position) ri != NULL;
ri = ri->prevrec)
{
if (recno == ri->group_num && ptr == ri->subject_position &&
mb->last_used_ptr == ri->last_used_ptr)
return PCRE2_ERROR_RECURSELOOP; return PCRE2_ERROR_RECURSELOOP;
}
/* Remember this recursion and where we started it so as to /* Remember this recursion and where we started it so as to
catch infinite loops. */ catch infinite loops. */
new_recursive.group_num = recno; new_recursive.group_num = recno;
new_recursive.subject_position = ptr; new_recursive.subject_position = ptr;
new_recursive.last_used_ptr = mb->last_used_ptr;
new_recursive.prevrec = mb->recursive; new_recursive.prevrec = mb->recursive;
mb->recursive = &new_recursive; mb->recursive = &new_recursive;
@@ -3424,7 +3476,7 @@ anchored = (options & (PCRE2_ANCHORED|PCRE2_DFA_RESTART)) != 0 ||
where to start. */ where to start. */
startline = (re->flags & PCRE2_STARTLINE) != 0; startline = (re->flags & PCRE2_STARTLINE) != 0;
firstline = (re->overall_options & PCRE2_FIRSTLINE) != 0; firstline = !anchored && (re->overall_options & PCRE2_FIRSTLINE) != 0;
bumpalong_limit = end_subject; bumpalong_limit = end_subject;
/* Initialize and set up the fixed fields in the callout block, with a pointer /* Initialize and set up the fixed fields in the callout block, with a pointer
@@ -3994,8 +4046,9 @@ for (;;)
match_data->ovector[0] = (PCRE2_SIZE)(start_match - subject); match_data->ovector[0] = (PCRE2_SIZE)(start_match - subject);
match_data->ovector[1] = (PCRE2_SIZE)(end_subject - subject); match_data->ovector[1] = (PCRE2_SIZE)(end_subject - subject);
} }
match_data->subject_length = length;
match_data->leftchar = (PCRE2_SIZE)(mb->start_used_ptr - subject); match_data->leftchar = (PCRE2_SIZE)(mb->start_used_ptr - subject);
match_data->rightchar = (PCRE2_SIZE)( mb->last_used_ptr - subject); match_data->rightchar = (PCRE2_SIZE)(mb->last_used_ptr - subject);
match_data->startchar = (PCRE2_SIZE)(start_match - subject); match_data->startchar = (PCRE2_SIZE)(start_match - subject);
match_data->rc = rc; match_data->rc = rc;

View File

@@ -56,10 +56,11 @@ given, they are written in binary. */
#include <string.h> #include <string.h>
#include <locale.h> #include <locale.h>
#define PCRE2_DFTABLES /* for pcre2_internal.h, pcre2_maketables.c */
#define PCRE2_CODE_UNIT_WIDTH 0 /* Must be set, but not relevant here */ #define PCRE2_CODE_UNIT_WIDTH 0 /* Must be set, but not relevant here */
#include "pcre2_internal.h" #include "pcre2_internal.h"
#define PCRE2_DFTABLES /* pcre2_maketables.c notices this */
#include "pcre2_maketables.c" #include "pcre2_maketables.c"
@@ -98,8 +99,8 @@ int i;
int nclass = 0; int nclass = 0;
BOOL binary = FALSE; BOOL binary = FALSE;
char *env = (char *)"C"; char *env = (char *)"C";
const unsigned char *tables; const uint8_t *tables;
const unsigned char *base_of_tables; const uint8_t *base_of_tables;
/* Process options */ /* Process options */
@@ -180,7 +181,8 @@ the very long string otherwise. */
"/* This file was automatically written by the pcre2_dftables auxiliary\n" "/* This file was automatically written by the pcre2_dftables auxiliary\n"
"program. It contains character tables that are used when no external\n" "program. It contains character tables that are used when no external\n"
"tables are passed to PCRE2 by the application that calls it. The tables\n" "tables are passed to PCRE2 by the application that calls it. The tables\n"
"are used only for characters whose code values are less than 256. */\n\n"); "are used only for characters whose code values are less than 256, and\n"
"only relevant if not in UCP mode. */\n\n");
(void)fprintf(f, (void)fprintf(f,
"/* This set of tables was written in the %s locale. */\n\n", env); "/* This set of tables was written in the %s locale. */\n\n", env);
@@ -205,14 +207,6 @@ the very long string otherwise. */
"#endif\n\n"); "#endif\n\n");
#endif #endif
(void)fprintf(f,
"/* The following #include is present because without it gcc 4.x may remove\n"
"the array definition from the final binary if PCRE2 is built into a static\n"
"library and dead code stripping is activated. This leads to link errors.\n"
"Pulling in the header ensures that the array gets flagged as \"someone\n"
"outside this compilation unit might reference this\" and so it will always\n"
"be supplied to the linker. */\n\n");
(void)fprintf(f, (void)fprintf(f,
"#ifdef HAVE_CONFIG_H\n" "#ifdef HAVE_CONFIG_H\n"
"#include \"config.h\"\n" "#include \"config.h\"\n"
@@ -269,7 +263,7 @@ for (i = 0; i < cbit_length; i++)
" 0x%02x letter\n" " 0x%02x letter\n"
" 0x%02x lower case letter\n" " 0x%02x lower case letter\n"
" 0x%02x decimal digit\n" " 0x%02x decimal digit\n"
" 0x%02x alphanumeric or '_'\n*/\n\n", " 0x%02x word (alphanumeric or '_')\n*/\n\n",
ctype_space, ctype_letter, ctype_lcletter, ctype_digit, ctype_word); ctype_space, ctype_letter, ctype_lcletter, ctype_digit, ctype_word);
(void)fprintf(f, " "); (void)fprintf(f, " ");

View File

@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge Original API code Copyright (c) 1997-2012 University of Cambridge
New API code Copyright (c) 2016-2021 University of Cambridge New API code Copyright (c) 2016-2023 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@@ -82,7 +82,7 @@ static const unsigned char compile_error_texts[] =
"missing closing parenthesis\0" "missing closing parenthesis\0"
/* 15 */ /* 15 */
"reference to non-existent subpattern\0" "reference to non-existent subpattern\0"
"pattern passed as NULL\0" "pattern passed as NULL with non-zero length\0"
"unrecognised compile-time option bit(s)\0" "unrecognised compile-time option bit(s)\0"
"missing ) after (?# comment\0" "missing ) after (?# comment\0"
"parentheses are too deeply nested\0" "parentheses are too deeply nested\0"
@@ -93,7 +93,7 @@ static const unsigned char compile_error_texts[] =
"internal error: code overflow\0" "internal error: code overflow\0"
"missing closing parenthesis for condition\0" "missing closing parenthesis for condition\0"
/* 25 */ /* 25 */
"lookbehind assertion is not fixed length\0" "length of lookbehind assertion is not limited\0"
"a relative value of zero is not allowed\0" "a relative value of zero is not allowed\0"
"conditional subpattern contains more than two branches\0" "conditional subpattern contains more than two branches\0"
"assertion expected after (?( or (?(?C)\0" "assertion expected after (?( or (?(?C)\0"
@@ -187,6 +187,8 @@ static const unsigned char compile_error_texts[] =
"too many capturing groups (maximum 65535)\0" "too many capturing groups (maximum 65535)\0"
"atomic assertion expected after (?( or (?(?C)\0" "atomic assertion expected after (?( or (?(?C)\0"
"\\K is not allowed in lookarounds (but see PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK)\0" "\\K is not allowed in lookarounds (but see PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK)\0"
/* 100 */
"branch too long in variable-length lookbehind assertion\0"
; ;
/* Match-time and UTF error texts are in the same format. */ /* Match-time and UTF error texts are in the same format. */
@@ -272,6 +274,7 @@ static const unsigned char match_error_texts[] =
/* 65 */ /* 65 */
"internal error - duplicate substitution match\0" "internal error - duplicate substitution match\0"
"PCRE2_MATCH_INVALID_UTF is not supported for DFA matching\0" "PCRE2_MATCH_INVALID_UTF is not supported for DFA matching\0"
"INTERNAL ERROR: invalid substring offset\0"
; ;

View File

@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge Original API code Copyright (c) 1997-2012 University of Cambridge
New API code Copyright (c) 2016-2018 University of Cambridge New API code Copyright (c) 2016-2023 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,9 @@ POSSIBILITY OF SUCH DAMAGE.
/* This module contains a single function that scans through a compiled pattern /* This module contains a single function that scans through a compiled pattern
until it finds a capturing bracket with the given number, or, if the number is until it finds a capturing bracket with the given number, or, if the number is
negative, an instance of OP_REVERSE for a lookbehind. The function is called negative, an instance of OP_REVERSE or OP_VREVERSE for a lookbehind. The
from pcre2_compile.c and also from pcre2_study.c when finding the minimum function is called from pcre2_compile.c and also from pcre2_study.c when
matching length. */ finding the minimum matching length. */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
@@ -85,7 +85,7 @@ for (;;)
/* Handle lookbehind */ /* Handle lookbehind */
else if (c == OP_REVERSE) else if (c == OP_REVERSE || c == OP_VREVERSE)
{ {
if (number < 0) return (PCRE2_UCHAR *)code; if (number < 0) return (PCRE2_UCHAR *)code;
code += PRIV(OP_lengths)[c]; code += PRIV(OP_lengths)[c];

View File

@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge Original API code Copyright (c) 1997-2012 University of Cambridge
New API code Copyright (c) 2016-2022 University of Cambridge New API code Copyright (c) 2016-2023 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@@ -51,6 +51,24 @@ pcre2test.c with CODE_UNIT_WIDTH == 0. */
#error The use of both EBCDIC and SUPPORT_UNICODE is not supported. #error The use of both EBCDIC and SUPPORT_UNICODE is not supported.
#endif #endif
/* When compiling one of the libraries, the value of PCRE2_CODE_UNIT_WIDTH must
be 8, 16, or 32. AutoTools and CMake ensure that this is always the case, but
other other building methods may not, so here is a check. It is cut out when
building pcre2test, bcause that sets the value to zero. No other source should
be including this file. There is no explicit way of forcing a compile to be
abandoned, but trying to include a non-existent file seems cleanest. Otherwise
there will be many irrelevant consequential errors. */
#if (!defined PCRE2_BUILDING_PCRE2TEST && !defined PCRE2_DFTABLES) && \
(!defined PCRE2_CODE_UNIT_WIDTH || \
(PCRE2_CODE_UNIT_WIDTH != 8 && \
PCRE2_CODE_UNIT_WIDTH != 16 && \
PCRE2_CODE_UNIT_WIDTH != 32))
#error PCRE2_CODE_UNIT_WIDTH must be defined as 8, 16, or 32.
#include <AbandonCompile>
#endif
/* Standard C headers */ /* Standard C headers */
#include <ctype.h> #include <ctype.h>
@@ -119,20 +137,20 @@ only if it is not already set. */
#ifndef PCRE2_EXP_DECL #ifndef PCRE2_EXP_DECL
# ifdef _WIN32 # ifdef _WIN32
# ifndef PCRE2_STATIC # ifndef PCRE2_STATIC
# define PCRE2_EXP_DECL extern __declspec(dllexport) # define PCRE2_EXP_DECL extern __declspec(dllexport)
# define PCRE2_EXP_DEFN __declspec(dllexport) # define PCRE2_EXP_DEFN __declspec(dllexport)
# else # else
# define PCRE2_EXP_DECL extern # define PCRE2_EXP_DECL extern PCRE2_EXPORT
# define PCRE2_EXP_DEFN # define PCRE2_EXP_DEFN
# endif # endif
# else # else
# ifdef __cplusplus # ifdef __cplusplus
# define PCRE2_EXP_DECL extern "C" # define PCRE2_EXP_DECL extern "C" PCRE2_EXPORT
# else # else
# define PCRE2_EXP_DECL extern # define PCRE2_EXP_DECL extern PCRE2_EXPORT
# endif # endif
# ifndef PCRE2_EXP_DEFN # ifndef PCRE2_EXP_DEFN
# define PCRE2_EXP_DEFN PCRE2_EXP_DECL # define PCRE2_EXP_DEFN PCRE2_EXP_DECL
# endif # endif
# endif # endif
#endif #endif
@@ -156,8 +174,8 @@ pcre2_match() because of the way it backtracks. */
#define PCRE2_SPTR CUSTOM_SUBJECT_PTR #define PCRE2_SPTR CUSTOM_SUBJECT_PTR
#endif #endif
/* When checking for integer overflow in pcre2_compile(), we need to handle /* When checking for integer overflow, we need to handle large integers.
large integers. If a 64-bit integer type is available, we can use that. If a 64-bit integer type is available, we can use that.
Otherwise we have to cast to double, which of course requires floating point Otherwise we have to cast to double, which of course requires floating point
arithmetic. Handle this by defining a macro for the appropriate type. */ arithmetic. Handle this by defining a macro for the appropriate type. */
@@ -1281,7 +1299,7 @@ match. */
#define PT_ALNUM 6 /* Alphanumeric - the union of L and N */ #define PT_ALNUM 6 /* Alphanumeric - the union of L and N */
#define PT_SPACE 7 /* Perl space - general category Z plus 9,10,12,13 */ #define PT_SPACE 7 /* Perl space - general category Z plus 9,10,12,13 */
#define PT_PXSPACE 8 /* POSIX space - Z plus 9,10,11,12,13 */ #define PT_PXSPACE 8 /* POSIX space - Z plus 9,10,11,12,13 */
#define PT_WORD 9 /* Word - L plus N plus underscore */ #define PT_WORD 9 /* Word - L, N, Mn, or Pc */
#define PT_CLIST 10 /* Pseudo-property: match character list */ #define PT_CLIST 10 /* Pseudo-property: match character list */
#define PT_UCNC 11 /* Universal Character nameable character */ #define PT_UCNC 11 /* Universal Character nameable character */
#define PT_BIDICL 12 /* Specified bidi class */ #define PT_BIDICL 12 /* Specified bidi class */
@@ -1297,6 +1315,7 @@ table. */
#define PT_PXGRAPH 14 /* [:graph:] - characters that mark the paper */ #define PT_PXGRAPH 14 /* [:graph:] - characters that mark the paper */
#define PT_PXPRINT 15 /* [:print:] - [:graph:] plus non-control spaces */ #define PT_PXPRINT 15 /* [:print:] - [:graph:] plus non-control spaces */
#define PT_PXPUNCT 16 /* [:punct:] - punctuation characters */ #define PT_PXPUNCT 16 /* [:punct:] - punctuation characters */
#define PT_PXXDIGIT 17 /* [:xdigit:] - hex digits */
/* This value is used when parsing \p and \P escapes to indicate that neither /* This value is used when parsing \p and \P escapes to indicate that neither
\p{script:...} nor \p{scx:...} has been encountered. */ \p{script:...} nor \p{scx:...} has been encountered. */
@@ -1327,6 +1346,12 @@ mode rather than an escape sequence. It is also used for [^] in JavaScript
compatibility mode, and for \C in non-utf mode. In non-DOTALL mode, "." behaves compatibility mode, and for \C in non-utf mode. In non-DOTALL mode, "." behaves
like \N. like \N.
ESC_ub is a special return from check_escape() when, in BSUX mode, \u{ is not
followed by hex digits and }, in which case it should mean a literal "u"
followed by a literal "{". This hack is necessary for cases like \u{ 12}
because without it, this is interpreted as u{12} now that spaces are allowed in
quantifiers.
Negative numbers are used to encode a backreference (\1, \2, \3, etc.) in Negative numbers are used to encode a backreference (\1, \2, \3, etc.) in
check_escape(). There are tests in the code for an escape greater than ESC_b check_escape(). There are tests in the code for an escape greater than ESC_b
and less than ESC_Z to detect the types that may be repeated. These are the and less than ESC_Z to detect the types that may be repeated. These are the
@@ -1336,7 +1361,7 @@ consume a character, that code will have to change. */
enum { ESC_A = 1, ESC_G, ESC_K, ESC_B, ESC_b, ESC_D, ESC_d, ESC_S, ESC_s, enum { ESC_A = 1, ESC_G, ESC_K, ESC_B, ESC_b, ESC_D, ESC_d, ESC_S, ESC_s,
ESC_W, ESC_w, ESC_N, ESC_dum, ESC_C, ESC_P, ESC_p, ESC_R, ESC_H, ESC_W, ESC_w, ESC_N, ESC_dum, ESC_C, ESC_P, ESC_p, ESC_R, ESC_H,
ESC_h, ESC_V, ESC_v, ESC_X, ESC_Z, ESC_z, ESC_h, ESC_V, ESC_v, ESC_X, ESC_Z, ESC_z,
ESC_E, ESC_Q, ESC_g, ESC_k }; ESC_E, ESC_Q, ESC_g, ESC_k, ESC_ub };
/********************** Opcode definitions ******************/ /********************** Opcode definitions ******************/
@@ -1372,8 +1397,8 @@ enum {
OP_SOD, /* 1 Start of data: \A */ OP_SOD, /* 1 Start of data: \A */
OP_SOM, /* 2 Start of match (subject + offset): \G */ OP_SOM, /* 2 Start of match (subject + offset): \G */
OP_SET_SOM, /* 3 Set start of match (\K) */ OP_SET_SOM, /* 3 Set start of match (\K) */
OP_NOT_WORD_BOUNDARY, /* 4 \B */ OP_NOT_WORD_BOUNDARY, /* 4 \B -- see also OP_NOT_UCP_WORD_BOUNDARY */
OP_WORD_BOUNDARY, /* 5 \b */ OP_WORD_BOUNDARY, /* 5 \b -- see also OP_UCP_WORD_BOUNDARY */
OP_NOT_DIGIT, /* 6 \D */ OP_NOT_DIGIT, /* 6 \D */
OP_DIGIT, /* 7 \d */ OP_DIGIT, /* 7 \d */
OP_NOT_WHITESPACE, /* 8 \S */ OP_NOT_WHITESPACE, /* 8 \S */
@@ -1547,78 +1572,85 @@ enum {
/* The assertions must come before BRA, CBRA, ONCE, and COND. */ /* The assertions must come before BRA, CBRA, ONCE, and COND. */
OP_REVERSE, /* 125 Move pointer back - used in lookbehind assertions */ OP_REVERSE, /* 125 Move pointer back - used in lookbehind assertions */
OP_ASSERT, /* 126 Positive lookahead */ OP_VREVERSE, /* 126 Move pointer back - variable */
OP_ASSERT_NOT, /* 127 Negative lookahead */ OP_ASSERT, /* 127 Positive lookahead */
OP_ASSERTBACK, /* 128 Positive lookbehind */ OP_ASSERT_NOT, /* 128 Negative lookahead */
OP_ASSERTBACK_NOT, /* 129 Negative lookbehind */ OP_ASSERTBACK, /* 129 Positive lookbehind */
OP_ASSERT_NA, /* 130 Positive non-atomic lookahead */ OP_ASSERTBACK_NOT, /* 130 Negative lookbehind */
OP_ASSERTBACK_NA, /* 131 Positive non-atomic lookbehind */ OP_ASSERT_NA, /* 131 Positive non-atomic lookahead */
OP_ASSERTBACK_NA, /* 132 Positive non-atomic lookbehind */
/* ONCE, SCRIPT_RUN, BRA, BRAPOS, CBRA, CBRAPOS, and COND must come /* ONCE, SCRIPT_RUN, BRA, BRAPOS, CBRA, CBRAPOS, and COND must come
immediately after the assertions, with ONCE first, as there's a test for >= immediately after the assertions, with ONCE first, as there's a test for >=
ONCE for a subpattern that isn't an assertion. The POS versions must ONCE for a subpattern that isn't an assertion. The POS versions must
immediately follow the non-POS versions in each case. */ immediately follow the non-POS versions in each case. */
OP_ONCE, /* 132 Atomic group, contains captures */ OP_ONCE, /* 133 Atomic group, contains captures */
OP_SCRIPT_RUN, /* 133 Non-capture, but check characters' scripts */ OP_SCRIPT_RUN, /* 134 Non-capture, but check characters' scripts */
OP_BRA, /* 134 Start of non-capturing bracket */ OP_BRA, /* 135 Start of non-capturing bracket */
OP_BRAPOS, /* 135 Ditto, with unlimited, possessive repeat */ OP_BRAPOS, /* 136 Ditto, with unlimited, possessive repeat */
OP_CBRA, /* 136 Start of capturing bracket */ OP_CBRA, /* 137 Start of capturing bracket */
OP_CBRAPOS, /* 137 Ditto, with unlimited, possessive repeat */ OP_CBRAPOS, /* 138 Ditto, with unlimited, possessive repeat */
OP_COND, /* 138 Conditional group */ OP_COND, /* 139 Conditional group */
/* These five must follow the previous five, in the same order. There's a /* These five must follow the previous five, in the same order. There's a
check for >= SBRA to distinguish the two sets. */ check for >= SBRA to distinguish the two sets. */
OP_SBRA, /* 139 Start of non-capturing bracket, check empty */ OP_SBRA, /* 140 Start of non-capturing bracket, check empty */
OP_SBRAPOS, /* 149 Ditto, with unlimited, possessive repeat */ OP_SBRAPOS, /* 141 Ditto, with unlimited, possessive repeat */
OP_SCBRA, /* 141 Start of capturing bracket, check empty */ OP_SCBRA, /* 142 Start of capturing bracket, check empty */
OP_SCBRAPOS, /* 142 Ditto, with unlimited, possessive repeat */ OP_SCBRAPOS, /* 143 Ditto, with unlimited, possessive repeat */
OP_SCOND, /* 143 Conditional group, check empty */ OP_SCOND, /* 144 Conditional group, check empty */
/* The next two pairs must (respectively) be kept together. */ /* The next two pairs must (respectively) be kept together. */
OP_CREF, /* 144 Used to hold a capture number as condition */ OP_CREF, /* 145 Used to hold a capture number as condition */
OP_DNCREF, /* 145 Used to point to duplicate names as a condition */ OP_DNCREF, /* 146 Used to point to duplicate names as a condition */
OP_RREF, /* 146 Used to hold a recursion number as condition */ OP_RREF, /* 147 Used to hold a recursion number as condition */
OP_DNRREF, /* 147 Used to point to duplicate names as a condition */ OP_DNRREF, /* 148 Used to point to duplicate names as a condition */
OP_FALSE, /* 148 Always false (used by DEFINE and VERSION) */ OP_FALSE, /* 149 Always false (used by DEFINE and VERSION) */
OP_TRUE, /* 149 Always true (used by VERSION) */ OP_TRUE, /* 150 Always true (used by VERSION) */
OP_BRAZERO, /* 150 These two must remain together and in this */ OP_BRAZERO, /* 151 These two must remain together and in this */
OP_BRAMINZERO, /* 151 order. */ OP_BRAMINZERO, /* 152 order. */
OP_BRAPOSZERO, /* 152 */ OP_BRAPOSZERO, /* 153 */
/* These are backtracking control verbs */ /* These are backtracking control verbs */
OP_MARK, /* 153 always has an argument */ OP_MARK, /* 154 always has an argument */
OP_PRUNE, /* 154 */ OP_PRUNE, /* 155 */
OP_PRUNE_ARG, /* 155 same, but with argument */ OP_PRUNE_ARG, /* 156 same, but with argument */
OP_SKIP, /* 156 */ OP_SKIP, /* 157 */
OP_SKIP_ARG, /* 157 same, but with argument */ OP_SKIP_ARG, /* 158 same, but with argument */
OP_THEN, /* 158 */ OP_THEN, /* 159 */
OP_THEN_ARG, /* 159 same, but with argument */ OP_THEN_ARG, /* 160 same, but with argument */
OP_COMMIT, /* 160 */ OP_COMMIT, /* 161 */
OP_COMMIT_ARG, /* 161 same, but with argument */ OP_COMMIT_ARG, /* 162 same, but with argument */
/* These are forced failure and success verbs. FAIL and ACCEPT do accept an /* These are forced failure and success verbs. FAIL and ACCEPT do accept an
argument, but these cases can be compiled as, for example, (*MARK:X)(*FAIL) argument, but these cases can be compiled as, for example, (*MARK:X)(*FAIL)
without the need for a special opcode. */ without the need for a special opcode. */
OP_FAIL, /* 162 */ OP_FAIL, /* 163 */
OP_ACCEPT, /* 163 */ OP_ACCEPT, /* 164 */
OP_ASSERT_ACCEPT, /* 164 Used inside assertions */ OP_ASSERT_ACCEPT, /* 165 Used inside assertions */
OP_CLOSE, /* 165 Used before OP_ACCEPT to close open captures */ OP_CLOSE, /* 166 Used before OP_ACCEPT to close open captures */
/* This is used to skip a subpattern with a {0} quantifier */ /* This is used to skip a subpattern with a {0} quantifier */
OP_SKIPZERO, /* 166 */ OP_SKIPZERO, /* 167 */
/* This is used to identify a DEFINE group during compilation so that it can /* This is used to identify a DEFINE group during compilation so that it can
be checked for having only one branch. It is changed to OP_FALSE before be checked for having only one branch. It is changed to OP_FALSE before
compilation finishes. */ compilation finishes. */
OP_DEFINE, /* 167 */ OP_DEFINE, /* 168 */
/* These opcodes replace their normal counterparts in UCP mode when
PCRE2_EXTRA_ASCII_BSW is not set. */
OP_NOT_UCP_WORD_BOUNDARY, /* 169 */
OP_UCP_WORD_BOUNDARY, /* 170 */
/* This is not an opcode, but is used to check that tables indexed by opcode /* This is not an opcode, but is used to check that tables indexed by opcode
are the correct length, in order to catch updating errors - there have been are the correct length, in order to catch updating errors - there have been
@@ -1664,7 +1696,7 @@ some cases doesn't actually use these names at all). */
"class", "nclass", "xclass", "Ref", "Refi", "DnRef", "DnRefi", \ "class", "nclass", "xclass", "Ref", "Refi", "DnRef", "DnRefi", \
"Recurse", "Callout", "CalloutStr", \ "Recurse", "Callout", "CalloutStr", \
"Alt", "Ket", "KetRmax", "KetRmin", "KetRpos", \ "Alt", "Ket", "KetRmax", "KetRmin", "KetRpos", \
"Reverse", "Assert", "Assert not", \ "Reverse", "VReverse", "Assert", "Assert not", \
"Assert back", "Assert back not", \ "Assert back", "Assert back not", \
"Non-atomic assert", "Non-atomic assert back", \ "Non-atomic assert", "Non-atomic assert back", \
"Once", \ "Once", \
@@ -1679,7 +1711,7 @@ some cases doesn't actually use these names at all). */
"*MARK", "*PRUNE", "*PRUNE", "*SKIP", "*SKIP", \ "*MARK", "*PRUNE", "*PRUNE", "*SKIP", "*SKIP", \
"*THEN", "*THEN", "*COMMIT", "*COMMIT", "*FAIL", \ "*THEN", "*THEN", "*COMMIT", "*COMMIT", "*FAIL", \
"*ACCEPT", "*ASSERT_ACCEPT", \ "*ACCEPT", "*ASSERT_ACCEPT", \
"Close", "Skip zero", "Define" "Close", "Skip zero", "Define", "\\B (ucp)", "\\b (ucp)"
/* This macro defines the length of fixed length operations in the compiled /* This macro defines the length of fixed length operations in the compiled
@@ -1746,7 +1778,8 @@ in UTF-8 mode. The code that uses this table must know about such things. */
1+LINK_SIZE, /* KetRmax */ \ 1+LINK_SIZE, /* KetRmax */ \
1+LINK_SIZE, /* KetRmin */ \ 1+LINK_SIZE, /* KetRmin */ \
1+LINK_SIZE, /* KetRpos */ \ 1+LINK_SIZE, /* KetRpos */ \
1+LINK_SIZE, /* Reverse */ \ 1+IMM2_SIZE, /* Reverse */ \
1+2*IMM2_SIZE, /* VReverse */ \
1+LINK_SIZE, /* Assert */ \ 1+LINK_SIZE, /* Assert */ \
1+LINK_SIZE, /* Assert not */ \ 1+LINK_SIZE, /* Assert not */ \
1+LINK_SIZE, /* Assert behind */ \ 1+LINK_SIZE, /* Assert behind */ \
@@ -1775,7 +1808,8 @@ in UTF-8 mode. The code that uses this table must know about such things. */
1, 3, /* COMMIT, COMMIT_ARG */ \ 1, 3, /* COMMIT, COMMIT_ARG */ \
1, 1, 1, /* FAIL, ACCEPT, ASSERT_ACCEPT */ \ 1, 1, 1, /* FAIL, ACCEPT, ASSERT_ACCEPT */ \
1+IMM2_SIZE, 1, /* CLOSE, SKIPZERO */ \ 1+IMM2_SIZE, 1, /* CLOSE, SKIPZERO */ \
1 /* DEFINE */ 1, /* DEFINE */ \
1, 1 /* \B and \b in UCP mode */
/* A magic value for OP_RREF to indicate the "any recursion" condition. */ /* A magic value for OP_RREF to indicate the "any recursion" condition. */
@@ -2042,6 +2076,9 @@ extern void * _pcre2_memmove(void *, const void *, size_t);
#endif #endif
#endif /* PCRE2_CODE_UNIT_WIDTH */ #endif /* PCRE2_CODE_UNIT_WIDTH */
extern BOOL PRIV(ckd_smul)(PCRE2_SIZE *, int, int);
#endif /* PCRE2_INTERNAL_H_IDEMPOTENT_GUARD */ #endif /* PCRE2_INTERNAL_H_IDEMPOTENT_GUARD */
/* End of pcre2_internal.h */ /* End of pcre2_internal.h */

View File

@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge Original API code Copyright (c) 1997-2012 University of Cambridge
New API code Copyright (c) 2016-2022 University of Cambridge New API code Copyright (c) 2016-2023 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@@ -572,6 +572,7 @@ typedef struct pcre2_real_compile_context {
uint16_t newline_convention; uint16_t newline_convention;
uint32_t parens_nest_limit; uint32_t parens_nest_limit;
uint32_t extra_options; uint32_t extra_options;
uint32_t max_varlookbehind;
} pcre2_real_compile_context; } pcre2_real_compile_context;
/* The real match context structure. */ /* The real match context structure. */
@@ -605,12 +606,12 @@ defined specially because it is required in pcre2_serialize_decode() when
copying the size from possibly unaligned memory into a variable of the same copying the size from possibly unaligned memory into a variable of the same
type. Use a macro rather than a typedef to avoid compiler warnings when this type. Use a macro rather than a typedef to avoid compiler warnings when this
file is included multiple times by pcre2test. LOOKBEHIND_MAX specifies the file is included multiple times by pcre2test. LOOKBEHIND_MAX specifies the
largest lookbehind that is supported. (OP_REVERSE in a pattern has a 16-bit largest lookbehind that is supported. (OP_REVERSE and OP_VREVERSE in a pattern
argument in 8-bit and 16-bit modes, so we need no more than a 16-bit field have 16-bit arguments in 8-bit and 16-bit modes, so we need no more than a
here.) */ 16-bit field here.) */
#undef CODE_BLOCKSIZE_TYPE #undef CODE_BLOCKSIZE_TYPE
#define CODE_BLOCKSIZE_TYPE size_t #define CODE_BLOCKSIZE_TYPE PCRE2_SIZE
#undef LOOKBEHIND_MAX #undef LOOKBEHIND_MAX
#define LOOKBEHIND_MAX UINT16_MAX #define LOOKBEHIND_MAX UINT16_MAX
@@ -658,6 +659,7 @@ typedef struct pcre2_real_match_data {
PCRE2_SPTR mark; /* Pointer to last mark */ PCRE2_SPTR mark; /* Pointer to last mark */
struct heapframe *heapframes; /* Backtracking frames heap memory */ struct heapframe *heapframes; /* Backtracking frames heap memory */
PCRE2_SIZE heapframes_size; /* Malloc-ed size */ PCRE2_SIZE heapframes_size; /* Malloc-ed size */
PCRE2_SIZE subject_length; /* Subject length */
PCRE2_SIZE leftchar; /* Offset to leftmost code unit */ PCRE2_SIZE leftchar; /* Offset to leftmost code unit */
PCRE2_SIZE rightchar; /* Offset to rightmost code unit */ PCRE2_SIZE rightchar; /* Offset to rightmost code unit */
PCRE2_SIZE startchar; /* Offset to starting code unit */ PCRE2_SIZE startchar; /* Offset to starting code unit */
@@ -675,8 +677,8 @@ typedef struct pcre2_real_match_data {
#ifndef PCRE2_PCRE2TEST #ifndef PCRE2_PCRE2TEST
/* Structures for checking for mutual recursion when scanning compiled or /* Structures for checking for mutual function recursion when scanning compiled
parsed code. */ or parsed code. */
typedef struct recurse_check { typedef struct recurse_check {
struct recurse_check *prev; struct recurse_check *prev;
@@ -688,7 +690,7 @@ typedef struct parsed_recurse_check {
uint32_t *groupptr; uint32_t *groupptr;
} parsed_recurse_check; } parsed_recurse_check;
/* Structure for building a cache when filling in recursion offsets. */ /* Structure for building a cache when filling in pattern recursion offsets. */
typedef struct recurse_cache { typedef struct recurse_cache {
PCRE2_SPTR group; PCRE2_SPTR group;
@@ -734,7 +736,6 @@ typedef struct compile_block {
uint16_t name_entry_size; /* Size of each entry */ uint16_t name_entry_size; /* Size of each entry */
uint16_t parens_depth; /* Depth of nested parentheses */ uint16_t parens_depth; /* Depth of nested parentheses */
uint16_t assert_depth; /* Depth of nested assertions */ uint16_t assert_depth; /* Depth of nested assertions */
open_capitem *open_caps; /* Chain of open capture items */
named_group *named_groups; /* Points to vector in pre-compile */ named_group *named_groups; /* Points to vector in pre-compile */
uint32_t named_group_list_size; /* Number of entries in the list */ uint32_t named_group_list_size; /* Number of entries in the list */
uint32_t external_options; /* External (initial) options */ uint32_t external_options; /* External (initial) options */
@@ -752,10 +753,11 @@ typedef struct compile_block {
uint32_t class_range_end; /* Overall class range end */ uint32_t class_range_end; /* Overall class range end */
PCRE2_UCHAR nl[4]; /* Newline string when fixed length */ PCRE2_UCHAR nl[4]; /* Newline string when fixed length */
uint32_t req_varyopt; /* "After variable item" flag for reqbyte */ uint32_t req_varyopt; /* "After variable item" flag for reqbyte */
int max_lookbehind; /* Maximum lookbehind (characters) */ uint32_t max_varlookbehind; /* Limit for variable lookbehinds */
int max_lookbehind; /* Maximum lookbehind encountered (characters) */
BOOL had_accept; /* (*ACCEPT) encountered */ BOOL had_accept; /* (*ACCEPT) encountered */
BOOL had_pruneorskip; /* (*PRUNE) or (*SKIP) encountered */ BOOL had_pruneorskip; /* (*PRUNE) or (*SKIP) encountered */
BOOL had_recurse; /* Had a recursion or subroutine call */ BOOL had_recurse; /* Had a pattern recursion or subroutine call */
BOOL dupnames; /* Duplicate names exist */ BOOL dupnames; /* Duplicate names exist */
} compile_block; } compile_block;
@@ -773,6 +775,7 @@ call within the pattern when running pcre2_dfa_match(). */
typedef struct dfa_recursion_info { typedef struct dfa_recursion_info {
struct dfa_recursion_info *prevrec; struct dfa_recursion_info *prevrec;
PCRE2_SPTR subject_position; PCRE2_SPTR subject_position;
PCRE2_SPTR last_used_ptr;
uint32_t group_num; uint32_t group_num;
} dfa_recursion_info; } dfa_recursion_info;
@@ -793,7 +796,7 @@ typedef struct heapframe {
PCRE2_SIZE length; /* Used for character, string, or code lengths */ PCRE2_SIZE length; /* Used for character, string, or code lengths */
PCRE2_SIZE back_frame; /* Amount to subtract on RRETURN */ PCRE2_SIZE back_frame; /* Amount to subtract on RRETURN */
PCRE2_SIZE temp_size; /* Used for short-term PCRE2_SIZE values */ PCRE2_SIZE temp_size; /* Used for short-term PCRE2_SIZE values */
uint32_t rdepth; /* "Recursion" depth */ uint32_t rdepth; /* Function "recursion" depth within pcre2_match() */
uint32_t group_frame_type; /* Type information for group frames */ uint32_t group_frame_type; /* Type information for group frames */
uint32_t temp_32[4]; /* Used for short-term 32-bit or BOOL values */ uint32_t temp_32[4]; /* Used for short-term 32-bit or BOOL values */
uint8_t return_id; /* Where to go on in internal "return" */ uint8_t return_id; /* Where to go on in internal "return" */
@@ -826,14 +829,15 @@ typedef struct heapframe {
allows for exactly the right size ovector for the number of capturing allows for exactly the right size ovector for the number of capturing
parentheses. (See also the comment for pcre2_real_match_data above.) */ parentheses. (See also the comment for pcre2_real_match_data above.) */
PCRE2_SPTR eptr; /* MUST BE FIRST */ PCRE2_SPTR eptr; /* MUST BE FIRST */
PCRE2_SPTR start_match; /* Can be adjusted by \K */ PCRE2_SPTR start_match; /* Can be adjusted by \K */
PCRE2_SPTR mark; /* Most recent mark on the success path */ PCRE2_SPTR mark; /* Most recent mark on the success path */
uint32_t current_recurse; /* Current (deepest) recursion number */ PCRE2_SPTR recurse_last_used; /* Last character used at time of pattern recursion */
uint32_t capture_last; /* Most recent capture */ uint32_t current_recurse; /* Group number of current (deepest) pattern recursion */
PCRE2_SIZE last_group_offset; /* Saved offset to most recent group frame */ uint32_t capture_last; /* Most recent capture */
PCRE2_SIZE offset_top; /* Offset after highest capture */ PCRE2_SIZE last_group_offset; /* Saved offset to most recent group frame */
PCRE2_SIZE ovector[131072]; /* Must be last in the structure */ PCRE2_SIZE offset_top; /* Offset after highest capture */
PCRE2_SIZE ovector[131072]; /* Must be last in the structure */
} heapframe; } heapframe;
/* This typedef is a check that the size of the heapframe structure is a /* This typedef is a check that the size of the heapframe structure is a
@@ -858,7 +862,7 @@ doing traditional NFA matching (pcre2_match() and friends). */
typedef struct match_block { typedef struct match_block {
pcre2_memctl memctl; /* For general use */ pcre2_memctl memctl; /* For general use */
PCRE2_SIZE heap_limit; /* As it says */ uint32_t heap_limit; /* As it says */
uint32_t match_limit; /* As it says */ uint32_t match_limit; /* As it says */
uint32_t match_limit_depth; /* As it says */ uint32_t match_limit_depth; /* As it says */
uint32_t match_call_count; /* Number of times a new frame is created */ uint32_t match_call_count; /* Number of times a new frame is created */
@@ -875,10 +879,11 @@ typedef struct match_block {
uint16_t name_count; /* Number of names in name table */ uint16_t name_count; /* Number of names in name table */
uint16_t name_entry_size; /* Size of entry in names table */ uint16_t name_entry_size; /* Size of entry in names table */
PCRE2_SPTR name_table; /* Table of group names */ PCRE2_SPTR name_table; /* Table of group names */
PCRE2_SPTR start_code; /* For use when recursing */ PCRE2_SPTR start_code; /* For use in pattern recursion */
PCRE2_SPTR start_subject; /* Start of the subject string */ PCRE2_SPTR start_subject; /* Start of the subject string */
PCRE2_SPTR check_subject; /* Where UTF-checked from */ PCRE2_SPTR check_subject; /* Where UTF-checked from */
PCRE2_SPTR end_subject; /* End of the subject string */ PCRE2_SPTR end_subject; /* Usable end of the subject string */
PCRE2_SPTR true_end_subject; /* Actual end of the subject string */
PCRE2_SPTR end_match_ptr; /* Subject position at end match */ PCRE2_SPTR end_match_ptr; /* Subject position at end match */
PCRE2_SPTR start_used_ptr; /* Earliest consulted character */ PCRE2_SPTR start_used_ptr; /* Earliest consulted character */
PCRE2_SPTR last_used_ptr; /* Latest consulted character */ PCRE2_SPTR last_used_ptr; /* Latest consulted character */
@@ -886,7 +891,7 @@ typedef struct match_block {
PCRE2_SPTR nomatch_mark; /* Mark pointer to pass back on failure */ PCRE2_SPTR nomatch_mark; /* Mark pointer to pass back on failure */
PCRE2_SPTR verb_ecode_ptr; /* For passing back info */ PCRE2_SPTR verb_ecode_ptr; /* For passing back info */
PCRE2_SPTR verb_skip_ptr; /* For passing back a (*SKIP) name */ PCRE2_SPTR verb_skip_ptr; /* For passing back a (*SKIP) name */
uint32_t verb_current_recurse; /* Current recurse when (*VERB) happens */ uint32_t verb_current_recurse; /* Current recursion group when (*VERB) happens */
uint32_t moptions; /* Match options */ uint32_t moptions; /* Match options */
uint32_t poptions; /* Pattern options */ uint32_t poptions; /* Pattern options */
uint32_t skip_arg_count; /* For counting SKIP_ARGs */ uint32_t skip_arg_count; /* For counting SKIP_ARGs */
@@ -911,7 +916,7 @@ typedef struct dfa_match_block {
PCRE2_SPTR last_used_ptr; /* Latest consulted character */ PCRE2_SPTR last_used_ptr; /* Latest consulted character */
const uint8_t *tables; /* Character tables */ const uint8_t *tables; /* Character tables */
PCRE2_SIZE start_offset; /* The start offset value */ PCRE2_SIZE start_offset; /* The start offset value */
PCRE2_SIZE heap_limit; /* As it says */ uint32_t heap_limit; /* As it says */
PCRE2_SIZE heap_used; /* As it says */ PCRE2_SIZE heap_used; /* As it says */
uint32_t match_limit; /* As it says */ uint32_t match_limit; /* As it says */
uint32_t match_limit_depth; /* As it says */ uint32_t match_limit_depth; /* As it says */
@@ -926,7 +931,7 @@ typedef struct dfa_match_block {
pcre2_callout_block *cb; /* Points to a callout block */ pcre2_callout_block *cb; /* Points to a callout block */
void *callout_data; /* To pass back to callouts */ void *callout_data; /* To pass back to callouts */
int (*callout)(pcre2_callout_block *,void *); /* Callout function or NULL */ int (*callout)(pcre2_callout_block *,void *); /* Callout function or NULL */
dfa_recursion_info *recursive; /* Linked list of recursion data */ dfa_recursion_info *recursive; /* Linked list of pattern recursion data */
} dfa_match_block; } dfa_match_block;
#endif /* PCRE2_PCRE2TEST */ #endif /* PCRE2_PCRE2TEST */

File diff suppressed because it is too large Load Diff

View File

@@ -52,8 +52,6 @@ PCRE2_DFTABLES is defined. */
# include "pcre2_internal.h" # include "pcre2_internal.h"
#endif #endif
/************************************************* /*************************************************
* Create PCRE2 character tables * * Create PCRE2 character tables *
*************************************************/ *************************************************/
@@ -98,7 +96,11 @@ for (i = 0; i < 256; i++) *p++ = tolower(i);
/* Next the case-flipping table */ /* Next the case-flipping table */
for (i = 0; i < 256; i++) *p++ = islower(i)? toupper(i) : tolower(i); for (i = 0; i < 256; i++)
{
int c = islower(i)? toupper(i) : tolower(i);
*p++ = (c < 256)? c : i;
}
/* Then the character class tables. Don't try to be clever and save effort on /* Then the character class tables. Don't try to be clever and save effort on
exclusive ones - in some locales things may be different. exclusive ones - in some locales things may be different.

View File

@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge Original API code Copyright (c) 1997-2012 University of Cambridge
New API code Copyright (c) 2015-2022 University of Cambridge New API code Copyright (c) 2015-2024 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@@ -43,6 +43,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include "config.h" #include "config.h"
#endif #endif
#include "pcre2_internal.h"
/* These defines enable debugging code */ /* These defines enable debugging code */
/* #define DEBUG_FRAMES_DISPLAY */ /* #define DEBUG_FRAMES_DISPLAY */
@@ -53,6 +55,10 @@ POSSIBILITY OF SUCH DAMAGE.
#include <stdarg.h> #include <stdarg.h>
#endif #endif
#ifdef DEBUG_SHOW_OPS
static const char *OP_names[] = { OP_NAME_LIST };
#endif
/* These defines identify the name of the block containing "static" /* These defines identify the name of the block containing "static"
information, and fields within it. */ information, and fields within it. */
@@ -60,8 +66,6 @@ information, and fields within it. */
#define PSSTART start_subject /* Field containing processed string start */ #define PSSTART start_subject /* Field containing processed string start */
#define PSEND end_subject /* Field containing processed string end */ #define PSEND end_subject /* Field containing processed string end */
#include "pcre2_internal.h"
#define RECURSE_UNSET 0xffffffffu /* Bigger than max group number */ #define RECURSE_UNSET 0xffffffffu /* Bigger than max group number */
/* Masks for identifying the public options that are permitted at match time. */ /* Masks for identifying the public options that are permitted at match time. */
@@ -69,7 +73,8 @@ information, and fields within it. */
#define PUBLIC_MATCH_OPTIONS \ #define PUBLIC_MATCH_OPTIONS \
(PCRE2_ANCHORED|PCRE2_ENDANCHORED|PCRE2_NOTBOL|PCRE2_NOTEOL|PCRE2_NOTEMPTY| \ (PCRE2_ANCHORED|PCRE2_ENDANCHORED|PCRE2_NOTBOL|PCRE2_NOTEOL|PCRE2_NOTEMPTY| \
PCRE2_NOTEMPTY_ATSTART|PCRE2_NO_UTF_CHECK|PCRE2_PARTIAL_HARD| \ PCRE2_NOTEMPTY_ATSTART|PCRE2_NO_UTF_CHECK|PCRE2_PARTIAL_HARD| \
PCRE2_PARTIAL_SOFT|PCRE2_NO_JIT|PCRE2_COPY_MATCHED_SUBJECT) PCRE2_PARTIAL_SOFT|PCRE2_NO_JIT|PCRE2_COPY_MATCHED_SUBJECT| \
PCRE2_DISABLE_RECURSELOOP_CHECK)
#define PUBLIC_JIT_MATCH_OPTIONS \ #define PUBLIC_JIT_MATCH_OPTIONS \
(PCRE2_NO_UTF_CHECK|PCRE2_NOTBOL|PCRE2_NOTEOL|PCRE2_NOTEMPTY|\ (PCRE2_NO_UTF_CHECK|PCRE2_NOTBOL|PCRE2_NOTEOL|PCRE2_NOTEMPTY|\
@@ -150,7 +155,7 @@ changed, the code at RETURN_SWITCH below must be updated in sync. */
enum { RM1=1, RM2, RM3, RM4, RM5, RM6, RM7, RM8, RM9, RM10, enum { RM1=1, RM2, RM3, RM4, RM5, RM6, RM7, RM8, RM9, RM10,
RM11, RM12, RM13, RM14, RM15, RM16, RM17, RM18, RM19, RM20, RM11, RM12, RM13, RM14, RM15, RM16, RM17, RM18, RM19, RM20,
RM21, RM22, RM23, RM24, RM25, RM26, RM27, RM28, RM29, RM30, RM21, RM22, RM23, RM24, RM25, RM26, RM27, RM28, RM29, RM30,
RM31, RM32, RM33, RM34, RM35, RM36 }; RM31, RM32, RM33, RM34, RM35, RM36, RM37 };
#ifdef SUPPORT_WIDE_CHARS #ifdef SUPPORT_WIDE_CHARS
enum { RM100=100, RM101 }; enum { RM100=100, RM101 };
@@ -597,11 +602,12 @@ heapframe *P = NULL;
heapframe *frames_top; /* End of frames vector */ heapframe *frames_top; /* End of frames vector */
heapframe *assert_accept_frame = NULL; /* For passing back a frame with captures */ heapframe *assert_accept_frame = NULL; /* For passing back a frame with captures */
PCRE2_SIZE heapframes_size; /* Usable size of frames vector */
PCRE2_SIZE frame_copy_size; /* Amount to copy when creating a new frame */ PCRE2_SIZE frame_copy_size; /* Amount to copy when creating a new frame */
/* Local variables that do not need to be preserved over calls to RRMATCH(). */ /* Local variables that do not need to be preserved over calls to RRMATCH(). */
PCRE2_SPTR branch_end = NULL;
PCRE2_SPTR branch_start;
PCRE2_SPTR bracode; /* Temp pointer to start of group */ PCRE2_SPTR bracode; /* Temp pointer to start of group */
PCRE2_SIZE offset; /* Used for group offsets */ PCRE2_SIZE offset; /* Used for group offsets */
PCRE2_SIZE length; /* Used for various length calculations */ PCRE2_SIZE length; /* Used for various length calculations */
@@ -635,13 +641,10 @@ copied when a new frame is created. */
frame_copy_size = frame_size - offsetof(heapframe, eptr); frame_copy_size = frame_size - offsetof(heapframe, eptr);
/* Set up the first frame and the end of the frames vector. We set the local /* Set up the first frame and the end of the frames vector. */
heapframes_size to the usuable amount of the vector, that is, a whole number of
frames. */
F = match_data->heapframes; F = match_data->heapframes;
heapframes_size = (match_data->heapframes_size / frame_size) * frame_size; frames_top = (heapframe *)((char *)F + match_data->heapframes_size);
frames_top = (heapframe *)((char *)F + heapframes_size);
Frdepth = 0; /* "Recursion" depth */ Frdepth = 0; /* "Recursion" depth */
Fcapture_last = 0; /* Number of most recent capture */ Fcapture_last = 0; /* Number of most recent capture */
@@ -662,35 +665,54 @@ MATCH_RECURSE:
doubling the size, but constrained by the heap limit (which is in KiB). */ doubling the size, but constrained by the heap limit (which is in KiB). */
N = (heapframe *)((char *)F + frame_size); N = (heapframe *)((char *)F + frame_size);
if (N >= frames_top) if ((heapframe *)((char *)N + frame_size) >= frames_top)
{ {
heapframe *new; heapframe *new;
PCRE2_SIZE newsize = match_data->heapframes_size * 2; PCRE2_SIZE newsize;
PCRE2_SIZE usedsize = (char *)N - (char *)(match_data->heapframes);
if (newsize > mb->heap_limit) if (match_data->heapframes_size >= PCRE2_SIZE_MAX / 2)
{ {
PCRE2_SIZE maxsize = (mb->heap_limit/frame_size) * frame_size; if (match_data->heapframes_size == PCRE2_SIZE_MAX - 1)
if (match_data->heapframes_size >= maxsize) return PCRE2_ERROR_HEAPLIMIT; return PCRE2_ERROR_NOMEMORY;
newsize = maxsize; newsize = PCRE2_SIZE_MAX - 1;
}
else
newsize = match_data->heapframes_size * 2;
if (newsize / 1024 >= mb->heap_limit)
{
PCRE2_SIZE old_size = match_data->heapframes_size / 1024;
if (mb->heap_limit <= old_size)
return PCRE2_ERROR_HEAPLIMIT;
else
{
PCRE2_SIZE max_delta = 1024 * (mb->heap_limit - old_size);
int over_bytes = match_data->heapframes_size % 1024;
if (over_bytes) max_delta -= (1024 - over_bytes);
newsize = match_data->heapframes_size + max_delta;
}
} }
/* With a heap limit set, the permitted additional size may not be enough for
another frame, so do a final check. */
if (newsize - usedsize < frame_size) return PCRE2_ERROR_HEAPLIMIT;
new = match_data->memctl.malloc(newsize, match_data->memctl.memory_data); new = match_data->memctl.malloc(newsize, match_data->memctl.memory_data);
if (new == NULL) return PCRE2_ERROR_NOMEMORY; if (new == NULL) return PCRE2_ERROR_NOMEMORY;
memcpy(new, match_data->heapframes, heapframes_size); memcpy(new, match_data->heapframes, usedsize);
F = (heapframe *)((char *)new + ((char *)F - (char *)match_data->heapframes)); N = (heapframe *)((char *)new + usedsize);
N = (heapframe *)((char *)F + frame_size); F = (heapframe *)((char *)N - frame_size);
match_data->memctl.free(match_data->heapframes, match_data->memctl.memory_data); match_data->memctl.free(match_data->heapframes, match_data->memctl.memory_data);
match_data->heapframes = new; match_data->heapframes = new;
match_data->heapframes_size = newsize; match_data->heapframes_size = newsize;
frames_top = (heapframe *)((char *)new + newsize);
heapframes_size = (newsize / frame_size) * frame_size;
frames_top = (heapframe *)((char *)new + heapframes_size);
} }
#ifdef DEBUG_SHOW_RMATCH #ifdef DEBUG_SHOW_RMATCH
fprintf(stderr, "++ RMATCH %2d frame=%d", Freturn_id, Frdepth + 1); fprintf(stderr, "++ RMATCH %d frame=%d", Freturn_id, Frdepth + 1);
if (group_frame_type != 0) if (group_frame_type != 0)
{ {
fprintf(stderr, " type=%x ", group_frame_type); fprintf(stderr, " type=%x ", group_frame_type);
@@ -760,10 +782,16 @@ opcodes. */
if (mb->match_call_count++ >= mb->match_limit) return PCRE2_ERROR_MATCHLIMIT; if (mb->match_call_count++ >= mb->match_limit) return PCRE2_ERROR_MATCHLIMIT;
if (Frdepth >= mb->match_limit_depth) return PCRE2_ERROR_DEPTHLIMIT; if (Frdepth >= mb->match_limit_depth) return PCRE2_ERROR_DEPTHLIMIT;
#ifdef DEBUG_SHOW_OPS
fprintf(stderr, "\n++ New frame: type=0x%x subject offset %ld\n",
GF_IDMASK(Fgroup_frame_type), Feptr - mb->start_subject);
#endif
for (;;) for (;;)
{ {
#ifdef DEBUG_SHOW_OPS #ifdef DEBUG_SHOW_OPS
fprintf(stderr, "++ op=%d\n", *Fecode); fprintf(stderr, "++ %2ld op=%3d %s\n", Fecode - mb->start_code, *Fecode,
OP_names[*Fecode]);
#endif #endif
Fop = (uint8_t)(*Fecode); /* Cast needed for 16-bit and 32-bit modes */ Fop = (uint8_t)(*Fecode); /* Cast needed for 16-bit and 32-bit modes */
@@ -811,15 +839,16 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
assert_accept_frame = F; assert_accept_frame = F;
RRETURN(MATCH_ACCEPT); RRETURN(MATCH_ACCEPT);
/* If recursing, we have to find the most recent recursion. */ /* For ACCEPT within a recursion, we have to find the most recent
recursion. If not in a recursion, fall through to code that is common with
OP_END. */
case OP_ACCEPT: case OP_ACCEPT:
case OP_END:
/* Handle end of a recursion. */
if (Fcurrent_recurse != RECURSE_UNSET) if (Fcurrent_recurse != RECURSE_UNSET)
{ {
#ifdef DEBUG_SHOW_OPS
fprintf(stderr, "++ Accept within recursion\n");
#endif
offset = Flast_group_offset; offset = Flast_group_offset;
for(;;) for(;;)
{ {
@@ -842,27 +871,49 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
Fecode += 1 + LINK_SIZE; Fecode += 1 + LINK_SIZE;
continue; continue;
} }
/* Fall through */
/* Not a recursion. Fail for an empty string match if either PCRE2_NOTEMPTY /* OP_END itself can never be reached within a recursion because that is
is set, or if PCRE2_NOTEMPTY_ATSTART is set and we have matched at the picked up when the OP_KET that always precedes OP_END is reached. */
start of the subject. In both cases, backtracking will then try other
alternatives, if any. */ case OP_END:
/* Fail for an empty string match if either PCRE2_NOTEMPTY is set, or if
PCRE2_NOTEMPTY_ATSTART is set and we have matched at the start of the
subject. In both cases, backtracking will then try other alternatives, if
any. */
if (Feptr == Fstart_match && if (Feptr == Fstart_match &&
((mb->moptions & PCRE2_NOTEMPTY) != 0 || ((mb->moptions & PCRE2_NOTEMPTY) != 0 ||
((mb->moptions & PCRE2_NOTEMPTY_ATSTART) != 0 && ((mb->moptions & PCRE2_NOTEMPTY_ATSTART) != 0 &&
Fstart_match == mb->start_subject + mb->start_offset))) Fstart_match == mb->start_subject + mb->start_offset)))
{
#ifdef DEBUG_SHOW_OPS
fprintf(stderr, "++ Backtrack because empty string\n");
#endif
RRETURN(MATCH_NOMATCH); RRETURN(MATCH_NOMATCH);
}
/* Also fail if PCRE2_ENDANCHORED is set and the end of the match is not /* Fail if PCRE2_ENDANCHORED is set and the end of the match is not
the end of the subject. After (*ACCEPT) we fail the entire match (at this the end of the subject. After (*ACCEPT) we fail the entire match (at this
position) but backtrack on reaching the end of the pattern. */ position) but backtrack if we've reached the end of the pattern. This
applies whether or not we are in a recursion. */
if (Feptr < mb->end_subject && if (Feptr < mb->end_subject &&
((mb->moptions | mb->poptions) & PCRE2_ENDANCHORED) != 0) ((mb->moptions | mb->poptions) & PCRE2_ENDANCHORED) != 0)
{ {
if (Fop == OP_END) RRETURN(MATCH_NOMATCH); if (Fop == OP_END)
return MATCH_NOMATCH; {
#ifdef DEBUG_SHOW_OPS
fprintf(stderr, "++ Backtrack because not at end (endanchored set)\n");
#endif
RRETURN(MATCH_NOMATCH);
}
#ifdef DEBUG_SHOW_OPS
fprintf(stderr, "++ Failed ACCEPT not at end (endanchnored set)\n");
#endif
return MATCH_NOMATCH; /* (*ACCEPT) */
} }
/* We have a successful match of the whole pattern. Record the result and /* We have a successful match of the whole pattern. Record the result and
@@ -2435,6 +2486,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
GETCHARINCTEST(fc, Feptr); GETCHARINCTEST(fc, Feptr);
{ {
const uint32_t *cp; const uint32_t *cp;
uint32_t chartype;
const ucd_record *prop = GET_UCD(fc); const ucd_record *prop = GET_UCD(fc);
BOOL notmatch = Fop == OP_NOTPROP; BOOL notmatch = Fop == OP_NOTPROP;
@@ -2445,9 +2497,10 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
break; break;
case PT_LAMP: case PT_LAMP:
if ((prop->chartype == ucp_Lu || chartype = prop->chartype;
prop->chartype == ucp_Ll || if ((chartype == ucp_Lu ||
prop->chartype == ucp_Lt) == notmatch) chartype == ucp_Ll ||
chartype == ucp_Lt) == notmatch)
RRETURN(MATCH_NOMATCH); RRETURN(MATCH_NOMATCH);
break; break;
@@ -2477,8 +2530,9 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
/* These are specials */ /* These are specials */
case PT_ALNUM: case PT_ALNUM:
if ((PRIV(ucp_gentype)[prop->chartype] == ucp_L || chartype = prop->chartype;
PRIV(ucp_gentype)[prop->chartype] == ucp_N) == notmatch) if ((PRIV(ucp_gentype)[chartype] == ucp_L ||
PRIV(ucp_gentype)[chartype] == ucp_N) == notmatch)
RRETURN(MATCH_NOMATCH); RRETURN(MATCH_NOMATCH);
break; break;
@@ -2503,13 +2557,22 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
break; break;
case PT_WORD: case PT_WORD:
if ((PRIV(ucp_gentype)[prop->chartype] == ucp_L || chartype = prop->chartype;
PRIV(ucp_gentype)[prop->chartype] == ucp_N || if ((PRIV(ucp_gentype)[chartype] == ucp_L ||
fc == CHAR_UNDERSCORE) == notmatch) PRIV(ucp_gentype)[chartype] == ucp_N ||
chartype == ucp_Mn ||
chartype == ucp_Pc) == notmatch)
RRETURN(MATCH_NOMATCH); RRETURN(MATCH_NOMATCH);
break; break;
case PT_CLIST: case PT_CLIST:
#if PCRE2_CODE_UNIT_WIDTH == 32
if (fc > MAX_UTF_CODE_POINT)
{
if (notmatch) break;;
RRETURN(MATCH_NOMATCH);
}
#endif
cp = PRIV(ucd_caseless_sets) + Fecode[2]; cp = PRIV(ucd_caseless_sets) + Fecode[2];
for (;;) for (;;)
{ {
@@ -2805,16 +2868,17 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
case PT_WORD: case PT_WORD:
for (i = 1; i <= Lmin; i++) for (i = 1; i <= Lmin; i++)
{ {
int category; int chartype, category;
if (Feptr >= mb->end_subject) if (Feptr >= mb->end_subject)
{ {
SCHECK_PARTIAL(); SCHECK_PARTIAL();
RRETURN(MATCH_NOMATCH); RRETURN(MATCH_NOMATCH);
} }
GETCHARINCTEST(fc, Feptr); GETCHARINCTEST(fc, Feptr);
category = UCD_CATEGORY(fc); chartype = UCD_CHARTYPE(fc);
category = PRIV(ucp_gentype)[chartype];
if ((category == ucp_L || category == ucp_N || if ((category == ucp_L || category == ucp_N ||
fc == CHAR_UNDERSCORE) == notmatch) chartype == ucp_Mn || chartype == ucp_Pc) == notmatch)
RRETURN(MATCH_NOMATCH); RRETURN(MATCH_NOMATCH);
} }
break; break;
@@ -2829,6 +2893,13 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
RRETURN(MATCH_NOMATCH); RRETURN(MATCH_NOMATCH);
} }
GETCHARINCTEST(fc, Feptr); GETCHARINCTEST(fc, Feptr);
#if PCRE2_CODE_UNIT_WIDTH == 32
if (fc > MAX_UTF_CODE_POINT)
{
if (notmatch) continue;
RRETURN(MATCH_NOMATCH);
}
#endif
cp = PRIV(ucd_caseless_sets) + Lpropvalue; cp = PRIV(ucd_caseless_sets) + Lpropvalue;
for (;;) for (;;)
{ {
@@ -3609,7 +3680,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
case PT_WORD: case PT_WORD:
for (;;) for (;;)
{ {
int category; int chartype, category;
RMATCH(Fecode, RM215); RMATCH(Fecode, RM215);
if (rrc != MATCH_NOMATCH) RRETURN(rrc); if (rrc != MATCH_NOMATCH) RRETURN(rrc);
if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH); if (Lmin++ >= Lmax) RRETURN(MATCH_NOMATCH);
@@ -3619,10 +3690,12 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
RRETURN(MATCH_NOMATCH); RRETURN(MATCH_NOMATCH);
} }
GETCHARINCTEST(fc, Feptr); GETCHARINCTEST(fc, Feptr);
category = UCD_CATEGORY(fc); chartype = UCD_CHARTYPE(fc);
category = PRIV(ucp_gentype)[chartype];
if ((category == ucp_L || if ((category == ucp_L ||
category == ucp_N || category == ucp_N ||
fc == CHAR_UNDERSCORE) == (Lctype == OP_NOTPROP)) chartype == ucp_Mn ||
chartype == ucp_Pc) == (Lctype == OP_NOTPROP))
RRETURN(MATCH_NOMATCH); RRETURN(MATCH_NOMATCH);
} }
/* Control never gets here */ /* Control never gets here */
@@ -3640,6 +3713,13 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
RRETURN(MATCH_NOMATCH); RRETURN(MATCH_NOMATCH);
} }
GETCHARINCTEST(fc, Feptr); GETCHARINCTEST(fc, Feptr);
#if PCRE2_CODE_UNIT_WIDTH == 32
if (fc > MAX_UTF_CODE_POINT)
{
if (Lctype == OP_NOTPROP) continue;
RRETURN(MATCH_NOMATCH);
}
#endif
cp = PRIV(ucd_caseless_sets) + Lpropvalue; cp = PRIV(ucd_caseless_sets) + Lpropvalue;
for (;;) for (;;)
{ {
@@ -4190,7 +4270,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
case PT_WORD: case PT_WORD:
for (i = Lmin; i < Lmax; i++) for (i = Lmin; i < Lmax; i++)
{ {
int category; int chartype, category;
int len = 1; int len = 1;
if (Feptr >= mb->end_subject) if (Feptr >= mb->end_subject)
{ {
@@ -4198,9 +4278,12 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
break; break;
} }
GETCHARLENTEST(fc, Feptr, len); GETCHARLENTEST(fc, Feptr, len);
category = UCD_CATEGORY(fc); chartype = UCD_CHARTYPE(fc);
if ((category == ucp_L || category == ucp_N || category = PRIV(ucp_gentype)[chartype];
fc == CHAR_UNDERSCORE) == notmatch) if ((category == ucp_L ||
category == ucp_N ||
chartype == ucp_Mn ||
chartype == ucp_Pc) == notmatch)
break; break;
Feptr+= len; Feptr+= len;
} }
@@ -4217,14 +4300,24 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
break; break;
} }
GETCHARLENTEST(fc, Feptr, len); GETCHARLENTEST(fc, Feptr, len);
cp = PRIV(ucd_caseless_sets) + Lpropvalue; #if PCRE2_CODE_UNIT_WIDTH == 32
for (;;) if (fc > MAX_UTF_CODE_POINT)
{ {
if (fc < *cp) if (!notmatch) goto GOT_MAX;
{ if (notmatch) break; else goto GOT_MAX; }
if (fc == *cp++)
{ if (notmatch) goto GOT_MAX; else break; }
} }
else
#endif
{
cp = PRIV(ucd_caseless_sets) + Lpropvalue;
for (;;)
{
if (fc < *cp)
{ if (notmatch) break; else goto GOT_MAX; }
if (fc == *cp++)
{ if (notmatch) goto GOT_MAX; else break; }
}
}
Feptr += len; Feptr += len;
} }
GOT_MAX: GOT_MAX:
@@ -5322,9 +5415,11 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
/* ===================================================================== */ /* ===================================================================== */
/* Recursion either matches the current regex, or some subexpression. The /* Pattern recursion either matches the current regex, or some
offset data is the offset to the starting bracket from the start of the subexpression. The offset data is the offset to the starting bracket from
whole pattern. (This is so that it works from duplicated subpatterns.) */ the start of the whole pattern. This is so that it works from duplicated
subpatterns. For a whole-pattern recursion, we have to infer the number
zero. */
#define Lframe_type F->temp_32[0] #define Lframe_type F->temp_32[0]
#define Lstart_branch F->temp_sptr[0] #define Lstart_branch F->temp_sptr[0]
@@ -5333,9 +5428,12 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
bracode = mb->start_code + GET(Fecode, 1); bracode = mb->start_code + GET(Fecode, 1);
number = (bracode == mb->start_code)? 0 : GET2(bracode, 1 + LINK_SIZE); number = (bracode == mb->start_code)? 0 : GET2(bracode, 1 + LINK_SIZE);
/* If we are already in a recursion, check for repeating the same one /* If we are already in a pattern recursion, check for repeating the same
without advancing the subject pointer. This should catch convoluted mutual one without changing the subject pointer or the last referenced character
recursions. (Some simple cases are caught at compile time.) */ in the subject. This should catch convoluted mutual recursions; some
simple cases are caught at compile time. However, there are rare cases when
this check needs to be turned off. In this case, actual recursion loops
will be caught by the match or heap limits. */
if (Fcurrent_recurse != RECURSE_UNSET) if (Fcurrent_recurse != RECURSE_UNSET)
{ {
@@ -5346,15 +5444,19 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
P = (heapframe *)((char *)N - frame_size); P = (heapframe *)((char *)N - frame_size);
if (N->group_frame_type == (GF_RECURSE | number)) if (N->group_frame_type == (GF_RECURSE | number))
{ {
if (Feptr == P->eptr) return PCRE2_ERROR_RECURSELOOP; if (Feptr == P->eptr && mb->last_used_ptr == P->recurse_last_used &&
(mb->moptions & PCRE2_DISABLE_RECURSELOOP_CHECK) == 0)
return PCRE2_ERROR_RECURSELOOP;
break; break;
} }
offset = P->last_group_offset; offset = P->last_group_offset;
} }
} }
/* Now run the recursion, branch by branch. */ /* Remember the current last referenced character and then run the
recursion branch by branch. */
F->recurse_last_used = mb->last_used_ptr;
Lstart_branch = bracode; Lstart_branch = bracode;
Lframe_type = GF_RECURSE | number; Lframe_type = GF_RECURSE | number;
@@ -5683,13 +5785,13 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
/* ===================================================================== */ /* ===================================================================== */
/* Move the subject pointer back. This occurs only at the start of each /* Move the subject pointer back by one fixed amount. This occurs at the
branch of a lookbehind assertion. If we are too close to the start to move start of each branch that has a fixed length in a lookbehind assertion. If
back, fail. When working with UTF-8 we move back a number of characters, we are too close to the start to move back, fail. When working with UTF-8
not bytes. */ we move back a number of characters, not bytes. */
case OP_REVERSE: case OP_REVERSE:
number = GET(Fecode, 1); number = GET2(Fecode, 1);
#ifdef SUPPORT_UNICODE #ifdef SUPPORT_UNICODE
if (utf) if (utf)
{ {
@@ -5703,7 +5805,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
else else
#endif #endif
/* No UTF-8 support, or not in UTF-8 mode: count is code unit count */ /* No UTF support, or not in UTF mode: count is code unit count */
{ {
if ((ptrdiff_t)number > Feptr - mb->start_subject) RRETURN(MATCH_NOMATCH); if ((ptrdiff_t)number > Feptr - mb->start_subject) RRETURN(MATCH_NOMATCH);
@@ -5713,15 +5815,84 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
/* Save the earliest consulted character, then skip to next opcode */ /* Save the earliest consulted character, then skip to next opcode */
if (Feptr < mb->start_used_ptr) mb->start_used_ptr = Feptr; if (Feptr < mb->start_used_ptr) mb->start_used_ptr = Feptr;
Fecode += 1 + LINK_SIZE; Fecode += 1 + IMM2_SIZE;
break; break;
/* ===================================================================== */
/* Move the subject pointer back by a variable amount. This occurs at the
start of each branch of a lookbehind assertion when the branch has a
variable, but limited, length. A loop is needed to try matching the branch
after moving back different numbers of characters. If we are too close to
the start to move back even the minimum amount, fail. When working with
UTF-8 we move back a number of characters, not bytes. */
#define Lmin F->temp_32[0]
#define Lmax F->temp_32[1]
#define Leptr F->temp_sptr[0]
case OP_VREVERSE:
Lmin = GET2(Fecode, 1);
Lmax = GET2(Fecode, 1 + IMM2_SIZE);
Leptr = Feptr;
/* Move back by the maximum branch length and then work forwards. This
ensures that items such as \d{3,5} get the maximum length, which is
relevant for captures, and makes for Perl compatibility. */
#ifdef SUPPORT_UNICODE
if (utf)
{
for (i = 0; i < Lmax; i++)
{
if (Feptr == mb->start_subject)
{
if (i < Lmin) RRETURN(MATCH_NOMATCH);
Lmax = i;
break;
}
Feptr--;
BACKCHAR(Feptr);
}
}
else
#endif
/* No UTF support or not in UTF mode */
{
ptrdiff_t diff = Feptr - mb->start_subject;
uint32_t available = (diff > 65535)? 65535 : ((diff > 0)? diff : 0);
if (Lmin > available) RRETURN(MATCH_NOMATCH);
if (Lmax > available) Lmax = available;
Feptr -= Lmax;
}
/* Now try matching, moving forward one character on failure, until we
reach the mimimum back length. */
for (;;)
{
RMATCH(Fecode + 1 + 2 * IMM2_SIZE, RM37);
if (rrc != MATCH_NOMATCH) RRETURN(rrc);
if (Lmax-- <= Lmin) RRETURN(MATCH_NOMATCH);
Feptr++;
#ifdef SUPPORT_UNICODE
if (utf) { FORWARDCHARTEST(Feptr, mb->end_subject); }
#endif
}
/* Control never reaches here */
#undef Lmin
#undef Lmax
#undef Leptr
/* ===================================================================== */ /* ===================================================================== */
/* An alternation is the end of a branch; scan along to find the end of the /* An alternation is the end of a branch; scan along to find the end of the
bracketed group. */ bracketed group. */
case OP_ALT: case OP_ALT:
branch_end = Fecode;
do Fecode += GET(Fecode,1); while (*Fecode == OP_ALT); do Fecode += GET(Fecode,1); while (*Fecode == OP_ALT);
break; break;
@@ -5729,7 +5900,8 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
/* ===================================================================== */ /* ===================================================================== */
/* The end of a parenthesized group. For all but OP_BRA and OP_COND, the /* The end of a parenthesized group. For all but OP_BRA and OP_COND, the
starting frame was added to the chained frames in order to remember the starting frame was added to the chained frames in order to remember the
starting subject position for the group. */ starting subject position for the group. (Not true for OP_BRA when it's a
whole pattern recursion, but that is handled separately below.)*/
case OP_KET: case OP_KET:
case OP_KETRMIN: case OP_KETRMIN:
@@ -5738,8 +5910,14 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
bracode = Fecode - GET(Fecode, 1); bracode = Fecode - GET(Fecode, 1);
/* Point N to the frame at the start of the most recent group. if (branch_end == NULL) branch_end = Fecode;
Remember the subject pointer at the start of the group. */ branch_start = bracode;
while (branch_start + GET(branch_start, 1) != branch_end)
branch_start += GET(branch_start, 1);
branch_end = NULL;
/* Point N to the frame at the start of the most recent group, and P to its
predecessor. Remember the subject pointer at the start of the group. */
if (*bracode != OP_BRA && *bracode != OP_COND) if (*bracode != OP_BRA && *bracode != OP_COND)
{ {
@@ -5775,27 +5953,64 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
switch (*bracode) switch (*bracode)
{ {
case OP_BRA: /* No need to do anything for these */ /* Whole pattern recursion is handled as a recursion into group 0, but
case OP_COND: the entire pattern is wrapped in OP_BRA/OP_KET rather than a capturing
group - a design mistake: it should perhaps have been capture group 0.
Anyway, that means the end of such recursion must be handled here. It is
detected by checking for an immediately following OP_END when we are
recursing in group 0. If this is not the end of a whole-pattern
recursion, there is nothing to be done. */
case OP_BRA:
if (Fcurrent_recurse != 0 || Fecode[1+LINK_SIZE] != OP_END) break;
/* It is the end of whole-pattern recursion. */
offset = Flast_group_offset;
if (offset == PCRE2_UNSET) return PCRE2_ERROR_INTERNAL;
N = (heapframe *)((char *)match_data->heapframes + offset);
P = (heapframe *)((char *)N - frame_size);
Flast_group_offset = P->last_group_offset;
/* Reinstate the previous set of captures and then carry on after the
recursion call. */
memcpy((char *)F + offsetof(heapframe, ovector), P->ovector,
Foffset_top * sizeof(PCRE2_SIZE));
Foffset_top = P->offset_top;
Fcapture_last = P->capture_last;
Fcurrent_recurse = P->current_recurse;
Fecode = P->ecode + 1 + LINK_SIZE;
continue; /* With next opcode */
case OP_COND: /* No need to do anything for these */
case OP_SCOND: case OP_SCOND:
break; break;
/* Non-atomic positive assertions are like OP_BRA, except that the /* Non-atomic positive assertions are like OP_BRA, except that the
subject pointer must be put back to where it was at the start of the subject pointer must be put back to where it was at the start of the
assertion. */ assertion. For a variable lookbehind, check its end point. */
case OP_ASSERTBACK_NA:
if (branch_start[1 + LINK_SIZE] == OP_VREVERSE && Feptr != P->eptr)
RRETURN(MATCH_NOMATCH);
/* Fall through */
case OP_ASSERT_NA: case OP_ASSERT_NA:
case OP_ASSERTBACK_NA:
if (Feptr > mb->last_used_ptr) mb->last_used_ptr = Feptr; if (Feptr > mb->last_used_ptr) mb->last_used_ptr = Feptr;
Feptr = P->eptr; Feptr = P->eptr;
break; break;
/* Atomic positive assertions are like OP_ONCE, except that in addition /* Atomic positive assertions are like OP_ONCE, except that in addition
the subject pointer must be put back to where it was at the start of the the subject pointer must be put back to where it was at the start of the
assertion. */ assertion. For a variable lookbehind, check its end point. */
case OP_ASSERTBACK:
if (branch_start[1 + LINK_SIZE] == OP_VREVERSE && Feptr != P->eptr)
RRETURN(MATCH_NOMATCH);
/* Fall through */
case OP_ASSERT: case OP_ASSERT:
case OP_ASSERTBACK:
if (Feptr > mb->last_used_ptr) mb->last_used_ptr = Feptr; if (Feptr > mb->last_used_ptr) mb->last_used_ptr = Feptr;
Feptr = P->eptr; Feptr = P->eptr;
/* Fall through */ /* Fall through */
@@ -5816,10 +6031,15 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
break; break;
/* A matching negative assertion returns MATCH, which is turned into /* A matching negative assertion returns MATCH, which is turned into
NOMATCH at the assertion level. */ NOMATCH at the assertion level. For a variable lookbehind, check its end
point. */
case OP_ASSERTBACK_NOT:
if (branch_start[1 + LINK_SIZE] == OP_VREVERSE && Feptr != P->eptr)
RRETURN(MATCH_NOMATCH);
/* Fall through */
case OP_ASSERT_NOT: case OP_ASSERT_NOT:
case OP_ASSERTBACK_NOT:
RRETURN(MATCH_MATCH); RRETURN(MATCH_MATCH);
/* At the end of a script run, apply the script-checking rules. This code /* At the end of a script run, apply the script-checking rules. This code
@@ -5830,9 +6050,8 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
if (!PRIV(script_run)(P->eptr, Feptr, utf)) RRETURN(MATCH_NOMATCH); if (!PRIV(script_run)(P->eptr, Feptr, utf)) RRETURN(MATCH_NOMATCH);
break; break;
/* Whole-pattern recursion is coded as a recurse into group 0, so it /* Whole-pattern recursion is coded as a recurse into group 0, and is
won't be picked up here. Instead, we catch it when the OP_END is reached. handled with OP_BRA above. Other recursion is handled here. */
Other recursion is handled here. */
case OP_CBRA: case OP_CBRA:
case OP_CBRAPOS: case OP_CBRAPOS:
@@ -5847,7 +6066,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
{ {
P = (heapframe *)((char *)N - frame_size); P = (heapframe *)((char *)N - frame_size);
memcpy((char *)F + offsetof(heapframe, ovector), P->ovector, memcpy((char *)F + offsetof(heapframe, ovector), P->ovector,
P->offset_top * sizeof(PCRE2_SIZE)); Foffset_top * sizeof(PCRE2_SIZE));
Foffset_top = P->offset_top; Foffset_top = P->offset_top;
Fcapture_last = P->capture_last; Fcapture_last = P->capture_last;
Fcurrent_recurse = P->current_recurse; Fcurrent_recurse = P->current_recurse;
@@ -5930,10 +6149,10 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
if ((mb->poptions & PCRE2_DOLLAR_ENDONLY) == 0) goto ASSERT_NL_OR_EOS; if ((mb->poptions & PCRE2_DOLLAR_ENDONLY) == 0) goto ASSERT_NL_OR_EOS;
/* Fall through */ /* Fall through */
/* Unconditional end of subject assertion (\z) */ /* Unconditional end of subject assertion (\z). */
case OP_EOD: case OP_EOD:
if (Feptr < mb->end_subject) RRETURN(MATCH_NOMATCH); if (Feptr < mb->true_end_subject) RRETURN(MATCH_NOMATCH);
if (mb->partial != 0) if (mb->partial != 0)
{ {
mb->hitend = TRUE; mb->hitend = TRUE;
@@ -6045,6 +6264,8 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
case OP_NOT_WORD_BOUNDARY: case OP_NOT_WORD_BOUNDARY:
case OP_WORD_BOUNDARY: case OP_WORD_BOUNDARY:
case OP_NOT_UCP_WORD_BOUNDARY:
case OP_UCP_WORD_BOUNDARY:
if (Feptr == mb->check_subject) prev_is_word = FALSE; else if (Feptr == mb->check_subject) prev_is_word = FALSE; else
{ {
PCRE2_SPTR lastptr = Feptr - 1; PCRE2_SPTR lastptr = Feptr - 1;
@@ -6059,13 +6280,12 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
fc = *lastptr; fc = *lastptr;
if (lastptr < mb->start_used_ptr) mb->start_used_ptr = lastptr; if (lastptr < mb->start_used_ptr) mb->start_used_ptr = lastptr;
#ifdef SUPPORT_UNICODE #ifdef SUPPORT_UNICODE
if ((mb->poptions & PCRE2_UCP) != 0) if (Fop == OP_UCP_WORD_BOUNDARY || Fop == OP_NOT_UCP_WORD_BOUNDARY)
{ {
if (fc == '_') prev_is_word = TRUE; else int chartype = UCD_CHARTYPE(fc);
{ int category = PRIV(ucp_gentype)[chartype];
int cat = UCD_CATEGORY(fc); prev_is_word = (category == ucp_L || category == ucp_N ||
prev_is_word = (cat == ucp_L || cat == ucp_N); chartype == ucp_Mn || chartype == ucp_Pc);
}
} }
else else
#endif /* SUPPORT_UNICODE */ #endif /* SUPPORT_UNICODE */
@@ -6093,13 +6313,12 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
fc = *Feptr; fc = *Feptr;
if (nextptr > mb->last_used_ptr) mb->last_used_ptr = nextptr; if (nextptr > mb->last_used_ptr) mb->last_used_ptr = nextptr;
#ifdef SUPPORT_UNICODE #ifdef SUPPORT_UNICODE
if ((mb->poptions & PCRE2_UCP) != 0) if (Fop == OP_UCP_WORD_BOUNDARY || Fop == OP_NOT_UCP_WORD_BOUNDARY)
{ {
if (fc == '_') cur_is_word = TRUE; else int chartype = UCD_CHARTYPE(fc);
{ int category = PRIV(ucp_gentype)[chartype];
int cat = UCD_CATEGORY(fc); cur_is_word = (category == ucp_L || category == ucp_N ||
cur_is_word = (cat == ucp_L || cat == ucp_N); chartype == ucp_Mn || chartype == ucp_Pc);
}
} }
else else
#endif /* SUPPORT_UNICODE */ #endif /* SUPPORT_UNICODE */
@@ -6108,7 +6327,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
/* Now see if the situation is what we want */ /* Now see if the situation is what we want */
if ((*Fecode++ == OP_WORD_BOUNDARY)? if ((*Fecode++ == OP_WORD_BOUNDARY || Fop == OP_UCP_WORD_BOUNDARY)?
cur_is_word == prev_is_word : cur_is_word != prev_is_word) cur_is_word == prev_is_word : cur_is_word != prev_is_word)
RRETURN(MATCH_NOMATCH); RRETURN(MATCH_NOMATCH);
break; break;
@@ -6254,7 +6473,7 @@ F = (heapframe *)((char *)F - Fback_frame); /* Backtrack */
mb->cb->callout_flags |= PCRE2_CALLOUT_BACKTRACK; /* Note for callouts */ mb->cb->callout_flags |= PCRE2_CALLOUT_BACKTRACK; /* Note for callouts */
#ifdef DEBUG_SHOW_RMATCH #ifdef DEBUG_SHOW_RMATCH
fprintf(stderr, "++ RETURN %d to %d\n", rrc, Freturn_id); fprintf(stderr, "++ RETURN %d to RM%d\n", rrc, Freturn_id);
#endif #endif
switch (Freturn_id) switch (Freturn_id)
@@ -6263,7 +6482,7 @@ switch (Freturn_id)
LBL( 9) LBL(10) LBL(11) LBL(12) LBL(13) LBL(14) LBL(15) LBL(16) LBL( 9) LBL(10) LBL(11) LBL(12) LBL(13) LBL(14) LBL(15) LBL(16)
LBL(17) LBL(18) LBL(19) LBL(20) LBL(21) LBL(22) LBL(23) LBL(24) LBL(17) LBL(18) LBL(19) LBL(20) LBL(21) LBL(22) LBL(23) LBL(24)
LBL(25) LBL(26) LBL(27) LBL(28) LBL(29) LBL(30) LBL(31) LBL(32) LBL(25) LBL(26) LBL(27) LBL(28) LBL(29) LBL(30) LBL(31) LBL(32)
LBL(33) LBL(34) LBL(35) LBL(36) LBL(33) LBL(34) LBL(35) LBL(36) LBL(37)
#ifdef SUPPORT_WIDE_CHARS #ifdef SUPPORT_WIDE_CHARS
LBL(100) LBL(101) LBL(100) LBL(101)
@@ -6551,6 +6770,7 @@ if (use_jit)
match_data, mcontext); match_data, mcontext);
if (rc != PCRE2_ERROR_JIT_BADOPTION) if (rc != PCRE2_ERROR_JIT_BADOPTION)
{ {
match_data->subject_length = length;
if (rc >= 0 && (options & PCRE2_COPY_MATCHED_SUBJECT) != 0) if (rc >= 0 && (options & PCRE2_COPY_MATCHED_SUBJECT) != 0)
{ {
length = CU2BYTES(length + was_zero_terminated); length = CU2BYTES(length + was_zero_terminated);
@@ -6719,7 +6939,7 @@ if (mcontext == NULL)
else mb->memctl = mcontext->memctl; else mb->memctl = mcontext->memctl;
anchored = ((re->overall_options | options) & PCRE2_ANCHORED) != 0; anchored = ((re->overall_options | options) & PCRE2_ANCHORED) != 0;
firstline = (re->overall_options & PCRE2_FIRSTLINE) != 0; firstline = !anchored && (re->overall_options & PCRE2_FIRSTLINE) != 0;
startline = (re->flags & PCRE2_STARTLINE) != 0; startline = (re->flags & PCRE2_STARTLINE) != 0;
bumpalong_limit = (mcontext->offset_limit == PCRE2_UNSET)? bumpalong_limit = (mcontext->offset_limit == PCRE2_UNSET)?
true_end_subject : subject + mcontext->offset_limit; true_end_subject : subject + mcontext->offset_limit;
@@ -6742,6 +6962,7 @@ mb->callout_data = mcontext->callout_data;
mb->start_subject = subject; mb->start_subject = subject;
mb->start_offset = start_offset; mb->start_offset = start_offset;
mb->end_subject = end_subject; mb->end_subject = end_subject;
mb->true_end_subject = true_end_subject;
mb->hasthen = (re->flags & PCRE2_HASTHEN) != 0; mb->hasthen = (re->flags & PCRE2_HASTHEN) != 0;
mb->allowemptypartial = (re->max_lookbehind > 0) || mb->allowemptypartial = (re->max_lookbehind > 0) ||
(re->flags & PCRE2_MATCH_EMPTY) != 0; (re->flags & PCRE2_MATCH_EMPTY) != 0;
@@ -6801,7 +7022,7 @@ the pattern. It is not used at all if there are no capturing parentheses.
frame_size is the total size of each frame frame_size is the total size of each frame
match_data->heapframes is the pointer to the frames vector match_data->heapframes is the pointer to the frames vector
match_data->heapframes_size is the total size of the vector match_data->heapframes_size is the allocated size of the vector
We must pad the frame_size for alignment to ensure subsequent frames are as We must pad the frame_size for alignment to ensure subsequent frames are as
aligned as heapframe. Whilst ovector is word-aligned due to being a PCRE2_SIZE aligned as heapframe. Whilst ovector is word-aligned due to being a PCRE2_SIZE
@@ -6816,7 +7037,7 @@ frame_size = (offsetof(heapframe, ovector) +
smaller. */ smaller. */
mb->heap_limit = ((mcontext->heap_limit < re->limit_heap)? mb->heap_limit = ((mcontext->heap_limit < re->limit_heap)?
mcontext->heap_limit : re->limit_heap) * 1024; mcontext->heap_limit : re->limit_heap);
mb->match_limit = (mcontext->match_limit < re->limit_match)? mb->match_limit = (mcontext->match_limit < re->limit_match)?
mcontext->match_limit : re->limit_match; mcontext->match_limit : re->limit_match;
@@ -6827,19 +7048,19 @@ mb->match_limit_depth = (mcontext->depth_limit < re->limit_depth)?
/* If a pattern has very many capturing parentheses, the frame size may be very /* If a pattern has very many capturing parentheses, the frame size may be very
large. Set the initial frame vector size to ensure that there are at least 10 large. Set the initial frame vector size to ensure that there are at least 10
available frames, but enforce a minimum of START_FRAMES_SIZE. If this is available frames, but enforce a minimum of START_FRAMES_SIZE. If this is
greater than the heap limit, get as large a vector as possible. Always round greater than the heap limit, get as large a vector as possible. */
the size to a multiple of the frame size. */
heapframes_size = frame_size * 10; heapframes_size = frame_size * 10;
if (heapframes_size < START_FRAMES_SIZE) heapframes_size = START_FRAMES_SIZE; if (heapframes_size < START_FRAMES_SIZE) heapframes_size = START_FRAMES_SIZE;
if (heapframes_size > mb->heap_limit) if (heapframes_size / 1024 > mb->heap_limit)
{ {
if (frame_size > mb->heap_limit ) return PCRE2_ERROR_HEAPLIMIT; PCRE2_SIZE max_size = 1024 * mb->heap_limit;
heapframes_size = mb->heap_limit; if (max_size < frame_size) return PCRE2_ERROR_HEAPLIMIT;
heapframes_size = max_size;
} }
/* If an existing frame vector in the match_data block is large enough, we can /* If an existing frame vector in the match_data block is large enough, we can
use it.Otherwise, free any pre-existing vector and get a new one. */ use it. Otherwise, free any pre-existing vector and get a new one. */
if (match_data->heapframes_size < heapframes_size) if (match_data->heapframes_size < heapframes_size)
{ {
@@ -7286,9 +7507,17 @@ for(;;)
mb->end_offset_top = 0; mb->end_offset_top = 0;
mb->skip_arg_count = 0; mb->skip_arg_count = 0;
#ifdef DEBUG_SHOW_OPS
fprintf(stderr, "++ Calling match()\n");
#endif
rc = match(start_match, mb->start_code, re->top_bracket, frame_size, rc = match(start_match, mb->start_code, re->top_bracket, frame_size,
match_data, mb); match_data, mb);
#ifdef DEBUG_SHOW_OPS
fprintf(stderr, "++ match() returned %d\n\n", rc);
#endif
if (mb->hitend && start_partial == NULL) if (mb->hitend && start_partial == NULL)
{ {
start_partial = mb->start_used_ptr; start_partial = mb->start_used_ptr;
@@ -7436,6 +7665,7 @@ if (utf && end_subject != true_end_subject &&
if (start_match >= true_end_subject) if (start_match >= true_end_subject)
{ {
rc = MATCH_NOMATCH; /* In case it was partial */ rc = MATCH_NOMATCH; /* In case it was partial */
match_partial = NULL;
break; break;
} }
@@ -7485,6 +7715,7 @@ if (rc == MATCH_MATCH)
{ {
match_data->rc = ((int)mb->end_offset_top >= 2 * match_data->oveccount)? match_data->rc = ((int)mb->end_offset_top >= 2 * match_data->oveccount)?
0 : (int)mb->end_offset_top/2 + 1; 0 : (int)mb->end_offset_top/2 + 1;
match_data->subject_length = length;
match_data->startchar = start_match - subject; match_data->startchar = start_match - subject;
match_data->leftchar = mb->start_used_ptr - subject; match_data->leftchar = mb->start_used_ptr - subject;
match_data->rightchar = ((mb->last_used_ptr > mb->end_match_ptr)? match_data->rightchar = ((mb->last_used_ptr > mb->end_match_ptr)?
@@ -7499,6 +7730,7 @@ if (rc == MATCH_MATCH)
match_data->flags |= PCRE2_MD_COPIED_SUBJECT; match_data->flags |= PCRE2_MD_COPIED_SUBJECT;
} }
else match_data->subject = subject; else match_data->subject = subject;
return match_data->rc; return match_data->rc;
} }
@@ -7520,6 +7752,7 @@ PCRE2_ERROR_PARTIAL. */
else if (match_partial != NULL) else if (match_partial != NULL)
{ {
match_data->subject = subject; match_data->subject = subject;
match_data->subject_length = length;
match_data->ovector[0] = match_partial - subject; match_data->ovector[0] = match_partial - subject;
match_data->ovector[1] = end_subject - subject; match_data->ovector[1] = end_subject - subject;
match_data->startchar = match_partial - subject; match_data->startchar = match_partial - subject;

View File

@@ -170,4 +170,16 @@ return offsetof(pcre2_match_data, ovector) +
2 * (match_data->oveccount) * sizeof(PCRE2_SIZE); 2 * (match_data->oveccount) * sizeof(PCRE2_SIZE);
} }
/*************************************************
* Get heapframes size *
*************************************************/
PCRE2_EXP_DEFN PCRE2_SIZE PCRE2_CALL_CONVENTION
pcre2_get_match_data_heapframes_size(pcre2_match_data *match_data)
{
return match_data->heapframes_size;
}
/* End of pcre2_match_data.c */ /* End of pcre2_match_data.c */

View File

@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge Original API code Copyright (c) 1997-2012 University of Cambridge
New API code Copyright (c) 2016-2021 University of Cambridge New API code Copyright (c) 2016-2023 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@@ -256,6 +256,7 @@ for (;;)
/* Skip over things that don't match chars */ /* Skip over things that don't match chars */
case OP_REVERSE: case OP_REVERSE:
case OP_VREVERSE:
case OP_CREF: case OP_CREF:
case OP_DNCREF: case OP_DNCREF:
case OP_RREF: case OP_RREF:
@@ -273,6 +274,8 @@ for (;;)
case OP_DOLLM: case OP_DOLLM:
case OP_NOT_WORD_BOUNDARY: case OP_NOT_WORD_BOUNDARY:
case OP_WORD_BOUNDARY: case OP_WORD_BOUNDARY:
case OP_NOT_UCP_WORD_BOUNDARY:
case OP_UCP_WORD_BOUNDARY:
cc += PRIV(OP_lengths)[*cc]; cc += PRIV(OP_lengths)[*cc];
break; break;
@@ -976,6 +979,7 @@ do
while (try_next) /* Loop for items in this branch */ while (try_next) /* Loop for items in this branch */
{ {
int rc; int rc;
PCRE2_SPTR ncode;
uint8_t *classmap = NULL; uint8_t *classmap = NULL;
#ifdef SUPPORT_WIDE_CHARS #ifdef SUPPORT_WIDE_CHARS
PCRE2_UCHAR xclassflags; PCRE2_UCHAR xclassflags;
@@ -1054,6 +1058,7 @@ do
case OP_REF: case OP_REF:
case OP_REFI: case OP_REFI:
case OP_REVERSE: case OP_REVERSE:
case OP_VREVERSE:
case OP_RREF: case OP_RREF:
case OP_SCOND: case OP_SCOND:
case OP_SET_SOM: case OP_SET_SOM:
@@ -1101,13 +1106,100 @@ do
case OP_WORD_BOUNDARY: case OP_WORD_BOUNDARY:
case OP_NOT_WORD_BOUNDARY: case OP_NOT_WORD_BOUNDARY:
case OP_UCP_WORD_BOUNDARY:
case OP_NOT_UCP_WORD_BOUNDARY:
tcode++; tcode++;
break; break;
/* If we hit a bracket or a positive lookahead assertion, recurse to set /* For a positive lookahead assertion, inspect what immediately follows,
bits from within the subpattern. If it can't find anything, we have to ignoring intermediate assertions and callouts. If the next item is one
give up. If it finds some mandatory character(s), we are done for this that sets a mandatory character, skip this assertion. Otherwise, treat it
branch. Otherwise, carry on scanning after the subpattern. */ the same as other bracket groups. */
case OP_ASSERT:
case OP_ASSERT_NA:
ncode = tcode + GET(tcode, 1);
while (*ncode == OP_ALT) ncode += GET(ncode, 1);
ncode += 1 + LINK_SIZE;
/* Skip irrelevant items */
for (BOOL done = FALSE; !done;)
{
switch (*ncode)
{
case OP_ASSERT:
case OP_ASSERT_NOT:
case OP_ASSERTBACK:
case OP_ASSERTBACK_NOT:
case OP_ASSERT_NA:
case OP_ASSERTBACK_NA:
ncode += GET(ncode, 1);
while (*ncode == OP_ALT) ncode += GET(ncode, 1);
ncode += 1 + LINK_SIZE;
break;
case OP_WORD_BOUNDARY:
case OP_NOT_WORD_BOUNDARY:
case OP_UCP_WORD_BOUNDARY:
case OP_NOT_UCP_WORD_BOUNDARY:
ncode++;
break;
case OP_CALLOUT:
ncode += PRIV(OP_lengths)[OP_CALLOUT];
break;
case OP_CALLOUT_STR:
ncode += GET(ncode, 1 + 2*LINK_SIZE);
break;
default:
done = TRUE;
break;
}
}
/* Now check the next significant item. */
switch(*ncode)
{
default:
break;
case OP_PROP:
if (ncode[1] != PT_CLIST) break;
/* Fall through */
case OP_ANYNL:
case OP_CHAR:
case OP_CHARI:
case OP_EXACT:
case OP_EXACTI:
case OP_HSPACE:
case OP_MINPLUS:
case OP_MINPLUSI:
case OP_PLUS:
case OP_PLUSI:
case OP_POSPLUS:
case OP_POSPLUSI:
case OP_VSPACE:
/* Note that these types will only be present in non-UCP mode. */
case OP_DIGIT:
case OP_NOT_DIGIT:
case OP_WORDCHAR:
case OP_NOT_WORDCHAR:
case OP_WHITESPACE:
case OP_NOT_WHITESPACE:
tcode = ncode;
continue; /* With the following significant opcode */
}
/* Fall through */
/* For a group bracket or a positive assertion without an immediately
following mandatory setting, recurse to set bits from within the
subpattern. If it can't find anything, we have to give up. If it finds
some mandatory character(s), we are done for this branch. Otherwise,
carry on scanning after the subpattern. */
case OP_BRA: case OP_BRA:
case OP_SBRA: case OP_SBRA:
@@ -1119,8 +1211,6 @@ do
case OP_SCBRAPOS: case OP_SCBRAPOS:
case OP_ONCE: case OP_ONCE:
case OP_SCRIPT_RUN: case OP_SCRIPT_RUN:
case OP_ASSERT:
case OP_ASSERT_NA:
rc = set_start_bits(re, tcode, utf, ucp, depthptr); rc = set_start_bits(re, tcode, utf, ucp, depthptr);
if (rc == SSB_DONE) if (rc == SSB_DONE)
{ {

View File

@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge Original API code Copyright (c) 1997-2012 University of Cambridge
New API code Copyright (c) 2016-2018 University of Cambridge New API code Copyright (c) 2016-2023 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@@ -309,6 +309,7 @@ Returns: if successful: 0
PCRE2_ERROR_NOSUBSTRING: no such substring PCRE2_ERROR_NOSUBSTRING: no such substring
PCRE2_ERROR_UNAVAILABLE: ovector is too small PCRE2_ERROR_UNAVAILABLE: ovector is too small
PCRE2_ERROR_UNSET: substring is not set PCRE2_ERROR_UNSET: substring is not set
PCRE2_ERROR_INVALIDOFFSET: internal error, should not occur
*/ */
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
@@ -341,6 +342,8 @@ else /* Matched using pcre2_dfa_match() */
left = match_data->ovector[stringnumber*2]; left = match_data->ovector[stringnumber*2];
right = match_data->ovector[stringnumber*2+1]; right = match_data->ovector[stringnumber*2+1];
if (left > match_data->subject_length || right > match_data->subject_length)
return PCRE2_ERROR_INVALIDOFFSET;
if (sizeptr != NULL) *sizeptr = (left > right)? 0 : right - left; if (sizeptr != NULL) *sizeptr = (left > right)? 0 : right - left;
return 0; return 0;
} }
@@ -442,7 +445,7 @@ Returns: nothing
*/ */
PCRE2_EXP_DEFN void PCRE2_CALL_CONVENTION PCRE2_EXP_DEFN void PCRE2_CALL_CONVENTION
pcre2_substring_list_free(PCRE2_SPTR *list) pcre2_substring_list_free(PCRE2_UCHAR **list)
{ {
if (list != NULL) if (list != NULL)
{ {

File diff suppressed because it is too large Load Diff

View File

@@ -166,29 +166,29 @@ enum {
/* These are the bidi class values. */ /* These are the bidi class values. */
enum { enum {
ucp_bidiAL, /* Arabic letter */ ucp_bidiAL, /* Arabic_Letter */
ucp_bidiAN, /* Arabic number */ ucp_bidiAN, /* Arabic_Number */
ucp_bidiB, /* Paragraph separator */ ucp_bidiB, /* Paragraph_Separator */
ucp_bidiBN, /* Boundary neutral */ ucp_bidiBN, /* Boundary_Neutral */
ucp_bidiCS, /* Common separator */ ucp_bidiCS, /* Common_Separator */
ucp_bidiEN, /* European number */ ucp_bidiEN, /* European_Number */
ucp_bidiES, /* European separator */ ucp_bidiES, /* European_Separator */
ucp_bidiET, /* European terminator */ ucp_bidiET, /* European_Terminator */
ucp_bidiFSI, /* First strong isolate */ ucp_bidiFSI, /* First_Strong_Isolate */
ucp_bidiL, /* Left to right */ ucp_bidiL, /* Left_To_Right */
ucp_bidiLRE, /* Left to right embedding */ ucp_bidiLRE, /* Left_To_Right_Embedding */
ucp_bidiLRI, /* Left to right isolate */ ucp_bidiLRI, /* Left_To_Right_Isolate */
ucp_bidiLRO, /* Left to right override */ ucp_bidiLRO, /* Left_To_Right_Override */
ucp_bidiNSM, /* Non-spacing mark */ ucp_bidiNSM, /* Nonspacing_Mark */
ucp_bidiON, /* Other neutral */ ucp_bidiON, /* Other_Neutral */
ucp_bidiPDF, /* Pop directional format */ ucp_bidiPDF, /* Pop_Directional_Format */
ucp_bidiPDI, /* Pop directional isolate */ ucp_bidiPDI, /* Pop_Directional_Isolate */
ucp_bidiR, /* Right to left */ ucp_bidiR, /* Right_To_Left */
ucp_bidiRLE, /* Right to left embedding */ ucp_bidiRLE, /* Right_To_Left_Embedding */
ucp_bidiRLI, /* Right to left isolate */ ucp_bidiRLI, /* Right_To_Left_Isolate */
ucp_bidiRLO, /* Right to left override */ ucp_bidiRLO, /* Right_To_Left_Override */
ucp_bidiS, /* Segment separator */ ucp_bidiS, /* Segment_Separator */
ucp_bidiWS, /* White space */ ucp_bidiWS, /* White_Space */
}; };
/* These are grapheme break properties. The Extended Pictographic property /* These are grapheme break properties. The Extended Pictographic property
@@ -380,6 +380,8 @@ enum {
ucp_Tangsa, ucp_Tangsa,
ucp_Toto, ucp_Toto,
ucp_Vithkuqi, ucp_Vithkuqi,
ucp_Kawi,
ucp_Nag_Mundari,
/* This must be last */ /* This must be last */
ucp_Script_Count ucp_Script_Count

View File

@@ -265,6 +265,7 @@ the "loose matching" rules that Unicode advises and Perl uses. */
#define STRING_kana0 STR_k STR_a STR_n STR_a "\0" #define STRING_kana0 STR_k STR_a STR_n STR_a "\0"
#define STRING_kannada0 STR_k STR_a STR_n STR_n STR_a STR_d STR_a "\0" #define STRING_kannada0 STR_k STR_a STR_n STR_n STR_a STR_d STR_a "\0"
#define STRING_katakana0 STR_k STR_a STR_t STR_a STR_k STR_a STR_n STR_a "\0" #define STRING_katakana0 STR_k STR_a STR_t STR_a STR_k STR_a STR_n STR_a "\0"
#define STRING_kawi0 STR_k STR_a STR_w STR_i "\0"
#define STRING_kayahli0 STR_k STR_a STR_y STR_a STR_h STR_l STR_i "\0" #define STRING_kayahli0 STR_k STR_a STR_y STR_a STR_h STR_l STR_i "\0"
#define STRING_khar0 STR_k STR_h STR_a STR_r "\0" #define STRING_khar0 STR_k STR_h STR_a STR_r "\0"
#define STRING_kharoshthi0 STR_k STR_h STR_a STR_r STR_o STR_s STR_h STR_t STR_h STR_i "\0" #define STRING_kharoshthi0 STR_k STR_h STR_a STR_r STR_o STR_s STR_h STR_t STR_h STR_i "\0"
@@ -347,6 +348,8 @@ the "loose matching" rules that Unicode advises and Perl uses. */
#define STRING_mymr0 STR_m STR_y STR_m STR_r "\0" #define STRING_mymr0 STR_m STR_y STR_m STR_r "\0"
#define STRING_n0 STR_n "\0" #define STRING_n0 STR_n "\0"
#define STRING_nabataean0 STR_n STR_a STR_b STR_a STR_t STR_a STR_e STR_a STR_n "\0" #define STRING_nabataean0 STR_n STR_a STR_b STR_a STR_t STR_a STR_e STR_a STR_n "\0"
#define STRING_nagm0 STR_n STR_a STR_g STR_m "\0"
#define STRING_nagmundari0 STR_n STR_a STR_g STR_m STR_u STR_n STR_d STR_a STR_r STR_i "\0"
#define STRING_nand0 STR_n STR_a STR_n STR_d "\0" #define STRING_nand0 STR_n STR_a STR_n STR_d "\0"
#define STRING_nandinagari0 STR_n STR_a STR_n STR_d STR_i STR_n STR_a STR_g STR_a STR_r STR_i "\0" #define STRING_nandinagari0 STR_n STR_a STR_n STR_d STR_i STR_n STR_a STR_g STR_a STR_r STR_i "\0"
#define STRING_narb0 STR_n STR_a STR_r STR_b "\0" #define STRING_narb0 STR_n STR_a STR_r STR_b "\0"
@@ -753,6 +756,7 @@ const char PRIV(utt_names)[] =
STRING_kana0 STRING_kana0
STRING_kannada0 STRING_kannada0
STRING_katakana0 STRING_katakana0
STRING_kawi0
STRING_kayahli0 STRING_kayahli0
STRING_khar0 STRING_khar0
STRING_kharoshthi0 STRING_kharoshthi0
@@ -835,6 +839,8 @@ const char PRIV(utt_names)[] =
STRING_mymr0 STRING_mymr0
STRING_n0 STRING_n0
STRING_nabataean0 STRING_nabataean0
STRING_nagm0
STRING_nagmundari0
STRING_nand0 STRING_nand0
STRING_nandinagari0 STRING_nandinagari0
STRING_narb0 STRING_narb0
@@ -1241,280 +1247,283 @@ const ucp_type_table PRIV(utt)[] = {
{ 1665, PT_SCX, ucp_Katakana }, { 1665, PT_SCX, ucp_Katakana },
{ 1670, PT_SCX, ucp_Kannada }, { 1670, PT_SCX, ucp_Kannada },
{ 1678, PT_SCX, ucp_Katakana }, { 1678, PT_SCX, ucp_Katakana },
{ 1687, PT_SCX, ucp_Kayah_Li }, { 1687, PT_SC, ucp_Kawi },
{ 1695, PT_SC, ucp_Kharoshthi }, { 1692, PT_SCX, ucp_Kayah_Li },
{ 1700, PT_SC, ucp_Kharoshthi }, { 1700, PT_SC, ucp_Kharoshthi },
{ 1711, PT_SC, ucp_Khitan_Small_Script }, { 1705, PT_SC, ucp_Kharoshthi },
{ 1729, PT_SC, ucp_Khmer }, { 1716, PT_SC, ucp_Khitan_Small_Script },
{ 1735, PT_SC, ucp_Khmer }, { 1734, PT_SC, ucp_Khmer },
{ 1740, PT_SCX, ucp_Khojki }, { 1740, PT_SC, ucp_Khmer },
{ 1745, PT_SCX, ucp_Khojki }, { 1745, PT_SCX, ucp_Khojki },
{ 1752, PT_SCX, ucp_Khudawadi }, { 1750, PT_SCX, ucp_Khojki },
{ 1762, PT_SC, ucp_Khitan_Small_Script }, { 1757, PT_SCX, ucp_Khudawadi },
{ 1767, PT_SCX, ucp_Kannada }, { 1767, PT_SC, ucp_Khitan_Small_Script },
{ 1772, PT_SCX, ucp_Kaithi }, { 1772, PT_SCX, ucp_Kannada },
{ 1777, PT_GC, ucp_L }, { 1777, PT_SCX, ucp_Kaithi },
{ 1779, PT_LAMP, 0 }, { 1782, PT_GC, ucp_L },
{ 1782, PT_SC, ucp_Tai_Tham }, { 1784, PT_LAMP, 0 },
{ 1787, PT_SC, ucp_Lao }, { 1787, PT_SC, ucp_Tai_Tham },
{ 1791, PT_SC, ucp_Lao }, { 1792, PT_SC, ucp_Lao },
{ 1796, PT_SCX, ucp_Latin }, { 1796, PT_SC, ucp_Lao },
{ 1802, PT_SCX, ucp_Latin }, { 1801, PT_SCX, ucp_Latin },
{ 1807, PT_LAMP, 0 }, { 1807, PT_SCX, ucp_Latin },
{ 1810, PT_SC, ucp_Lepcha }, { 1812, PT_LAMP, 0 },
{ 1815, PT_SC, ucp_Lepcha }, { 1815, PT_SC, ucp_Lepcha },
{ 1822, PT_SCX, ucp_Limbu }, { 1820, PT_SC, ucp_Lepcha },
{ 1827, PT_SCX, ucp_Limbu }, { 1827, PT_SCX, ucp_Limbu },
{ 1833, PT_SCX, ucp_Linear_A }, { 1832, PT_SCX, ucp_Limbu },
{ 1838, PT_SCX, ucp_Linear_B }, { 1838, PT_SCX, ucp_Linear_A },
{ 1843, PT_SCX, ucp_Linear_A }, { 1843, PT_SCX, ucp_Linear_B },
{ 1851, PT_SCX, ucp_Linear_B }, { 1848, PT_SCX, ucp_Linear_A },
{ 1859, PT_SC, ucp_Lisu }, { 1856, PT_SCX, ucp_Linear_B },
{ 1864, PT_PC, ucp_Ll }, { 1864, PT_SC, ucp_Lisu },
{ 1867, PT_PC, ucp_Lm }, { 1869, PT_PC, ucp_Ll },
{ 1870, PT_PC, ucp_Lo }, { 1872, PT_PC, ucp_Lm },
{ 1873, PT_BOOL, ucp_Logical_Order_Exception }, { 1875, PT_PC, ucp_Lo },
{ 1877, PT_BOOL, ucp_Logical_Order_Exception }, { 1878, PT_BOOL, ucp_Logical_Order_Exception },
{ 1899, PT_BOOL, ucp_Lowercase }, { 1882, PT_BOOL, ucp_Logical_Order_Exception },
{ 1905, PT_BOOL, ucp_Lowercase }, { 1904, PT_BOOL, ucp_Lowercase },
{ 1915, PT_PC, ucp_Lt }, { 1910, PT_BOOL, ucp_Lowercase },
{ 1918, PT_PC, ucp_Lu }, { 1920, PT_PC, ucp_Lt },
{ 1921, PT_SC, ucp_Lycian }, { 1923, PT_PC, ucp_Lu },
{ 1926, PT_SC, ucp_Lycian }, { 1926, PT_SC, ucp_Lycian },
{ 1933, PT_SC, ucp_Lydian }, { 1931, PT_SC, ucp_Lycian },
{ 1938, PT_SC, ucp_Lydian }, { 1938, PT_SC, ucp_Lydian },
{ 1945, PT_GC, ucp_M }, { 1943, PT_SC, ucp_Lydian },
{ 1947, PT_SCX, ucp_Mahajani }, { 1950, PT_GC, ucp_M },
{ 1956, PT_SCX, ucp_Mahajani }, { 1952, PT_SCX, ucp_Mahajani },
{ 1961, PT_SC, ucp_Makasar }, { 1961, PT_SCX, ucp_Mahajani },
{ 1966, PT_SC, ucp_Makasar }, { 1966, PT_SC, ucp_Makasar },
{ 1974, PT_SCX, ucp_Malayalam }, { 1971, PT_SC, ucp_Makasar },
{ 1984, PT_SCX, ucp_Mandaic }, { 1979, PT_SCX, ucp_Malayalam },
{ 1989, PT_SCX, ucp_Mandaic }, { 1989, PT_SCX, ucp_Mandaic },
{ 1997, PT_SCX, ucp_Manichaean }, { 1994, PT_SCX, ucp_Mandaic },
{ 2002, PT_SCX, ucp_Manichaean }, { 2002, PT_SCX, ucp_Manichaean },
{ 2013, PT_SC, ucp_Marchen }, { 2007, PT_SCX, ucp_Manichaean },
{ 2018, PT_SC, ucp_Marchen }, { 2018, PT_SC, ucp_Marchen },
{ 2026, PT_SCX, ucp_Masaram_Gondi }, { 2023, PT_SC, ucp_Marchen },
{ 2039, PT_BOOL, ucp_Math }, { 2031, PT_SCX, ucp_Masaram_Gondi },
{ 2044, PT_PC, ucp_Mc }, { 2044, PT_BOOL, ucp_Math },
{ 2047, PT_PC, ucp_Me }, { 2049, PT_PC, ucp_Mc },
{ 2050, PT_SC, ucp_Medefaidrin }, { 2052, PT_PC, ucp_Me },
{ 2062, PT_SC, ucp_Medefaidrin }, { 2055, PT_SC, ucp_Medefaidrin },
{ 2067, PT_SC, ucp_Meetei_Mayek }, { 2067, PT_SC, ucp_Medefaidrin },
{ 2079, PT_SC, ucp_Mende_Kikakui }, { 2072, PT_SC, ucp_Meetei_Mayek },
{ 2084, PT_SC, ucp_Mende_Kikakui }, { 2084, PT_SC, ucp_Mende_Kikakui },
{ 2097, PT_SC, ucp_Meroitic_Cursive }, { 2089, PT_SC, ucp_Mende_Kikakui },
{ 2102, PT_SC, ucp_Meroitic_Hieroglyphs }, { 2102, PT_SC, ucp_Meroitic_Cursive },
{ 2107, PT_SC, ucp_Meroitic_Cursive }, { 2107, PT_SC, ucp_Meroitic_Hieroglyphs },
{ 2123, PT_SC, ucp_Meroitic_Hieroglyphs }, { 2112, PT_SC, ucp_Meroitic_Cursive },
{ 2143, PT_SC, ucp_Miao }, { 2128, PT_SC, ucp_Meroitic_Hieroglyphs },
{ 2148, PT_SCX, ucp_Malayalam }, { 2148, PT_SC, ucp_Miao },
{ 2153, PT_PC, ucp_Mn }, { 2153, PT_SCX, ucp_Malayalam },
{ 2156, PT_SCX, ucp_Modi }, { 2158, PT_PC, ucp_Mn },
{ 2161, PT_SCX, ucp_Mongolian }, { 2161, PT_SCX, ucp_Modi },
{ 2166, PT_SCX, ucp_Mongolian }, { 2166, PT_SCX, ucp_Mongolian },
{ 2176, PT_SC, ucp_Mro }, { 2171, PT_SCX, ucp_Mongolian },
{ 2180, PT_SC, ucp_Mro }, { 2181, PT_SC, ucp_Mro },
{ 2185, PT_SC, ucp_Meetei_Mayek }, { 2185, PT_SC, ucp_Mro },
{ 2190, PT_SCX, ucp_Multani }, { 2190, PT_SC, ucp_Meetei_Mayek },
{ 2195, PT_SCX, ucp_Multani }, { 2195, PT_SCX, ucp_Multani },
{ 2203, PT_SCX, ucp_Myanmar }, { 2200, PT_SCX, ucp_Multani },
{ 2211, PT_SCX, ucp_Myanmar }, { 2208, PT_SCX, ucp_Myanmar },
{ 2216, PT_GC, ucp_N }, { 2216, PT_SCX, ucp_Myanmar },
{ 2218, PT_SC, ucp_Nabataean }, { 2221, PT_GC, ucp_N },
{ 2228, PT_SCX, ucp_Nandinagari }, { 2223, PT_SC, ucp_Nabataean },
{ 2233, PT_SCX, ucp_Nandinagari }, { 2233, PT_SC, ucp_Nag_Mundari },
{ 2245, PT_SC, ucp_Old_North_Arabian }, { 2238, PT_SC, ucp_Nag_Mundari },
{ 2250, PT_SC, ucp_Nabataean }, { 2249, PT_SCX, ucp_Nandinagari },
{ 2255, PT_BOOL, ucp_Noncharacter_Code_Point }, { 2254, PT_SCX, ucp_Nandinagari },
{ 2261, PT_PC, ucp_Nd }, { 2266, PT_SC, ucp_Old_North_Arabian },
{ 2264, PT_SC, ucp_Newa }, { 2271, PT_SC, ucp_Nabataean },
{ 2269, PT_SC, ucp_New_Tai_Lue }, { 2276, PT_BOOL, ucp_Noncharacter_Code_Point },
{ 2279, PT_SCX, ucp_Nko }, { 2282, PT_PC, ucp_Nd },
{ 2283, PT_SCX, ucp_Nko }, { 2285, PT_SC, ucp_Newa },
{ 2288, PT_PC, ucp_Nl }, { 2290, PT_SC, ucp_New_Tai_Lue },
{ 2291, PT_PC, ucp_No }, { 2300, PT_SCX, ucp_Nko },
{ 2294, PT_BOOL, ucp_Noncharacter_Code_Point }, { 2304, PT_SCX, ucp_Nko },
{ 2316, PT_SC, ucp_Nushu }, { 2309, PT_PC, ucp_Nl },
{ 2321, PT_SC, ucp_Nushu }, { 2312, PT_PC, ucp_No },
{ 2327, PT_SC, ucp_Nyiakeng_Puachue_Hmong }, { 2315, PT_BOOL, ucp_Noncharacter_Code_Point },
{ 2348, PT_SC, ucp_Ogham }, { 2337, PT_SC, ucp_Nushu },
{ 2353, PT_SC, ucp_Ogham }, { 2342, PT_SC, ucp_Nushu },
{ 2359, PT_SC, ucp_Ol_Chiki }, { 2348, PT_SC, ucp_Nyiakeng_Puachue_Hmong },
{ 2367, PT_SC, ucp_Ol_Chiki }, { 2369, PT_SC, ucp_Ogham },
{ 2372, PT_SC, ucp_Old_Hungarian }, { 2374, PT_SC, ucp_Ogham },
{ 2385, PT_SC, ucp_Old_Italic }, { 2380, PT_SC, ucp_Ol_Chiki },
{ 2395, PT_SC, ucp_Old_North_Arabian }, { 2388, PT_SC, ucp_Ol_Chiki },
{ 2411, PT_SCX, ucp_Old_Permic }, { 2393, PT_SC, ucp_Old_Hungarian },
{ 2421, PT_SC, ucp_Old_Persian }, { 2406, PT_SC, ucp_Old_Italic },
{ 2432, PT_SC, ucp_Old_Sogdian }, { 2416, PT_SC, ucp_Old_North_Arabian },
{ 2443, PT_SC, ucp_Old_South_Arabian }, { 2432, PT_SCX, ucp_Old_Permic },
{ 2459, PT_SC, ucp_Old_Turkic }, { 2442, PT_SC, ucp_Old_Persian },
{ 2469, PT_SCX, ucp_Old_Uyghur }, { 2453, PT_SC, ucp_Old_Sogdian },
{ 2479, PT_SCX, ucp_Oriya }, { 2464, PT_SC, ucp_Old_South_Arabian },
{ 2485, PT_SC, ucp_Old_Turkic }, { 2480, PT_SC, ucp_Old_Turkic },
{ 2490, PT_SCX, ucp_Oriya }, { 2490, PT_SCX, ucp_Old_Uyghur },
{ 2495, PT_SC, ucp_Osage }, { 2500, PT_SCX, ucp_Oriya },
{ 2501, PT_SC, ucp_Osage }, { 2506, PT_SC, ucp_Old_Turkic },
{ 2506, PT_SC, ucp_Osmanya }, { 2511, PT_SCX, ucp_Oriya },
{ 2511, PT_SC, ucp_Osmanya }, { 2516, PT_SC, ucp_Osage },
{ 2519, PT_SCX, ucp_Old_Uyghur }, { 2522, PT_SC, ucp_Osage },
{ 2524, PT_GC, ucp_P }, { 2527, PT_SC, ucp_Osmanya },
{ 2526, PT_SC, ucp_Pahawh_Hmong }, { 2532, PT_SC, ucp_Osmanya },
{ 2538, PT_SC, ucp_Palmyrene }, { 2540, PT_SCX, ucp_Old_Uyghur },
{ 2543, PT_SC, ucp_Palmyrene }, { 2545, PT_GC, ucp_P },
{ 2553, PT_BOOL, ucp_Pattern_Syntax }, { 2547, PT_SC, ucp_Pahawh_Hmong },
{ 2560, PT_BOOL, ucp_Pattern_Syntax }, { 2559, PT_SC, ucp_Palmyrene },
{ 2574, PT_BOOL, ucp_Pattern_White_Space }, { 2564, PT_SC, ucp_Palmyrene },
{ 2592, PT_BOOL, ucp_Pattern_White_Space }, { 2574, PT_BOOL, ucp_Pattern_Syntax },
{ 2598, PT_SC, ucp_Pau_Cin_Hau }, { 2581, PT_BOOL, ucp_Pattern_Syntax },
{ 2603, PT_SC, ucp_Pau_Cin_Hau }, { 2595, PT_BOOL, ucp_Pattern_White_Space },
{ 2613, PT_PC, ucp_Pc }, { 2613, PT_BOOL, ucp_Pattern_White_Space },
{ 2616, PT_BOOL, ucp_Prepended_Concatenation_Mark }, { 2619, PT_SC, ucp_Pau_Cin_Hau },
{ 2620, PT_PC, ucp_Pd }, { 2624, PT_SC, ucp_Pau_Cin_Hau },
{ 2623, PT_PC, ucp_Pe }, { 2634, PT_PC, ucp_Pc },
{ 2626, PT_SCX, ucp_Old_Permic }, { 2637, PT_BOOL, ucp_Prepended_Concatenation_Mark },
{ 2631, PT_PC, ucp_Pf }, { 2641, PT_PC, ucp_Pd },
{ 2634, PT_SCX, ucp_Phags_Pa }, { 2644, PT_PC, ucp_Pe },
{ 2639, PT_SCX, ucp_Phags_Pa }, { 2647, PT_SCX, ucp_Old_Permic },
{ 2647, PT_SC, ucp_Inscriptional_Pahlavi }, { 2652, PT_PC, ucp_Pf },
{ 2652, PT_SCX, ucp_Psalter_Pahlavi }, { 2655, PT_SCX, ucp_Phags_Pa },
{ 2657, PT_SC, ucp_Phoenician }, { 2660, PT_SCX, ucp_Phags_Pa },
{ 2662, PT_SC, ucp_Phoenician }, { 2668, PT_SC, ucp_Inscriptional_Pahlavi },
{ 2673, PT_PC, ucp_Pi }, { 2673, PT_SCX, ucp_Psalter_Pahlavi },
{ 2676, PT_SC, ucp_Miao }, { 2678, PT_SC, ucp_Phoenician },
{ 2681, PT_PC, ucp_Po }, { 2683, PT_SC, ucp_Phoenician },
{ 2684, PT_BOOL, ucp_Prepended_Concatenation_Mark }, { 2694, PT_PC, ucp_Pi },
{ 2711, PT_SC, ucp_Inscriptional_Parthian }, { 2697, PT_SC, ucp_Miao },
{ 2716, PT_PC, ucp_Ps }, { 2702, PT_PC, ucp_Po },
{ 2719, PT_SCX, ucp_Psalter_Pahlavi }, { 2705, PT_BOOL, ucp_Prepended_Concatenation_Mark },
{ 2734, PT_SCX, ucp_Coptic }, { 2732, PT_SC, ucp_Inscriptional_Parthian },
{ 2739, PT_SC, ucp_Inherited }, { 2737, PT_PC, ucp_Ps },
{ 2744, PT_BOOL, ucp_Quotation_Mark }, { 2740, PT_SCX, ucp_Psalter_Pahlavi },
{ 2750, PT_BOOL, ucp_Quotation_Mark }, { 2755, PT_SCX, ucp_Coptic },
{ 2764, PT_BOOL, ucp_Radical }, { 2760, PT_SC, ucp_Inherited },
{ 2772, PT_BOOL, ucp_Regional_Indicator }, { 2765, PT_BOOL, ucp_Quotation_Mark },
{ 2790, PT_SC, ucp_Rejang }, { 2771, PT_BOOL, ucp_Quotation_Mark },
{ 2797, PT_BOOL, ucp_Regional_Indicator }, { 2785, PT_BOOL, ucp_Radical },
{ 2800, PT_SC, ucp_Rejang }, { 2793, PT_BOOL, ucp_Regional_Indicator },
{ 2805, PT_SCX, ucp_Hanifi_Rohingya }, { 2811, PT_SC, ucp_Rejang },
{ 2810, PT_SC, ucp_Runic }, { 2818, PT_BOOL, ucp_Regional_Indicator },
{ 2816, PT_SC, ucp_Runic }, { 2821, PT_SC, ucp_Rejang },
{ 2821, PT_GC, ucp_S }, { 2826, PT_SCX, ucp_Hanifi_Rohingya },
{ 2823, PT_SC, ucp_Samaritan }, { 2831, PT_SC, ucp_Runic },
{ 2833, PT_SC, ucp_Samaritan }, { 2837, PT_SC, ucp_Runic },
{ 2838, PT_SC, ucp_Old_South_Arabian }, { 2842, PT_GC, ucp_S },
{ 2843, PT_SC, ucp_Saurashtra }, { 2844, PT_SC, ucp_Samaritan },
{ 2848, PT_SC, ucp_Saurashtra }, { 2854, PT_SC, ucp_Samaritan },
{ 2859, PT_PC, ucp_Sc }, { 2859, PT_SC, ucp_Old_South_Arabian },
{ 2862, PT_BOOL, ucp_Soft_Dotted }, { 2864, PT_SC, ucp_Saurashtra },
{ 2865, PT_BOOL, ucp_Sentence_Terminal }, { 2869, PT_SC, ucp_Saurashtra },
{ 2882, PT_SC, ucp_SignWriting }, { 2880, PT_PC, ucp_Sc },
{ 2887, PT_SCX, ucp_Sharada }, { 2883, PT_BOOL, ucp_Soft_Dotted },
{ 2895, PT_SC, ucp_Shavian }, { 2886, PT_BOOL, ucp_Sentence_Terminal },
{ 2903, PT_SC, ucp_Shavian }, { 2903, PT_SC, ucp_SignWriting },
{ 2908, PT_SCX, ucp_Sharada }, { 2908, PT_SCX, ucp_Sharada },
{ 2913, PT_SC, ucp_Siddham }, { 2916, PT_SC, ucp_Shavian },
{ 2918, PT_SC, ucp_Siddham }, { 2924, PT_SC, ucp_Shavian },
{ 2926, PT_SC, ucp_SignWriting }, { 2929, PT_SCX, ucp_Sharada },
{ 2938, PT_SCX, ucp_Khudawadi }, { 2934, PT_SC, ucp_Siddham },
{ 2943, PT_SCX, ucp_Sinhala }, { 2939, PT_SC, ucp_Siddham },
{ 2948, PT_SCX, ucp_Sinhala }, { 2947, PT_SC, ucp_SignWriting },
{ 2956, PT_PC, ucp_Sk }, { 2959, PT_SCX, ucp_Khudawadi },
{ 2959, PT_PC, ucp_Sm }, { 2964, PT_SCX, ucp_Sinhala },
{ 2962, PT_PC, ucp_So }, { 2969, PT_SCX, ucp_Sinhala },
{ 2965, PT_BOOL, ucp_Soft_Dotted }, { 2977, PT_PC, ucp_Sk },
{ 2976, PT_SCX, ucp_Sogdian }, { 2980, PT_PC, ucp_Sm },
{ 2981, PT_SCX, ucp_Sogdian }, { 2983, PT_PC, ucp_So },
{ 2989, PT_SC, ucp_Old_Sogdian }, { 2986, PT_BOOL, ucp_Soft_Dotted },
{ 2994, PT_SC, ucp_Sora_Sompeng }, { 2997, PT_SCX, ucp_Sogdian },
{ 2999, PT_SC, ucp_Sora_Sompeng }, { 3002, PT_SCX, ucp_Sogdian },
{ 3011, PT_SC, ucp_Soyombo }, { 3010, PT_SC, ucp_Old_Sogdian },
{ 3016, PT_SC, ucp_Soyombo }, { 3015, PT_SC, ucp_Sora_Sompeng },
{ 3024, PT_BOOL, ucp_White_Space }, { 3020, PT_SC, ucp_Sora_Sompeng },
{ 3030, PT_BOOL, ucp_Sentence_Terminal }, { 3032, PT_SC, ucp_Soyombo },
{ 3036, PT_SC, ucp_Sundanese }, { 3037, PT_SC, ucp_Soyombo },
{ 3041, PT_SC, ucp_Sundanese }, { 3045, PT_BOOL, ucp_White_Space },
{ 3051, PT_SCX, ucp_Syloti_Nagri }, { 3051, PT_BOOL, ucp_Sentence_Terminal },
{ 3056, PT_SCX, ucp_Syloti_Nagri }, { 3057, PT_SC, ucp_Sundanese },
{ 3068, PT_SCX, ucp_Syriac }, { 3062, PT_SC, ucp_Sundanese },
{ 3073, PT_SCX, ucp_Syriac }, { 3072, PT_SCX, ucp_Syloti_Nagri },
{ 3080, PT_SCX, ucp_Tagalog }, { 3077, PT_SCX, ucp_Syloti_Nagri },
{ 3088, PT_SCX, ucp_Tagbanwa }, { 3089, PT_SCX, ucp_Syriac },
{ 3093, PT_SCX, ucp_Tagbanwa }, { 3094, PT_SCX, ucp_Syriac },
{ 3102, PT_SCX, ucp_Tai_Le }, { 3101, PT_SCX, ucp_Tagalog },
{ 3108, PT_SC, ucp_Tai_Tham }, { 3109, PT_SCX, ucp_Tagbanwa },
{ 3116, PT_SC, ucp_Tai_Viet }, { 3114, PT_SCX, ucp_Tagbanwa },
{ 3124, PT_SCX, ucp_Takri }, { 3123, PT_SCX, ucp_Tai_Le },
{ 3129, PT_SCX, ucp_Takri }, { 3129, PT_SC, ucp_Tai_Tham },
{ 3135, PT_SCX, ucp_Tai_Le }, { 3137, PT_SC, ucp_Tai_Viet },
{ 3140, PT_SC, ucp_New_Tai_Lue }, { 3145, PT_SCX, ucp_Takri },
{ 3145, PT_SCX, ucp_Tamil }, { 3150, PT_SCX, ucp_Takri },
{ 3151, PT_SCX, ucp_Tamil }, { 3156, PT_SCX, ucp_Tai_Le },
{ 3156, PT_SC, ucp_Tangut }, { 3161, PT_SC, ucp_New_Tai_Lue },
{ 3161, PT_SC, ucp_Tangsa }, { 3166, PT_SCX, ucp_Tamil },
{ 3168, PT_SC, ucp_Tangut }, { 3172, PT_SCX, ucp_Tamil },
{ 3175, PT_SC, ucp_Tai_Viet }, { 3177, PT_SC, ucp_Tangut },
{ 3180, PT_SCX, ucp_Telugu }, { 3182, PT_SC, ucp_Tangsa },
{ 3185, PT_SCX, ucp_Telugu }, { 3189, PT_SC, ucp_Tangut },
{ 3192, PT_BOOL, ucp_Terminal_Punctuation }, { 3196, PT_SC, ucp_Tai_Viet },
{ 3197, PT_BOOL, ucp_Terminal_Punctuation }, { 3201, PT_SCX, ucp_Telugu },
{ 3217, PT_SC, ucp_Tifinagh }, { 3206, PT_SCX, ucp_Telugu },
{ 3222, PT_SCX, ucp_Tagalog }, { 3213, PT_BOOL, ucp_Terminal_Punctuation },
{ 3227, PT_SCX, ucp_Thaana }, { 3218, PT_BOOL, ucp_Terminal_Punctuation },
{ 3232, PT_SCX, ucp_Thaana }, { 3238, PT_SC, ucp_Tifinagh },
{ 3239, PT_SC, ucp_Thai }, { 3243, PT_SCX, ucp_Tagalog },
{ 3244, PT_SC, ucp_Tibetan }, { 3248, PT_SCX, ucp_Thaana },
{ 3252, PT_SC, ucp_Tibetan }, { 3253, PT_SCX, ucp_Thaana },
{ 3257, PT_SC, ucp_Tifinagh }, { 3260, PT_SC, ucp_Thai },
{ 3266, PT_SCX, ucp_Tirhuta }, { 3265, PT_SC, ucp_Tibetan },
{ 3271, PT_SCX, ucp_Tirhuta }, { 3273, PT_SC, ucp_Tibetan },
{ 3279, PT_SC, ucp_Tangsa }, { 3278, PT_SC, ucp_Tifinagh },
{ 3284, PT_SC, ucp_Toto }, { 3287, PT_SCX, ucp_Tirhuta },
{ 3289, PT_SC, ucp_Ugaritic }, { 3292, PT_SCX, ucp_Tirhuta },
{ 3294, PT_SC, ucp_Ugaritic }, { 3300, PT_SC, ucp_Tangsa },
{ 3303, PT_BOOL, ucp_Unified_Ideograph }, { 3305, PT_SC, ucp_Toto },
{ 3309, PT_BOOL, ucp_Unified_Ideograph }, { 3310, PT_SC, ucp_Ugaritic },
{ 3326, PT_SC, ucp_Unknown }, { 3315, PT_SC, ucp_Ugaritic },
{ 3334, PT_BOOL, ucp_Uppercase }, { 3324, PT_BOOL, ucp_Unified_Ideograph },
{ 3340, PT_BOOL, ucp_Uppercase }, { 3330, PT_BOOL, ucp_Unified_Ideograph },
{ 3350, PT_SC, ucp_Vai }, { 3347, PT_SC, ucp_Unknown },
{ 3354, PT_SC, ucp_Vai }, { 3355, PT_BOOL, ucp_Uppercase },
{ 3359, PT_BOOL, ucp_Variation_Selector }, { 3361, PT_BOOL, ucp_Uppercase },
{ 3377, PT_SC, ucp_Vithkuqi }, { 3371, PT_SC, ucp_Vai },
{ 3382, PT_SC, ucp_Vithkuqi }, { 3375, PT_SC, ucp_Vai },
{ 3391, PT_BOOL, ucp_Variation_Selector }, { 3380, PT_BOOL, ucp_Variation_Selector },
{ 3394, PT_SC, ucp_Wancho }, { 3398, PT_SC, ucp_Vithkuqi },
{ 3401, PT_SC, ucp_Warang_Citi }, { 3403, PT_SC, ucp_Vithkuqi },
{ 3406, PT_SC, ucp_Warang_Citi }, { 3412, PT_BOOL, ucp_Variation_Selector },
{ 3417, PT_SC, ucp_Wancho }, { 3415, PT_SC, ucp_Wancho },
{ 3422, PT_BOOL, ucp_White_Space }, { 3422, PT_SC, ucp_Warang_Citi },
{ 3433, PT_BOOL, ucp_White_Space }, { 3427, PT_SC, ucp_Warang_Citi },
{ 3440, PT_ALNUM, 0 }, { 3438, PT_SC, ucp_Wancho },
{ 3444, PT_BOOL, ucp_XID_Continue }, { 3443, PT_BOOL, ucp_White_Space },
{ 3449, PT_BOOL, ucp_XID_Continue }, { 3454, PT_BOOL, ucp_White_Space },
{ 3461, PT_BOOL, ucp_XID_Start }, { 3461, PT_ALNUM, 0 },
{ 3466, PT_BOOL, ucp_XID_Start }, { 3465, PT_BOOL, ucp_XID_Continue },
{ 3475, PT_SC, ucp_Old_Persian }, { 3470, PT_BOOL, ucp_XID_Continue },
{ 3480, PT_PXSPACE, 0 }, { 3482, PT_BOOL, ucp_XID_Start },
{ 3484, PT_SPACE, 0 }, { 3487, PT_BOOL, ucp_XID_Start },
{ 3488, PT_SC, ucp_Cuneiform }, { 3496, PT_SC, ucp_Old_Persian },
{ 3493, PT_UCNC, 0 }, { 3501, PT_PXSPACE, 0 },
{ 3497, PT_WORD, 0 }, { 3505, PT_SPACE, 0 },
{ 3501, PT_SCX, ucp_Yezidi }, { 3509, PT_SC, ucp_Cuneiform },
{ 3506, PT_SCX, ucp_Yezidi }, { 3514, PT_UCNC, 0 },
{ 3513, PT_SCX, ucp_Yi }, { 3518, PT_WORD, 0 },
{ 3516, PT_SCX, ucp_Yi }, { 3522, PT_SCX, ucp_Yezidi },
{ 3521, PT_GC, ucp_Z }, { 3527, PT_SCX, ucp_Yezidi },
{ 3523, PT_SC, ucp_Zanabazar_Square }, { 3534, PT_SCX, ucp_Yi },
{ 3539, PT_SC, ucp_Zanabazar_Square }, { 3537, PT_SCX, ucp_Yi },
{ 3544, PT_SC, ucp_Inherited }, { 3542, PT_GC, ucp_Z },
{ 3549, PT_PC, ucp_Zl }, { 3544, PT_SC, ucp_Zanabazar_Square },
{ 3552, PT_PC, ucp_Zp }, { 3560, PT_SC, ucp_Zanabazar_Square },
{ 3555, PT_PC, ucp_Zs }, { 3565, PT_SC, ucp_Inherited },
{ 3558, PT_SC, ucp_Common }, { 3570, PT_PC, ucp_Zl },
{ 3563, PT_SC, ucp_Unknown } { 3573, PT_PC, ucp_Zp },
{ 3576, PT_PC, ucp_Zs },
{ 3579, PT_SC, ucp_Common },
{ 3584, PT_SC, ucp_Unknown }
}; };
const size_t PRIV(utt_size) = sizeof(PRIV(utt)) / sizeof(ucp_type_table); const size_t PRIV(utt_size) = sizeof(PRIV(utt)) / sizeof(ucp_type_table);

View File

@@ -171,7 +171,7 @@ for (p = string; length > 0; p++)
if (((d = *(++p)) & 0xc0) != 0x80) if (((d = *(++p)) & 0xc0) != 0x80)
{ {
*erroroffset = (int)(p - string) - 1; *erroroffset = (PCRE2_SIZE)(p - string) - 1;
return PCRE2_ERROR_UTF8_ERR6; return PCRE2_ERROR_UTF8_ERR6;
} }
@@ -186,7 +186,7 @@ for (p = string; length > 0; p++)
case 1: if ((c & 0x3e) == 0) case 1: if ((c & 0x3e) == 0)
{ {
*erroroffset = (int)(p - string) - 1; *erroroffset = (PCRE2_SIZE)(p - string) - 1;
return PCRE2_ERROR_UTF8_ERR15; return PCRE2_ERROR_UTF8_ERR15;
} }
break; break;
@@ -198,17 +198,17 @@ for (p = string; length > 0; p++)
case 2: case 2:
if ((*(++p) & 0xc0) != 0x80) /* Third byte */ if ((*(++p) & 0xc0) != 0x80) /* Third byte */
{ {
*erroroffset = (int)(p - string) - 2; *erroroffset = (PCRE2_SIZE)(p - string) - 2;
return PCRE2_ERROR_UTF8_ERR7; return PCRE2_ERROR_UTF8_ERR7;
} }
if (c == 0xe0 && (d & 0x20) == 0) if (c == 0xe0 && (d & 0x20) == 0)
{ {
*erroroffset = (int)(p - string) - 2; *erroroffset = (PCRE2_SIZE)(p - string) - 2;
return PCRE2_ERROR_UTF8_ERR16; return PCRE2_ERROR_UTF8_ERR16;
} }
if (c == 0xed && d >= 0xa0) if (c == 0xed && d >= 0xa0)
{ {
*erroroffset = (int)(p - string) - 2; *erroroffset = (PCRE2_SIZE)(p - string) - 2;
return PCRE2_ERROR_UTF8_ERR14; return PCRE2_ERROR_UTF8_ERR14;
} }
break; break;
@@ -220,22 +220,22 @@ for (p = string; length > 0; p++)
case 3: case 3:
if ((*(++p) & 0xc0) != 0x80) /* Third byte */ if ((*(++p) & 0xc0) != 0x80) /* Third byte */
{ {
*erroroffset = (int)(p - string) - 2; *erroroffset = (PCRE2_SIZE)(p - string) - 2;
return PCRE2_ERROR_UTF8_ERR7; return PCRE2_ERROR_UTF8_ERR7;
} }
if ((*(++p) & 0xc0) != 0x80) /* Fourth byte */ if ((*(++p) & 0xc0) != 0x80) /* Fourth byte */
{ {
*erroroffset = (int)(p - string) - 3; *erroroffset = (PCRE2_SIZE)(p - string) - 3;
return PCRE2_ERROR_UTF8_ERR8; return PCRE2_ERROR_UTF8_ERR8;
} }
if (c == 0xf0 && (d & 0x30) == 0) if (c == 0xf0 && (d & 0x30) == 0)
{ {
*erroroffset = (int)(p - string) - 3; *erroroffset = (PCRE2_SIZE)(p - string) - 3;
return PCRE2_ERROR_UTF8_ERR17; return PCRE2_ERROR_UTF8_ERR17;
} }
if (c > 0xf4 || (c == 0xf4 && d > 0x8f)) if (c > 0xf4 || (c == 0xf4 && d > 0x8f))
{ {
*erroroffset = (int)(p - string) - 3; *erroroffset = (PCRE2_SIZE)(p - string) - 3;
return PCRE2_ERROR_UTF8_ERR13; return PCRE2_ERROR_UTF8_ERR13;
} }
break; break;
@@ -251,22 +251,22 @@ for (p = string; length > 0; p++)
case 4: case 4:
if ((*(++p) & 0xc0) != 0x80) /* Third byte */ if ((*(++p) & 0xc0) != 0x80) /* Third byte */
{ {
*erroroffset = (int)(p - string) - 2; *erroroffset = (PCRE2_SIZE)(p - string) - 2;
return PCRE2_ERROR_UTF8_ERR7; return PCRE2_ERROR_UTF8_ERR7;
} }
if ((*(++p) & 0xc0) != 0x80) /* Fourth byte */ if ((*(++p) & 0xc0) != 0x80) /* Fourth byte */
{ {
*erroroffset = (int)(p - string) - 3; *erroroffset = (PCRE2_SIZE)(p - string) - 3;
return PCRE2_ERROR_UTF8_ERR8; return PCRE2_ERROR_UTF8_ERR8;
} }
if ((*(++p) & 0xc0) != 0x80) /* Fifth byte */ if ((*(++p) & 0xc0) != 0x80) /* Fifth byte */
{ {
*erroroffset = (int)(p - string) - 4; *erroroffset = (PCRE2_SIZE)(p - string) - 4;
return PCRE2_ERROR_UTF8_ERR9; return PCRE2_ERROR_UTF8_ERR9;
} }
if (c == 0xf8 && (d & 0x38) == 0) if (c == 0xf8 && (d & 0x38) == 0)
{ {
*erroroffset = (int)(p - string) - 4; *erroroffset = (PCRE2_SIZE)(p - string) - 4;
return PCRE2_ERROR_UTF8_ERR18; return PCRE2_ERROR_UTF8_ERR18;
} }
break; break;
@@ -277,27 +277,27 @@ for (p = string; length > 0; p++)
case 5: case 5:
if ((*(++p) & 0xc0) != 0x80) /* Third byte */ if ((*(++p) & 0xc0) != 0x80) /* Third byte */
{ {
*erroroffset = (int)(p - string) - 2; *erroroffset = (PCRE2_SIZE)(p - string) - 2;
return PCRE2_ERROR_UTF8_ERR7; return PCRE2_ERROR_UTF8_ERR7;
} }
if ((*(++p) & 0xc0) != 0x80) /* Fourth byte */ if ((*(++p) & 0xc0) != 0x80) /* Fourth byte */
{ {
*erroroffset = (int)(p - string) - 3; *erroroffset = (PCRE2_SIZE)(p - string) - 3;
return PCRE2_ERROR_UTF8_ERR8; return PCRE2_ERROR_UTF8_ERR8;
} }
if ((*(++p) & 0xc0) != 0x80) /* Fifth byte */ if ((*(++p) & 0xc0) != 0x80) /* Fifth byte */
{ {
*erroroffset = (int)(p - string) - 4; *erroroffset = (PCRE2_SIZE)(p - string) - 4;
return PCRE2_ERROR_UTF8_ERR9; return PCRE2_ERROR_UTF8_ERR9;
} }
if ((*(++p) & 0xc0) != 0x80) /* Sixth byte */ if ((*(++p) & 0xc0) != 0x80) /* Sixth byte */
{ {
*erroroffset = (int)(p - string) - 5; *erroroffset = (PCRE2_SIZE)(p - string) - 5;
return PCRE2_ERROR_UTF8_ERR10; return PCRE2_ERROR_UTF8_ERR10;
} }
if (c == 0xfc && (d & 0x3c) == 0) if (c == 0xfc && (d & 0x3c) == 0)
{ {
*erroroffset = (int)(p - string) - 5; *erroroffset = (PCRE2_SIZE)(p - string) - 5;
return PCRE2_ERROR_UTF8_ERR19; return PCRE2_ERROR_UTF8_ERR19;
} }
break; break;
@@ -309,7 +309,7 @@ for (p = string; length > 0; p++)
if (ab > 3) if (ab > 3)
{ {
*erroroffset = (int)(p - string) - ab; *erroroffset = (PCRE2_SIZE)(p - string) - ab;
return (ab == 4)? PCRE2_ERROR_UTF8_ERR11 : PCRE2_ERROR_UTF8_ERR12; return (ab == 4)? PCRE2_ERROR_UTF8_ERR11 : PCRE2_ERROR_UTF8_ERR12;
} }
} }
@@ -340,21 +340,21 @@ for (p = string; length > 0; p++)
/* High surrogate. Must be a followed by a low surrogate. */ /* High surrogate. Must be a followed by a low surrogate. */
if (length == 0) if (length == 0)
{ {
*erroroffset = p - string; *erroroffset = (PCRE2_SIZE)(p - string);
return PCRE2_ERROR_UTF16_ERR1; return PCRE2_ERROR_UTF16_ERR1;
} }
p++; p++;
length--; length--;
if ((*p & 0xfc00) != 0xdc00) if ((*p & 0xfc00) != 0xdc00)
{ {
*erroroffset = p - string - 1; *erroroffset = (PCRE2_SIZE)(p - string) - 1;
return PCRE2_ERROR_UTF16_ERR2; return PCRE2_ERROR_UTF16_ERR2;
} }
} }
else else
{ {
/* Isolated low surrogate. Always an error. */ /* Isolated low surrogate. Always an error. */
*erroroffset = p - string; *erroroffset = (PCRE2_SIZE)(p - string);
return PCRE2_ERROR_UTF16_ERR3; return PCRE2_ERROR_UTF16_ERR3;
} }
} }
@@ -379,14 +379,14 @@ for (p = string; length > 0; length--, p++)
/* Normal UTF-32 code point. Neither high nor low surrogate. */ /* Normal UTF-32 code point. Neither high nor low surrogate. */
if (c > 0x10ffffu) if (c > 0x10ffffu)
{ {
*erroroffset = p - string; *erroroffset = (PCRE2_SIZE)(p - string);
return PCRE2_ERROR_UTF32_ERR2; return PCRE2_ERROR_UTF32_ERR2;
} }
} }
else else
{ {
/* A surrogate */ /* A surrogate */
*erroroffset = p - string; *erroroffset = (PCRE2_SIZE)(p - string);
return PCRE2_ERROR_UTF32_ERR1; return PCRE2_ERROR_UTF32_ERR1;
} }
} }

View File

@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge Original API code Copyright (c) 1997-2012 University of Cambridge
New API code Copyright (c) 2016-2022 University of Cambridge New API code Copyright (c) 2016-2023 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@@ -133,6 +133,7 @@ while ((t = *data++) != XCL_END)
#ifdef SUPPORT_UNICODE #ifdef SUPPORT_UNICODE
else /* XCL_PROP & XCL_NOTPROP */ else /* XCL_PROP & XCL_NOTPROP */
{ {
int chartype;
const ucd_record *prop = GET_UCD(c); const ucd_record *prop = GET_UCD(c);
BOOL isprop = t == XCL_PROP; BOOL isprop = t == XCL_PROP;
BOOL ok; BOOL ok;
@@ -144,8 +145,9 @@ while ((t = *data++) != XCL_END)
break; break;
case PT_LAMP: case PT_LAMP:
if ((prop->chartype == ucp_Lu || prop->chartype == ucp_Ll || chartype = prop->chartype;
prop->chartype == ucp_Lt) == isprop) return !negated; if ((chartype == ucp_Lu || chartype == ucp_Ll ||
chartype == ucp_Lt) == isprop) return !negated;
break; break;
case PT_GC: case PT_GC:
@@ -168,8 +170,9 @@ while ((t = *data++) != XCL_END)
break; break;
case PT_ALNUM: case PT_ALNUM:
if ((PRIV(ucp_gentype)[prop->chartype] == ucp_L || chartype = prop->chartype;
PRIV(ucp_gentype)[prop->chartype] == ucp_N) == isprop) if ((PRIV(ucp_gentype)[chartype] == ucp_L ||
PRIV(ucp_gentype)[chartype] == ucp_N) == isprop)
return !negated; return !negated;
break; break;
@@ -194,9 +197,10 @@ while ((t = *data++) != XCL_END)
break; break;
case PT_WORD: case PT_WORD:
if ((PRIV(ucp_gentype)[prop->chartype] == ucp_L || chartype = prop->chartype;
PRIV(ucp_gentype)[prop->chartype] == ucp_N || c == CHAR_UNDERSCORE) if ((PRIV(ucp_gentype)[chartype] == ucp_L ||
== isprop) PRIV(ucp_gentype)[chartype] == ucp_N ||
chartype == ucp_Mn || chartype == ucp_Pc) == isprop)
return !negated; return !negated;
break; break;
@@ -238,9 +242,10 @@ while ((t = *data++) != XCL_END)
*/ */
case PT_PXGRAPH: case PT_PXGRAPH:
if ((PRIV(ucp_gentype)[prop->chartype] != ucp_Z && chartype = prop->chartype;
(PRIV(ucp_gentype)[prop->chartype] != ucp_C || if ((PRIV(ucp_gentype)[chartype] != ucp_Z &&
(prop->chartype == ucp_Cf && (PRIV(ucp_gentype)[chartype] != ucp_C ||
(chartype == ucp_Cf &&
c != 0x061c && c != 0x180e && (c < 0x2066 || c > 0x2069)) c != 0x061c && c != 0x180e && (c < 0x2066 || c > 0x2069))
)) == isprop) )) == isprop)
return !negated; return !negated;
@@ -250,10 +255,11 @@ while ((t = *data++) != XCL_END)
not Zl and not Zp, and U+180E. */ not Zl and not Zp, and U+180E. */
case PT_PXPRINT: case PT_PXPRINT:
if ((prop->chartype != ucp_Zl && chartype = prop->chartype;
prop->chartype != ucp_Zp && if ((chartype != ucp_Zl &&
(PRIV(ucp_gentype)[prop->chartype] != ucp_C || chartype != ucp_Zp &&
(prop->chartype == ucp_Cf && (PRIV(ucp_gentype)[chartype] != ucp_C ||
(chartype == ucp_Cf &&
c != 0x061c && (c < 0x2066 || c > 0x2069)) c != 0x061c && (c < 0x2066 || c > 0x2069))
)) == isprop) )) == isprop)
return !negated; return !negated;
@@ -264,8 +270,21 @@ while ((t = *data++) != XCL_END)
compatibility (these are $+<=>^`|~). */ compatibility (these are $+<=>^`|~). */
case PT_PXPUNCT: case PT_PXPUNCT:
if ((PRIV(ucp_gentype)[prop->chartype] == ucp_P || chartype = prop->chartype;
(c < 128 && PRIV(ucp_gentype)[prop->chartype] == ucp_S)) == isprop) if ((PRIV(ucp_gentype)[chartype] == ucp_P ||
(c < 128 && PRIV(ucp_gentype)[chartype] == ucp_S)) == isprop)
return !negated;
break;
/* Perl has two sets of hex digits */
case PT_PXXDIGIT:
if (((c >= CHAR_0 && c <= CHAR_9) ||
(c >= CHAR_A && c <= CHAR_F) ||
(c >= CHAR_a && c <= CHAR_f) ||
(c >= 0xff10 && c <= 0xff19) || /* Fullwidth digits */
(c >= 0xff21 && c <= 0xff26) || /* Fullwidth letters */
(c >= 0xff41 && c <= 0xff46)) == isprop)
return !negated; return !negated;
break; break;

View File

@@ -40,25 +40,27 @@ POSSIBILITY OF SUCH DAMAGE.
/* This module is a wrapper that provides a POSIX API to the underlying PCRE2 /* This module is a wrapper that provides a POSIX API to the underlying PCRE2
functions. The operative functions are called pcre2_regcomp(), etc., with functions. The functions are called pcre2_regcomp(), pcre2_regexec(), etc.
wrappers that use the plain POSIX names. In addition, pcre2posix.h defines the pcre2posix.h defines the POSIX names as macros for the corresonding pcre2_xxx
POSIX names as macros for the pcre2_xxx functions, so any program that includes functions, so any program that includes it and uses the POSIX names will call
it and uses the POSIX names will call the base functions directly. This makes the PCRE2 implementations instead. */
it easier for an application to be sure it gets the PCRE2 versions in the
presence of other POSIX regex libraries. */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
#ifdef PCRE2POSIX_SHARED
#undef PCRE2_STATIC
#endif
/* Ensure that the PCRE2POSIX_EXP_xxx macros are set appropriately for /* Ensure that the PCRE2POSIX_EXP_xxx macros are set appropriately for
compiling these functions. This must come before including pcre2posix.h, where compiling these functions. This must come before including pcre2posix.h, where
they are set for an application (using these functions) if they have not they are set for an application (using these functions) if they have not
previously been set. */ previously been set. */
#if defined(_WIN32) && !defined(PCRE2_STATIC) #if defined(_WIN32) && (defined(PCRE2POSIX_SHARED) || !defined(PCRE2_STATIC))
# define PCRE2POSIX_EXP_DECL extern __declspec(dllexport) # define PCRE2POSIX_EXP_DECL extern __declspec(dllexport)
# define PCRE2POSIX_EXP_DEFN __declspec(dllexport) # define PCRE2POSIX_EXP_DEFN __declspec(dllexport)
#endif #endif
@@ -69,6 +71,7 @@ MSVC 10/2010. Except for VC6 (which is missing some fundamentals and fails). */
#if defined(_MSC_VER) && (_MSC_VER < 1900) #if defined(_MSC_VER) && (_MSC_VER < 1900)
#define snprintf _snprintf #define snprintf _snprintf
#define BROKEN_SNPRINTF
#endif #endif
@@ -160,68 +163,14 @@ static const char *const pstring[] = {
"match failed" /* NOMATCH */ "match failed" /* NOMATCH */
}; };
static int message_len(const char *message, int offset)
#if 0 /* REMOVE THIS CODE */
The code below was created for 10.33 (see ChangeLog 10.33 #4) when the
POSIX functions were given pcre2_... names instead of the traditional POSIX
names. However, it has proved to be more troublesome than useful. There have
been at least two cases where a program links with two others, one of which
uses the POSIX library and the other uses the PCRE2 POSIX functions, thus
causing two instances of the POSIX runctions to exist, leading to trouble. For
10.37 this code is commented out. In due course it can be removed if there are
no issues. The only small worry is the comment below about languages that do
not include pcre2posix.h. If there are any such cases, they will have to use
the PCRE2 names.
/*************************************************
* Wrappers with traditional POSIX names *
*************************************************/
/* Keep defining them to preseve the ABI for applications linked to the pcre2
POSIX library before these names were changed into macros in pcre2posix.h.
This also ensures that the POSIX names are callable from languages that do not
include pcre2posix.h. It is vital to #undef the macro definitions from
pcre2posix.h! */
#undef regerror
PCRE2POSIX_EXP_DECL size_t regerror(int, const regex_t *, char *, size_t);
PCRE2POSIX_EXP_DEFN size_t PCRE2_CALL_CONVENTION
regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)
{ {
return pcre2_regerror(errcode, preg, errbuf, errbuf_size); char buf[12];
}
#undef regfree /* 11 magic number comes from the format below */
PCRE2POSIX_EXP_DECL void regfree(regex_t *); return (int)strlen(message) + 11 + snprintf(buf, sizeof(buf), "%d", offset);
PCRE2POSIX_EXP_DEFN void PCRE2_CALL_CONVENTION
regfree(regex_t *preg)
{
pcre2_regfree(preg);
} }
#undef regcomp
PCRE2POSIX_EXP_DECL int regcomp(regex_t *, const char *, int);
PCRE2POSIX_EXP_DEFN int PCRE2_CALL_CONVENTION
regcomp(regex_t *preg, const char *pattern, int cflags)
{
return pcre2_regcomp(preg, pattern, cflags);
}
#undef regexec
PCRE2POSIX_EXP_DECL int regexec(const regex_t *, const char *, size_t,
regmatch_t *, int);
PCRE2POSIX_EXP_DEFN int PCRE2_CALL_CONVENTION
regexec(const regex_t *preg, const char *string, size_t nmatch,
regmatch_t pmatch[], int eflags)
{
return pcre2_regexec(preg, string, nmatch, pmatch, eflags);
}
#endif
/************************************************* /*************************************************
* Translate error code to string * * Translate error code to string *
*************************************************/ *************************************************/
@@ -230,23 +179,64 @@ PCRE2POSIX_EXP_DEFN size_t PCRE2_CALL_CONVENTION
pcre2_regerror(int errcode, const regex_t *preg, char *errbuf, pcre2_regerror(int errcode, const regex_t *preg, char *errbuf,
size_t errbuf_size) size_t errbuf_size)
{ {
int used; int ret;
const char *message; const char *message;
size_t len = 0; /* keeps 0 if snprintf is used */
message = (errcode <= 0 || errcode >= (int)(sizeof(pstring)/sizeof(char *)))? message = (errcode <= 0 || errcode >= (int)(sizeof(pstring)/sizeof(char *)))?
"unknown error code" : pstring[errcode]; "unknown error code" : pstring[errcode];
if (preg != NULL && (int)preg->re_erroffset != -1) if (preg != NULL && (int)preg->re_erroffset != -1)
{ {
used = snprintf(errbuf, errbuf_size, "%s at offset %-6d", message, /* no need to deal with UB in snprintf */
(int)preg->re_erroffset); if (errbuf_size > INT_MAX) errbuf_size = INT_MAX;
/* there are 11 charactes between message and offset,
update message_len() if changed */
ret = snprintf(errbuf, errbuf_size, "%s at offset %d", message,
(int)preg->re_erroffset);
} }
else else
{ {
used = snprintf(errbuf, errbuf_size, "%s", message); len = strlen(message);
if (errbuf_size != 0)
{
strncpy(errbuf, message, errbuf_size);
if (errbuf_size <= len) errbuf[errbuf_size - 1] = '\0';
}
ret = (int)len;
} }
return used + 1; do {
if (ret < 0)
{
#ifdef BROKEN_SNPRINTF
/* _snprintf returns -1 on overflow and doesn't zero terminate */
if (!len)
{
if (ret == -1 && errbuf_size != 0) errbuf[errbuf_size - 1] = '\0';
ret = message_len(message, (int)preg->re_erroffset);
break;
}
#endif
/* snprintf failed, will use a 14 char long message if possible */
ret = 14;
if (errbuf_size != 0)
{
strncpy(errbuf, "internal error", errbuf_size);
if ((int)errbuf_size <= ret) errbuf[errbuf_size - 1] = '\0';
}
}
else if (ret == (int)errbuf_size && !len)
{
/* pre C99 snprintf returns used, so redo ret to fix that */
ret = message_len(message, (int)preg->re_erroffset);
}
} while (0);
return ret + 1;
} }

View File

@@ -9,7 +9,7 @@ POSIX wrapper interface.
Written by Philip Hazel Written by Philip Hazel
Original API code Copyright (c) 1997-2012 University of Cambridge Original API code Copyright (c) 1997-2012 University of Cambridge
New API code Copyright (c) 2016-2022 University of Cambridge New API code Copyright (c) 2016-2023 University of Cambridge
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
@@ -40,6 +40,8 @@ POSSIBILITY OF SUCH DAMAGE.
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
*/ */
#ifndef PCRE2POSIX_H_IDEMPOTENT_GUARD
#define PCRE2POSIX_H_IDEMPOTENT_GUARD
/* Have to include stdlib.h in order to ensure that size_t is defined. */ /* Have to include stdlib.h in order to ensure that size_t is defined. */
@@ -130,25 +132,24 @@ set, we ensure here that it has no effect. */
#define PCRE2_CALL_CONVENTION #define PCRE2_CALL_CONVENTION
#endif #endif
#ifndef PCRE2_EXPORT
#define PCRE2_EXPORT
#endif
/* When an application links to a PCRE2 DLL in Windows, the symbols that are /* When an application links to a PCRE2 DLL in Windows, the symbols that are
imported have to be identified as such. When building PCRE2, the appropriate imported have to be identified as such. When building PCRE2, the appropriate
export settings are needed, and are set in pcre2posix.c before including this export settings are needed, and are set in pcre2posix.c before including this
file. */ file. */
#if defined(_WIN32) && !defined(PCRE2_STATIC) && !defined(PCRE2POSIX_EXP_DECL)
# define PCRE2POSIX_EXP_DECL extern __declspec(dllimport)
# define PCRE2POSIX_EXP_DEFN __declspec(dllimport)
#endif
/* By default, we use the standard "extern" declarations. */ /* By default, we use the standard "extern" declarations. */
#ifndef PCRE2POSIX_EXP_DECL #ifndef PCRE2POSIX_EXP_DECL
# ifdef __cplusplus # if defined(_WIN32) && defined(PCRE2POSIX_SHARED) && !defined(PCRE2_STATIC)
# define PCRE2POSIX_EXP_DECL extern "C" # define PCRE2POSIX_EXP_DECL extern __declspec(dllimport)
# define PCRE2POSIX_EXP_DEFN extern "C" # define PCRE2POSIX_EXP_DEFN __declspec(dllimport)
# else # else
# define PCRE2POSIX_EXP_DECL extern # define PCRE2POSIX_EXP_DECL extern PCRE2_EXPORT
# define PCRE2POSIX_EXP_DEFN extern # define PCRE2POSIX_EXP_DEFN
# endif # endif
#endif #endif
@@ -181,4 +182,6 @@ them having to maintain their own patch, but are not documented by PCRE2. */
} /* extern "C" */ } /* extern "C" */
#endif #endif
#endif /* PCRE2POSIX_H_IDEMPOTENT_GUARD */
/* End of pcre2posix.h */ /* End of pcre2posix.h */

View File

@@ -58,7 +58,7 @@ number of subject strings, terminated by NULL. Some tests share data, but use
different flags. */ different flags. */
static const char *data0_1[] = { "posix", "lower posix", "upper POSIX", NULL }; static const char *data0_1[] = { "posix", "lower posix", "upper POSIX", NULL };
static const char *data2_3[] = { "^(cat|dog)", "catastrophic\ncataclysm", static const char *data2_3[] = { "(*LF)^(cat|dog)", "catastrophic\ncataclysm",
"dogfight", "no animals", NULL }; "dogfight", "no animals", NULL };
static const char *data4[] = { "*badpattern", NULL }; static const char *data4[] = { "*badpattern", NULL };