diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | Makefile.in | 2 | ||||
-rw-r--r-- | linux/dev/glue/misc.c | 107 |
3 files changed, 9 insertions, 108 deletions
@@ -1,3 +1,11 @@ +2001-09-18 Marcus Brinkmann <marcus@gnu.org> + + * linux/dev/glue/misc.c: Do not include <linux/types.h> and + <linux/string.h>. + Remove global variable ___strtok. + Remove implementation of strspn, strpbrk, strtok and strstr. + * Makefile.in: Add strpbrk and strtok. + 2001-08-24 Roland McGrath <roland@frob.com> * kern/bootstrap.c (bootstrap_create): Make setting of boot-args and diff --git a/Makefile.in b/Makefile.in index 3b6d050..62a0222 100644 --- a/Makefile.in +++ b/Makefile.in @@ -297,7 +297,7 @@ check: # This is the list of routines we decide is OK to steal from the C library. clib-routines := memcpy memmove memset bcopy bzero \ - strchr strstr strsep \ + strchr strstr strsep strpbrk strtok \ htonl htons ntohl ntohs \ etext edata end # actually ld magic, not libc diff --git a/linux/dev/glue/misc.c b/linux/dev/glue/misc.c index 10a9128..d8ca3c2 100644 --- a/linux/dev/glue/misc.c +++ b/linux/dev/glue/misc.c @@ -204,113 +204,6 @@ set_device_ro (kdev_t dev, int flag) ro_bits[major][minor >> 5] &= ~(1 << (minor & 31)); } -/* - * linux/lib/string.c - * - * Copyright (C) 1991, 1992 Linus Torvalds - */ - -/* - * stupid library routines.. The optimized versions should generally be found - * as inline code in <asm-xx/string.h> - * - * These are buggy as well.. - */ - -#include <linux/types.h> -#include <linux/string.h> - -char *___strtok = NULL; - -#ifndef __HAVE_ARCH_STRSPN -size_t -strspn (const char *s, const char *accept) -{ - const char *p; - const char *a; - size_t count = 0; - - for (p = s; *p != '\0'; ++p) - { - for (a = accept; *a != '\0'; ++a) - { - if (*p == *a) - break; - } - if (*a == '\0') - return count; - ++count; - } - - return count; -} -#endif - -#ifndef __HAVE_ARCH_STRPBRK -char * -strpbrk (const char *cs, const char *ct) -{ - const char *sc1, *sc2; - - for (sc1 = cs; *sc1 != '\0'; ++sc1) - { - for (sc2 = ct; *sc2 != '\0'; ++sc2) - { - if (*sc1 == *sc2) - return (char *) sc1; - } - } - return NULL; -} -#endif - -#ifndef __HAVE_ARCH_STRTOK -char * -strtok (char *s, const char *ct) -{ - char *sbegin, *send; - - sbegin = s ? s : ___strtok; - if (!sbegin) - { - return NULL; - } - sbegin += strspn (sbegin, ct); - if (*sbegin == '\0') - { - ___strtok = NULL; - return (NULL); - } - send = strpbrk (sbegin, ct); - if (send && *send != '\0') - *send++ = '\0'; - ___strtok = send; - return (sbegin); -} -#endif - - -#ifndef __HAVE_ARCH_STRSTR -char * -strstr (const char *s1, const char *s2) -{ - int l1, l2; - - l2 = strlen (s2); - if (! l2) - return (char *) s1; - l1 = strlen (s1); - while (l1 >= l2) - { - l1--; - if (! memcmp (s1,s2,l2)) - return (char *) s1; - s1++; - } - return NULL; -} -#endif - struct proc_dir_entry proc_scsi; struct inode_operations proc_scsi_inode_operations; struct proc_dir_entry proc_net; |