"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/regex.h" between
gcal-4.tar.gz and gcal-4.1.tar.gz

About: Gcal displays month/year calendar sheets, eternal holiday and fixed date lists in many ways.

regex.h  (gcal-4):regex.h  (gcal-4.1)
/* Definitions for data structures and routines for the regular /* Definitions for data structures and routines for the regular
expression library. expression library.
Copyright (C) 1985, 1989-1993, 1995-1998, 2000-2003, 2005-2015 Free Software Copyright (C) 1985, 1989-1993, 1995-1998, 2000-2003, 2005-2017 Free Software
Foundation, Inc. Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version. version 3 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful, The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 45 skipping to change at line 45
#endif #endif
#ifdef _REGEX_LARGE_OFFSETS #ifdef _REGEX_LARGE_OFFSETS
/* Use types and values that are wide enough to represent signed and /* Use types and values that are wide enough to represent signed and
unsigned byte offsets in memory. This currently works only when unsigned byte offsets in memory. This currently works only when
the regex code is used outside of the GNU C library; it is not yet the regex code is used outside of the GNU C library; it is not yet
supported within glibc itself, and glibc users should not define supported within glibc itself, and glibc users should not define
_REGEX_LARGE_OFFSETS. */ _REGEX_LARGE_OFFSETS. */
/* The type of nonnegative object indexes. Traditionally, GNU regex
uses 'int' for these. Code that uses __re_idx_t should work
regardless of whether the type is signed. */
typedef size_t __re_idx_t;
/* The type of object sizes. */ /* The type of object sizes. */
typedef size_t __re_size_t; typedef size_t __re_size_t;
/* The type of object sizes, in places where the traditional code /* The type of object sizes, in places where the traditional code
uses unsigned long int. */ uses unsigned long int. */
typedef size_t __re_long_size_t; typedef size_t __re_long_size_t;
#else #else
/* The traditional GNU regex implementation mishandles strings longer /* The traditional GNU regex implementation mishandles strings longer
than INT_MAX. */ than INT_MAX. */
typedef int __re_idx_t;
typedef unsigned int __re_size_t; typedef unsigned int __re_size_t;
typedef unsigned long int __re_long_size_t; typedef unsigned long int __re_long_size_t;
#endif #endif
/* The following two types have to be signed and unsigned integer type /* The following two types have to be signed and unsigned integer type
wide enough to hold a value of a pointer. For most ANSI compilers wide enough to hold a value of a pointer. For most ANSI compilers
ptrdiff_t and size_t should be likely OK. Still size of these two ptrdiff_t and size_t should be likely OK. Still size of these two
types is 2 for Microsoft C. Ugh... */ types is 2 for Microsoft C. Ugh... */
typedef long int s_reg_t; typedef long int s_reg_t;
skipping to change at line 246 skipping to change at line 240
| RE_INVALID_INTERVAL_ORD) \ | RE_INVALID_INTERVAL_ORD) \
& ~(RE_DOT_NOT_NULL | RE_CONTEXT_INDEP_OPS \ & ~(RE_DOT_NOT_NULL | RE_CONTEXT_INDEP_OPS \
| RE_CONTEXT_INVALID_OPS )) | RE_CONTEXT_INVALID_OPS ))
# define RE_SYNTAX_POSIX_AWK \ # define RE_SYNTAX_POSIX_AWK \
(RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \ (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \
| RE_INTERVALS | RE_NO_GNU_OPS \ | RE_INTERVALS | RE_NO_GNU_OPS \
| RE_INVALID_INTERVAL_ORD) | RE_INVALID_INTERVAL_ORD)
# define RE_SYNTAX_GREP \ # define RE_SYNTAX_GREP \
(RE_BK_PLUS_QM | RE_CHAR_CLASSES \ ((RE_SYNTAX_POSIX_BASIC | RE_NEWLINE_ALT) \
| RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \ & ~(RE_CONTEXT_INVALID_DUP | RE_DOT_NOT_NULL))
| RE_NEWLINE_ALT)
# define RE_SYNTAX_EGREP \ # define RE_SYNTAX_EGREP \
(RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \ ((RE_SYNTAX_POSIX_EXTENDED | RE_INVALID_INTERVAL_ORD | RE_NEWLINE_ALT) \
| RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \ & ~(RE_CONTEXT_INVALID_OPS | RE_DOT_NOT_NULL))
| RE_NEWLINE_ALT | RE_NO_BK_PARENS \
| RE_NO_BK_VBAR)
/* POSIX grep -E behavior is no longer incompatible with GNU. */
# define RE_SYNTAX_POSIX_EGREP \ # define RE_SYNTAX_POSIX_EGREP \
(RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES \ RE_SYNTAX_EGREP
| RE_INVALID_INTERVAL_ORD)
/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */ /* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */
# define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC # define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC
# define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC # define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC
/* Syntax bits common to both basic and extended POSIX regex syntax. */ /* Syntax bits common to both basic and extended POSIX regex syntax. */
# define _RE_SYNTAX_POSIX_COMMON \ # define _RE_SYNTAX_POSIX_COMMON \
(RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \ (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
| RE_INTERVALS | RE_NO_EMPTY_RANGES) | RE_INTERVALS | RE_NO_EMPTY_RANGES)
skipping to change at line 488 skipping to change at line 479
/* If true, an anchor at a newline matches. */ /* If true, an anchor at a newline matches. */
unsigned __REPB_PREFIX(newline_anchor) : 1; unsigned __REPB_PREFIX(newline_anchor) : 1;
}; };
typedef struct re_pattern_buffer regex_t; typedef struct re_pattern_buffer regex_t;
/* Type for byte offsets within the string. POSIX mandates this. */ /* Type for byte offsets within the string. POSIX mandates this. */
#ifdef _REGEX_LARGE_OFFSETS #ifdef _REGEX_LARGE_OFFSETS
/* POSIX 1003.1-2008 requires that regoff_t be at least as wide as /* POSIX 1003.1-2008 requires that regoff_t be at least as wide as
ptrdiff_t and ssize_t. We don't know of any hosts where ptrdiff_t ptrdiff_t and ssize_t. We don't know of any hosts where ptrdiff_t
is wider than ssize_t, so ssize_t is safe. */ is wider than ssize_t, so ssize_t is safe. ptrdiff_t is not
visible here, so use ssize_t. */
typedef ssize_t regoff_t; typedef ssize_t regoff_t;
#else #else
/* The traditional GNU regex implementation mishandles strings longer /* The traditional GNU regex implementation mishandles strings longer
than INT_MAX. */ than INT_MAX. */
typedef int regoff_t; typedef int regoff_t;
#endif #endif
#ifdef __USE_GNU #ifdef __USE_GNU
/* This is the structure we store register match data in. See /* This is the structure we store register match data in. See
regex.texinfo for a full description of what registers match. */ regex.texinfo for a full description of what registers match. */
skipping to change at line 534 skipping to change at line 526
#ifdef __USE_GNU #ifdef __USE_GNU
/* Sets the current default syntax to SYNTAX, and return the old syntax. /* Sets the current default syntax to SYNTAX, and return the old syntax.
You can also simply assign to the 're_syntax_options' variable. */ You can also simply assign to the 're_syntax_options' variable. */
extern reg_syntax_t re_set_syntax (reg_syntax_t __syntax); extern reg_syntax_t re_set_syntax (reg_syntax_t __syntax);
/* Compile the regular expression PATTERN, with length LENGTH /* Compile the regular expression PATTERN, with length LENGTH
and syntax given by the global 're_syntax_options', into the buffer and syntax given by the global 're_syntax_options', into the buffer
BUFFER. Return NULL if successful, and an error string if not. BUFFER. Return NULL if successful, and an error string if not.
To free the allocated storage, you must call 'regfree' on BUFFER. To free the allocated storage, you must call 'regfree' on BUFFER.
Note that the translate table must either have been initialised by Note that the translate table must either have been initialized by
'regcomp', with a malloc'ed value, or set to NULL before calling 'regcomp', with a malloc'ed value, or set to NULL before calling
'regfree'. */ 'regfree'. */
extern const char *re_compile_pattern (const char *__pattern, size_t __length, extern const char *re_compile_pattern (const char *__pattern, size_t __length,
struct re_pattern_buffer *__buffer); struct re_pattern_buffer *__buffer);
/* Compile a fastmap for the compiled pattern in BUFFER; used to /* Compile a fastmap for the compiled pattern in BUFFER; used to
accelerate searches. Return 0 if successful and -2 if was an accelerate searches. Return 0 if successful and -2 if was an
internal error. */ internal error. */
extern int re_compile_fastmap (struct re_pattern_buffer *__buffer); extern int re_compile_fastmap (struct re_pattern_buffer *__buffer);
/* Search in the string STRING (with length LENGTH) for the pattern /* Search in the string STRING (with length LENGTH) for the pattern
compiled into BUFFER. Start searching at position START, for RANGE compiled into BUFFER. Start searching at position START, for RANGE
characters. Return the starting position of the match, -1 for no characters. Return the starting position of the match, -1 for no
match, or -2 for an internal error. Also return register match, or -2 for an internal error. Also return register
information in REGS (if REGS and BUFFER->no_sub are nonzero). */ information in REGS (if REGS and BUFFER->no_sub are nonzero). */
extern regoff_t re_search (struct re_pattern_buffer *__buffer, extern regoff_t re_search (struct re_pattern_buffer *__buffer,
const char *__string, __re_idx_t __length, const char *__String, regoff_t __length,
__re_idx_t __start, regoff_t __range, regoff_t __start, regoff_t __range,
struct re_registers *__regs); struct re_registers *__regs);
/* Like 're_search', but search in the concatenation of STRING1 and /* Like 're_search', but search in the concatenation of STRING1 and
STRING2. Also, stop searching at index START + STOP. */ STRING2. Also, stop searching at index START + STOP. */
extern regoff_t re_search_2 (struct re_pattern_buffer *__buffer, extern regoff_t re_search_2 (struct re_pattern_buffer *__buffer,
const char *__string1, __re_idx_t __length1, const char *__string1, regoff_t __length1,
const char *__string2, __re_idx_t __length2, const char *__string2, regoff_t __length2,
__re_idx_t __start, regoff_t __range, regoff_t __start, regoff_t __range,
struct re_registers *__regs, struct re_registers *__regs,
__re_idx_t __stop); regoff_t __stop);
/* Like 're_search', but return how many characters in STRING the regexp /* Like 're_search', but return how many characters in STRING the regexp
in BUFFER matched, starting at position START. */ in BUFFER matched, starting at position START. */
extern regoff_t re_match (struct re_pattern_buffer *__buffer, extern regoff_t re_match (struct re_pattern_buffer *__buffer,
const char *__string, __re_idx_t __length, const char *__String, regoff_t __length,
__re_idx_t __start, struct re_registers *__regs); regoff_t __start, struct re_registers *__regs);
/* Relates to 're_match' as 're_search_2' relates to 're_search'. */ /* Relates to 're_match' as 're_search_2' relates to 're_search'. */
extern regoff_t re_match_2 (struct re_pattern_buffer *__buffer, extern regoff_t re_match_2 (struct re_pattern_buffer *__buffer,
const char *__string1, __re_idx_t __length1, const char *__string1, regoff_t __length1,
const char *__string2, __re_idx_t __length2, const char *__string2, regoff_t __length2,
__re_idx_t __start, struct re_registers *__regs, regoff_t __start, struct re_registers *__regs,
__re_idx_t __stop); regoff_t __stop);
/* Set REGS to hold NUM_REGS registers, storing them in STARTS and /* Set REGS to hold NUM_REGS registers, storing them in STARTS and
ENDS. Subsequent matches using BUFFER and REGS will use this memory ENDS. Subsequent matches using BUFFER and REGS will use this memory
for recording register information. STARTS and ENDS must be for recording register information. STARTS and ENDS must be
allocated with malloc, and must each be at least 'NUM_REGS * sizeof allocated with malloc, and must each be at least 'NUM_REGS * sizeof
(regoff_t)' bytes long. (regoff_t)' bytes long.
If NUM_REGS == 0, then subsequent matches should allocate their own If NUM_REGS == 0, then subsequent matches should allocate their own
register data. register data.
skipping to change at line 637 skipping to change at line 629
# define _Restrict_arr_ # define _Restrict_arr_
# endif # endif
#endif #endif
/* POSIX compatibility. */ /* POSIX compatibility. */
extern int regcomp (regex_t *_Restrict_ __preg, extern int regcomp (regex_t *_Restrict_ __preg,
const char *_Restrict_ __pattern, const char *_Restrict_ __pattern,
int __cflags); int __cflags);
extern int regexec (const regex_t *_Restrict_ __preg, extern int regexec (const regex_t *_Restrict_ __preg,
const char *_Restrict_ __string, size_t __nmatch, const char *_Restrict_ __String, size_t __nmatch,
regmatch_t __pmatch[_Restrict_arr_], regmatch_t __pmatch[_Restrict_arr_],
int __eflags); int __eflags);
extern size_t regerror (int __errcode, const regex_t *_Restrict_ __preg, extern size_t regerror (int __errcode, const regex_t *_Restrict_ __preg,
char *_Restrict_ __errbuf, size_t __errbuf_size); char *_Restrict_ __errbuf, size_t __errbuf_size);
extern void regfree (regex_t *__preg); extern void regfree (regex_t *__preg);
#ifdef __cplusplus #ifdef __cplusplus
} }
 End of changes. 15 change blocks. 
31 lines changed or deleted 23 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS