From d254189b38bb5b0b77a18a401c05c415ce0733c9 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Tue, 23 Jul 2002 21:38:00 +0000 Subject: 2002-07-23 Jeff Johnston * libc/include/string.h: Add mempcpy, strndup, and _strndup_r prototypes. * libc/stdlib/Makefile.am: Remove strdup.c and strdup_r.c. * libc/stdlib/Makefile.in: Regenerated. * libc/stdlib/strdup.c: Removed. * libc/stdlib/strdup_r.c: Removed. * libc/string/Makefile.am: Add strdup.c, strdup_r.c, memccpy.c, mempcpy.c, strndup.c, and strndup_r.c. * libc/string/Makefile.in: Regenerated. * libc/string/memccpy.c: New file. * libc/string/mempcpy.c: Ditto. * libc/string/strndup.c: Ditto. * libc/string/strndup_r.c: Ditto. * libc/string/strdup.c: New file moved from stdlib. * libc/string/strdup_r.c: Ditto. * libc/string/strings.tex: Add memccpy and mempcpy documentation. --- newlib/libc/stdlib/Makefile.am | 2 -- newlib/libc/stdlib/Makefile.in | 13 +++++-------- newlib/libc/stdlib/strdup.c | 13 ------------- newlib/libc/stdlib/strdup_r.c | 17 ----------------- 4 files changed, 5 insertions(+), 40 deletions(-) delete mode 100644 newlib/libc/stdlib/strdup.c delete mode 100644 newlib/libc/stdlib/strdup_r.c (limited to 'newlib/libc/stdlib') diff --git a/newlib/libc/stdlib/Makefile.am b/newlib/libc/stdlib/Makefile.am index 4aee696a4..13608eafd 100644 --- a/newlib/libc/stdlib/Makefile.am +++ b/newlib/libc/stdlib/Makefile.am @@ -67,8 +67,6 @@ LIB_SOURCES = \ setenv.c \ setenv_r.c \ srand48.c \ - strdup.c \ - strdup_r.c \ strtod.c \ strtol.c \ strtoll.c \ diff --git a/newlib/libc/stdlib/Makefile.in b/newlib/libc/stdlib/Makefile.in index 6e731b415..98b64b84e 100644 --- a/newlib/libc/stdlib/Makefile.in +++ b/newlib/libc/stdlib/Makefile.in @@ -173,8 +173,6 @@ LIB_SOURCES = \ setenv.c \ setenv_r.c \ srand48.c \ - strdup.c \ - strdup_r.c \ strtod.c \ strtol.c \ strtoll.c \ @@ -290,8 +288,7 @@ LIBS = @LIBS@ @USE_LIBTOOL_FALSE@putenv_r.$(OBJEXT) rand.$(OBJEXT) rand48.$(OBJEXT) \ @USE_LIBTOOL_FALSE@rand_r.$(OBJEXT) realloc.$(OBJEXT) seed48.$(OBJEXT) \ @USE_LIBTOOL_FALSE@setenv.$(OBJEXT) setenv_r.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@srand48.$(OBJEXT) strdup.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@strdup_r.$(OBJEXT) strtod.$(OBJEXT) strtol.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@srand48.$(OBJEXT) strtod.$(OBJEXT) strtol.$(OBJEXT) \ @USE_LIBTOOL_FALSE@strtoll.$(OBJEXT) strtoll_r.$(OBJEXT) \ @USE_LIBTOOL_FALSE@strtoul.$(OBJEXT) strtoull.$(OBJEXT) \ @USE_LIBTOOL_FALSE@strtoull_r.$(OBJEXT) system.$(OBJEXT) \ @@ -318,10 +315,10 @@ LTLIBRARIES = $(noinst_LTLIBRARIES) @USE_LIBTOOL_TRUE@msize.lo mstats.lo mtrim.lo nrand48.lo on_exit.lo \ @USE_LIBTOOL_TRUE@putenv.lo putenv_r.lo rand.lo rand48.lo rand_r.lo \ @USE_LIBTOOL_TRUE@realloc.lo seed48.lo setenv.lo setenv_r.lo srand48.lo \ -@USE_LIBTOOL_TRUE@strdup.lo strdup_r.lo strtod.lo strtol.lo strtoll.lo \ -@USE_LIBTOOL_TRUE@strtoll_r.lo strtoul.lo strtoull.lo strtoull_r.lo \ -@USE_LIBTOOL_TRUE@system.lo valloc.lo wcstombs.lo wcstombs_r.lo \ -@USE_LIBTOOL_TRUE@wctomb.lo wctomb_r.lo +@USE_LIBTOOL_TRUE@strtod.lo strtol.lo strtoll.lo strtoll_r.lo \ +@USE_LIBTOOL_TRUE@strtoul.lo strtoull.lo strtoull_r.lo system.lo \ +@USE_LIBTOOL_TRUE@valloc.lo wcstombs.lo wcstombs_r.lo wctomb.lo \ +@USE_LIBTOOL_TRUE@wctomb_r.lo CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) diff --git a/newlib/libc/stdlib/strdup.c b/newlib/libc/stdlib/strdup.c deleted file mode 100644 index dbb069264..000000000 --- a/newlib/libc/stdlib/strdup.c +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _REENT_ONLY - -#include -#include -#include - -char * -_DEFUN (strdup, (str), _CONST char *str) -{ - return _strdup_r (_REENT, str); -} - -#endif /* !_REENT_ONLY */ diff --git a/newlib/libc/stdlib/strdup_r.c b/newlib/libc/stdlib/strdup_r.c deleted file mode 100644 index ef77a58eb..000000000 --- a/newlib/libc/stdlib/strdup_r.c +++ /dev/null @@ -1,17 +0,0 @@ -#include -#include -#include - -char * -_DEFUN (_strdup_r, (reent_ptr, str), - struct _reent *reent_ptr _AND - _CONST char *str) -{ - size_t len = strlen (str) + 1; - char *copy = _malloc_r (reent_ptr, len); - if (copy) - { - memcpy (copy, str, len); - } - return copy; -} -- cgit v1.2.3