|
@@ -23,12 +23,10 @@
|
|
|
|
|
|
#undef emacs
|
|
|
#include <features.h>
|
|
|
+
|
|
|
#ifdef __UCLIBC__
|
|
|
# undef _LIBC
|
|
|
# define _REGEX_RE_COMP
|
|
|
-# ifdef __USE_GNU
|
|
|
-# define HAVE_MEMPCPY
|
|
|
-# endif
|
|
|
# define STDC_HEADERS
|
|
|
# define RE_TRANSLATE_TYPE char *
|
|
|
#endif
|
|
@@ -38,20 +36,9 @@
|
|
|
#include <unistd.h>
|
|
|
#include <stdio.h>
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-#ifdef __USE_GNU
|
|
|
-
|
|
|
-#endif
|
|
|
-
|
|
|
|
|
|
#if defined _AIX && !defined REGEX_MALLOC
|
|
|
- #pragma alloca
|
|
|
+# pragma alloca
|
|
|
#endif
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
@@ -70,43 +57,15 @@
|
|
|
|
|
|
|
|
|
support user defined character classes. */
|
|
|
-#if defined __UCLIBC_HAS_WCHAR__
|
|
|
+# if defined __UCLIBC_HAS_WCHAR__
|
|
|
# define WIDE_CHAR_SUPPORT 1
|
|
|
|
|
|
# include <wchar.h>
|
|
|
# include <wctype.h>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
# endif
|
|
|
|
|
|
# if defined _LIBC || defined __UCLIBC__
|
|
|
|
|
|
-# define regfree(preg) __regfree (preg)
|
|
|
-# define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef)
|
|
|
-# define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags)
|
|
|
-# define regerror(errcode, preg, errbuf, errbuf_size) \
|
|
|
- __regerror(errcode, preg, errbuf, errbuf_size)
|
|
|
-# define re_set_registers(bu, re, nu, st, en) \
|
|
|
- __re_set_registers (bu, re, nu, st, en)
|
|
|
-# define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \
|
|
|
- __re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
|
|
|
-# define re_match(bufp, string, size, pos, regs) \
|
|
|
- __re_match (bufp, string, size, pos, regs)
|
|
|
-# define re_search(bufp, string, size, startpos, range, regs) \
|
|
|
- __re_search (bufp, string, size, startpos, range, regs)
|
|
|
-# define re_compile_pattern(pattern, length, bufp) \
|
|
|
- __re_compile_pattern (pattern, length, bufp)
|
|
|
-# define re_set_syntax(syntax) __re_set_syntax (syntax)
|
|
|
-# define re_search_2(bufp, st1, s1, st2, s2, startpos, range, regs, stop) \
|
|
|
- __re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop)
|
|
|
-# define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
|
|
|
|
|
|
# ifndef __UCLIBC__
|
|
|
# define btowc __btowc
|
|
@@ -217,9 +176,6 @@ char *realloc ();
|
|
|
# endif
|
|
|
|
|
|
|
|
|
-# ifdef __UCLIBC__
|
|
|
-# include "_regex.h"
|
|
|
-# endif
|
|
|
# include <regex.h>
|
|
|
|
|
|
|
|
@@ -1366,9 +1322,6 @@ re_set_syntax (reg_syntax_t syntax)
|
|
|
# endif
|
|
|
return ret;
|
|
|
}
|
|
|
-# if defined _LIBC || defined __UCLIBC__
|
|
|
-strong_alias(__re_set_syntax, re_set_syntax)
|
|
|
-# endif
|
|
|
|
|
|
|
|
|
in regex.h. Obviously the order here has to be same as there.
|
|
@@ -1429,7 +1382,7 @@ static const char re_error_msgid[] =
|
|
|
gettext_noop ("Unmatched ) or \\)")
|
|
|
};
|
|
|
|
|
|
-static const size_t re_error_msgid_idx[] =
|
|
|
+static const uint16_t re_error_msgid_idx[] =
|
|
|
{
|
|
|
REG_NOERROR_IDX,
|
|
|
REG_NOMATCH_IDX,
|
|
@@ -4955,13 +4908,10 @@ re_compile_fastmap (struct re_pattern_buffer *bufp)
|
|
|
# ifdef MBS_SUPPORT
|
|
|
if (MB_CUR_MAX != 1)
|
|
|
return wcs_re_compile_fastmap(bufp);
|
|
|
- else
|
|
|
# endif
|
|
|
- return byte_re_compile_fastmap(bufp);
|
|
|
-}
|
|
|
-#if defined _LIBC || defined __UCLIBC__
|
|
|
-strong_alias(__re_compile_fastmap, re_compile_fastmap)
|
|
|
-#endif
|
|
|
+ return byte_re_compile_fastmap(bufp);
|
|
|
+}
|
|
|
+libc_hidden_def(re_compile_fastmap)
|
|
|
|
|
|
|
|
|
|
|
@@ -4998,9 +4948,6 @@ re_set_registers (
|
|
|
regs->start = regs->end = (regoff_t *) 0;
|
|
|
}
|
|
|
}
|
|
|
-#if defined _LIBC || defined __UCLIBC__
|
|
|
-strong_alias(__re_set_registers, re_set_registers)
|
|
|
-#endif
|
|
|
|
|
|
|
|
|
|
|
@@ -5017,9 +4964,6 @@ re_search (
|
|
|
return re_search_2 (bufp, NULL, 0, string, size, startpos, range,
|
|
|
regs, size);
|
|
|
}
|
|
|
-#if defined _LIBC || defined __UCLIBC__
|
|
|
-strong_alias(__re_search, re_search)
|
|
|
-#endif
|
|
|
|
|
|
|
|
|
|
|
@@ -5057,14 +5001,10 @@ re_search_2 (
|
|
|
if (MB_CUR_MAX != 1)
|
|
|
return wcs_re_search_2 (bufp, string1, size1, string2, size2, startpos,
|
|
|
range, regs, stop);
|
|
|
- else
|
|
|
# endif
|
|
|
- return byte_re_search_2 (bufp, string1, size1, string2, size2, startpos,
|
|
|
- range, regs, stop);
|
|
|
-}
|
|
|
-#if defined _LIBC || defined __UCLIBC__
|
|
|
-strong_alias(__re_search_2, re_search_2)
|
|
|
-#endif
|
|
|
+ return byte_re_search_2 (bufp, string1, size1, string2, size2, startpos,
|
|
|
+ range, regs, stop);
|
|
|
+}
|
|
|
|
|
|
#endif
|
|
|
|
|
@@ -5520,9 +5460,6 @@ re_match (
|
|
|
# endif
|
|
|
return result;
|
|
|
}
|
|
|
-# if defined _LIBC || defined __UCLIBC__
|
|
|
-strong_alias(__re_match, re_match)
|
|
|
-# endif
|
|
|
#endif
|
|
|
|
|
|
#endif
|
|
@@ -5581,9 +5518,6 @@ re_match_2 (
|
|
|
#endif
|
|
|
return result;
|
|
|
}
|
|
|
-#if defined _LIBC || defined __UCLIBC__
|
|
|
-strong_alias(__re_match_2, re_match_2)
|
|
|
-#endif
|
|
|
|
|
|
#endif
|
|
|
|
|
@@ -7928,9 +7862,6 @@ re_compile_pattern (
|
|
|
return NULL;
|
|
|
return gettext (re_error_msgid + re_error_msgid_idx[(int) ret]);
|
|
|
}
|
|
|
-#if defined _LIBC || defined __UCLIBC__
|
|
|
-strong_alias(__re_compile_pattern, re_compile_pattern)
|
|
|
-#endif
|
|
|
|
|
|
|
|
|
them unless specifically requested. */
|
|
@@ -8122,9 +8053,6 @@ regcomp (
|
|
|
|
|
|
return (int) ret;
|
|
|
}
|
|
|
-#if defined _LIBC || defined __UCLIBC__
|
|
|
-strong_alias(__regcomp, regcomp)
|
|
|
-#endif
|
|
|
|
|
|
|
|
|
|
|
@@ -8200,9 +8128,7 @@ regexec (
|
|
|
|
|
|
return ret >= 0 ? (int) REG_NOERROR : (int) REG_NOMATCH;
|
|
|
}
|
|
|
-#if defined _LIBC || defined __UCLIBC__
|
|
|
-strong_alias(__regexec, regexec)
|
|
|
-#endif
|
|
|
+libc_hidden_def(regexec)
|
|
|
|
|
|
|
|
|
|
|
@@ -8235,12 +8161,8 @@ regerror (
|
|
|
{
|
|
|
if (msg_size > errbuf_size)
|
|
|
{
|
|
|
-#if (defined HAVE_MEMPCPY || defined _LIBC) && defined __USE_GNU
|
|
|
- *((char *) mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
|
|
|
-#else
|
|
|
memcpy (errbuf, msg, errbuf_size - 1);
|
|
|
errbuf[errbuf_size - 1] = 0;
|
|
|
-#endif
|
|
|
}
|
|
|
else
|
|
|
memcpy (errbuf, msg, msg_size);
|
|
@@ -8248,9 +8170,6 @@ regerror (
|
|
|
|
|
|
return msg_size;
|
|
|
}
|
|
|
-#if defined _LIBC || defined __UCLIBC__
|
|
|
-strong_alias(__regerror, regerror)
|
|
|
-#endif
|
|
|
|
|
|
|
|
|
|
|
@@ -8271,9 +8190,7 @@ regfree (regex_t *preg)
|
|
|
free (preg->translate);
|
|
|
preg->translate = NULL;
|
|
|
}
|
|
|
-#if defined _LIBC || defined __UCLIBC__
|
|
|
-strong_alias(__regfree, regfree)
|
|
|
-#endif
|
|
|
+libc_hidden_def(regfree)
|
|
|
|
|
|
#endif
|
|
|
|