Reduce header complexity of PCRE2

This commit is contained in:
Justine Tunney 2023-12-10 06:08:25 -08:00
parent b27e9fe845
commit 4a63e4a27e
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
14 changed files with 25 additions and 15 deletions

View file

@ -91,10 +91,6 @@ not have stdint.h, which is why we use inttypes.h, which according to the C
standard is a superset of stdint.h. If inttypes.h is not available the build standard is a superset of stdint.h. If inttypes.h is not available the build
will break and the relevant values must be provided by some other means. */ will break and the relevant values must be provided by some other means. */
#include <limits.h>
#include <stdlib.h>
#include <inttypes.h>
/* Allow for C++ users compiling this directly. */ /* Allow for C++ users compiling this directly. */
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -1,3 +1,5 @@
#include "libc/str/str.h"
asm(".ident\t\"\\n\\n\ asm(".ident\t\"\\n\\n\
PCRE2 (PCRE2 License)\\n\ PCRE2 (PCRE2 License)\\n\
Copyright (c) 1997-2022 University of Cambridge\""); Copyright (c) 1997-2022 University of Cambridge\"");

View file

@ -39,6 +39,7 @@ POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "libc/str/str.h"
#include "config.h" #include "config.h"
#endif #endif

View file

@ -1,3 +1,6 @@
#include "libc/mem/mem.h"
#include "libc/str/str.h"
/************************************************* /*************************************************
* Perl-Compatible Regular Expressions * * Perl-Compatible Regular Expressions *
*************************************************/ *************************************************/

View file

@ -1,3 +1,5 @@
#include "libc/str/str.h"
/************************************************* /*************************************************
* Perl-Compatible Regular Expressions * * Perl-Compatible Regular Expressions *
*************************************************/ *************************************************/

View file

@ -1,3 +1,5 @@
#include "libc/str/str.h"
/************************************************* /*************************************************
* Perl-Compatible Regular Expressions * * Perl-Compatible Regular Expressions *
*************************************************/ *************************************************/

View file

@ -53,13 +53,6 @@ pcre2test.c with CODE_UNIT_WIDTH == 0. */
/* Standard C headers */ /* Standard C headers */
#include <ctype.h>
#include <limits.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* Macros to make boolean values more obvious. The #ifndef is to pacify /* Macros to make boolean values more obvious. The #ifndef is to pacify
compiler warnings in environments where these macros are defined elsewhere. compiler warnings in environments where these macros are defined elsewhere.
Unfortunately, there is no way to do the same for the typedef. */ Unfortunately, there is no way to do the same for the typedef. */
@ -72,10 +65,6 @@ typedef int BOOL;
/* Valgrind (memcheck) support */ /* Valgrind (memcheck) support */
#ifdef SUPPORT_VALGRIND
#include <valgrind/memcheck.h>
#endif
/* -ftrivial-auto-var-init support supports initializing all local variables /* -ftrivial-auto-var-init support supports initializing all local variables
to avoid some classes of bug, but this can cause an unacceptable slowdown to avoid some classes of bug, but this can cause an unacceptable slowdown
for large on-stack arrays in hot functions. This macro lets us annotate for large on-stack arrays in hot functions. This macro lets us annotate
@ -140,6 +129,7 @@ only if it is not already set. */
/* Include the public PCRE2 header and the definitions of UCP character /* Include the public PCRE2 header and the definitions of UCP character
property values. This must follow the setting of PCRE2_EXP_DECL above. */ property values. This must follow the setting of PCRE2_EXP_DECL above. */
#include "libc/limits.h"
#include "pcre2.h" #include "pcre2.h"
#include "pcre2_ucp.h" #include "pcre2_ucp.h"

View file

@ -1,6 +1,8 @@
/************************************************* /*************************************************
* Perl-Compatible Regular Expressions * * Perl-Compatible Regular Expressions *
*************************************************/ *************************************************/
#include "libc/str/str.h"
#include "libc/mem/mem.h"
/* PCRE is a library of functions to support regular expressions whose syntax /* 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. and semantics are as close as possible to those of the Perl 5 language.

View file

@ -1,3 +1,5 @@
#include "libc/str/str.h"
asm(".ident\t\"\\n\\n\ asm(".ident\t\"\\n\\n\
PCRE2 (PCRE2 License)\\n\ PCRE2 (PCRE2 License)\\n\
Copyright (c) 1997-2022 University of Cambridge\""); Copyright (c) 1997-2022 University of Cambridge\"");

View file

@ -1,3 +1,5 @@
#include "libc/str/str.h"
/************************************************* /*************************************************
* Perl-Compatible Regular Expressions * * Perl-Compatible Regular Expressions *
*************************************************/ *************************************************/

View file

@ -1,3 +1,5 @@
#include "libc/str/str.h"
/************************************************* /*************************************************
* Perl-Compatible Regular Expressions * * Perl-Compatible Regular Expressions *
*************************************************/ *************************************************/

View file

@ -1,3 +1,5 @@
#include "libc/str/str.h"
/************************************************* /*************************************************
* Perl-Compatible Regular Expressions * * Perl-Compatible Regular Expressions *
*************************************************/ *************************************************/

View file

@ -1,3 +1,5 @@
#include "libc/str/str.h"
/************************************************* /*************************************************
* Perl-Compatible Regular Expressions * * Perl-Compatible Regular Expressions *
*************************************************/ *************************************************/

View file

@ -1,3 +1,5 @@
#include "libc/str/str.h"
/************************************************* /*************************************************
* Perl-Compatible Regular Expressions * * Perl-Compatible Regular Expressions *
*************************************************/ *************************************************/