2002-07-23 Jeff Johnston <jjohnstn@redhat.com>

* 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.
This commit is contained in:
Jeff Johnston
2002-07-23 21:38:00 +00:00
parent 5e50e4e45c
commit d254189b38
13 changed files with 357 additions and 24 deletions

View File

@ -67,8 +67,6 @@ LIB_SOURCES = \
setenv.c \
setenv_r.c \
srand48.c \
strdup.c \
strdup_r.c \
strtod.c \
strtol.c \
strtoll.c \

View File

@ -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)

View File

@ -1,13 +0,0 @@
#ifndef _REENT_ONLY
#include <reent.h>
#include <stdlib.h>
#include <string.h>
char *
_DEFUN (strdup, (str), _CONST char *str)
{
return _strdup_r (_REENT, str);
}
#endif /* !_REENT_ONLY */

View File

@ -1,17 +0,0 @@
#include <reent.h>
#include <stdlib.h>
#include <string.h>
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;
}