summaryrefslogtreecommitdiff
path: root/libc/misc
diff options
context:
space:
mode:
Diffstat (limited to 'libc/misc')
-rw-r--r--libc/misc/regex/_regex.h24
-rw-r--r--libc/misc/regex/regex.c13
-rw-r--r--libc/misc/regex/regex_old.c3
-rw-r--r--libc/misc/wctype/wctype.c23
-rw-r--r--libc/misc/wordexp/wordexp.c1
5 files changed, 38 insertions, 26 deletions
diff --git a/libc/misc/regex/_regex.h b/libc/misc/regex/_regex.h
index cf3a5a2c1..01bb21158 100644
--- a/libc/misc/regex/_regex.h
+++ b/libc/misc/regex/_regex.h
@@ -4,42 +4,42 @@
#include <regex.h>
/* Document internal interfaces. */
-extern reg_syntax_t __re_set_syntax (reg_syntax_t syntax);
+extern reg_syntax_t __re_set_syntax (reg_syntax_t syntax) attribute_hidden;
extern const char *__re_compile_pattern (const char *pattern, size_t length,
- struct re_pattern_buffer *buffer);
+ struct re_pattern_buffer *buffer) attribute_hidden;
-extern int __re_compile_fastmap (struct re_pattern_buffer *buffer);
+extern int __re_compile_fastmap (struct re_pattern_buffer *buffer) attribute_hidden;
extern int __re_search (struct re_pattern_buffer *buffer, const char *string,
int length, int start, int range,
- struct re_registers *regs);
+ struct re_registers *regs) attribute_hidden;
extern int __re_search_2
(struct re_pattern_buffer *buffer, const char *string1,
int length1, const char *string2, int length2,
- int start, int range, struct re_registers *regs, int stop);
+ int start, int range, struct re_registers *regs, int stop) attribute_hidden;
extern int __re_match
(struct re_pattern_buffer *buffer, const char *string,
- int length, int start, struct re_registers *regs);
+ int length, int start, struct re_registers *regs) attribute_hidden;
extern int __re_match_2
(struct re_pattern_buffer *buffer, const char *string1,
int length1, const char *string2, int length2,
- int start, struct re_registers *regs, int stop);
+ int start, struct re_registers *regs, int stop) attribute_hidden;
extern void __re_set_registers
(struct re_pattern_buffer *buffer, struct re_registers *regs,
- unsigned num_regs, regoff_t *starts, regoff_t *ends);
+ unsigned num_regs, regoff_t *starts, regoff_t *ends) attribute_hidden;
-extern int __regcomp (regex_t *__preg, const char *__pattern, int __cflags);
+extern int __regcomp (regex_t *__preg, const char *__pattern, int __cflags) attribute_hidden;
extern int __regexec (const regex_t *__preg, const char *__string,
- size_t __nmatch, regmatch_t __pmatch[], int __eflags);
+ size_t __nmatch, regmatch_t __pmatch[], int __eflags) attribute_hidden;
extern size_t __regerror (int __errcode, const regex_t *__preg,
- char *__errbuf, size_t __errbuf_size);
+ char *__errbuf, size_t __errbuf_size) attribute_hidden;
-extern void __regfree (regex_t *__preg);
+extern void __regfree (regex_t *__preg) attribute_hidden;
#endif
diff --git a/libc/misc/regex/regex.c b/libc/misc/regex/regex.c
index 789e78b49..0eefa85c9 100644
--- a/libc/misc/regex/regex.c
+++ b/libc/misc/regex/regex.c
@@ -32,9 +32,17 @@
#include <stdint.h>
#ifdef __UCLIBC_HAS_WCHAR__
#define RE_ENABLE_I18N
+#define wcscoll __wcscoll
+#define mbrtowc __mbrtowc
+#define iswctype __iswctype
+#define iswlower __iswlower
+#define iswalnum __iswalnum
#include <wchar.h>
#include <wctype.h>
+/* attribute_hidden produces text relocation */
+//extern int __wcscoll (__const wchar_t *__s1, __const wchar_t *__s2) __THROW /*attribute_hidden*/;
+
extern size_t __wcrtomb (char *__restrict __s, wchar_t __wc,
mbstate_t *__restrict __ps) attribute_hidden;
@@ -42,7 +50,7 @@ extern wint_t __btowc (int __c) attribute_hidden;
extern wctype_t __wctype (__const char *__property) attribute_hidden;
-extern int __iswctype (wint_t __wc, wctype_t __desc) /*attribute_hidden*/;
+//extern int __iswctype (wint_t __wc, wctype_t __desc) /*attribute_hidden*/;
#endif
#define memcmp __memcmp
@@ -55,10 +63,9 @@ extern int __iswctype (wint_t __wc, wctype_t __desc) /*attribute_hidden*/;
#define strncpy __strncpy
#define getenv __getenv
#define strcasecmp __strcasecmp
-#define wcscoll __wcscoll
extern void *__mempcpy (void *__restrict __dest,
- __const void *__restrict __src, size_t __n) /*attribute_hidden*/;
+ __const void *__restrict __src, size_t __n) attribute_hidden;
#endif
/* Make sure noone compiles this code with a C++ compiler. */
diff --git a/libc/misc/regex/regex_old.c b/libc/misc/regex/regex_old.c
index 486e29c40..ab471ee1e 100644
--- a/libc/misc/regex/regex_old.c
+++ b/libc/misc/regex/regex_old.c
@@ -28,7 +28,10 @@
#define wcslen __wcslen
/* for some reason this does not work */
#define memcpy __memcpy
+#define mbrtowc __mbrtowc
#define wcscoll __wcscoll
+#define iswctype __iswctype
+#define iswalnum __iswalnum
/* To exclude some unwanted junk.... */
#undef _LIBC
diff --git a/libc/misc/wctype/wctype.c b/libc/misc/wctype/wctype.c
index c256400e7..77d7572da 100644
--- a/libc/misc/wctype/wctype.c
+++ b/libc/misc/wctype/wctype.c
@@ -48,7 +48,7 @@ extern wctype_t __wctype (__const char *__property) attribute_hidden;
#include <xlocale.h>
extern wint_t __towlower_l(wint_t __wc, __locale_t __locale) __THROW;
extern wint_t __towupper_l(wint_t __wc, __locale_t __locale) __THROW;
-extern int __iswctype_l(wint_t __wc, wctype_t __desc, __locale_t __locale) __THROW;
+//extern int __iswctype_l(wint_t __wc, wctype_t __desc, __locale_t __locale) __THROW attribute_hidden;
extern wint_t __towctrans_l(wint_t __wc, wctrans_t __desc, __locale_t __locale) __THROW;
#endif /* __UCLIBC_HAS_XLOCALE__ */
@@ -181,10 +181,10 @@ enum {
#ifdef __UCLIBC_DO_XLOCALE
extern int __iswctype_l (wint_t __wc, wctype_t __desc, __locale_t __locale)
- __THROW;
+ __THROW attribute_hidden;
#define ISW_FUNC_BODY(NAME) \
-int __PASTE3(__isw,NAME,_l) (wint_t wc, __locale_t l) \
+int attribute_hidden __PASTE3(__isw,NAME,_l) (wint_t wc, __locale_t l) \
{ \
return __iswctype_l(wc, __PASTE2(_CTYPE_is,NAME), l); \
} \
@@ -192,13 +192,14 @@ weak_alias(__PASTE3(__isw,NAME,_l), __PASTE3(isw,NAME,_l))
#else /* __UCLIBC_DO_XLOCALE */
-extern int __iswctype (wint_t __wc, wctype_t __desc) __THROW;
+extern int __iswctype (wint_t __wc, wctype_t __desc) __THROW attribute_hidden;
#define ISW_FUNC_BODY(NAME) \
-int __PASTE2(isw,NAME) (wint_t wc) \
+int attribute_hidden __PASTE2(__isw,NAME) (wint_t wc) \
{ \
return __iswctype(wc, __PASTE2(_CTYPE_is,NAME)); \
-}
+} \
+weak_alias(__PASTE2(__isw,NAME), __PASTE2(isw,NAME))
#endif /* __UCLIBC_DO_XLOCALE */
/**********************************************************************/
@@ -514,7 +515,7 @@ strong_alias(__wctype,wctype)
#warning REMINDER: Currently wctype_l simply calls wctype.
#endif /* __UCLIBC_MJN3_ONLY__ */
-wctype_t __wctype_l (const char *property, __locale_t locale)
+wctype_t attribute_hidden __wctype_l (const char *property, __locale_t locale)
{
return __wctype(property);
}
@@ -568,7 +569,7 @@ static const unsigned short int desc2flag[] = {
#ifdef __UCLIBC_HAS_CTYPE_TABLES__
-int __iswctype(wint_t wc, wctype_t desc)
+int attribute_hidden __iswctype(wint_t wc, wctype_t desc)
{
/* Note... wctype_t is unsigned. */
@@ -582,7 +583,7 @@ int __iswctype(wint_t wc, wctype_t desc)
#else /* __UCLIBC_HAS_CTYPE_TABLES__ */
-int __iswctype(wint_t wc, wctype_t desc)
+int attribute_hidden __iswctype(wint_t wc, wctype_t desc)
{
/* This is lame, but it is here just to get it working for now. */
@@ -641,14 +642,14 @@ int __iswctype(wint_t wc, wctype_t desc)
#if defined(L_iswctype) && defined(__UCLIBC_HAS_XLOCALE__)
-int __iswctype(wint_t wc, wctype_t desc)
+int attribute_hidden __iswctype(wint_t wc, wctype_t desc)
{
return __iswctype_l(wc, desc, __UCLIBC_CURLOCALE);
}
#else /* defined(L_iswctype) && defined(__UCLIBC_HAS_XLOCALE__) */
-int ISWCTYPE(wint_t wc, wctype_t desc)
+int attribute_hidden ISWCTYPE(wint_t wc, wctype_t desc)
{
unsigned int sc, n, i0, i1;
unsigned char d = __CTYPE_unclassified;
diff --git a/libc/misc/wordexp/wordexp.c b/libc/misc/wordexp/wordexp.c
index 9cdeaf162..7cac06f69 100644
--- a/libc/misc/wordexp/wordexp.c
+++ b/libc/misc/wordexp/wordexp.c
@@ -28,6 +28,7 @@
#define kill __kill
#define getuid __getuid
#define execve __execve
+#define dup2 __dup2
#define _GNU_SOURCE
#include <sys/cdefs.h>