diff options
Diffstat (limited to 'gl/regex.h')
| -rw-r--r-- | gl/regex.h | 51 |
1 files changed, 18 insertions, 33 deletions
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Definitions for data structures and routines for the regular | 1 | /* Definitions for data structures and routines for the regular |
| 2 | expression library. | 2 | expression library. |
| 3 | Copyright (C) 1985, 1989-2024 Free Software Foundation, Inc. | 3 | Copyright (C) 1985, 1989-2025 Free Software Foundation, Inc. |
| 4 | This file is part of the GNU C Library. | 4 | This file is part of the GNU C Library. |
| 5 | 5 | ||
| 6 | The GNU C Library is free software; you can redistribute it and/or | 6 | The GNU C Library is free software; you can redistribute it and/or |
| @@ -66,15 +66,14 @@ typedef unsigned long int active_reg_t; | |||
| 66 | 66 | ||
| 67 | /* The following bits are used to determine the regexp syntax we | 67 | /* The following bits are used to determine the regexp syntax we |
| 68 | recognize. The set/not-set meanings are chosen so that Emacs syntax | 68 | recognize. The set/not-set meanings are chosen so that Emacs syntax |
| 69 | remains the value 0. The bits are given in alphabetical order, and | 69 | is the value 0 for Emacs 20 (2000) and earlier, and the value |
| 70 | the definitions shifted by one from the previous bit; thus, when we | 70 | RE_SYNTAX_EMACS for Emacs 21 (2001) and later. */ |
| 71 | add or remove a bit, only one other definition need change. */ | ||
| 72 | typedef unsigned long int reg_syntax_t; | 71 | typedef unsigned long int reg_syntax_t; |
| 73 | 72 | ||
| 74 | #ifdef __USE_GNU | 73 | #ifdef __USE_GNU |
| 75 | /* If this bit is not set, then \ inside a bracket expression is literal. | 74 | /* If this bit is not set, then \ inside a bracket expression is literal. |
| 76 | If set, then such a \ quotes the following character. */ | 75 | If set, then such a \ quotes the following character. */ |
| 77 | # define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1) | 76 | # define RE_BACKSLASH_ESCAPE_IN_LISTS 1ul |
| 78 | 77 | ||
| 79 | /* If this bit is not set, then + and ? are operators, and \+ and \? are | 78 | /* If this bit is not set, then + and ? are operators, and \+ and \? are |
| 80 | literals. | 79 | literals. |
| @@ -215,7 +214,8 @@ extern reg_syntax_t re_syntax_options; | |||
| 215 | (The [[[ comments delimit what gets put into the Texinfo file, so | 214 | (The [[[ comments delimit what gets put into the Texinfo file, so |
| 216 | don't delete them!) */ | 215 | don't delete them!) */ |
| 217 | /* [[[begin syntaxes]]] */ | 216 | /* [[[begin syntaxes]]] */ |
| 218 | # define RE_SYNTAX_EMACS 0 | 217 | # define RE_SYNTAX_EMACS \ |
| 218 | (RE_CHAR_CLASSES | RE_INTERVALS) | ||
| 219 | 219 | ||
| 220 | # define RE_SYNTAX_AWK \ | 220 | # define RE_SYNTAX_AWK \ |
| 221 | (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \ | 221 | (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \ |
| @@ -522,20 +522,6 @@ typedef struct | |||
| 522 | 522 | ||
| 523 | /* Declarations for routines. */ | 523 | /* Declarations for routines. */ |
| 524 | 524 | ||
| 525 | #ifndef _REGEX_NELTS | ||
| 526 | # if (defined __STDC_VERSION__ && 199901L <= __STDC_VERSION__ \ | ||
| 527 | && !defined __STDC_NO_VLA__) | ||
| 528 | # define _REGEX_NELTS(n) n | ||
| 529 | # else | ||
| 530 | # define _REGEX_NELTS(n) | ||
| 531 | # endif | ||
| 532 | #endif | ||
| 533 | |||
| 534 | #if defined __GNUC__ && 4 < __GNUC__ + (6 <= __GNUC_MINOR__) | ||
| 535 | # pragma GCC diagnostic push | ||
| 536 | # pragma GCC diagnostic ignored "-Wvla" | ||
| 537 | #endif | ||
| 538 | |||
| 539 | #ifndef _Attr_access_ | 525 | #ifndef _Attr_access_ |
| 540 | # ifdef __attr_access | 526 | # ifdef __attr_access |
| 541 | # define _Attr_access_(arg) __attr_access (arg) | 527 | # define _Attr_access_(arg) __attr_access (arg) |
| @@ -647,10 +633,12 @@ extern int re_exec (const char *); | |||
| 647 | || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \ | 633 | || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \ |
| 648 | || __clang_major__ >= 3 | 634 | || __clang_major__ >= 3 |
| 649 | # define _Restrict_ __restrict | 635 | # define _Restrict_ __restrict |
| 650 | # elif 199901L <= __STDC_VERSION__ || defined restrict | ||
| 651 | # define _Restrict_ restrict | ||
| 652 | # else | 636 | # else |
| 653 | # define _Restrict_ | 637 | # if 199901L <= __STDC_VERSION__ || defined restrict |
| 638 | # define _Restrict_ restrict | ||
| 639 | # else | ||
| 640 | # define _Restrict_ | ||
| 641 | # endif | ||
| 654 | # endif | 642 | # endif |
| 655 | #endif | 643 | #endif |
| 656 | /* For the ISO C99 syntax | 644 | /* For the ISO C99 syntax |
| @@ -661,13 +649,15 @@ extern int re_exec (const char *); | |||
| 661 | #ifndef _Restrict_arr_ | 649 | #ifndef _Restrict_arr_ |
| 662 | # ifdef __restrict_arr | 650 | # ifdef __restrict_arr |
| 663 | # define _Restrict_arr_ __restrict_arr | 651 | # define _Restrict_arr_ __restrict_arr |
| 664 | # elif ((199901L <= __STDC_VERSION__ \ | 652 | # else |
| 653 | # if ((199901L <= __STDC_VERSION__ \ | ||
| 665 | || 3 < __GNUC__ + (1 <= __GNUC_MINOR__) \ | 654 | || 3 < __GNUC__ + (1 <= __GNUC_MINOR__) \ |
| 666 | || __clang_major__ >= 3) \ | 655 | || __clang_major__ >= 3) \ |
| 667 | && !defined __cplusplus) | 656 | && !defined __cplusplus) |
| 668 | # define _Restrict_arr_ _Restrict_ | 657 | # define _Restrict_arr_ _Restrict_ |
| 669 | # else | 658 | # else |
| 670 | # define _Restrict_arr_ | 659 | # define _Restrict_arr_ |
| 660 | # endif | ||
| 671 | # endif | 661 | # endif |
| 672 | #endif | 662 | #endif |
| 673 | 663 | ||
| @@ -678,8 +668,7 @@ extern int regcomp (regex_t *_Restrict_ __preg, | |||
| 678 | 668 | ||
| 679 | extern int regexec (const regex_t *_Restrict_ __preg, | 669 | extern int regexec (const regex_t *_Restrict_ __preg, |
| 680 | const char *_Restrict_ __String, size_t __nmatch, | 670 | const char *_Restrict_ __String, size_t __nmatch, |
| 681 | regmatch_t __pmatch[_Restrict_arr_ | 671 | regmatch_t __pmatch[_Restrict_arr_], |
| 682 | _REGEX_NELTS (__nmatch)], | ||
| 683 | int __eflags); | 672 | int __eflags); |
| 684 | 673 | ||
| 685 | extern size_t regerror (int __errcode, const regex_t *_Restrict_ __preg, | 674 | extern size_t regerror (int __errcode, const regex_t *_Restrict_ __preg, |
| @@ -688,10 +677,6 @@ extern size_t regerror (int __errcode, const regex_t *_Restrict_ __preg, | |||
| 688 | 677 | ||
| 689 | extern void regfree (regex_t *__preg); | 678 | extern void regfree (regex_t *__preg); |
| 690 | 679 | ||
| 691 | #if defined __GNUC__ && 4 < __GNUC__ + (6 <= __GNUC_MINOR__) | ||
| 692 | # pragma GCC diagnostic pop | ||
| 693 | #endif | ||
| 694 | |||
| 695 | #ifdef __cplusplus | 680 | #ifdef __cplusplus |
| 696 | } | 681 | } |
| 697 | #endif /* C++ */ | 682 | #endif /* C++ */ |
