5
5
/* This is the public header file for the PCRE library, second API, to be
6
6
#included by applications that call PCRE2 functions.
7
7
8
- Copyright (c) 2016-2021 University of Cambridge
8
+ Copyright (c) 2016-2024 University of Cambridge
9
9
10
10
-----------------------------------------------------------------------------
11
11
Redistribution and use in source and binary forms, with or without
@@ -42,9 +42,9 @@ POSSIBILITY OF SUCH DAMAGE.
42
42
/* The current PCRE version information. */
43
43
44
44
#define PCRE2_MAJOR 10
45
- #define PCRE2_MINOR 42
45
+ #define PCRE2_MINOR 43
46
46
#define PCRE2_PRERELEASE
47
- #define PCRE2_DATE 2022-12-12
47
+ #define PCRE2_DATE 2024-02-16
48
48
49
49
/* When an application links to a PCRE DLL in Windows, the symbols that are
50
50
imported have to be identified as such. When building PCRE2, the appropriate
@@ -153,6 +153,12 @@ D is inspected during pcre2_dfa_match() execution
153
153
#define PCRE2_EXTRA_ESCAPED_CR_IS_LF 0x00000010u /* C */
154
154
#define PCRE2_EXTRA_ALT_BSUX 0x00000020u /* C */
155
155
#define PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK 0x00000040u /* C */
156
+ #define PCRE2_EXTRA_CASELESS_RESTRICT 0x00000080u /* C */
157
+ #define PCRE2_EXTRA_ASCII_BSD 0x00000100u /* C */
158
+ #define PCRE2_EXTRA_ASCII_BSS 0x00000200u /* C */
159
+ #define PCRE2_EXTRA_ASCII_BSW 0x00000400u /* C */
160
+ #define PCRE2_EXTRA_ASCII_POSIX 0x00000800u /* C */
161
+ #define PCRE2_EXTRA_ASCII_DIGIT 0x00001000u /* C */
156
162
157
163
/* These are for pcre2_jit_compile(). */
158
164
@@ -180,11 +186,12 @@ pcre2_jit_match() ignores the latter since it bypasses all sanity checks). */
180
186
#define PCRE2_SUBSTITUTE_UNSET_EMPTY 0x00000400u /* pcre2_substitute() only */
181
187
#define PCRE2_SUBSTITUTE_UNKNOWN_UNSET 0x00000800u /* pcre2_substitute() only */
182
188
#define PCRE2_SUBSTITUTE_OVERFLOW_LENGTH 0x00001000u /* pcre2_substitute() only */
183
- #define PCRE2_NO_JIT 0x00002000u /* Not for pcre2_dfa_match() */
189
+ #define PCRE2_NO_JIT 0x00002000u /* not for pcre2_dfa_match() */
184
190
#define PCRE2_COPY_MATCHED_SUBJECT 0x00004000u
185
191
#define PCRE2_SUBSTITUTE_LITERAL 0x00008000u /* pcre2_substitute() only */
186
192
#define PCRE2_SUBSTITUTE_MATCHED 0x00010000u /* pcre2_substitute() only */
187
193
#define PCRE2_SUBSTITUTE_REPLACEMENT_ONLY 0x00020000u /* pcre2_substitute() only */
194
+ #define PCRE2_DISABLE_RECURSELOOP_CHECK 0x00040000u /* not for pcre2_dfa_match() or pcre2_jit_match() */
188
195
189
196
/* Options for pcre2_pattern_convert(). */
190
197
@@ -399,6 +406,7 @@ released, the numbers must not be changed. */
399
406
#define PCRE2_ERROR_CONVERT_SYNTAX (-64)
400
407
#define PCRE2_ERROR_INTERNAL_DUPMATCH (-65)
401
408
#define PCRE2_ERROR_DFA_UINVALID_UTF (-66)
409
+ #define PCRE2_ERROR_INVALIDOFFSET (-67)
402
410
403
411
404
412
/* Request types for pcre2_pattern_info() */
@@ -572,19 +580,19 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION pcre2_config(uint32_t, void *);
572
580
/* Functions for manipulating contexts. */
573
581
574
582
#define PCRE2_GENERAL_CONTEXT_FUNCTIONS \
575
- PCRE2_EXP_DECL pcre2_general_context PCRE2_CALL_CONVENTION \
576
- * pcre2_general_context_copy(pcre2_general_context *); \
577
- PCRE2_EXP_DECL pcre2_general_context PCRE2_CALL_CONVENTION \
578
- * pcre2_general_context_create(void *(*)(PCRE2_SIZE , void *), \
583
+ PCRE2_EXP_DECL pcre2_general_context * PCRE2_CALL_CONVENTION \
584
+ pcre2_general_context_copy(pcre2_general_context *); \
585
+ PCRE2_EXP_DECL pcre2_general_context * PCRE2_CALL_CONVENTION \
586
+ pcre2_general_context_create(void *(*)(size_t , void *), \
579
587
void (*)(void *, void *), void *); \
580
588
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
581
589
pcre2_general_context_free(pcre2_general_context *);
582
590
583
591
#define PCRE2_COMPILE_CONTEXT_FUNCTIONS \
584
- PCRE2_EXP_DECL pcre2_compile_context PCRE2_CALL_CONVENTION \
585
- * pcre2_compile_context_copy(pcre2_compile_context *); \
586
- PCRE2_EXP_DECL pcre2_compile_context PCRE2_CALL_CONVENTION \
587
- * pcre2_compile_context_create(pcre2_general_context *);\
592
+ PCRE2_EXP_DECL pcre2_compile_context * PCRE2_CALL_CONVENTION \
593
+ pcre2_compile_context_copy(pcre2_compile_context *); \
594
+ PCRE2_EXP_DECL pcre2_compile_context * PCRE2_CALL_CONVENTION \
595
+ pcre2_compile_context_create(pcre2_general_context *);\
588
596
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
589
597
pcre2_compile_context_free(pcre2_compile_context *); \
590
598
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
@@ -595,6 +603,8 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
595
603
pcre2_set_compile_extra_options(pcre2_compile_context *, uint32_t); \
596
604
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
597
605
pcre2_set_max_pattern_length(pcre2_compile_context *, PCRE2_SIZE); \
606
+ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
607
+ pcre2_set_max_varlookbehind(pcre2_compile_context *, uint32_t); \
598
608
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
599
609
pcre2_set_newline(pcre2_compile_context *, uint32_t); \
600
610
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
@@ -604,10 +614,10 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
604
614
int (*)(uint32_t, void *), void *);
605
615
606
616
#define PCRE2_MATCH_CONTEXT_FUNCTIONS \
607
- PCRE2_EXP_DECL pcre2_match_context PCRE2_CALL_CONVENTION \
608
- * pcre2_match_context_copy(pcre2_match_context *); \
609
- PCRE2_EXP_DECL pcre2_match_context PCRE2_CALL_CONVENTION \
610
- * pcre2_match_context_create(pcre2_general_context *); \
617
+ PCRE2_EXP_DECL pcre2_match_context * PCRE2_CALL_CONVENTION \
618
+ pcre2_match_context_copy(pcre2_match_context *); \
619
+ PCRE2_EXP_DECL pcre2_match_context * PCRE2_CALL_CONVENTION \
620
+ pcre2_match_context_create(pcre2_general_context *); \
611
621
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
612
622
pcre2_match_context_free(pcre2_match_context *); \
613
623
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
@@ -628,13 +638,13 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
628
638
pcre2_set_recursion_limit(pcre2_match_context *, uint32_t); \
629
639
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
630
640
pcre2_set_recursion_memory_management(pcre2_match_context *, \
631
- void *(*)(PCRE2_SIZE , void *), void (*)(void *, void *), void *);
641
+ void *(*)(size_t , void *), void (*)(void *, void *), void *);
632
642
633
643
#define PCRE2_CONVERT_CONTEXT_FUNCTIONS \
634
- PCRE2_EXP_DECL pcre2_convert_context PCRE2_CALL_CONVENTION \
635
- * pcre2_convert_context_copy(pcre2_convert_context *); \
636
- PCRE2_EXP_DECL pcre2_convert_context PCRE2_CALL_CONVENTION \
637
- * pcre2_convert_context_create(pcre2_general_context *); \
644
+ PCRE2_EXP_DECL pcre2_convert_context * PCRE2_CALL_CONVENTION \
645
+ pcre2_convert_context_copy(pcre2_convert_context *); \
646
+ PCRE2_EXP_DECL pcre2_convert_context * PCRE2_CALL_CONVENTION \
647
+ pcre2_convert_context_create(pcre2_general_context *); \
638
648
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
639
649
pcre2_convert_context_free(pcre2_convert_context *); \
640
650
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
@@ -646,15 +656,15 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
646
656
/* Functions concerned with compiling a pattern to PCRE internal code. */
647
657
648
658
#define PCRE2_COMPILE_FUNCTIONS \
649
- PCRE2_EXP_DECL pcre2_code PCRE2_CALL_CONVENTION \
650
- * pcre2_compile(PCRE2_SPTR, PCRE2_SIZE, uint32_t, int *, PCRE2_SIZE *, \
659
+ PCRE2_EXP_DECL pcre2_code * PCRE2_CALL_CONVENTION \
660
+ pcre2_compile(PCRE2_SPTR, PCRE2_SIZE, uint32_t, int *, PCRE2_SIZE *, \
651
661
pcre2_compile_context *); \
652
662
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
653
663
pcre2_code_free(pcre2_code *); \
654
- PCRE2_EXP_DECL pcre2_code PCRE2_CALL_CONVENTION \
655
- * pcre2_code_copy(const pcre2_code *); \
656
- PCRE2_EXP_DECL pcre2_code PCRE2_CALL_CONVENTION \
657
- * pcre2_code_copy_with_tables(const pcre2_code *);
664
+ PCRE2_EXP_DECL pcre2_code * PCRE2_CALL_CONVENTION \
665
+ pcre2_code_copy(const pcre2_code *); \
666
+ PCRE2_EXP_DECL pcre2_code * PCRE2_CALL_CONVENTION \
667
+ pcre2_code_copy_with_tables(const pcre2_code *);
658
668
659
669
660
670
/* Functions that give information about a compiled pattern. */
@@ -670,10 +680,10 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
670
680
/* Functions for running a match and inspecting the result. */
671
681
672
682
#define PCRE2_MATCH_FUNCTIONS \
673
- PCRE2_EXP_DECL pcre2_match_data PCRE2_CALL_CONVENTION \
674
- * pcre2_match_data_create(uint32_t, pcre2_general_context *); \
675
- PCRE2_EXP_DECL pcre2_match_data PCRE2_CALL_CONVENTION \
676
- * pcre2_match_data_create_from_pattern(const pcre2_code *, \
683
+ PCRE2_EXP_DECL pcre2_match_data * PCRE2_CALL_CONVENTION \
684
+ pcre2_match_data_create(uint32_t, pcre2_general_context *); \
685
+ PCRE2_EXP_DECL pcre2_match_data * PCRE2_CALL_CONVENTION \
686
+ pcre2_match_data_create_from_pattern(const pcre2_code *, \
677
687
pcre2_general_context *); \
678
688
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
679
689
pcre2_dfa_match(const pcre2_code *, PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, \
@@ -687,10 +697,12 @@ PCRE2_EXP_DECL PCRE2_SPTR PCRE2_CALL_CONVENTION \
687
697
pcre2_get_mark(pcre2_match_data *); \
688
698
PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \
689
699
pcre2_get_match_data_size(pcre2_match_data *); \
700
+ PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \
701
+ pcre2_get_match_data_heapframes_size(pcre2_match_data *); \
690
702
PCRE2_EXP_DECL uint32_t PCRE2_CALL_CONVENTION \
691
703
pcre2_get_ovector_count(pcre2_match_data *); \
692
- PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \
693
- * pcre2_get_ovector_pointer(pcre2_match_data *); \
704
+ PCRE2_EXP_DECL PCRE2_SIZE * PCRE2_CALL_CONVENTION \
705
+ pcre2_get_ovector_pointer(pcre2_match_data *); \
694
706
PCRE2_EXP_DECL PCRE2_SIZE PCRE2_CALL_CONVENTION \
695
707
pcre2_get_startchar(pcre2_match_data *);
696
708
@@ -722,7 +734,7 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
722
734
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
723
735
pcre2_substring_number_from_name(const pcre2_code *, PCRE2_SPTR); \
724
736
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
725
- pcre2_substring_list_free(PCRE2_SPTR *); \
737
+ pcre2_substring_list_free(PCRE2_UCHAR * *); \
726
738
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
727
739
pcre2_substring_list_get(pcre2_match_data *, PCRE2_UCHAR ***, PCRE2_SIZE **);
728
740
@@ -770,8 +782,8 @@ PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
770
782
uint32_t, pcre2_match_data *, pcre2_match_context *); \
771
783
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
772
784
pcre2_jit_free_unused_memory(pcre2_general_context *); \
773
- PCRE2_EXP_DECL pcre2_jit_stack PCRE2_CALL_CONVENTION \
774
- * pcre2_jit_stack_create(PCRE2_SIZE, PCRE2_SIZE , pcre2_general_context *); \
785
+ PCRE2_EXP_DECL pcre2_jit_stack * PCRE2_CALL_CONVENTION \
786
+ pcre2_jit_stack_create(size_t, size_t , pcre2_general_context *); \
775
787
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
776
788
pcre2_jit_stack_assign(pcre2_match_context *, pcre2_jit_callback, void *); \
777
789
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
@@ -783,8 +795,8 @@ PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
783
795
#define PCRE2_OTHER_FUNCTIONS \
784
796
PCRE2_EXP_DECL int PCRE2_CALL_CONVENTION \
785
797
pcre2_get_error_message(int, PCRE2_UCHAR *, PCRE2_SIZE); \
786
- PCRE2_EXP_DECL const uint8_t PCRE2_CALL_CONVENTION \
787
- * pcre2_maketables(pcre2_general_context *); \
798
+ PCRE2_EXP_DECL const uint8_t * PCRE2_CALL_CONVENTION \
799
+ pcre2_maketables(pcre2_general_context *); \
788
800
PCRE2_EXP_DECL void PCRE2_CALL_CONVENTION \
789
801
pcre2_maketables_free(pcre2_general_context *, const uint8_t *);
790
802
@@ -851,6 +863,7 @@ pcre2_compile are called by application code. */
851
863
#define pcre2_general_context_free PCRE2_SUFFIX(pcre2_general_context_free_)
852
864
#define pcre2_get_error_message PCRE2_SUFFIX(pcre2_get_error_message_)
853
865
#define pcre2_get_mark PCRE2_SUFFIX(pcre2_get_mark_)
866
+ #define pcre2_get_match_data_heapframes_size PCRE2_SUFFIX(pcre2_get_match_data_heapframes_size_)
854
867
#define pcre2_get_match_data_size PCRE2_SUFFIX(pcre2_get_match_data_size_)
855
868
#define pcre2_get_ovector_pointer PCRE2_SUFFIX(pcre2_get_ovector_pointer_)
856
869
#define pcre2_get_ovector_count PCRE2_SUFFIX(pcre2_get_ovector_count_)
@@ -886,6 +899,7 @@ pcre2_compile are called by application code. */
886
899
#define pcre2_set_glob_separator PCRE2_SUFFIX(pcre2_set_glob_separator_)
887
900
#define pcre2_set_heap_limit PCRE2_SUFFIX(pcre2_set_heap_limit_)
888
901
#define pcre2_set_match_limit PCRE2_SUFFIX(pcre2_set_match_limit_)
902
+ #define pcre2_set_max_varlookbehind PCRE2_SUFFIX(pcre2_set_max_varlookbehind_)
889
903
#define pcre2_set_max_pattern_length PCRE2_SUFFIX(pcre2_set_max_pattern_length_)
890
904
#define pcre2_set_newline PCRE2_SUFFIX(pcre2_set_newline_)
891
905
#define pcre2_set_parens_nest_limit PCRE2_SUFFIX(pcre2_set_parens_nest_limit_)
0 commit comments