OSDN Git Service

Add index and rindex
authorEric Andersen <andersen@codepoet.org>
Thu, 15 Mar 2001 19:30:26 +0000 (19:30 -0000)
committerEric Andersen <andersen@codepoet.org>
Thu, 15 Mar 2001 19:30:26 +0000 (19:30 -0000)
libc/string/Makefile
libc/string/string.c

index 6823f27..becd201 100644 (file)
@@ -27,7 +27,7 @@ LIBC=$(TOPDIR)libc.a
 MSRC=string.c
 MOBJ=strlen.o strcat.o strcpy.o strchr.o strcmp.o strncat.o strncpy.o \
        strncmp.o strrchr.o strdup.o memcpy.o memccpy.o memset.o \
-       memmove.o memcmp.o memchr.o ffs.o strnlen.o
+       memmove.o memcmp.o memchr.o ffs.o strnlen.o index.o rindex.o
 
 MSRC1=index.c
 MOBJ1=index.o rindex.o
index 29ac83a..2a689cc 100644 (file)
@@ -151,6 +151,13 @@ char *strchr(const char *str, int c)
 }
 #endif
 
+#ifdef L_index
+char *index (const char *s, int c)
+{
+           return( strchr(s, c));
+}
+#endif
+
 /********************** Function strrchr ************************************/
 
 #ifdef L_strrchr
@@ -172,6 +179,13 @@ char *strrchr(const char *str, int c)
 }
 #endif
 
+#ifdef L_rindex
+char *rindex (const char *s, int c)
+{
+           return( strrchr(s, c));
+}
+#endif
+
 /********************** Function strdup ************************************/
 
 #ifdef L_strdup