svn commit: trunk/uClibc: include libc/misc/wordexp libc/pwd_grp l etc...

psm at uclibc.org psm at uclibc.org
Fri Dec 16 01:25:08 UTC 2005


Author: psm
Date: 2005-12-15 17:18:01 -0800 (Thu, 15 Dec 2005)
New Revision: 12920

Log:
Convert all the rest, remove isxupper/isxlower, if someone objects, I'll add it back

Modified:
   trunk/uClibc/include/ctype.h
   trunk/uClibc/libc/misc/wordexp/wordexp.c
   trunk/uClibc/libc/pwd_grp/pwd_grp.c
   trunk/uClibc/libc/stdlib/malloc/heap_debug.c
   trunk/uClibc/libc/stdlib/malloc/malloc.h
   trunk/uClibc/libc/stdlib/malloc/malloc_debug.c
   trunk/uClibc/libc/stdlib/stdlib.c
   trunk/uClibc/libc/stdlib/system.c
   trunk/uClibc/libc/stdlib/unix_grantpt.c
   trunk/uClibc/libc/string/wstring.c
   trunk/uClibc/libc/sysdeps/linux/arm/ioperm.c
   trunk/uClibc/libc/sysdeps/linux/common/_exit.c
   trunk/uClibc/libc/sysdeps/linux/common/bits/uClibc_ctype.h
   trunk/uClibc/libc/termios/ttyname.c
   trunk/uClibc/libc/unistd/daemon.c
   trunk/uClibc/libc/unistd/getpass.c
   trunk/uClibc/libc/unistd/usershell.c


Changeset:
Modified: trunk/uClibc/include/ctype.h
===================================================================
--- trunk/uClibc/include/ctype.h	2005-12-16 01:05:56 UTC (rev 12919)
+++ trunk/uClibc/include/ctype.h	2005-12-16 01:18:01 UTC (rev 12920)
@@ -136,18 +136,11 @@
 #define	__isascii(c)	(((c) & ~0x7f) == 0)	/* If C is a 7 bit value.  */
 #define	__toascii(c)	((c) & 0x7f)		/* Mask off high bits.  */
 
-#ifdef __USE_MISC
-
-/* The following are included for compatibility with older versions of
- * uClibc; but now they're only visible if MISC funcctionality is requested. */
-extern int isxlower(int c) __THROW;
-extern int isxupper(int c) __THROW;
-
+#if defined _LIBC && (defined IS_IN_libc || defined NOT_IN_libc)
 /* isdigit() is really locale-invariant, so provide some small fast macros.
  * These are uClibc-specific. */
 #define __isdigit_char(C)    (((unsigned char)((C) - '0')) <= 9)
 #define __isdigit_int(C)     (((unsigned int)((C) - '0')) <= 9)
-
 #endif
 
 #define	__exctype(name)	extern int name (int) __THROW

Modified: trunk/uClibc/libc/misc/wordexp/wordexp.c
===================================================================
--- trunk/uClibc/libc/misc/wordexp/wordexp.c	2005-12-16 01:05:56 UTC (rev 12919)
+++ trunk/uClibc/libc/misc/wordexp/wordexp.c	2005-12-16 01:18:01 UTC (rev 12920)
@@ -23,6 +23,8 @@
 #define stpcpy __stpcpy
 #define strndup __strndup
 #define strspn __strspn
+#define strcspn __strcspn
+#define setenv __setenv
 #define unsetenv __unsetenv
 #define waitpid __waitpid
 #define kill __kill
@@ -34,10 +36,7 @@
 #define atoi __atoi
 #define fnmatch __fnmatch
 #define pipe __pipe
-#if 0
-#define glob __glob
-#define globfree __globfree
-#endif
+#define fork __fork
 
 #define _GNU_SOURCE
 #include <features.h>
@@ -56,6 +55,12 @@
 #include <glob.h>
 #include <wordexp.h>
 
+extern void __wordfree (wordexp_t *__wordexp) __THROW attribute_hidden;
+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;
+
 #define __WORDEXP_FULL
 //#undef __WORDEXP_FULL
 
@@ -362,7 +367,7 @@
 	int match;
 	glob_t globbuf;
 
-	error = glob(glob_word, GLOB_NOCHECK, NULL, &globbuf);
+	error = __glob(glob_word, GLOB_NOCHECK, NULL, &globbuf);
 
 	if (error != 0) {
 		/* We can only run into memory problems.  */
@@ -381,7 +386,7 @@
 								 globbuf.gl_pathv[match]);
 		}
 
-		globfree(&globbuf);
+		__globfree(&globbuf);
 		return *word ? 0 : WRDE_NOSPACE;
 	}
 
@@ -395,12 +400,12 @@
 		char *matching_word = __strdup(globbuf.gl_pathv[match]);
 
 		if (matching_word == NULL || w_addword(pwordexp, matching_word)) {
-			globfree(&globbuf);
+			__globfree(&globbuf);
 			return WRDE_NOSPACE;
 		}
 	}
 
-	globfree(&globbuf);
+	__globfree(&globbuf);
 	return 0;
 }
 
@@ -483,7 +488,7 @@
 
 	/* Now tidy up */
   tidy_up:
-	wordfree(&glob_list);
+	__wordfree(&glob_list);
 	return error;
 }
 
@@ -2023,7 +2028,7 @@
  * wordfree() is to be called after pwordexp is finished with.
  */
 
-void wordfree(wordexp_t * pwordexp)
+void attribute_hidden __wordfree(wordexp_t * pwordexp)
 {
 
 	/* wordexp can set pwordexp to NULL */
@@ -2037,6 +2042,7 @@
 		pwordexp->we_wordv = NULL;
 	}
 }
+strong_alias(__wordfree,wordfree)
 
 /*
  * wordexp()
@@ -2055,7 +2061,7 @@
 
 	if (flags & WRDE_REUSE) {
 		/* Minimal implementation of WRDE_REUSE for now */
-		wordfree(we);
+		__wordfree(we);
 		old_word.we_wordv = NULL;
 	}
 
@@ -2257,7 +2263,7 @@
 		return WRDE_NOSPACE;
 
 	if ((flags & WRDE_APPEND) == 0)
-		wordfree(we);
+		__wordfree(we);
 
 	*we = old_word;
 	return error;

Modified: trunk/uClibc/libc/pwd_grp/pwd_grp.c
===================================================================
--- trunk/uClibc/libc/pwd_grp/pwd_grp.c	2005-12-16 01:05:56 UTC (rev 12919)
+++ trunk/uClibc/libc/pwd_grp/pwd_grp.c	2005-12-16 01:18:01 UTC (rev 12920)
@@ -21,6 +21,7 @@
 #define setgroups __setgroups
 #define strtoul __strtoul
 #define rewind __rewind
+#define fgets_unlocked __fgets_unlocked
 
 #define _GNU_SOURCE
 #include <features.h>
@@ -51,6 +52,8 @@
 		       char *__restrict __buffer, size_t __buflen,
 		       struct passwd **__restrict __result) attribute_hidden;
 
+extern int __fputc_unlocked_internal(int c, FILE *stream) attribute_hidden;
+
 /**********************************************************************/
 /* Sizes for staticly allocated buffers. */
 
@@ -806,7 +809,7 @@
 
 			do {
 				if (!*m) {
-					if (fputc_unlocked('\n', f) >= 0) {
+					if (__fputc_unlocked_internal('\n', f) >= 0) {
 						rv = 0;
 					}
 					break;
@@ -872,7 +875,7 @@
 		goto DO_UNLOCK;
 	}
 
-	if (fputc_unlocked('\n', stream) > 0) {
+	if (__fputc_unlocked_internal('\n', stream) > 0) {
 		rv = 0;
 	}
 

Modified: trunk/uClibc/libc/stdlib/malloc/heap_debug.c
===================================================================
--- trunk/uClibc/libc/stdlib/malloc/heap_debug.c	2005-12-16 01:05:56 UTC (rev 12919)
+++ trunk/uClibc/libc/stdlib/malloc/heap_debug.c	2005-12-16 01:18:01 UTC (rev 12920)
@@ -80,13 +80,13 @@
   vfprintf (stderr, fmt, val);
   va_end (val);
 
-  putc ('\n', stderr);
+  __putc ('\n', stderr);
 
   __malloc_debug_set_indent (0);
   __malloc_debug_printf (1, "heap dump:");
   __heap_dump_freelist (heap);
 
-  exit (22);
+  __exit (22);
 }
 
 /* Do some consistency checks on HEAP.  If they fail, output an error

Modified: trunk/uClibc/libc/stdlib/malloc/malloc.h
===================================================================
--- trunk/uClibc/libc/stdlib/malloc/malloc.h	2005-12-16 01:05:56 UTC (rev 12919)
+++ trunk/uClibc/libc/stdlib/malloc/malloc.h	2005-12-16 01:18:01 UTC (rev 12920)
@@ -79,6 +79,8 @@
    to stderr, when the variable __malloc_mmb_debug is set to true. */
 #ifdef MALLOC_MMB_DEBUGGING
 # include <stdio.h>
+extern int __putc(int c, FILE *stream) attribute_hidden;
+
 extern int __malloc_mmb_debug;
 # define MALLOC_MMB_DEBUG(indent, fmt, args...)				      \
    (__malloc_mmb_debug ? __malloc_debug_printf (indent, fmt , ##args) : 0)

Modified: trunk/uClibc/libc/stdlib/malloc/malloc_debug.c
===================================================================
--- trunk/uClibc/libc/stdlib/malloc/malloc_debug.c	2005-12-16 01:05:56 UTC (rev 12919)
+++ trunk/uClibc/libc/stdlib/malloc/malloc_debug.c	2005-12-16 01:18:01 UTC (rev 12920)
@@ -42,7 +42,7 @@
 
   while (spaces > 0)
     {
-      putc (' ', stderr);
+      __putc (' ', stderr);
       spaces--;
     }
 
@@ -50,7 +50,7 @@
   vfprintf (stderr, fmt, val);
   va_end (val);
 
-  putc ('\n', stderr);
+  __putc ('\n', stderr);
 
   __malloc_debug_indent (indent);
 }

Modified: trunk/uClibc/libc/stdlib/stdlib.c
===================================================================
--- trunk/uClibc/libc/stdlib/stdlib.c	2005-12-16 01:05:56 UTC (rev 12919)
+++ trunk/uClibc/libc/stdlib/stdlib.c	2005-12-16 01:18:01 UTC (rev 12920)
@@ -724,7 +724,7 @@
 
 /*  void _Exit(int status) */
 /*  { */
-/*  	_exit(status); */
+/*  	_exit_internal(status); */
 /*  } */
 
 /*  #endif */

Modified: trunk/uClibc/libc/stdlib/system.c
===================================================================
--- trunk/uClibc/libc/stdlib/system.c	2005-12-16 01:05:56 UTC (rev 12919)
+++ trunk/uClibc/libc/stdlib/system.c	2005-12-16 01:18:01 UTC (rev 12920)
@@ -1,6 +1,8 @@
 #define wait4 __wait4
 #define execl __execl
 #define signal __signal
+#define vfork __vfork
+#define fork __fork
 
 #include <stdio.h>
 #include <stddef.h>
@@ -38,7 +40,7 @@
 		signal(SIGCHLD, SIG_DFL);
 
 		execl("/bin/sh", "sh", "-c", command, (char *) 0);
-		_exit(127);
+		_exit_internal(127);
 	}
 	/* Signals are not absolutly guarenteed with vfork */
 	signal(SIGQUIT, SIG_IGN);

Modified: trunk/uClibc/libc/stdlib/unix_grantpt.c
===================================================================
--- trunk/uClibc/libc/stdlib/unix_grantpt.c	2005-12-16 01:05:56 UTC (rev 12919)
+++ trunk/uClibc/libc/stdlib/unix_grantpt.c	2005-12-16 01:18:01 UTC (rev 12920)
@@ -24,6 +24,8 @@
 #define waitpid __waitpid
 #define dup2 __dup2
 #define chmod __chmod
+#define vfork __vfork
+#define fork __fork
 
 #include <assert.h>
 #include <errno.h>
@@ -42,7 +44,7 @@
 /* uClinux-2.0 has vfork, but Linux 2.0 doesn't */
 #include <sys/syscall.h>
 #if ! defined __NR_vfork
-#define vfork fork	
+#define vfork fork
 #endif
 
 extern int __ptsname_r (int fd, char *buf, size_t buflen) attribute_hidden;
@@ -166,10 +168,10 @@
       /* We pase the master pseudo terminal as file descriptor PTY_FILENO.  */
       if (fd != PTY_FILENO)
 	if (dup2 (fd, PTY_FILENO) < 0)
-	  _exit (FAIL_EBADF);
+	  _exit_internal (FAIL_EBADF);
 
       execle (_PATH_PT_CHOWN, _PATH_PT_CHOWN, NULL, NULL);
-      _exit (FAIL_EXEC);
+      _exit_internal (FAIL_EXEC);
     }
   else
     {

Modified: trunk/uClibc/libc/string/wstring.c
===================================================================
--- trunk/uClibc/libc/string/wstring.c	2005-12-16 01:05:56 UTC (rev 12919)
+++ trunk/uClibc/libc/string/wstring.c	2005-12-16 01:18:01 UTC (rev 12920)
@@ -81,6 +81,7 @@
 extern int __wcscmp (__const wchar_t *__s1, __const wchar_t *__s2) attribute_hidden;
 extern size_t __wcsxfrm (wchar_t *__restrict __s1,
 		       __const wchar_t *__restrict __s2, size_t __n) attribute_hidden;
+extern wint_t __towlower (wint_t __wc) __THROW attribute_hidden;
 #endif
 #ifdef __UCLIBC_HAS_XLOCALE__
 extern int __strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l) attribute_hidden;
@@ -1263,7 +1264,7 @@
 #ifdef __UCLIBC_DO_XLOCALE
 #define TOLOWER(C) __towlower_l((C), locale_arg)
 #else
-#define TOLOWER(C) towlower((C))
+#define TOLOWER(C) __towlower((C))
 #endif
 
 #else  /* defined(L_wcscasecmp) || defined(L_wcscasecmp_l) */
@@ -1328,7 +1329,7 @@
 #ifdef __UCLIBC_DO_XLOCALE
 #define TOLOWER(C) __towlower_l((C), locale_arg)
 #else
-#define TOLOWER(C) towlower((C))
+#define TOLOWER(C) __towlower((C))
 #endif
 
 #else  /* defined(L_wcsncasecmp) || defined(L_wcsncasecmp_l) */
@@ -2113,7 +2114,7 @@
 		*p++ = 0;
 	}
 #else
-	if (s && *s && *(p = s + strcspn(s, s2))) {
+	if (s && *s && *(p = s + __strcspn(s, s2))) {
 		*p++ = 0;
 	} else {
 		p = NULL;

Modified: trunk/uClibc/libc/sysdeps/linux/arm/ioperm.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/arm/ioperm.c	2005-12-16 01:05:56 UTC (rev 12919)
+++ trunk/uClibc/libc/sysdeps/linux/arm/ioperm.c	2005-12-16 01:18:01 UTC (rev 12920)
@@ -37,6 +37,7 @@
 #define mmap __mmap
 #define sscanf __sscanf
 #define fscanf __fscanf
+#define fgets __fgets
 
 #include <errno.h>
 #include <fcntl.h>

Modified: trunk/uClibc/libc/sysdeps/linux/common/_exit.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/_exit.c	2005-12-16 01:05:56 UTC (rev 12919)
+++ trunk/uClibc/libc/sysdeps/linux/common/_exit.c	2005-12-16 01:18:01 UTC (rev 12920)
@@ -34,7 +34,7 @@
 
 #undef _exit
 #undef _exit_internal
-void attribute_noreturn _exit_internal(int status)
+void attribute_noreturn attribute_hidden _exit_internal(int status)
 {
 	/* The loop is added only to keep gcc happy. */
 	while(1)

Modified: trunk/uClibc/libc/sysdeps/linux/common/bits/uClibc_ctype.h
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/bits/uClibc_ctype.h	2005-12-16 01:05:56 UTC (rev 12919)
+++ trunk/uClibc/libc/sysdeps/linux/common/bits/uClibc_ctype.h	2005-12-16 01:18:01 UTC (rev 12920)
@@ -134,17 +134,6 @@
 #define __C_tolower(c) (__C_isupper(c) ? ((c) | 0x20) : (c))
 #define __C_toupper(c) (__C_islower(c) ? ((c) ^ 0x20) : (c))
 
-#define __C_isxlower(c) \
-	(__C_isdigit(c) \
-	 || ((sizeof(c) == sizeof(char)) \
-		 ? (((unsigned char)(((c)) - 'a')) < 6) \
-		 : (((unsigned int)(((c)) - 'a')) < 6)))
-#define __C_isxupper(c) \
-	(__C_isdigit(c) \
-	 || ((sizeof(c) == sizeof(char)) \
-		 ? (((unsigned char)(((c)) - 'A')) < 6) \
-		 : (((unsigned int)(((c)) - 'A')) < 6)))
-
 /**********************************************************************/
 __BEGIN_DECLS
 
@@ -171,14 +160,7 @@
 extern int toascii(int c) __THROW;
 #endif
 
-/* The following are included for compatibility with older versions of
- * uClibc; but now they're only visible if MISC funcctionality is requested.
- * However, as they are locale-independent, the hidden macro versions are
- * always present. */
-#ifdef __USE_MISC
-extern int isxlower(int c) __THROW;	/* uClibc-specific. */
-extern int isxupper(int c) __THROW;	/* uClibc-specific. */
-
+#if defined _LIBC && (defined NOT_IN_libc || defined IS_IN_libc)
 /* isdigit() is really locale-invariant, so provide some small fast macros.
  * These are uClibc-specific. */
 #define __isdigit_char(C)    (((unsigned char)((C) - '0')) <= 9)
@@ -203,12 +185,6 @@
 #define _tolower(c) ((c) | 0x20)
 
 
-/* For compatibility with older versions of uClibc.  Are these ever used? */
-#if 0
-#define __isxlower(c)	__C_isxlower(c)	/* uClibc-specific. */
-#define __isxupper(c)	__C_isxupper(c)	/* uClibc-specific. */
-#endif
-
 /* Apparently, glibc implements things as macros if __NO_CTYPE isn't defined.
  * If we don't have locale support, we'll do the same.  Otherwise, we'll
  * only use macros for the supported-locale-invariant cases. */
@@ -264,9 +240,6 @@
 #define __ispunct(c)		__body(ispunct,c)
 #define __isgraph(c)		__body(isgraph,c)
 
-#define __isxlower(c)		__body(isxlower,c)
-#define __isxupper(c)		__body(isxupper,c)
-
 #define __tolower(c)		__body(tolower,c)
 #define __toupper(c)		__body(toupper,c)
 
@@ -285,9 +258,6 @@
 #define ispunct(c)			__ispunct(c)
 #define isgraph(c)			__isgraph(c)
 
-#define isxlower(c)			__isxlower(c)
-#define isxupper(c)			__isxupper(c)
-
 #define tolower(c)			__tolower(c)
 #define toupper(c)			__toupper(c)
 

Modified: trunk/uClibc/libc/termios/ttyname.c
===================================================================
--- trunk/uClibc/libc/termios/ttyname.c	2005-12-16 01:05:56 UTC (rev 12919)
+++ trunk/uClibc/libc/termios/ttyname.c	2005-12-16 01:18:01 UTC (rev 12920)
@@ -1,5 +1,6 @@
 #define opendir __opendir
 #define closedir __closedir
+#define readdir __readdir
 #define isatty __isatty
 
 #include <string.h>
@@ -73,7 +74,7 @@
 			continue;
 		}
 
-		while ((d = __readdir(fp)) != NULL) {
+		while ((d = readdir(fp)) != NULL) {
 			/* This should never trigger for standard names, but we
 			 * check it to be safe.  */
 			if (__strlen(d->d_name) > len) { /* Too big? */

Modified: trunk/uClibc/libc/unistd/daemon.c
===================================================================
--- trunk/uClibc/libc/unistd/daemon.c	2005-12-16 01:05:56 UTC (rev 12919)
+++ trunk/uClibc/libc/unistd/daemon.c	2005-12-16 01:18:01 UTC (rev 12920)
@@ -26,6 +26,7 @@
 #define dup2 __dup2
 #define setsid __setsid
 #define chdir __chdir
+#define fork __fork
 
 #include <stdio.h>
 #include <features.h>
@@ -45,7 +46,7 @@
 		case 0:
 			break;
 		default:
-			_exit(0);
+			_exit_internal(0);
 	}
 
 	if (setsid() == -1)
@@ -54,7 +55,7 @@
 	/* Make certain we are not a session leader, or else we
 	 * might reacquire a controlling terminal */
 	if (fork())
-		_exit(0);
+		_exit_internal(0);
 
 	if (!nochdir)
 		chdir("/");

Modified: trunk/uClibc/libc/unistd/getpass.c
===================================================================
--- trunk/uClibc/libc/unistd/getpass.c	2005-12-16 01:05:56 UTC (rev 12919)
+++ trunk/uClibc/libc/unistd/getpass.c	2005-12-16 01:18:01 UTC (rev 12920)
@@ -21,6 +21,8 @@
 #define tcgetattr __tcgetattr
 #define fileno __fileno
 #define fflush __fflush
+#define fgets __fgets
+#define fputs __fputs
 
 #include <stdio.h>
 #include <string.h>
@@ -28,6 +30,8 @@
 #include <unistd.h>
 #include <string.h>
 
+extern int __putc(int c, FILE *stream) attribute_hidden;
+
 /* It is desirable to use this bit on systems that have it.
    The only bit of terminal state we want to twiddle is echoing, which is
    done in software; there is no need to change the state of the terminal
@@ -95,7 +99,7 @@
 	  buf[nread - 1] = '\0';
 	  if (tty_changed)
 	    /* Write the newline that was not echoed.  */
-	    putc('\n', out);
+	    __putc('\n', out);
 	}
     }
 

Modified: trunk/uClibc/libc/unistd/usershell.c
===================================================================
--- trunk/uClibc/libc/unistd/usershell.c	2005-12-16 01:05:56 UTC (rev 12919)
+++ trunk/uClibc/libc/unistd/usershell.c	2005-12-16 01:18:01 UTC (rev 12920)
@@ -32,6 +32,7 @@
 
 #define __fsetlocking __fsetlocking_internal
 #define fileno __fileno
+#define fgets_unlocked __fgets_unlocked
 
 #define _GNU_SOURCE
 #include <sys/param.h>




More information about the uClibc-cvs mailing list