aboutsummaryrefslogtreecommitdiffstats
path: root/lib/regcomp.c
diff options
context:
space:
mode:
authorPaul Eggert2018-12-27 11:45:21 -0800
committerPaul Eggert2018-12-27 11:45:47 -0800
commitee7514b91beb254a7dc62f618046d34036555cea (patch)
tree7299efc4b14731bb30d013bb9594b2e7834b1d8d /lib/regcomp.c
parenta8576aba8fa45549985566bc8be4921dce508dd9 (diff)
downloademacs-ee7514b91beb254a7dc62f618046d34036555cea.tar.gz
emacs-ee7514b91beb254a7dc62f618046d34036555cea.zip
Update from Gnulib
* build-aux/config.guess, lib/regcomp.c, lib/regex.c: * lib/regex_internal.h, lib/regexec.c: Copy from Gnulib.
Diffstat (limited to 'lib/regcomp.c')
-rw-r--r--lib/regcomp.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/lib/regcomp.c b/lib/regcomp.c
index 0b05a63b632..2672ffcc37a 100644
--- a/lib/regcomp.c
+++ b/lib/regcomp.c
@@ -233,9 +233,7 @@ re_compile_pattern (const char *pattern, size_t length,
233 return NULL; 233 return NULL;
234 return gettext (__re_error_msgid + __re_error_msgid_idx[(int) ret]); 234 return gettext (__re_error_msgid + __re_error_msgid_idx[(int) ret]);
235} 235}
236#ifdef _LIBC
237weak_alias (__re_compile_pattern, re_compile_pattern) 236weak_alias (__re_compile_pattern, re_compile_pattern)
238#endif
239 237
240/* Set by 're_set_syntax' to the current regexp syntax to recognize. Can 238/* Set by 're_set_syntax' to the current regexp syntax to recognize. Can
241 also be assigned to arbitrarily: each pattern buffer stores its own 239 also be assigned to arbitrarily: each pattern buffer stores its own
@@ -260,9 +258,7 @@ re_set_syntax (reg_syntax_t syntax)
260 re_syntax_options = syntax; 258 re_syntax_options = syntax;
261 return ret; 259 return ret;
262} 260}
263#ifdef _LIBC
264weak_alias (__re_set_syntax, re_set_syntax) 261weak_alias (__re_set_syntax, re_set_syntax)
265#endif
266 262
267int 263int
268re_compile_fastmap (struct re_pattern_buffer *bufp) 264re_compile_fastmap (struct re_pattern_buffer *bufp)
@@ -281,9 +277,7 @@ re_compile_fastmap (struct re_pattern_buffer *bufp)
281 bufp->fastmap_accurate = 1; 277 bufp->fastmap_accurate = 1;
282 return 0; 278 return 0;
283} 279}
284#ifdef _LIBC
285weak_alias (__re_compile_fastmap, re_compile_fastmap) 280weak_alias (__re_compile_fastmap, re_compile_fastmap)
286#endif
287 281
288static inline void 282static inline void
289__attribute__ ((always_inline)) 283__attribute__ ((always_inline))
@@ -464,7 +458,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
464 the return codes and their meanings.) */ 458 the return codes and their meanings.) */
465 459
466int 460int
467regcomp (regex_t *_Restrict_ preg, const char *_Restrict_ pattern, int cflags) 461regcomp (regex_t *__restrict preg, const char *__restrict pattern, int cflags)
468{ 462{
469 reg_errcode_t ret; 463 reg_errcode_t ret;
470 reg_syntax_t syntax = ((cflags & REG_EXTENDED) ? RE_SYNTAX_POSIX_EXTENDED 464 reg_syntax_t syntax = ((cflags & REG_EXTENDED) ? RE_SYNTAX_POSIX_EXTENDED
@@ -515,16 +509,14 @@ regcomp (regex_t *_Restrict_ preg, const char *_Restrict_ pattern, int cflags)
515 509
516 return (int) ret; 510 return (int) ret;
517} 511}
518#ifdef _LIBC
519libc_hidden_def (__regcomp) 512libc_hidden_def (__regcomp)
520weak_alias (__regcomp, regcomp) 513weak_alias (__regcomp, regcomp)
521#endif
522 514
523/* Returns a message corresponding to an error code, ERRCODE, returned 515/* Returns a message corresponding to an error code, ERRCODE, returned
524 from either regcomp or regexec. We don't use PREG here. */ 516 from either regcomp or regexec. We don't use PREG here. */
525 517
526size_t 518size_t
527regerror (int errcode, const regex_t *_Restrict_ preg, char *_Restrict_ errbuf, 519regerror (int errcode, const regex_t *__restrict preg, char *__restrict errbuf,
528 size_t errbuf_size) 520 size_t errbuf_size)
529{ 521{
530 const char *msg; 522 const char *msg;
@@ -555,9 +547,7 @@ regerror (int errcode, const regex_t *_Restrict_ preg, char *_Restrict_ errbuf,
555 547
556 return msg_size; 548 return msg_size;
557} 549}
558#ifdef _LIBC
559weak_alias (__regerror, regerror) 550weak_alias (__regerror, regerror)
560#endif
561 551
562 552
563#ifdef RE_ENABLE_I18N 553#ifdef RE_ENABLE_I18N
@@ -657,10 +647,8 @@ regfree (regex_t *preg)
657 re_free (preg->translate); 647 re_free (preg->translate);
658 preg->translate = NULL; 648 preg->translate = NULL;
659} 649}
660#ifdef _LIBC
661libc_hidden_def (__regfree) 650libc_hidden_def (__regfree)
662weak_alias (__regfree, regfree) 651weak_alias (__regfree, regfree)
663#endif
664 652
665/* Entry points compatible with 4.2 BSD regex library. We don't define 653/* Entry points compatible with 4.2 BSD regex library. We don't define
666 them unless specifically requested. */ 654 them unless specifically requested. */