diff options
Diffstat (limited to 'newlib/libc/argz')
-rw-r--r-- | newlib/libc/argz/Makefile.am | 65 | ||||
-rw-r--r-- | newlib/libc/argz/Makefile.in | 407 | ||||
-rw-r--r-- | newlib/libc/argz/argz_add.c | 32 | ||||
-rw-r--r-- | newlib/libc/argz/argz_add_sep.c | 33 | ||||
-rw-r--r-- | newlib/libc/argz/argz_append.c | 28 | ||||
-rw-r--r-- | newlib/libc/argz/argz_count.c | 24 | ||||
-rw-r--r-- | newlib/libc/argz/argz_create.c | 49 | ||||
-rw-r--r-- | newlib/libc/argz/argz_create_sep.c | 60 | ||||
-rw-r--r-- | newlib/libc/argz/argz_delete.c | 40 | ||||
-rw-r--r-- | newlib/libc/argz/argz_extract.c | 30 | ||||
-rw-r--r-- | newlib/libc/argz/argz_insert.c | 42 | ||||
-rw-r--r-- | newlib/libc/argz/argz_next.c | 36 | ||||
-rw-r--r-- | newlib/libc/argz/argz_replace.c | 88 | ||||
-rw-r--r-- | newlib/libc/argz/argz_stringify.c | 24 | ||||
-rw-r--r-- | newlib/libc/argz/buf_findstr.c | 44 | ||||
-rw-r--r-- | newlib/libc/argz/buf_findstr.h | 12 | ||||
-rw-r--r-- | newlib/libc/argz/dummy.c | 1 | ||||
-rw-r--r-- | newlib/libc/argz/envz_add.c | 47 | ||||
-rw-r--r-- | newlib/libc/argz/envz_entry.c | 46 | ||||
-rw-r--r-- | newlib/libc/argz/envz_get.c | 43 | ||||
-rw-r--r-- | newlib/libc/argz/envz_merge.c | 61 | ||||
-rw-r--r-- | newlib/libc/argz/envz_remove.c | 37 | ||||
-rw-r--r-- | newlib/libc/argz/envz_strip.c | 42 |
23 files changed, 0 insertions, 1291 deletions
diff --git a/newlib/libc/argz/Makefile.am b/newlib/libc/argz/Makefile.am deleted file mode 100644 index bbc82fc8e..000000000 --- a/newlib/libc/argz/Makefile.am +++ /dev/null @@ -1,65 +0,0 @@ -## Process this file with automake to generate Makefile.in - -AUTOMAKE_OPTIONS = cygnus - -INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) - -## All functions in this directory are EL/IX level 2 and above -if ELIX_LEVEL_1 -LIB_OBJS = -else -LIB_OBJS = \ - argz_add.$(oext) \ - argz_add_sep.$(oext) \ - argz_append.$(oext) \ - argz_count.$(oext) \ - argz_create.$(oext) \ - argz_create_sep.$(oext) \ - argz_delete.$(oext) \ - argz_extract.$(oext) \ - argz_insert.$(oext) \ - argz_next.$(oext) \ - argz_replace.$(oext) \ - argz_stringify.$(oext) \ - buf_findstr.$(oext) \ - envz_entry.$(oext) \ - envz_get.$(oext) \ - envz_add.$(oext) \ - envz_remove.$(oext) \ - envz_merge.$(oext) \ - envz_strip.$(oext) -endif - -libargz_la_LDFLAGS = -Xcompiler -nostdlib - -if USE_LIBTOOL -noinst_LTLIBRARIES = libargz.la -libargz_la_SOURCES = dummy.c -libargz_la_LIBADD = $(LIB_OBJS) -libargz_la_DEPENDENCIES = $(LIB_OBJS) -noinst_DATA = objectlist.awk.in -else -noinst_LIBRARIES = lib.a -lib_a_SOURCES = dummy.c -lib_a_LIBADD = $(LIB_OBJS) -lib_a_DEPENDENCIES = $(LIB_OBJS) -noinst_DATA = -endif # USE_LIBTOOL - -SUFFIXES = .def - -CHEWOUT_FILES = - -CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str - -.c.def: - $(CHEW) < $< > $*.def 2> $*.ref - touch stmp-def - -TARGETDOC = ../tmp.texi - -doc: $(CHEWOUT_FILES) - -CLEANFILES = $(CHEWOUT_FILES) *.ref - -include $(srcdir)/../../Makefile.shared diff --git a/newlib/libc/argz/Makefile.in b/newlib/libc/argz/Makefile.in deleted file mode 100644 index 868a75482..000000000 --- a/newlib/libc/argz/Makefile.in +++ /dev/null @@ -1,407 +0,0 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am - -# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_alias = @build_alias@ -build_triplet = @build@ -host_alias = @host_alias@ -host_triplet = @host@ -target_alias = @target_alias@ -target_triplet = @target@ -AR = @AR@ -AS = @AS@ -CC = @CC@ -CPP = @CPP@ -CRT0 = @CRT0@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -DLLTOOL = @DLLTOOL@ -EXEEXT = @EXEEXT@ -GCJ = @GCJ@ -GCJFLAGS = @GCJFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBC_EXTRA_DEF = @LIBC_EXTRA_DEF@ -LIBC_EXTRA_LIB = @LIBC_EXTRA_LIB@ -LIBC_MACHINE_LIB = @LIBC_MACHINE_LIB@ -LIBC_POSIX_LIB = @LIBC_POSIX_LIB@ -LIBC_SIGNAL_DEF = @LIBC_SIGNAL_DEF@ -LIBC_SIGNAL_LIB = @LIBC_SIGNAL_LIB@ -LIBC_STDIO64_DEF = @LIBC_STDIO64_DEF@ -LIBC_STDIO64_LIB = @LIBC_STDIO64_LIB@ -LIBC_SYSCALL_LIB = @LIBC_SYSCALL_LIB@ -LIBC_SYS_LIB = @LIBC_SYS_LIB@ -LIBC_UNIX_LIB = @LIBC_UNIX_LIB@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -NEWLIB_CFLAGS = @NEWLIB_CFLAGS@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -STRIP = @STRIP@ -VERSION = @VERSION@ -aext = @aext@ -extra_dir = @extra_dir@ -libm_machine_dir = @libm_machine_dir@ -machine_dir = @machine_dir@ -newlib_basedir = @newlib_basedir@ -oext = @oext@ -sys_dir = @sys_dir@ - -AUTOMAKE_OPTIONS = cygnus - -INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS) -@ELIX_LEVEL_1_TRUE@LIB_OBJS = -@ELIX_LEVEL_1_FALSE@LIB_OBJS = @ELIX_LEVEL_1_FALSE@\ -@ELIX_LEVEL_1_FALSE@ argz_add.$(oext) \ -@ELIX_LEVEL_1_FALSE@ argz_add_sep.$(oext) \ -@ELIX_LEVEL_1_FALSE@ argz_append.$(oext) \ -@ELIX_LEVEL_1_FALSE@ argz_count.$(oext) \ -@ELIX_LEVEL_1_FALSE@ argz_create.$(oext) \ -@ELIX_LEVEL_1_FALSE@ argz_create_sep.$(oext) \ -@ELIX_LEVEL_1_FALSE@ argz_delete.$(oext) \ -@ELIX_LEVEL_1_FALSE@ argz_extract.$(oext) \ -@ELIX_LEVEL_1_FALSE@ argz_insert.$(oext) \ -@ELIX_LEVEL_1_FALSE@ argz_next.$(oext) \ -@ELIX_LEVEL_1_FALSE@ argz_replace.$(oext) \ -@ELIX_LEVEL_1_FALSE@ argz_stringify.$(oext) \ -@ELIX_LEVEL_1_FALSE@ buf_findstr.$(oext) \ -@ELIX_LEVEL_1_FALSE@ envz_entry.$(oext) \ -@ELIX_LEVEL_1_FALSE@ envz_get.$(oext) \ -@ELIX_LEVEL_1_FALSE@ envz_add.$(oext) \ -@ELIX_LEVEL_1_FALSE@ envz_remove.$(oext) \ -@ELIX_LEVEL_1_FALSE@ envz_merge.$(oext) \ -@ELIX_LEVEL_1_FALSE@ envz_strip.$(oext) - -libargz_la_LDFLAGS = -Xcompiler -nostdlib - -@USE_LIBTOOL_TRUE@noinst_LTLIBRARIES = @USE_LIBTOOL_TRUE@libargz.la -@USE_LIBTOOL_TRUE@libargz_la_SOURCES = @USE_LIBTOOL_TRUE@dummy.c -@USE_LIBTOOL_TRUE@libargz_la_LIBADD = @USE_LIBTOOL_TRUE@$(LIB_OBJS) -@USE_LIBTOOL_TRUE@libargz_la_DEPENDENCIES = @USE_LIBTOOL_TRUE@$(LIB_OBJS) -@USE_LIBTOOL_TRUE@noinst_DATA = @USE_LIBTOOL_TRUE@objectlist.awk.in -@USE_LIBTOOL_FALSE@noinst_DATA = -@USE_LIBTOOL_FALSE@noinst_LIBRARIES = @USE_LIBTOOL_FALSE@lib.a -@USE_LIBTOOL_FALSE@lib_a_SOURCES = @USE_LIBTOOL_FALSE@dummy.c -@USE_LIBTOOL_FALSE@lib_a_LIBADD = @USE_LIBTOOL_FALSE@$(LIB_OBJS) -@USE_LIBTOOL_FALSE@lib_a_DEPENDENCIES = @USE_LIBTOOL_FALSE@$(LIB_OBJS) - -SUFFIXES = .def - -CHEWOUT_FILES = - -CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str - -TARGETDOC = ../tmp.texi - -CLEANFILES = $(CHEWOUT_FILES) *.ref -mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) - - -DEFS = @DEFS@ -I. -I$(srcdir) -CPPFLAGS = @CPPFLAGS@ -LIBS = @LIBS@ -@USE_LIBTOOL_FALSE@lib_a_OBJECTS = dummy.$(OBJEXT) -LTLIBRARIES = $(noinst_LTLIBRARIES) - -@USE_LIBTOOL_TRUE@libargz_la_OBJECTS = dummy.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) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DATA = $(noinst_DATA) - -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = gtar -GZIP_ENV = --best -SOURCES = $(lib_a_SOURCES) $(libargz_la_SOURCES) -OBJECTS = $(lib_a_OBJECTS) $(libargz_la_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .def .lo .o .obj .s -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(srcdir)/../../Makefile.shared - cd $(top_srcdir) && $(AUTOMAKE) --cygnus argz/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -mostlyclean-noinstLIBRARIES: - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) - -distclean-noinstLIBRARIES: - -maintainer-clean-noinstLIBRARIES: - -.c.o: - $(COMPILE) -c $< - -# FIXME: We should only use cygpath when building on Windows, -# and only if it is available. -.c.obj: - $(COMPILE) -c `cygpath -w $<` - -.s.o: - $(COMPILE) -c $< - -.S.o: - $(COMPILE) -c $< - -mostlyclean-compile: - -rm -f *.o core *.core - -rm -f *.$(OBJEXT) - -clean-compile: - -distclean-compile: - -rm -f *.tab.c - -maintainer-clean-compile: - -.c.lo: - $(LIBTOOL) --mode=compile $(COMPILE) -c $< - -.s.lo: - $(LIBTOOL) --mode=compile $(COMPILE) -c $< - -.S.lo: - $(LIBTOOL) --mode=compile $(COMPILE) -c $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -maintainer-clean-libtool: - -lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) - -rm -f lib.a - $(AR) cru lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD) - $(RANLIB) lib.a - -mostlyclean-noinstLTLIBRARIES: - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - -distclean-noinstLTLIBRARIES: - -maintainer-clean-noinstLTLIBRARIES: - -libargz.la: $(libargz_la_OBJECTS) $(libargz_la_DEPENDENCIES) - $(LINK) $(libargz_la_LDFLAGS) $(libargz_la_OBJECTS) $(libargz_la_LIBADD) $(LIBS) - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - here=`pwd` && cd $(srcdir) \ - && mkid -f$$here/ID $$unique $(LISP) - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ - || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) - -mostlyclean-tags: - -clean-tags: - -distclean-tags: - -rm -f TAGS ID - -maintainer-clean-tags: - -distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = argz - -distdir: $(DISTFILES) - @for file in $(DISTFILES); do \ - if test -f $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: -check: check-am -installcheck-am: -installcheck: installcheck-am -install-info-am: -install-info: install-info-am -install-exec-am: -install-exec: install-exec-am - -install-data-am: -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: -uninstall: uninstall-am -all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(DATA) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - - -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* - -maintainer-clean-generic: -mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ - mostlyclean-libtool mostlyclean-noinstLTLIBRARIES \ - mostlyclean-tags mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-noinstLIBRARIES clean-compile clean-libtool \ - clean-noinstLTLIBRARIES clean-tags clean-generic \ - mostlyclean-am - -clean: clean-am - -distclean-am: distclean-noinstLIBRARIES distclean-compile \ - distclean-libtool distclean-noinstLTLIBRARIES \ - distclean-tags distclean-generic clean-am - -rm -f libtool - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ - maintainer-clean-compile maintainer-clean-libtool \ - maintainer-clean-noinstLTLIBRARIES \ - maintainer-clean-tags maintainer-clean-generic \ - distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - -maintainer-clean: maintainer-clean-am - -.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ -clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile mostlyclean-libtool distclean-libtool \ -clean-libtool maintainer-clean-libtool mostlyclean-noinstLTLIBRARIES \ -distclean-noinstLTLIBRARIES clean-noinstLTLIBRARIES \ -maintainer-clean-noinstLTLIBRARIES tags mostlyclean-tags distclean-tags \ -clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ -check-am installcheck-am installcheck install-info-am install-info \ -install-exec-am install-exec install-data-am install-data install-am \ -install uninstall-am uninstall all-redirect all-am all installdirs \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -.c.def: - $(CHEW) < $< > $*.def 2> $*.ref - touch stmp-def - -doc: $(CHEWOUT_FILES) - -objectlist.awk.in: $(noinst_LTLIBRARIES) - -rm -f objectlist.awk.in - for i in `ls *.lo` ; \ - do \ - echo $$i `pwd`/$$i >> objectlist.awk.in ; \ - done - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/newlib/libc/argz/argz_add.c b/newlib/libc/argz/argz_add.c deleted file mode 100644 index 46e71ca37..000000000 --- a/newlib/libc/argz/argz_add.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#include <errno.h> -#include <sys/types.h> -#include <string.h> -#include <stdlib.h> - -error_t -_DEFUN (argz_add, (argz, argz_len, str), - char **argz _AND - size_t *argz_len _AND - const char *str) -{ - int len_to_add = 0; - size_t last = *argz_len; - - if (str == NULL) - return 0; - - len_to_add = strlen(str) + 1; - *argz_len += len_to_add; - - if(!(*argz = (char *)realloc(*argz, *argz_len))) - return ENOMEM; - - memcpy(*argz + last, str, len_to_add); - return 0; -} diff --git a/newlib/libc/argz/argz_add_sep.c b/newlib/libc/argz/argz_add_sep.c deleted file mode 100644 index 5a56ec931..000000000 --- a/newlib/libc/argz/argz_add_sep.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#include <errno.h> -#include <sys/types.h> -#include <stdlib.h> -#include <string.h> -#include <argz.h> - -error_t -_DEFUN (argz_add_sep, (argz, argz_len, str, sep), - char **argz _AND - size_t *argz_len _AND - const char *str _AND - int sep) -{ - char *str_argz = 0; - size_t str_argz_len = 0; - size_t last = *argz_len; - - argz_create_sep (str, sep, &str_argz, &str_argz_len); - - *argz_len += str_argz_len; - - if(!(*argz = (char *)realloc(*argz, *argz_len))) - return ENOMEM; - - memcpy(*argz + last, str_argz, str_argz_len); - return 0; -} diff --git a/newlib/libc/argz/argz_append.c b/newlib/libc/argz/argz_append.c deleted file mode 100644 index 7519e1608..000000000 --- a/newlib/libc/argz/argz_append.c +++ /dev/null @@ -1,28 +0,0 @@ -/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#include <errno.h> -#include <sys/types.h> -#include <string.h> -#include <stdlib.h> - -error_t -_DEFUN (argz_append, (argz, argz_len, buf, buf_len), - char **argz _AND - size_t *argz_len _AND - const char *buf _AND - size_t buf_len) -{ - size_t last = *argz_len; - - *argz_len += buf_len; - - if(!(*argz = (char *)realloc(*argz, *argz_len))) - return ENOMEM; - - memcpy(*argz + last, buf, buf_len); - return 0; -} diff --git a/newlib/libc/argz/argz_count.c b/newlib/libc/argz/argz_count.c deleted file mode 100644 index 0c8a816c1..000000000 --- a/newlib/libc/argz/argz_count.c +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#include <_ansi.h> -#include <sys/types.h> - -size_t -_DEFUN (argz_count, (argz, argz_len), - const char *argz _AND - size_t argz_len) -{ - int i; - size_t count = 0; - - for (i = 0; i < argz_len; i++) - { - if (argz[i] == '\0') - count++; - } - return count; -} diff --git a/newlib/libc/argz/argz_create.c b/newlib/libc/argz/argz_create.c deleted file mode 100644 index f5651c618..000000000 --- a/newlib/libc/argz/argz_create.c +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#include <errno.h> -#include <sys/types.h> -#include <string.h> -#include <stdlib.h> - -error_t -_DEFUN (argz_create, (argv, argz, argz_len), - char *const argv[] _AND - char **argz _AND - size_t *argz_len) -{ - int argc = 0; - int i = 0; - int len = 0; - char *iter; - - *argz_len = 0; - - if (*argv == NULL) - { - *argz = NULL; - return 0; - } - - while (argv[argc]) - { - *argz_len += (strlen(argv[argc]) + 1); - argc++; - } - - /* There are argc strings to copy into argz. */ - if(!(*argz = (char *)malloc(*argz_len))) - return ENOMEM; - - iter = *argz; - for(i = 0; i < argc; i++) - { - len = strlen(argv[i]) + 1; - memcpy(iter, argv[i], len); - iter += len; - } - return 0; -} diff --git a/newlib/libc/argz/argz_create_sep.c b/newlib/libc/argz/argz_create_sep.c deleted file mode 100644 index bf0670bda..000000000 --- a/newlib/libc/argz/argz_create_sep.c +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#include <errno.h> -#include <sys/types.h> -#include <string.h> -#include <stdlib.h> - -error_t -_DEFUN (argz_create_sep, (string, sep, argz, argz_len), - const char *string _AND - int sep _AND - char **argz _AND - size_t *argz_len) -{ - int len = 0; - int i = 0; - int num_strings = 0; - char delim[2]; - char *running = 0; - char *old_running = 0; - char *token = 0; - char *iter = 0; - - delim[0] = sep; - delim[1] = '\0'; - - running = strdup(string); - old_running = running; - - while ((token = strsep(&running, delim))) - { - len = strlen(token); - *argz_len += (len + 1); - num_strings++; - } - - if(!(*argz = (char *)malloc(*argz_len))) - return ENOMEM; - - free(old_running); - - running = strdup(string); - old_running = running; - - iter = *argz; - for (i = 0; i < num_strings; i++) - { - token = strsep(&running, delim); - len = strlen(token) + 1; - memcpy(iter, token, len); - iter += len; - } - - free(old_running); - return 0; -} diff --git a/newlib/libc/argz/argz_delete.c b/newlib/libc/argz/argz_delete.c deleted file mode 100644 index 237128c88..000000000 --- a/newlib/libc/argz/argz_delete.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#include <errno.h> -#include <sys/types.h> -#include <string.h> -#include <stdlib.h> - -error_t -_DEFUN (argz_delete, (argz, argz_len, entry), - char **argz _AND - size_t *argz_len _AND - char *entry) -{ - int len = 0; - char *moveto = entry; - - if (entry) - { - len = strlen(entry) + 1; - entry += len; - - memmove(moveto, entry, *argz + *argz_len - entry); - - *argz_len -= len; - - if(!(*argz = (char *)realloc(*argz, *argz_len))) - return ENOMEM; - - if (*argz_len <= 0) - { - free(*argz); - *argz = NULL; - } - } - return 0; -} diff --git a/newlib/libc/argz/argz_extract.c b/newlib/libc/argz/argz_extract.c deleted file mode 100644 index 289c6e100..000000000 --- a/newlib/libc/argz/argz_extract.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#include <argz.h> -#include <sys/types.h> - -void -_DEFUN (argz_extract, (argz, argz_len, argv), - char *argz _AND - size_t argz_len _AND - char **argv) -{ - size_t i = 0; - int j = 0; - const size_t count = argz_count(argz, argz_len); - - for (i = argz_len - 2; i > 0; i--) - { - if (argz[i] == '\0') - { - j++; - argv[count - j] = &argz[i + 1]; - } - } - argv[0] = &argz[0]; - argv[count] = NULL; -} diff --git a/newlib/libc/argz/argz_insert.c b/newlib/libc/argz/argz_insert.c deleted file mode 100644 index 043a10193..000000000 --- a/newlib/libc/argz/argz_insert.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#include <errno.h> -#include <sys/types.h> -#include <string.h> -#include <stdlib.h> -#include <argz.h> - -error_t -_DEFUN (argz_insert, (argz, argz_len, before, entry), - char **argz _AND - size_t *argz_len _AND - char *before _AND - const char *entry) -{ - int len = 0; - - if (before == NULL) - argz_add(argz, argz_len, entry); - - if (before < *argz || before >= *argz + *argz_len) - return EINVAL; - - while (before != *argz && before[-1]) - before--; - - len = strlen(entry) + 1; - - if(!(*argz = (char *)realloc(*argz, *argz_len + len))) - return ENOMEM; - - memmove(before + len, before, *argz + *argz_len - before); - memcpy(before, entry, len); - - *argz_len += len; - - return 0; -} diff --git a/newlib/libc/argz/argz_next.c b/newlib/libc/argz/argz_next.c deleted file mode 100644 index e9dbe0694..000000000 --- a/newlib/libc/argz/argz_next.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#include <errno.h> -#include <sys/types.h> -#include <string.h> -#include <stdlib.h> - -char * -_DEFUN (argz_next, (argz, argz_len, entry), - char *argz _AND - size_t argz_len _AND - const char *entry) -{ - if (entry) - { - while(*entry != '\0') - entry++; - entry++; - - if (entry >= argz + argz_len) - return NULL; - else - return (char *) entry; - } - else - { - if (argz_len > 0) - return (char *) argz; - else - return NULL; - } -} diff --git a/newlib/libc/argz/argz_replace.c b/newlib/libc/argz/argz_replace.c deleted file mode 100644 index cb01eaef5..000000000 --- a/newlib/libc/argz/argz_replace.c +++ /dev/null @@ -1,88 +0,0 @@ -/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#include <errno.h> -#include <sys/types.h> -#include <string.h> -#include <stdlib.h> -#include <argz.h> - -#include "buf_findstr.h" - -error_t -_DEFUN (argz_replace, (argz, argz_len, str, with, replace_count), - char **argz _AND - size_t *argz_len _AND - const char *str _AND - const char *with _AND - unsigned *replace_count) -{ - const int str_len = strlen(str); - const int with_len = strlen(with); - const int len_diff = with_len - str_len; - - char *buf_iter = *argz; - size_t buf_len = *argz_len; - char *last_iter = NULL; - char *new_argz = NULL; - size_t new_argz_len = 0; - char *new_argz_iter = NULL; - - *replace_count = 0; - new_argz_len = *argz_len; - - while(buf_len) - { - if(_buf_findstr(str, &buf_iter, &buf_len)) - { - *replace_count += 1; - new_argz_len += len_diff; - } - } - - if (*replace_count) - { - new_argz = (char *)malloc(new_argz_len); - - buf_iter = *argz; - buf_len = *argz_len; - last_iter = buf_iter; - new_argz_iter = new_argz; - - while(buf_len) - { - if (_buf_findstr(str, &buf_iter, &buf_len)) - { - /* copy everything up to, but not including str, from old argz to - new argz. */ - memcpy(new_argz_iter, last_iter, buf_iter - last_iter - str_len); - new_argz_iter += (buf_iter - last_iter - str_len); - /* copy replacement string. */ - memcpy(new_argz_iter, with, with_len); - new_argz_iter += with_len; - last_iter = buf_iter; - } - } - /* copy everything after last occurrence of str. */ - memcpy(new_argz_iter, last_iter, *argz + *argz_len - last_iter); - - /* reallocate argz, and copy over the new value. */ - if(!(*argz = (char *)realloc(*argz, new_argz_len))) - return ENOMEM; - - memcpy(*argz, new_argz, new_argz_len); - *argz_len = new_argz_len; - - if (*argz_len == 0) - { - free(*argz); - *argz = NULL; - } - free(new_argz); - } - - return 0; -} diff --git a/newlib/libc/argz/argz_stringify.c b/newlib/libc/argz/argz_stringify.c deleted file mode 100644 index 6ff5dd001..000000000 --- a/newlib/libc/argz/argz_stringify.c +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#include <_ansi.h> -#include <sys/types.h> - -void -_DEFUN (argz_stringify, (argz, argz_len, sep), - char *argz _AND - size_t argz_len _AND - int sep) -{ - size_t i; - - /* len includes trailing \0, which we don't want to replace. */ - for (i = 0; i < argz_len - 1; i++) - { - if (argz[i] == '\0') - argz[i] = sep; - } -} diff --git a/newlib/libc/argz/buf_findstr.c b/newlib/libc/argz/buf_findstr.c deleted file mode 100644 index aeb32a943..000000000 --- a/newlib/libc/argz/buf_findstr.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#include <errno.h> -#include <sys/types.h> -#include <string.h> -#include <stdlib.h> - -#include "buf_findstr.h" - -/* Find string str in buffer buf of length buf_len. Point buf to character after string, - or set it to NULL if end of buffer is reached. Return 1 if found, 0 if not. */ -int -_buf_findstr(const char *str, char **buf, size_t *buf_len) -{ - int i = 0; - int j = 0; - - for (i = 0; i < *buf_len; i++) - { - if (str[0] == (*buf)[i]) - { - j = i; - while (str[j - i] && (str[j - i] == (*buf)[j])) j++; - if(str[j - i] == '\0') - { - *buf += j; - *buf_len -= j; - return 1; - } - } - } - - if (i == *buf_len) - { - *buf += *buf_len; - *buf_len = 0; - } - - return 0; -} diff --git a/newlib/libc/argz/buf_findstr.h b/newlib/libc/argz/buf_findstr.h deleted file mode 100644 index d6cef7c15..000000000 --- a/newlib/libc/argz/buf_findstr.h +++ /dev/null @@ -1,12 +0,0 @@ -/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#include <sys/types.h> - -/* Find string str in buffer buf of length buf_len. Point buf to - character after string, or set it to NULL if end of buffer is - reached. Return 1 if found, 0 if not. */ -int _buf_findstr(const char *str, char **buf, size_t *buf_len); diff --git a/newlib/libc/argz/dummy.c b/newlib/libc/argz/dummy.c deleted file mode 100644 index 895395e51..000000000 --- a/newlib/libc/argz/dummy.c +++ /dev/null @@ -1 +0,0 @@ -/* empty stub to allow objectlist.awk.in to be created */ diff --git a/newlib/libc/argz/envz_add.c b/newlib/libc/argz/envz_add.c deleted file mode 100644 index 3e91a5867..000000000 --- a/newlib/libc/argz/envz_add.c +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#include <errno.h> -#include <sys/types.h> -#include <string.h> -#include <stdlib.h> -#include <argz.h> -#include <envz.h> - -error_t -_DEFUN (envz_add, (envz, envz_len, name, value), - char **envz _AND - size_t *envz_len _AND - const char *name _AND - const char *value) -{ - char *concat = NULL; - int name_len = 0; - int val_len = 0; - int retval = 0; - - envz_remove(envz, envz_len, name); - - if (value) - { - name_len = strlen(name); - val_len = strlen(value); - if(!(concat = (char *) malloc(name_len + val_len + 2))) - return ENOMEM; - - memcpy(concat, name, name_len); - concat[name_len] = '='; - memcpy(concat + name_len + 1, value, val_len + 1); - - retval = argz_add(envz, envz_len, concat); - free(concat); - } - else - { - retval = argz_add(envz, envz_len, name); - } - return retval; -} diff --git a/newlib/libc/argz/envz_entry.c b/newlib/libc/argz/envz_entry.c deleted file mode 100644 index 3d1986ba7..000000000 --- a/newlib/libc/argz/envz_entry.c +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#include <errno.h> -#include <sys/types.h> -#include <string.h> -#include <stdlib.h> -#include <envz.h> - -#include "buf_findstr.h" - -char * -_DEFUN (envz_entry, (envz, envz_len, name), - const char *envz _AND - size_t envz_len _AND - const char *name) -{ - char *buf_ptr = (char *)envz; - size_t buf_len = envz_len; - - while(buf_len) - { - if (_buf_findstr(name, &buf_ptr, &buf_len)) - { - if (buf_ptr) - { - if (*buf_ptr == '=' || *buf_ptr == '\0') - { - buf_ptr--; - - /* Move buf_ptr back to start of entry. */ - while(*buf_ptr != '\0' && buf_ptr != envz) buf_ptr--; - - if(*buf_ptr == '\0') - buf_ptr++; - - return (char *)buf_ptr; - } - } - } - } - return 0; -} diff --git a/newlib/libc/argz/envz_get.c b/newlib/libc/argz/envz_get.c deleted file mode 100644 index b4f7c2806..000000000 --- a/newlib/libc/argz/envz_get.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#include <errno.h> -#include <sys/types.h> -#include <string.h> -#include <stdlib.h> -#include <envz.h> - -#include "buf_findstr.h" - -char * -_DEFUN (envz_get, (envz, envz_len, name), - const char *envz _AND - size_t envz_len _AND - const char *name) -{ - char *buf_ptr = (char *)envz; - size_t buf_len = envz_len; - - while(buf_len) - { - if (_buf_findstr(name, &buf_ptr, &buf_len)) - { - if (*buf_ptr == '=') - { - buf_ptr++; - return (char *)buf_ptr; - } - else - { - if (*buf_ptr == '\0') - /* NULL entry. */ - return NULL; - } - } - } - /* No matching entries found. */ - return NULL; -} diff --git a/newlib/libc/argz/envz_merge.c b/newlib/libc/argz/envz_merge.c deleted file mode 100644 index 46832202e..000000000 --- a/newlib/libc/argz/envz_merge.c +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#include <errno.h> -#include <sys/types.h> -#include <string.h> -#include <stdlib.h> -#include <argz.h> -#include <envz.h> - -error_t -_DEFUN (envz_merge, (envz, envz_len, envz2, envz2_len, override), - char **envz _AND - size_t *envz_len _AND - const char *envz2 _AND - size_t envz2_len _AND - int override) -{ - char *entry = NULL; - char *name_str = NULL; - char *val_str = NULL; - char *name_iter = NULL; - int retval = 0; - - while((entry = argz_next((char *)envz2, envz2_len, entry)) && !retval) - { - if (!override) - { - name_str = strdup (entry); - name_iter = strchr(name_str, '='); - if(name_iter) - *name_iter = '\0'; - - if(!envz_entry(*envz, *envz_len, name_str)) - { - retval = argz_add(envz, envz_len, entry); - } - free(name_str); - } - else - { - name_str = strdup (entry); - name_iter = strchr(name_str, '='); - if(name_iter) - { - *name_iter = '\0'; - val_str = name_iter + 1; - } - else - { - val_str = NULL; - } - - retval = envz_add(envz, envz_len, name_str, val_str); - } - } - return retval; -} diff --git a/newlib/libc/argz/envz_remove.c b/newlib/libc/argz/envz_remove.c deleted file mode 100644 index 1882297f0..000000000 --- a/newlib/libc/argz/envz_remove.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#include <errno.h> -#include <sys/types.h> -#include <string.h> -#include <stdlib.h> -#include <argz.h> -#include <envz.h> - -void -_DEFUN (envz_remove, (envz, envz_len, name), - char **envz _AND - size_t *envz_len _AND - const char *name) -{ - char *entry = NULL; - int len = 0; - entry = envz_entry (*envz, *envz_len, name); - - if (entry) - { - len = strlen(entry) + 1; - - /* Not the last entry. */ - if (*envz + *envz_len != entry + len - 1) - { - memmove(entry, entry + len, *envz + *envz_len - entry - len); - } - - *envz = (char *)realloc(*envz, *envz_len - len); - *envz_len -= len; - } -} diff --git a/newlib/libc/argz/envz_strip.c b/newlib/libc/argz/envz_strip.c deleted file mode 100644 index e1c461091..000000000 --- a/newlib/libc/argz/envz_strip.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#include <errno.h> -#include <sys/types.h> -#include <string.h> -#include <stdlib.h> -#include <argz.h> -#include <envz.h> - -void -_DEFUN (envz_strip, (envz, envz_len), - char **envz _AND - size_t *envz_len) -{ - char *entry = 0; - int len = 0; - int null_found = 0; - - while((entry = argz_next(*envz, *envz_len, entry))) - { - if(!strchr(entry, '=')) - { - null_found = 1; - len = strlen(entry) + 1; - /* Make sure this is not the last entry in envz. If it is, it - will be chopped off by the realloc anyway.*/ - if(*envz + *envz_len != entry + len - 1) - { - memmove(entry, entry + len, *envz + *envz_len - entry - len); - } - *envz_len -= len; - } - } - if(null_found) - { - *envz = (char *)realloc(*envz, *envz_len); - } -} |