summaryrefslogtreecommitdiff
path: root/libc/misc
diff options
context:
space:
mode:
Diffstat (limited to 'libc/misc')
-rw-r--r--libc/misc/fnmatch/fnmatch.c1
-rw-r--r--libc/misc/glob/glob.c55
-rw-r--r--libc/misc/glob/glob64.c16
-rw-r--r--libc/misc/ttyent/getttyent.c23
-rw-r--r--libc/misc/utmp/utent.c7
-rw-r--r--libc/misc/wchar/wstdio.c11
6 files changed, 55 insertions, 58 deletions
diff --git a/libc/misc/fnmatch/fnmatch.c b/libc/misc/fnmatch/fnmatch.c
index dc18c2f59..ac7dbcf2b 100644
--- a/libc/misc/fnmatch/fnmatch.c
+++ b/libc/misc/fnmatch/fnmatch.c
@@ -475,7 +475,6 @@ compat_symbol (libc, __fnmatch_old, fnmatch, GLIBC_2_0);
libc_hidden_ver (__fnmatch, fnmatch)
# endif
# else
-libc_hidden_proto(fnmatch)
libc_hidden_def(fnmatch)
# endif
diff --git a/libc/misc/glob/glob.c b/libc/misc/glob/glob.c
index cbc232076..8cb9a3ae5 100644
--- a/libc/misc/glob/glob.c
+++ b/libc/misc/glob/glob.c
@@ -15,6 +15,7 @@ License along with this library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
+#define _GNU_SOURCE
#include <features.h>
#include <stdlib.h>
#include <string.h>
@@ -25,7 +26,6 @@ Cambridge, MA 02139, USA. */
#include <dirent.h>
#include <malloc.h>
#include <fnmatch.h>
-#define _GNU_SOURCE
#include <glob.h>
libc_hidden_proto(memcpy)
@@ -40,6 +40,7 @@ libc_hidden_proto(fnmatch)
libc_hidden_proto(qsort)
libc_hidden_proto(lstat)
+
extern __ptr_t (*__glob_opendir_hook) __P ((const char *directory)) attribute_hidden;
extern void (*__glob_closedir_hook) __P ((__ptr_t stream)) attribute_hidden;
extern const char *(*__glob_readdir_hook) __P ((__ptr_t stream)) attribute_hidden;
@@ -53,20 +54,20 @@ static int prefix_array __P ((const char *prefix, char **array, size_t n,
int add_slash));
static int collated_compare __P ((const __ptr_t, const __ptr_t));
+libc_hidden_proto(glob_pattern_p)
#ifdef __GLOB64
-extern int __glob_pattern_p(const char *pattern, int quote) attribute_hidden;
+libc_hidden_proto(glob64)
+libc_hidden_proto(globfree64)
libc_hidden_proto(readdir64)
#define __readdir readdir64
#else
-extern int __glob (__const char *__restrict __pattern, int __flags,
- int (*__errfunc) (__const char *, int),
- glob_t *__restrict __pglob) __THROW attribute_hidden;
-extern void __globfree (glob_t *__pglob) __THROW attribute_hidden;
+libc_hidden_proto(glob)
+libc_hidden_proto(globfree)
#define __readdir readdir
libc_hidden_proto(readdir)
/* Return nonzero if PATTERN contains any metacharacters.
Metacharacters can be quoted with backslashes if QUOTE is nonzero. */
-int attribute_hidden __glob_pattern_p(const char *pattern, int quote)
+int glob_pattern_p(const char *pattern, int quote)
{
const char *p;
int open = 0;
@@ -95,7 +96,7 @@ int attribute_hidden __glob_pattern_p(const char *pattern, int quote)
return 0;
}
-strong_alias(__glob_pattern_p,glob_pattern_p)
+libc_hidden_def(glob_pattern_p)
#endif
@@ -107,8 +108,8 @@ strong_alias(__glob_pattern_p,glob_pattern_p)
`glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
Otherwise, `glob' returns zero. */
-int attribute_hidden
-__glob (pattern, flags, errfunc, pglob)
+int
+glob (pattern, flags, errfunc, pglob)
const char *pattern;
int flags;
int (*errfunc) __P ((const char *, int));
@@ -153,7 +154,7 @@ __glob (pattern, flags, errfunc, pglob)
if (filename[0] == '\0' && dirlen > 1)
/* "pattern/". Expand "pattern", appending slashes. */
{
- int val = __glob (dirname, flags | GLOB_MARK, errfunc, pglob);
+ int val = glob (dirname, flags | GLOB_MARK, errfunc, pglob);
if (val == 0)
pglob->gl_flags = (pglob->gl_flags & ~GLOB_MARK) | (flags & GLOB_MARK);
return val;
@@ -167,7 +168,7 @@ __glob (pattern, flags, errfunc, pglob)
oldcount = pglob->gl_pathc;
- if (__glob_pattern_p (dirname, !(flags & GLOB_NOESCAPE)))
+ if (glob_pattern_p (dirname, !(flags & GLOB_NOESCAPE)))
{
/* The directory name contains metacharacters, so we
have to glob for the directory, and then glob for
@@ -175,7 +176,7 @@ __glob (pattern, flags, errfunc, pglob)
glob_t dirs;
register int i;
- status = __glob (dirname,
+ status = glob (dirname,
((flags & (GLOB_ERR | GLOB_NOCHECK | GLOB_NOESCAPE)) |
GLOB_NOSORT),
errfunc, &dirs);
@@ -196,8 +197,8 @@ __glob (pattern, flags, errfunc, pglob)
if (interrupt_state)
{
- __globfree (&dirs);
- __globfree (&files);
+ globfree (&dirs);
+ globfree (&files);
return GLOB_ABEND;
}
}
@@ -213,8 +214,8 @@ __glob (pattern, flags, errfunc, pglob)
if (status != 0)
{
- __globfree (&dirs);
- __globfree (pglob);
+ globfree (&dirs);
+ globfree (pglob);
return status;
}
@@ -224,8 +225,8 @@ __glob (pattern, flags, errfunc, pglob)
pglob->gl_pathc - oldcount,
flags & GLOB_MARK))
{
- __globfree (&dirs);
- __globfree (pglob);
+ globfree (&dirs);
+ globfree (pglob);
return GLOB_NOSPACE;
}
}
@@ -284,7 +285,7 @@ __glob (pattern, flags, errfunc, pglob)
pglob->gl_pathc - oldcount,
flags & GLOB_MARK))
{
- __globfree (pglob);
+ globfree (pglob);
return GLOB_NOSPACE;
}
}
@@ -311,15 +312,15 @@ __glob (pattern, flags, errfunc, pglob)
return 0;
}
#ifdef __GLOB64
-strong_alias(__glob64,glob64)
+libc_hidden_def(glob64)
#else
-strong_alias(__glob,glob)
+libc_hidden_def(glob)
#endif
/* Free storage allocated in PGLOB by a previous `glob' call. */
-void attribute_hidden
-__globfree (pglob)
+void
+globfree (pglob)
register glob_t *pglob;
{
if (pglob->gl_pathv != NULL)
@@ -332,9 +333,9 @@ __globfree (pglob)
}
}
#ifdef __GLOB64
-strong_alias(__globfree64,globfree64)
+libc_hidden_def(globfree64)
#else
-strong_alias(__globfree,globfree)
+libc_hidden_def(globfree)
#endif
@@ -432,7 +433,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
return GLOB_ABORTED;
}
- meta = __glob_pattern_p (pattern, !(flags & GLOB_NOESCAPE));
+ meta = glob_pattern_p (pattern, !(flags & GLOB_NOESCAPE));
if (meta)
flags |= GLOB_MAGCHAR;
diff --git a/libc/misc/glob/glob64.c b/libc/misc/glob/glob64.c
index 5baf86810..8c19e81bb 100644
--- a/libc/misc/glob/glob64.c
+++ b/libc/misc/glob/glob64.c
@@ -1,3 +1,10 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define _GNU_SOURCE
#include <features.h>
#ifdef __UCLIBC_HAS_LFS__
@@ -18,20 +25,11 @@
#include <glob.h>
#include <sys/stat.h>
-
-extern int __glob64 (__const char *__restrict __pattern, int __flags,
- int (*__errfunc) (__const char *, int),
- glob64_t *__restrict __pglob) __THROW attribute_hidden;
-extern void __globfree (glob_t *__pglob) __THROW attribute_hidden;
-extern void __globfree64 (glob64_t *__pglob) __THROW attribute_hidden;
#define dirent dirent64
#define glob_t glob64_t
-#define __glob(pattern, flags, errfunc, pglob) \
- __glob64 (pattern, flags, errfunc, pglob)
#define glob(pattern, flags, errfunc, pglob) \
glob64 (pattern, flags, errfunc, pglob)
-#define __globfree(pglob) __globfree64 (pglob)
#define globfree(pglob) globfree64 (pglob)
#undef stat
diff --git a/libc/misc/ttyent/getttyent.c b/libc/misc/ttyent/getttyent.c
index 9754e9b49..c11811769 100644
--- a/libc/misc/ttyent/getttyent.c
+++ b/libc/misc/ttyent/getttyent.c
@@ -98,7 +98,8 @@ static char * value(register char *p)
return ((p = strchr(p, '=')) ? ++p : NULL);
}
-int attribute_hidden __setttyent(void)
+libc_hidden_proto(setttyent)
+int setttyent(void)
{
if (tf) {
@@ -113,15 +114,16 @@ int attribute_hidden __setttyent(void)
}
return (0);
}
-strong_alias(__setttyent,setttyent)
+libc_hidden_def(setttyent)
-struct ttyent attribute_hidden * __getttyent(void)
+libc_hidden_proto(getttyent)
+struct ttyent * getttyent(void)
{
register int c;
register char *p;
static char *line = NULL;
- if (!tf && !__setttyent())
+ if (!tf && !setttyent())
return (NULL);
if (!line) {
@@ -191,9 +193,10 @@ struct ttyent attribute_hidden * __getttyent(void)
*p = '\0';
return (&tty);
}
-strong_alias(__getttyent,getttyent)
+libc_hidden_def(getttyent)
-int attribute_hidden __endttyent(void)
+libc_hidden_proto(endttyent)
+int endttyent(void)
{
int rval;
@@ -204,16 +207,16 @@ int attribute_hidden __endttyent(void)
}
return (1);
}
-strong_alias(__endttyent,endttyent)
+libc_hidden_def(endttyent)
struct ttyent * getttynam(const char *tty)
{
register struct ttyent *t;
- __setttyent();
- while ((t = __getttyent()))
+ setttyent();
+ while ((t = getttyent()))
if (!strcmp(tty, t->ty_name))
break;
- __endttyent();
+ endttyent();
return (t);
}
diff --git a/libc/misc/utmp/utent.c b/libc/misc/utmp/utent.c
index c1932d7d7..b865cc271 100644
--- a/libc/misc/utmp/utent.c
+++ b/libc/misc/utmp/utent.c
@@ -112,7 +112,8 @@ struct utmp *getutent(void)
}
/* Locking is done in __getutent */
-struct utmp attribute_hidden *__getutid (const struct utmp *utmp_entry)
+libc_hidden_proto(getutid)
+struct utmp *getutid (const struct utmp *utmp_entry)
{
struct utmp *lutmp;
@@ -137,7 +138,7 @@ struct utmp attribute_hidden *__getutid (const struct utmp *utmp_entry)
return NULL;
}
-strong_alias(__getutid,getutid)
+libc_hidden_def(getutid)
/* Locking is done in __getutent */
struct utmp *getutline(const struct utmp *utmp_entry)
@@ -162,7 +163,7 @@ struct utmp *pututline (const struct utmp *utmp_entry)
the file pointer where they want it, everything will work out. */
lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR);
- if (__getutid(utmp_entry) != NULL) {
+ if (getutid(utmp_entry) != NULL) {
lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR);
if (write(static_fd, utmp_entry, sizeof(struct utmp)) != sizeof(struct utmp))
return NULL;
diff --git a/libc/misc/wchar/wstdio.c b/libc/misc/wchar/wstdio.c
index 69287f871..00311a41d 100644
--- a/libc/misc/wchar/wstdio.c
+++ b/libc/misc/wchar/wstdio.c
@@ -56,6 +56,9 @@
#include <errno.h>
#include <assert.h>
+libc_hidden_proto(fgetwc_unlocked)
+libc_hidden_proto(fputwc_unlocked)
+
#ifndef __UCLIBC_HAS_THREADS__
#ifdef __BCC__
@@ -259,7 +262,6 @@ UNLOCKED(wint_t,fgetwc,(register FILE *stream),(stream))
return wi;
}
-libc_hidden_proto(fgetwc_unlocked)
libc_hidden_def(fgetwc_unlocked)
strong_alias(fgetwc_unlocked,getwc_unlocked)
@@ -269,8 +271,6 @@ strong_alias(fgetwc,getwc)
/**********************************************************************/
#ifdef L_getwchar
-libc_hidden_proto(fgetwc_unlocked)
-
UNLOCKED_STREAM(wint_t,getwchar,(void),(),stdin)
{
register FILE *stream = stdin; /* This helps bcc optimize. */
@@ -282,8 +282,6 @@ UNLOCKED_STREAM(wint_t,getwchar,(void),(),stdin)
/**********************************************************************/
#ifdef L_fgetws
-libc_hidden_proto(fgetwc_unlocked)
-
UNLOCKED(wchar_t *,fgetws,(wchar_t *__restrict ws, int n,
FILE *__restrict stream),(ws, n, stream))
{
@@ -333,7 +331,6 @@ UNLOCKED(wint_t,fputwc,(wchar_t wc, FILE *stream),(wc, stream))
? wc : WEOF;
#endif
}
-libc_hidden_proto(fputwc_unlocked)
libc_hidden_def(fputwc_unlocked)
strong_alias(fputwc_unlocked,putwc_unlocked)
@@ -343,8 +340,6 @@ strong_alias(fputwc,putwc)
/**********************************************************************/
#ifdef L_putwchar
-libc_hidden_proto(fputwc_unlocked)
-
UNLOCKED_STREAM(wint_t,putwchar,(wchar_t wc),(wc),stdout)
{
register FILE *stream = stdout; /* This helps bcc optimize. */