aboutsummaryrefslogtreecommitdiff
path: root/string
diff options
context:
space:
mode:
Diffstat (limited to 'string')
-rw-r--r--string/Makefile4
-rw-r--r--string/Versions7
-rw-r--r--string/bits/string2.h12
-rw-r--r--string/string.h8
4 files changed, 25 insertions, 6 deletions
diff --git a/string/Makefile b/string/Makefile
index ca823f42dc..ebdaad85ba 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
+# Copyright (C) 1991,92,93,94,95,96,97,98,99 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -34,7 +34,7 @@ routines := strcat strchr strcmp strcoll strcpy strcspn \
mempcpy bcopy bzero ffs ffsll stpcpy stpncpy \
strcasecmp strncase strcasecmp_l strncase_l \
memccpy memcpy wordcopy strsep strcasestr \
- swab strfry memfrob memmem \
+ swab strfry memfrob memmem rawmemchr \
$(addprefix argz-,append count create ctsep next \
delete extract insert stringify \
addsep replace) \
diff --git a/string/Versions b/string/Versions
index 32d0123e40..b3fba757c7 100644
--- a/string/Versions
+++ b/string/Versions
@@ -41,8 +41,8 @@ libc {
strsignal; strspn; strstr; strtok; strtok_r; strxfrm; swab;
}
GLIBC_2.1 {
- # functions used in other libraries
- __strcasestr;
+ # functions used in macros and other libraries
+ __rawmemchr; __strcasestr;
# f*
ffsl; ffsll;
@@ -50,6 +50,9 @@ libc {
# m*
mempcpy;
+ # r*
+ rawmemchr;
+
# s*
strcasestr; strverscmp;
}
diff --git a/string/bits/string2.h b/string/bits/string2.h
index 4904a3e4c0..0c28b3e122 100644
--- a/string/bits/string2.h
+++ b/string/bits/string2.h
@@ -1,5 +1,5 @@
/* Machine-independant string function optimizations.
- Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -252,6 +252,16 @@ __mempcpy_small (void *__dest1, char __src1,
#endif
+/* Return pointer to C in S. */
+#ifndef _HAVE_STRING_ARCH_strchr
+extern __ptr_t __rawmemchr (const __ptr_t __s, int __c);
+# define strchr(s, c) \
+ (__extension__ (__builtin_constant_p (c) && (c) == '\0' \
+ ? (char *) __rawmemchr (s, c) \
+ : strchr (s, c)))
+#endif
+
+
/* Copy SRC to DEST. */
#ifndef _HAVE_STRING_ARCH_strcpy
# define strcpy(dest, src) \
diff --git a/string/string.h b/string/string.h
index 7f19dfbd6d..766913a620 100644
--- a/string/string.h
+++ b/string/string.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 95, 96, 97, 98 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,93,95,96,97,98,99 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -60,6 +60,12 @@ extern int memcmp __P ((__const __ptr_t __s1, __const __ptr_t __s2,
/* Search N bytes of S for C. */
extern __ptr_t memchr __P ((__const __ptr_t __s, int __c, size_t __n));
+#ifdef __USE_GNU
+/* Search in S for C. This is similar to `memchr' but there is no
+ length limit. */
+extern __ptr_t rawmemchr __P ((__const __ptr_t __s, int __c));
+#endif
+
/* Copy SRC to DEST. */
extern char *strcpy __P ((char *__restrict __dest,