L4Re/OLD/libc_newlib

Changeset

31:7dcb28dd4615
2019-12-08 Paul Boddie raw files shortlog changelog graph Moved reent, string and malloc-related code into separate libraries/packages.
Control (file) NOTES.txt (file) libc/Makefile (file) libc/l4re/sys_memory.c libc/l4re/sys_memory.h libc/reent/Makefile.am libc/reent/Makefile.in libc/reent/closer.c libc/reent/execr.c libc/reent/fcntlr.c libc/reent/fstat64r.c libc/reent/fstatr.c libc/reent/getreent.c libc/reent/gettimeofdayr.c libc/reent/impure.c libc/reent/isattyr.c libc/reent/linkr.c libc/reent/lseek64r.c libc/reent/lseekr.c libc/reent/mkdirr.c libc/reent/open64r.c libc/reent/openr.c libc/reent/readr.c libc/reent/reent.c libc/reent/reent.tex libc/reent/renamer.c libc/reent/sbrkr.c libc/reent/signalr.c libc/reent/signgam.c libc/reent/stat64r.c libc/reent/statr.c libc/reent/timesr.c libc/reent/unlinkr.c libc/reent/writer.c libc/stdlib/mlock.c libc/stdlib/nano-mallocr.c libc/string/Makefile.am libc/string/Makefile.in libc/string/WIDTH-A libc/string/ambiguous.t libc/string/bcmp.c libc/string/bcopy.c libc/string/bzero.c libc/string/combining.t libc/string/explicit_bzero.c libc/string/ffsl.c libc/string/ffsll.c libc/string/fls.c libc/string/flsl.c libc/string/flsll.c libc/string/gnu_basename.c libc/string/index.c libc/string/local.h libc/string/memccpy.c libc/string/memchr.c libc/string/memcmp.c libc/string/memcpy.c libc/string/memmem.c libc/string/memmove.c libc/string/mempcpy.c libc/string/memrchr.c libc/string/memset.c libc/string/mkunidata libc/string/mkwide libc/string/mkwidthA libc/string/rawmemchr.c libc/string/rindex.c libc/string/stpcpy.c libc/string/stpncpy.c libc/string/str-two-way.h libc/string/strcasecmp.c libc/string/strcasecmp_l.c libc/string/strcasestr.c libc/string/strcat.c libc/string/strchr.c libc/string/strchrnul.c libc/string/strcmp.c libc/string/strcoll.c libc/string/strcoll_l.c libc/string/strcpy.c libc/string/strcspn.c libc/string/strdup.c libc/string/strdup_r.c libc/string/strerror.c libc/string/strerror_r.c libc/string/strings.tex libc/string/strlcat.c libc/string/strlcpy.c libc/string/strlen.c libc/string/strlwr.c libc/string/strncasecmp.c libc/string/strncasecmp_l.c libc/string/strncat.c libc/string/strncmp.c libc/string/strncpy.c libc/string/strndup.c libc/string/strndup_r.c libc/string/strnlen.c libc/string/strnstr.c libc/string/strpbrk.c libc/string/strrchr.c libc/string/strsep.c libc/string/strsignal.c libc/string/strspn.c libc/string/strstr.c libc/string/strtok.c libc/string/strtok_r.c libc/string/strupr.c libc/string/strverscmp.c libc/string/strxfrm.c libc/string/strxfrm_l.c libc/string/swab.c libc/string/timingsafe_bcmp.c libc/string/timingsafe_memcmp.c libc/string/u_strerr.c libc/string/uniset libc/string/wcpcpy.c libc/string/wcpncpy.c libc/string/wcscasecmp.c libc/string/wcscasecmp_l.c libc/string/wcscat.c libc/string/wcschr.c libc/string/wcscmp.c libc/string/wcscoll.c libc/string/wcscoll_l.c libc/string/wcscpy.c libc/string/wcscspn.c libc/string/wcsdup.c libc/string/wcslcat.c libc/string/wcslcpy.c libc/string/wcslen.c libc/string/wcsncasecmp.c libc/string/wcsncasecmp_l.c libc/string/wcsncat.c libc/string/wcsncmp.c libc/string/wcsncpy.c libc/string/wcsnlen.c libc/string/wcspbrk.c libc/string/wcsrchr.c libc/string/wcsspn.c libc/string/wcsstr.c libc/string/wcstok.c libc/string/wcstrings.tex libc/string/wcswidth.c libc/string/wcsxfrm.c libc/string/wcsxfrm_l.c libc/string/wcwidth.c libc/string/wide.t libc/string/wmemchr.c libc/string/wmemcmp.c libc/string/wmemcpy.c libc/string/wmemmove.c libc/string/wmempcpy.c libc/string/wmemset.c libc/string/xpg_strerror_r.c
     1.1 --- a/Control	Sat Dec 07 00:44:56 2019 +0100
     1.2 +++ b/Control	Sun Dec 08 19:24:55 2019 +0100
     1.3 @@ -1,3 +1,3 @@
     1.4  provides: libc_newlib
     1.5 -requires: libc_newlib_string libc_newlib_headers l4re libfsclient_minimal libipc_minimal
     1.6 +requires: libc_newlib_malloc libc_newlib_string libc_newlib_headers l4re libfsclient_minimal libipc_minimal
     1.7  maintainer: paul@boddie.org.uk
     2.1 --- a/NOTES.txt	Sat Dec 07 00:44:56 2019 +0100
     2.2 +++ b/NOTES.txt	Sun Dec 08 19:24:55 2019 +0100
     2.3 @@ -19,3 +19,10 @@
     2.4  system. It is possible that some of these are unnecessary or incorrect but
     2.5  that the nuances of the original build system and its configuration had not
     2.6  been fully understood when these changes needed to be made.
     2.7 +
     2.8 +Functionality from Newlib has been broken out into several separate packages.
     2.9 +This permits the use of such code in system-related libraries.
    2.10 +
    2.11 +libc_newlib_malloc - provides memory allocation routines
    2.12 +libc_newlib_reent  - provides reentrant system functions
    2.13 +libc_newlib_string - provides string processing routines
     3.1 --- a/libc/Makefile	Sat Dec 07 00:44:56 2019 +0100
     3.2 +++ b/libc/Makefile	Sun Dec 08 19:24:55 2019 +0100
     3.3 @@ -32,7 +32,6 @@
     3.4  		$(wildcard $(THISDIR)/errno/*.c) \
     3.5  		$(wildcard $(THISDIR)/locale/*.c) \
     3.6  		$(wildcard $(THISDIR)/misc/*.c) \
     3.7 -		$(wildcard $(THISDIR)/reent/*.c) \
     3.8  		$(wildcard $(THISDIR)/stdio/*.c) \
     3.9  		$(wildcard $(THISDIR)/stdlib/*.c) \
    3.10  		\
    3.11 @@ -51,6 +50,7 @@
    3.12  
    3.13  # Sources in other libraries.
    3.14  
    3.15 +#		$(wildcard $(THISDIR)/reent/*.c) \
    3.16  #		$(wildcard $(THISDIR)/string/*.c) \
    3.17  
    3.18  # Convert the filenames to relative paths for SRC_C.
    3.19 @@ -80,22 +80,12 @@
    3.20  		stdio/svfwscanf.c \
    3.21  		stdio/vfiscanf.c \
    3.22  		stdio/vfiwscanf.c \
    3.23 -		stdlib/nano-callocr.c \
    3.24 -		stdlib/nano-cfreer.c \
    3.25 -		stdlib/nano-freer.c \
    3.26 -		stdlib/nano-malignr.c \
    3.27 -		stdlib/nano-mallinfor.c \
    3.28 -		stdlib/_nano-mallocr.c \
    3.29 -		stdlib/nano-malloptr.c \
    3.30 -		stdlib/nano-mallstatsr.c \
    3.31 -		stdlib/nano-msizer.c \
    3.32 -		stdlib/nano-pvallocr.c \
    3.33 -		stdlib/nano-reallocr.c \
    3.34 -		stdlib/nano-vallocr.c \
    3.35  
    3.36  # Remove the spurious posix/engine.c.
    3.37  # Remove the nano stdio functions.
    3.38  # The nano-mallocr.c implementation is used to avoid sys/mman.h dependencies.
    3.39 +# The mlock.c functionality (along with nano-mallocr.c) is provided by the
    3.40 +# libc_newlib_malloc package/library.
    3.41  # Remove the duplicate isatty definition provided by the syscalls.
    3.42  # The VAX-specific XDR implementation is superfluous and will not compile.
    3.43  
    3.44 @@ -103,11 +93,12 @@
    3.45  		posix/engine.c \
    3.46  		stdio/nano-%.c \
    3.47  		stdlib/mallocr.c \
    3.48 +		stdlib/mlock.c \
    3.49  		syscalls/sysisatty.c \
    3.50  		xdr/xdr_float_vax.c \
    3.51  
    3.52  # Disable rpmatch.c when the posix functionality is disabled.
    3.53 -# Disable mtrim.c if nano-mallocr.c is being used (see below).
    3.54 +# Disable mtrim.c when nano-mallocr.c is being used (see libc_newlib_malloc).
    3.55  
    3.56  SOURCES_DISABLED = \
    3.57  		stdlib/rpmatch.c \
    3.58 @@ -148,7 +139,13 @@
    3.59  
    3.60  PRIVATE_INCDIR	+= $(PKGDIR)/libm/common
    3.61  
    3.62 -REQUIRES_LIBS	= libc_newlib_string libc_newlib_headers l4re libfsclient_minimal
    3.63 +# The malloc and string routines are provided by separate libraries in order to
    3.64 +# allow system-related libraries to use them.
    3.65 +
    3.66 +REQUIRES_LIBS	= \
    3.67 +		libc_newlib_reent libc_newlib_malloc libc_newlib_string \
    3.68 +		libc_newlib_headers \
    3.69 +		l4re libfsclient_minimal \
    3.70  
    3.71  include $(L4DIR)/mk/lib.mk
    3.72  
    3.73 @@ -216,66 +213,3 @@
    3.74  	$(CP) $< $@
    3.75  
    3.76  CPPFLAGS_stdio/vfiwscanf.c += -DINTEGER_ONLY -I$(THISDIR)/stdio
    3.77 -
    3.78 -# The malloc implementation also needs repeated compilation.
    3.79 -# A special rule is needed for malloc itself to get the flags used.
    3.80 -
    3.81 -stdlib/_nano-mallocr.c: stdlib/nano-mallocr.c
    3.82 -	$(CP) $< $@
    3.83 -
    3.84 -CPPFLAGS_stdlib/_nano-mallocr.c += -DINTERNAL_NEWLIB -DDEFINE_MALLOC -I$(THISDIR)/stdlib
    3.85 -
    3.86 -stdlib/nano-freer.c: stdlib/nano-mallocr.c
    3.87 -	$(CP) $< $@
    3.88 -
    3.89 -CPPFLAGS_stdlib/nano-freer.c += -DINTERNAL_NEWLIB -DDEFINE_FREE -I$(THISDIR)/stdlib
    3.90 -
    3.91 -stdlib/nano-reallocr.c: stdlib/nano-mallocr.c
    3.92 -	$(CP) $< $@
    3.93 -
    3.94 -CPPFLAGS_stdlib/nano-reallocr.c += -DINTERNAL_NEWLIB -DDEFINE_REALLOC -I$(THISDIR)/stdlib
    3.95 -
    3.96 -stdlib/nano-callocr.c: stdlib/nano-mallocr.c
    3.97 -	$(CP) $< $@
    3.98 -
    3.99 -CPPFLAGS_stdlib/nano-callocr.c += -DINTERNAL_NEWLIB -DDEFINE_CALLOC -I$(THISDIR)/stdlib
   3.100 -
   3.101 -stdlib/nano-cfreer.c: stdlib/nano-mallocr.c
   3.102 -	$(CP) $< $@
   3.103 -
   3.104 -CPPFLAGS_stdlib/nano-cfreer.c += -DINTERNAL_NEWLIB -DDEFINE_CFREE -I$(THISDIR)/stdlib
   3.105 -
   3.106 -stdlib/nano-malignr.c: stdlib/nano-mallocr.c
   3.107 -	$(CP) $< $@
   3.108 -
   3.109 -CPPFLAGS_stdlib/nano-malignr.c += -DINTERNAL_NEWLIB -DDEFINE_MEMALIGN -I$(THISDIR)/stdlib
   3.110 -
   3.111 -stdlib/nano-vallocr.c: stdlib/nano-mallocr.c
   3.112 -	$(CP) $< $@
   3.113 -
   3.114 -CPPFLAGS_stdlib/nano-vallocr.c += -DINTERNAL_NEWLIB -DDEFINE_VALLOC -I$(THISDIR)/stdlib
   3.115 -
   3.116 -stdlib/nano-pvallocr.c: stdlib/nano-mallocr.c
   3.117 -	$(CP) $< $@
   3.118 -
   3.119 -CPPFLAGS_stdlib/nano-pvallocr.c += -DINTERNAL_NEWLIB -DDEFINE_PVALLOC -I$(THISDIR)/stdlib
   3.120 -
   3.121 -stdlib/nano-mallinfor.c: stdlib/nano-mallocr.c
   3.122 -	$(CP) $< $@
   3.123 -
   3.124 -CPPFLAGS_stdlib/nano-mallinfor.c += -DINTERNAL_NEWLIB -DDEFINE_MALLINFO -I$(THISDIR)/stdlib
   3.125 -
   3.126 -stdlib/nano-mallstatsr.c: stdlib/nano-mallocr.c
   3.127 -	$(CP) $< $@
   3.128 -
   3.129 -CPPFLAGS_stdlib/nano-mallstatsr.c += -DINTERNAL_NEWLIB -DDEFINE_MALLOC_STATS -I$(THISDIR)/stdlib
   3.130 -
   3.131 -stdlib/nano-msizer.c: stdlib/nano-mallocr.c
   3.132 -	$(CP) $< $@
   3.133 -
   3.134 -CPPFLAGS_stdlib/nano-msizer.c += -DINTERNAL_NEWLIB -DDEFINE_MALLOC_USABLE_SIZE -I$(THISDIR)/stdlib
   3.135 -
   3.136 -stdlib/nano-malloptr.c: stdlib/nano-mallocr.c
   3.137 -	$(CP) $< $@
   3.138 -
   3.139 -CPPFLAGS_stdlib/nano-malloptr.c += -DINTERNAL_NEWLIB -DDEFINE_MALLOPT -I$(THISDIR)/stdlib
     4.1 --- a/libc/l4re/sys_memory.c	Sat Dec 07 00:44:56 2019 +0100
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,167 +0,0 @@
     4.4 -/*
     4.5 - * Traditional system functions for memory management.
     4.6 - *
     4.7 - * Copyright (C) 2019 Paul Boddie <paul@boddie.org.uk>
     4.8 - *
     4.9 - * This program is free software; you can redistribute it and/or
    4.10 - * modify it under the terms of the GNU General Public License as
    4.11 - * published by the Free Software Foundation; either version 2 of
    4.12 - * the License, or (at your option) any later version.
    4.13 - *
    4.14 - * This program is distributed in the hope that it will be useful,
    4.15 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
    4.16 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    4.17 - * GNU General Public License for more details.
    4.18 - *
    4.19 - * You should have received a copy of the GNU General Public License
    4.20 - * along with this program; if not, write to the Free Software
    4.21 - * Foundation, Inc., 51 Franklin Street, Fifth Floor,
    4.22 - * Boston, MA  02110-1301, USA
    4.23 - */
    4.24 -
    4.25 -#include <l4/sys/types.h>
    4.26 -
    4.27 -#include <ipc/mem_ipc.h>
    4.28 -
    4.29 -#include <errno.h>
    4.30 -#include <malloc.h>
    4.31 -
    4.32 -#include "sys_memory.h"
    4.33 -
    4.34 -
    4.35 -
    4.36 -/* NOTE: This should use the reentrancy state and prevent concurrent access. */
    4.37 -
    4.38 -/* The current and previous limit of the data segment. */
    4.39 -
    4.40 -static void *program_break = 0;
    4.41 -static void *program_break_previous = 0;
    4.42 -
    4.43 -/* Available memory already allocated. */
    4.44 -
    4.45 -const unsigned long initial_memory_size = L4_PAGESIZE;
    4.46 -unsigned long memory_available = 0;
    4.47 -
    4.48 -
    4.49 -
    4.50 -/* Return the "program break" or address of the first location after the end of
    4.51 -   the data segment. If increment is non-zero, allocate more data space and
    4.52 -   provide the address before allocation as the result. */
    4.53 -
    4.54 -void *_sbrk_r(struct _reent *reent, intptr_t increment)
    4.55 -{
    4.56 -  l4_cap_idx_t ds;
    4.57 -  void *addr;
    4.58 -  unsigned long size;
    4.59 -
    4.60 -  /* For a zero increment, obtain the current limit. */
    4.61 -
    4.62 -  if (!increment)
    4.63 -  {
    4.64 -    /* Without any recorded address, obtain some memory first in order to provide
    4.65 -       the initial address. */
    4.66 -
    4.67 -    if (!program_break)
    4.68 -    {
    4.69 -      if (ipc_allocate(initial_memory_size, &program_break_previous, &ds))
    4.70 -      {
    4.71 -        reent->_errno = ENOMEM;
    4.72 -        return (void *) -1;
    4.73 -      }
    4.74 -
    4.75 -      if (ipc_dataspace_size(ds, &memory_available))
    4.76 -      {
    4.77 -        reent->_errno = ENOMEM;
    4.78 -        return (void *) -1;
    4.79 -      }
    4.80 -
    4.81 -      /* The actual limit is concealed from the caller. */
    4.82 -
    4.83 -      program_break = program_break_previous;
    4.84 -    }
    4.85 -  }
    4.86 -
    4.87 -  /* For a non-zero increment, obtain a new limit, using any available memory
    4.88 -     from initialisation. */
    4.89 -
    4.90 -  /* NOTE: For now, ignore negative increments. */
    4.91 -
    4.92 -  else if (increment > 0)
    4.93 -  {
    4.94 -    program_break_previous = program_break;
    4.95 -
    4.96 -    /* Consume available pre-allocated memory if possible. */
    4.97 -
    4.98 -    size = labs(increment);
    4.99 -
   4.100 -    if (memory_available >= size)
   4.101 -      memory_available -= size;
   4.102 -
   4.103 -    /* Without any available pre-allocated memory, obtain a new dataspace and
   4.104 -       advance the address. */
   4.105 -
   4.106 -    else
   4.107 -    {
   4.108 -      if (ipc_allocate(size - memory_available, &addr, &ds))
   4.109 -      {
   4.110 -        reent->_errno = ENOMEM;
   4.111 -        return (void *) -1;
   4.112 -      }
   4.113 -
   4.114 -      if (ipc_dataspace_size(ds, &size))
   4.115 -      {
   4.116 -        reent->_errno = ENOMEM;
   4.117 -        return (void *) -1;
   4.118 -      }
   4.119 -
   4.120 -      /* If allocation does not produce an adjacent block, just return the
   4.121 -         address of the newly-allocated memory, because the caller will be
   4.122 -         expecting contiguous memory. Any remaining pre-allocated memory will be
   4.123 -         abandoned. */
   4.124 -
   4.125 -      if (addr != program_break + memory_available)
   4.126 -        program_break_previous = addr;
   4.127 -
   4.128 -      memory_available = 0;
   4.129 -    }
   4.130 -
   4.131 -    /* Calculate the new limit using whichever size was employed. */
   4.132 -
   4.133 -    program_break = program_break_previous + size;
   4.134 -  }
   4.135 -
   4.136 -  /* Return the previous limit. */
   4.137 -
   4.138 -  return program_break_previous;
   4.139 -}
   4.140 -
   4.141 -
   4.142 -
   4.143 -/* Obtain an aligned memory region of the given alignment and size, populating
   4.144 -   the given pointer. The alignment must express a whole power of two and
   4.145 -   express a multiple of sizeof(void *). */
   4.146 -
   4.147 -int posix_memalign(void **memptr, size_t alignment, size_t size)
   4.148 -{
   4.149 -  void *addr;
   4.150 -
   4.151 -  /* Require a power of two (a single bit set only) and a multiple of the void
   4.152 -     pointer size. */
   4.153 -
   4.154 -  if (!alignment || ((alignment & (alignment - 1))) || (alignment % sizeof(void *)))
   4.155 -    return EINVAL;
   4.156 -
   4.157 -  if (size)
   4.158 -  {
   4.159 -    addr = _memalign_r(_REENT, alignment, size);
   4.160 -
   4.161 -    if (addr == NULL)
   4.162 -      return ENOMEM;
   4.163 -
   4.164 -    *memptr = addr;
   4.165 -  }
   4.166 -  else
   4.167 -    *memptr = NULL;
   4.168 -
   4.169 -  return 0;
   4.170 -}
     5.1 --- a/libc/l4re/sys_memory.h	Sat Dec 07 00:44:56 2019 +0100
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,29 +0,0 @@
     5.4 -/*
     5.5 - * Traditional system functions for memory management.
     5.6 - *
     5.7 - * Copyright (C) 2019 Paul Boddie <paul@boddie.org.uk>
     5.8 - *
     5.9 - * This program is free software; you can redistribute it and/or
    5.10 - * modify it under the terms of the GNU General Public License as
    5.11 - * published by the Free Software Foundation; either version 2 of
    5.12 - * the License, or (at your option) any later version.
    5.13 - *
    5.14 - * This program is distributed in the hope that it will be useful,
    5.15 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
    5.16 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    5.17 - * GNU General Public License for more details.
    5.18 - *
    5.19 - * You should have received a copy of the GNU General Public License
    5.20 - * along with this program; if not, write to the Free Software
    5.21 - * Foundation, Inc., 51 Franklin Street, Fifth Floor,
    5.22 - * Boston, MA  02110-1301, USA
    5.23 - */
    5.24 -
    5.25 -#pragma once
    5.26 -
    5.27 -#include <stdlib.h>           /* posix_memalign */
    5.28 -#include <unistd.h>           /* sbrk */
    5.29 -#include <reent.h>            /* struct _reent */
    5.30 -
    5.31 -void *_sbrk_r(struct _reent *reent, intptr_t increment);
    5.32 -int posix_memalign(void **memptr, size_t alignment, size_t size);
     6.1 --- a/libc/reent/Makefile.am	Sat Dec 07 00:44:56 2019 +0100
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,95 +0,0 @@
     6.4 -## Process this file with automake to generate Makefile.in
     6.5 -
     6.6 -AUTOMAKE_OPTIONS = cygnus
     6.7 -
     6.8 -INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
     6.9 -
    6.10 -if HAVE_STDIO64_DIR
    6.11 -STDIO64_SOURCES = \
    6.12 -	fstat64r.c \
    6.13 -	lseek64r.c \
    6.14 -	stat64r.c \
    6.15 -	open64r.c
    6.16 -
    6.17 -STDIO64_DEFS = \
    6.18 -	fstat64r.def \
    6.19 -	lseek64r.def \
    6.20 -	stat64r.def \
    6.21 -	open64r.def
    6.22 -endif
    6.23 -
    6.24 -ELIX_2_SOURCES = $(STDIO64_SOURCES)
    6.25 -ELIX_3_SOURCES = execr.c
    6.26 -
    6.27 -if ELIX_LEVEL_1
    6.28 -ELIX_SOURCES =
    6.29 -else
    6.30 -if ELIX_LEVEL_2
    6.31 -ELIX_SOURCES = $(ELIX_2_SOURCES)
    6.32 -else
    6.33 -ELIX_SOURCES = $(ELIX_2_SOURCES) $(ELIX_3_SOURCES)
    6.34 -endif
    6.35 -endif
    6.36 -
    6.37 -GENERAL_SOURCES = \
    6.38 -	closer.c \
    6.39 -	reent.c \
    6.40 -	impure.c \
    6.41 -	fcntlr.c \
    6.42 -	fstatr.c \
    6.43 -	getreent.c \
    6.44 -	gettimeofdayr.c \
    6.45 -	isattyr.c \
    6.46 -	linkr.c \
    6.47 -	lseekr.c \
    6.48 -	mkdirr.c \
    6.49 -	openr.c \
    6.50 -	readr.c \
    6.51 -	renamer.c \
    6.52 -	signalr.c \
    6.53 -	signgam.c \
    6.54 -	sbrkr.c \
    6.55 -	statr.c \
    6.56 -	timesr.c \
    6.57 -	unlinkr.c \
    6.58 -	writer.c
    6.59 -
    6.60 -libreent_la_LDFLAGS = -Xcompiler -nostdlib
    6.61 -
    6.62 -if USE_LIBTOOL
    6.63 -noinst_LTLIBRARIES = libreent.la
    6.64 -libreent_la_SOURCES = $(GENERAL_SOURCES) $(ELIX_SOURCES)
    6.65 -noinst_DATA = objectlist.awk.in
    6.66 -else
    6.67 -noinst_LIBRARIES = lib.a
    6.68 -lib_a_SOURCES = $(GENERAL_SOURCES) $(ELIX_SOURCES)
    6.69 -lib_a_CFLAGS = $(AM_CFLAGS)
    6.70 -noinst_DATA =
    6.71 -endif # USE_LIBTOOL
    6.72 -
    6.73 -include $(srcdir)/../../Makefile.shared
    6.74 -
    6.75 -CHEWOUT_FILES = \
    6.76 -	closer.def \
    6.77 -	reent.def \
    6.78 -	execr.def \
    6.79 -	fcntlr.def \
    6.80 -	fstatr.def \
    6.81 -	gettimeofdayr.def \
    6.82 -	linkr.def \
    6.83 -	lseekr.def \
    6.84 -	mkdirr.def \
    6.85 -	openr.def \
    6.86 -	readr.def \
    6.87 -	renamer.def \
    6.88 -	signalr.def \
    6.89 -	sbrkr.def \
    6.90 -	statr.def \
    6.91 -	timesr.def \
    6.92 -	unlinkr.def \
    6.93 -	$(STDIO64_DEFS) \
    6.94 -	writer.def
    6.95 -
    6.96 -CHAPTERS = reent.tex
    6.97 -
    6.98 -$(lpfx)impure.$(oext): $(srcdir)/impure.c $(srcdir)/../include/sys/reent.h
     7.1 --- a/libc/reent/Makefile.in	Sat Dec 07 00:44:56 2019 +0100
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,804 +0,0 @@
     7.4 -# Makefile.in generated by automake 1.11.6 from Makefile.am.
     7.5 -# @configure_input@
     7.6 -
     7.7 -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
     7.8 -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
     7.9 -# Foundation, Inc.
    7.10 -# This Makefile.in is free software; the Free Software Foundation
    7.11 -# gives unlimited permission to copy and/or distribute it,
    7.12 -# with or without modifications, as long as this notice is preserved.
    7.13 -
    7.14 -# This program is distributed in the hope that it will be useful,
    7.15 -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
    7.16 -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
    7.17 -# PARTICULAR PURPOSE.
    7.18 -
    7.19 -@SET_MAKE@
    7.20 -
    7.21 -
    7.22 -
    7.23 -VPATH = @srcdir@
    7.24 -am__make_dryrun = \
    7.25 -  { \
    7.26 -    am__dry=no; \
    7.27 -    case $$MAKEFLAGS in \
    7.28 -      *\\[\ \	]*) \
    7.29 -        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
    7.30 -          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
    7.31 -      *) \
    7.32 -        for am__flg in $$MAKEFLAGS; do \
    7.33 -          case $$am__flg in \
    7.34 -            *=*|--*) ;; \
    7.35 -            *n*) am__dry=yes; break;; \
    7.36 -          esac; \
    7.37 -        done;; \
    7.38 -    esac; \
    7.39 -    test $$am__dry = yes; \
    7.40 -  }
    7.41 -pkgdatadir = $(datadir)/@PACKAGE@
    7.42 -pkgincludedir = $(includedir)/@PACKAGE@
    7.43 -pkglibdir = $(libdir)/@PACKAGE@
    7.44 -pkglibexecdir = $(libexecdir)/@PACKAGE@
    7.45 -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
    7.46 -install_sh_DATA = $(install_sh) -c -m 644
    7.47 -install_sh_PROGRAM = $(install_sh) -c
    7.48 -install_sh_SCRIPT = $(install_sh) -c
    7.49 -INSTALL_HEADER = $(INSTALL_DATA)
    7.50 -transform = $(program_transform_name)
    7.51 -NORMAL_INSTALL = :
    7.52 -PRE_INSTALL = :
    7.53 -POST_INSTALL = :
    7.54 -NORMAL_UNINSTALL = :
    7.55 -PRE_UNINSTALL = :
    7.56 -POST_UNINSTALL = :
    7.57 -build_triplet = @build@
    7.58 -host_triplet = @host@
    7.59 -DIST_COMMON = $(srcdir)/../../Makefile.shared $(srcdir)/Makefile.in \
    7.60 -	$(srcdir)/Makefile.am
    7.61 -subdir = reent
    7.62 -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
    7.63 -am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \
    7.64 -	$(top_srcdir)/../../ltoptions.m4 \
    7.65 -	$(top_srcdir)/../../ltsugar.m4 \
    7.66 -	$(top_srcdir)/../../ltversion.m4 \
    7.67 -	$(top_srcdir)/../../lt~obsolete.m4 \
    7.68 -	$(top_srcdir)/../acinclude.m4 $(top_srcdir)/configure.in
    7.69 -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
    7.70 -	$(ACLOCAL_M4)
    7.71 -mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs
    7.72 -CONFIG_CLEAN_FILES =
    7.73 -CONFIG_CLEAN_VPATH_FILES =
    7.74 -LIBRARIES = $(noinst_LIBRARIES)
    7.75 -ARFLAGS = cru
    7.76 -lib_a_AR = $(AR) $(ARFLAGS)
    7.77 -lib_a_LIBADD =
    7.78 -am__objects_1 = lib_a-closer.$(OBJEXT) lib_a-reent.$(OBJEXT) \
    7.79 -	lib_a-impure.$(OBJEXT) lib_a-fcntlr.$(OBJEXT) \
    7.80 -	lib_a-fstatr.$(OBJEXT) lib_a-getreent.$(OBJEXT) \
    7.81 -	lib_a-gettimeofdayr.$(OBJEXT) lib_a-isattyr.$(OBJEXT) \
    7.82 -	lib_a-linkr.$(OBJEXT) lib_a-lseekr.$(OBJEXT) \
    7.83 -	lib_a-mkdirr.$(OBJEXT) lib_a-openr.$(OBJEXT) \
    7.84 -	lib_a-readr.$(OBJEXT) lib_a-renamer.$(OBJEXT) \
    7.85 -	lib_a-signalr.$(OBJEXT) lib_a-signgam.$(OBJEXT) \
    7.86 -	lib_a-sbrkr.$(OBJEXT) lib_a-statr.$(OBJEXT) \
    7.87 -	lib_a-timesr.$(OBJEXT) lib_a-unlinkr.$(OBJEXT) \
    7.88 -	lib_a-writer.$(OBJEXT)
    7.89 -@HAVE_STDIO64_DIR_TRUE@am__objects_2 = lib_a-fstat64r.$(OBJEXT) \
    7.90 -@HAVE_STDIO64_DIR_TRUE@	lib_a-lseek64r.$(OBJEXT) \
    7.91 -@HAVE_STDIO64_DIR_TRUE@	lib_a-stat64r.$(OBJEXT) \
    7.92 -@HAVE_STDIO64_DIR_TRUE@	lib_a-open64r.$(OBJEXT)
    7.93 -am__objects_3 = $(am__objects_2)
    7.94 -am__objects_4 = lib_a-execr.$(OBJEXT)
    7.95 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@am__objects_5 =  \
    7.96 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@	$(am__objects_3) \
    7.97 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@	$(am__objects_4)
    7.98 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@am__objects_5 =  \
    7.99 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@	$(am__objects_3)
   7.100 -@USE_LIBTOOL_FALSE@am_lib_a_OBJECTS = $(am__objects_1) \
   7.101 -@USE_LIBTOOL_FALSE@	$(am__objects_5)
   7.102 -lib_a_OBJECTS = $(am_lib_a_OBJECTS)
   7.103 -LTLIBRARIES = $(noinst_LTLIBRARIES)
   7.104 -libreent_la_LIBADD =
   7.105 -am__objects_6 = closer.lo reent.lo impure.lo fcntlr.lo fstatr.lo \
   7.106 -	getreent.lo gettimeofdayr.lo isattyr.lo linkr.lo lseekr.lo \
   7.107 -	mkdirr.lo openr.lo readr.lo renamer.lo signalr.lo signgam.lo \
   7.108 -	sbrkr.lo statr.lo timesr.lo unlinkr.lo writer.lo
   7.109 -@HAVE_STDIO64_DIR_TRUE@am__objects_7 = fstat64r.lo lseek64r.lo \
   7.110 -@HAVE_STDIO64_DIR_TRUE@	stat64r.lo open64r.lo
   7.111 -am__objects_8 = $(am__objects_7)
   7.112 -am__objects_9 = execr.lo
   7.113 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@am__objects_10 =  \
   7.114 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@	$(am__objects_8) \
   7.115 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@	$(am__objects_9)
   7.116 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@am__objects_10 =  \
   7.117 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@	$(am__objects_8)
   7.118 -@USE_LIBTOOL_TRUE@am_libreent_la_OBJECTS = $(am__objects_6) \
   7.119 -@USE_LIBTOOL_TRUE@	$(am__objects_10)
   7.120 -libreent_la_OBJECTS = $(am_libreent_la_OBJECTS)
   7.121 -libreent_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
   7.122 -	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
   7.123 -	$(libreent_la_LDFLAGS) $(LDFLAGS) -o $@
   7.124 -@USE_LIBTOOL_TRUE@am_libreent_la_rpath =
   7.125 -DEFAULT_INCLUDES = -I.@am__isrc@
   7.126 -depcomp =
   7.127 -am__depfiles_maybe =
   7.128 -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
   7.129 -	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
   7.130 -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
   7.131 -	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
   7.132 -	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
   7.133 -CCLD = $(CC)
   7.134 -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
   7.135 -	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
   7.136 -	$(LDFLAGS) -o $@
   7.137 -SOURCES = $(lib_a_SOURCES) $(libreent_la_SOURCES)
   7.138 -am__can_run_installinfo = \
   7.139 -  case $$AM_UPDATE_INFO_DIR in \
   7.140 -    n|no|NO) false;; \
   7.141 -    *) (install-info --version) >/dev/null 2>&1;; \
   7.142 -  esac
   7.143 -DATA = $(noinst_DATA)
   7.144 -ETAGS = etags
   7.145 -CTAGS = ctags
   7.146 -ACLOCAL = @ACLOCAL@
   7.147 -AMTAR = @AMTAR@
   7.148 -AR = @AR@
   7.149 -AS = @AS@
   7.150 -AUTOCONF = @AUTOCONF@
   7.151 -AUTOHEADER = @AUTOHEADER@
   7.152 -AUTOMAKE = @AUTOMAKE@
   7.153 -AWK = @AWK@
   7.154 -CC = @CC@
   7.155 -CCAS = @CCAS@
   7.156 -CCASFLAGS = @CCASFLAGS@
   7.157 -CCDEPMODE = @CCDEPMODE@
   7.158 -CFLAGS = @CFLAGS@
   7.159 -CPP = @CPP@
   7.160 -CPPFLAGS = @CPPFLAGS@
   7.161 -CRT0 = @CRT0@
   7.162 -CYGPATH_W = @CYGPATH_W@
   7.163 -DEFS = @DEFS@
   7.164 -DEPDIR = @DEPDIR@
   7.165 -DLLTOOL = @DLLTOOL@
   7.166 -DSYMUTIL = @DSYMUTIL@
   7.167 -DUMPBIN = @DUMPBIN@
   7.168 -ECHO_C = @ECHO_C@
   7.169 -ECHO_N = @ECHO_N@
   7.170 -ECHO_T = @ECHO_T@
   7.171 -EGREP = @EGREP@
   7.172 -EXEEXT = @EXEEXT@
   7.173 -FGREP = @FGREP@
   7.174 -GREP = @GREP@
   7.175 -INSTALL = @INSTALL@
   7.176 -INSTALL_DATA = @INSTALL_DATA@
   7.177 -INSTALL_PROGRAM = @INSTALL_PROGRAM@
   7.178 -INSTALL_SCRIPT = @INSTALL_SCRIPT@
   7.179 -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
   7.180 -LD = @LD@
   7.181 -LDFLAGS = @LDFLAGS@
   7.182 -LIBC_EXTRA_DEF = @LIBC_EXTRA_DEF@
   7.183 -LIBC_EXTRA_LIB = @LIBC_EXTRA_LIB@
   7.184 -LIBC_MACHINE_LIB = @LIBC_MACHINE_LIB@
   7.185 -LIBC_POSIX_DEF = @LIBC_POSIX_DEF@
   7.186 -LIBC_POSIX_LIB = @LIBC_POSIX_LIB@
   7.187 -LIBC_SIGNAL_DEF = @LIBC_SIGNAL_DEF@
   7.188 -LIBC_SIGNAL_LIB = @LIBC_SIGNAL_LIB@
   7.189 -LIBC_STDIO64_DEF = @LIBC_STDIO64_DEF@
   7.190 -LIBC_STDIO64_LIB = @LIBC_STDIO64_LIB@
   7.191 -LIBC_STDIO_DEF = @LIBC_STDIO_DEF@
   7.192 -LIBC_STDIO_LIB = @LIBC_STDIO_LIB@
   7.193 -LIBC_SYSCALL_LIB = @LIBC_SYSCALL_LIB@
   7.194 -LIBC_SYS_LIB = @LIBC_SYS_LIB@
   7.195 -LIBC_UNIX_LIB = @LIBC_UNIX_LIB@
   7.196 -LIBC_XDR_DEF = @LIBC_XDR_DEF@
   7.197 -LIBC_XDR_LIB = @LIBC_XDR_LIB@
   7.198 -LIBOBJS = @LIBOBJS@
   7.199 -LIBS = @LIBS@
   7.200 -LIBTOOL = @LIBTOOL@
   7.201 -LIPO = @LIPO@
   7.202 -LN_S = @LN_S@
   7.203 -LTLIBOBJS = @LTLIBOBJS@
   7.204 -MAINT = @MAINT@
   7.205 -MAKEINFO = @MAKEINFO@
   7.206 -MKDIR_P = @MKDIR_P@
   7.207 -NEWLIB_CFLAGS = @NEWLIB_CFLAGS@
   7.208 -NM = @NM@
   7.209 -NMEDIT = @NMEDIT@
   7.210 -NO_INCLUDE_LIST = @NO_INCLUDE_LIST@
   7.211 -OBJDUMP = @OBJDUMP@
   7.212 -OBJEXT = @OBJEXT@
   7.213 -OTOOL = @OTOOL@
   7.214 -OTOOL64 = @OTOOL64@
   7.215 -PACKAGE = @PACKAGE@
   7.216 -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
   7.217 -PACKAGE_NAME = @PACKAGE_NAME@
   7.218 -PACKAGE_STRING = @PACKAGE_STRING@
   7.219 -PACKAGE_TARNAME = @PACKAGE_TARNAME@
   7.220 -PACKAGE_URL = @PACKAGE_URL@
   7.221 -PACKAGE_VERSION = @PACKAGE_VERSION@
   7.222 -PATH_SEPARATOR = @PATH_SEPARATOR@
   7.223 -RANLIB = @RANLIB@
   7.224 -READELF = @READELF@
   7.225 -SED = @SED@
   7.226 -SET_MAKE = @SET_MAKE@
   7.227 -SHELL = @SHELL@
   7.228 -STRIP = @STRIP@
   7.229 -VERSION = @VERSION@
   7.230 -abs_builddir = @abs_builddir@
   7.231 -abs_srcdir = @abs_srcdir@
   7.232 -abs_top_builddir = @abs_top_builddir@
   7.233 -abs_top_srcdir = @abs_top_srcdir@
   7.234 -ac_ct_CC = @ac_ct_CC@
   7.235 -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
   7.236 -aext = @aext@
   7.237 -am__include = @am__include@
   7.238 -am__leading_dot = @am__leading_dot@
   7.239 -am__quote = @am__quote@
   7.240 -am__tar = @am__tar@
   7.241 -am__untar = @am__untar@
   7.242 -bindir = @bindir@
   7.243 -build = @build@
   7.244 -build_alias = @build_alias@
   7.245 -build_cpu = @build_cpu@
   7.246 -build_os = @build_os@
   7.247 -build_vendor = @build_vendor@
   7.248 -builddir = @builddir@
   7.249 -datadir = @datadir@
   7.250 -datarootdir = @datarootdir@
   7.251 -docdir = @docdir@
   7.252 -dvidir = @dvidir@
   7.253 -exec_prefix = @exec_prefix@
   7.254 -extra_dir = @extra_dir@
   7.255 -host = @host@
   7.256 -host_alias = @host_alias@
   7.257 -host_cpu = @host_cpu@
   7.258 -host_os = @host_os@
   7.259 -host_vendor = @host_vendor@
   7.260 -htmldir = @htmldir@
   7.261 -includedir = @includedir@
   7.262 -infodir = @infodir@
   7.263 -install_sh = @install_sh@
   7.264 -libdir = @libdir@
   7.265 -libexecdir = @libexecdir@
   7.266 -libm_machine_dir = @libm_machine_dir@
   7.267 -localedir = @localedir@
   7.268 -localstatedir = @localstatedir@
   7.269 -lpfx = @lpfx@
   7.270 -machine_dir = @machine_dir@
   7.271 -mandir = @mandir@
   7.272 -mkdir_p = @mkdir_p@
   7.273 -newlib_basedir = @newlib_basedir@
   7.274 -oext = @oext@
   7.275 -oldincludedir = @oldincludedir@
   7.276 -pdfdir = @pdfdir@
   7.277 -prefix = @prefix@
   7.278 -program_transform_name = @program_transform_name@
   7.279 -psdir = @psdir@
   7.280 -sbindir = @sbindir@
   7.281 -sharedstatedir = @sharedstatedir@
   7.282 -srcdir = @srcdir@
   7.283 -subdirs = @subdirs@
   7.284 -sys_dir = @sys_dir@
   7.285 -sysconfdir = @sysconfdir@
   7.286 -target_alias = @target_alias@
   7.287 -top_build_prefix = @top_build_prefix@
   7.288 -top_builddir = @top_builddir@
   7.289 -top_srcdir = @top_srcdir@
   7.290 -AUTOMAKE_OPTIONS = cygnus
   7.291 -INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
   7.292 -@HAVE_STDIO64_DIR_TRUE@STDIO64_SOURCES = \
   7.293 -@HAVE_STDIO64_DIR_TRUE@	fstat64r.c \
   7.294 -@HAVE_STDIO64_DIR_TRUE@	lseek64r.c \
   7.295 -@HAVE_STDIO64_DIR_TRUE@	stat64r.c \
   7.296 -@HAVE_STDIO64_DIR_TRUE@	open64r.c
   7.297 -
   7.298 -@HAVE_STDIO64_DIR_TRUE@STDIO64_DEFS = \
   7.299 -@HAVE_STDIO64_DIR_TRUE@	fstat64r.def \
   7.300 -@HAVE_STDIO64_DIR_TRUE@	lseek64r.def \
   7.301 -@HAVE_STDIO64_DIR_TRUE@	stat64r.def \
   7.302 -@HAVE_STDIO64_DIR_TRUE@	open64r.def
   7.303 -
   7.304 -ELIX_2_SOURCES = $(STDIO64_SOURCES)
   7.305 -ELIX_3_SOURCES = execr.c
   7.306 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@ELIX_SOURCES = $(ELIX_2_SOURCES) $(ELIX_3_SOURCES)
   7.307 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@ELIX_SOURCES = $(ELIX_2_SOURCES)
   7.308 -@ELIX_LEVEL_1_TRUE@ELIX_SOURCES = 
   7.309 -GENERAL_SOURCES = \
   7.310 -	closer.c \
   7.311 -	reent.c \
   7.312 -	impure.c \
   7.313 -	fcntlr.c \
   7.314 -	fstatr.c \
   7.315 -	getreent.c \
   7.316 -	gettimeofdayr.c \
   7.317 -	isattyr.c \
   7.318 -	linkr.c \
   7.319 -	lseekr.c \
   7.320 -	mkdirr.c \
   7.321 -	openr.c \
   7.322 -	readr.c \
   7.323 -	renamer.c \
   7.324 -	signalr.c \
   7.325 -	signgam.c \
   7.326 -	sbrkr.c \
   7.327 -	statr.c \
   7.328 -	timesr.c \
   7.329 -	unlinkr.c \
   7.330 -	writer.c
   7.331 -
   7.332 -libreent_la_LDFLAGS = -Xcompiler -nostdlib
   7.333 -@USE_LIBTOOL_TRUE@noinst_LTLIBRARIES = libreent.la
   7.334 -@USE_LIBTOOL_TRUE@libreent_la_SOURCES = $(GENERAL_SOURCES) $(ELIX_SOURCES)
   7.335 -@USE_LIBTOOL_FALSE@noinst_DATA = 
   7.336 -@USE_LIBTOOL_TRUE@noinst_DATA = objectlist.awk.in
   7.337 -@USE_LIBTOOL_FALSE@noinst_LIBRARIES = lib.a
   7.338 -@USE_LIBTOOL_FALSE@lib_a_SOURCES = $(GENERAL_SOURCES) $(ELIX_SOURCES)
   7.339 -@USE_LIBTOOL_FALSE@lib_a_CFLAGS = $(AM_CFLAGS)
   7.340 -
   7.341 -#
   7.342 -# documentation rules
   7.343 -#
   7.344 -SUFFIXES = .def .xml
   7.345 -CHEW = ${top_builddir}/../doc/makedoc -f $(top_srcdir)/../doc/doc.str
   7.346 -DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py
   7.347 -DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml)
   7.348 -DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml)
   7.349 -CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES)
   7.350 -CHEWOUT_FILES = \
   7.351 -	closer.def \
   7.352 -	reent.def \
   7.353 -	execr.def \
   7.354 -	fcntlr.def \
   7.355 -	fstatr.def \
   7.356 -	gettimeofdayr.def \
   7.357 -	linkr.def \
   7.358 -	lseekr.def \
   7.359 -	mkdirr.def \
   7.360 -	openr.def \
   7.361 -	readr.def \
   7.362 -	renamer.def \
   7.363 -	signalr.def \
   7.364 -	sbrkr.def \
   7.365 -	statr.def \
   7.366 -	timesr.def \
   7.367 -	unlinkr.def \
   7.368 -	$(STDIO64_DEFS) \
   7.369 -	writer.def
   7.370 -
   7.371 -CHAPTERS = reent.tex
   7.372 -all: all-am
   7.373 -
   7.374 -.SUFFIXES:
   7.375 -.SUFFIXES: .def .xml .c .lo .o .obj
   7.376 -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(am__configure_deps)
   7.377 -	@for dep in $?; do \
   7.378 -	  case '$(am__configure_deps)' in \
   7.379 -	    *$$dep*) \
   7.380 -	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
   7.381 -	        && { if test -f $@; then exit 0; else break; fi; }; \
   7.382 -	      exit 1;; \
   7.383 -	  esac; \
   7.384 -	done; \
   7.385 -	echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus reent/Makefile'; \
   7.386 -	$(am__cd) $(top_srcdir) && \
   7.387 -	  $(AUTOMAKE) --cygnus reent/Makefile
   7.388 -.PRECIOUS: Makefile
   7.389 -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
   7.390 -	@case '$?' in \
   7.391 -	  *config.status*) \
   7.392 -	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
   7.393 -	  *) \
   7.394 -	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
   7.395 -	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
   7.396 -	esac;
   7.397 -$(srcdir)/../../Makefile.shared:
   7.398 -
   7.399 -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
   7.400 -	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   7.401 -
   7.402 -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
   7.403 -	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   7.404 -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
   7.405 -	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   7.406 -$(am__aclocal_m4_deps):
   7.407 -
   7.408 -clean-noinstLIBRARIES:
   7.409 -	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
   7.410 -lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) $(EXTRA_lib_a_DEPENDENCIES) 
   7.411 -	-rm -f lib.a
   7.412 -	$(lib_a_AR) lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD)
   7.413 -	$(RANLIB) lib.a
   7.414 -
   7.415 -clean-noinstLTLIBRARIES:
   7.416 -	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
   7.417 -	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
   7.418 -	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
   7.419 -	  test "$$dir" != "$$p" || dir=.; \
   7.420 -	  echo "rm -f \"$${dir}/so_locations\""; \
   7.421 -	  rm -f "$${dir}/so_locations"; \
   7.422 -	done
   7.423 -libreent.la: $(libreent_la_OBJECTS) $(libreent_la_DEPENDENCIES) $(EXTRA_libreent_la_DEPENDENCIES) 
   7.424 -	$(libreent_la_LINK) $(am_libreent_la_rpath) $(libreent_la_OBJECTS) $(libreent_la_LIBADD) $(LIBS)
   7.425 -
   7.426 -mostlyclean-compile:
   7.427 -	-rm -f *.$(OBJEXT)
   7.428 -
   7.429 -distclean-compile:
   7.430 -	-rm -f *.tab.c
   7.431 -
   7.432 -.c.o:
   7.433 -	$(COMPILE) -c $<
   7.434 -
   7.435 -.c.obj:
   7.436 -	$(COMPILE) -c `$(CYGPATH_W) '$<'`
   7.437 -
   7.438 -.c.lo:
   7.439 -	$(LTCOMPILE) -c -o $@ $<
   7.440 -
   7.441 -lib_a-closer.o: closer.c
   7.442 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-closer.o `test -f 'closer.c' || echo '$(srcdir)/'`closer.c
   7.443 -
   7.444 -lib_a-closer.obj: closer.c
   7.445 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-closer.obj `if test -f 'closer.c'; then $(CYGPATH_W) 'closer.c'; else $(CYGPATH_W) '$(srcdir)/closer.c'; fi`
   7.446 -
   7.447 -lib_a-reent.o: reent.c
   7.448 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-reent.o `test -f 'reent.c' || echo '$(srcdir)/'`reent.c
   7.449 -
   7.450 -lib_a-reent.obj: reent.c
   7.451 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-reent.obj `if test -f 'reent.c'; then $(CYGPATH_W) 'reent.c'; else $(CYGPATH_W) '$(srcdir)/reent.c'; fi`
   7.452 -
   7.453 -lib_a-impure.o: impure.c
   7.454 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-impure.o `test -f 'impure.c' || echo '$(srcdir)/'`impure.c
   7.455 -
   7.456 -lib_a-impure.obj: impure.c
   7.457 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-impure.obj `if test -f 'impure.c'; then $(CYGPATH_W) 'impure.c'; else $(CYGPATH_W) '$(srcdir)/impure.c'; fi`
   7.458 -
   7.459 -lib_a-fcntlr.o: fcntlr.c
   7.460 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fcntlr.o `test -f 'fcntlr.c' || echo '$(srcdir)/'`fcntlr.c
   7.461 -
   7.462 -lib_a-fcntlr.obj: fcntlr.c
   7.463 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fcntlr.obj `if test -f 'fcntlr.c'; then $(CYGPATH_W) 'fcntlr.c'; else $(CYGPATH_W) '$(srcdir)/fcntlr.c'; fi`
   7.464 -
   7.465 -lib_a-fstatr.o: fstatr.c
   7.466 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fstatr.o `test -f 'fstatr.c' || echo '$(srcdir)/'`fstatr.c
   7.467 -
   7.468 -lib_a-fstatr.obj: fstatr.c
   7.469 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fstatr.obj `if test -f 'fstatr.c'; then $(CYGPATH_W) 'fstatr.c'; else $(CYGPATH_W) '$(srcdir)/fstatr.c'; fi`
   7.470 -
   7.471 -lib_a-getreent.o: getreent.c
   7.472 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-getreent.o `test -f 'getreent.c' || echo '$(srcdir)/'`getreent.c
   7.473 -
   7.474 -lib_a-getreent.obj: getreent.c
   7.475 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-getreent.obj `if test -f 'getreent.c'; then $(CYGPATH_W) 'getreent.c'; else $(CYGPATH_W) '$(srcdir)/getreent.c'; fi`
   7.476 -
   7.477 -lib_a-gettimeofdayr.o: gettimeofdayr.c
   7.478 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-gettimeofdayr.o `test -f 'gettimeofdayr.c' || echo '$(srcdir)/'`gettimeofdayr.c
   7.479 -
   7.480 -lib_a-gettimeofdayr.obj: gettimeofdayr.c
   7.481 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-gettimeofdayr.obj `if test -f 'gettimeofdayr.c'; then $(CYGPATH_W) 'gettimeofdayr.c'; else $(CYGPATH_W) '$(srcdir)/gettimeofdayr.c'; fi`
   7.482 -
   7.483 -lib_a-isattyr.o: isattyr.c
   7.484 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-isattyr.o `test -f 'isattyr.c' || echo '$(srcdir)/'`isattyr.c
   7.485 -
   7.486 -lib_a-isattyr.obj: isattyr.c
   7.487 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-isattyr.obj `if test -f 'isattyr.c'; then $(CYGPATH_W) 'isattyr.c'; else $(CYGPATH_W) '$(srcdir)/isattyr.c'; fi`
   7.488 -
   7.489 -lib_a-linkr.o: linkr.c
   7.490 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-linkr.o `test -f 'linkr.c' || echo '$(srcdir)/'`linkr.c
   7.491 -
   7.492 -lib_a-linkr.obj: linkr.c
   7.493 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-linkr.obj `if test -f 'linkr.c'; then $(CYGPATH_W) 'linkr.c'; else $(CYGPATH_W) '$(srcdir)/linkr.c'; fi`
   7.494 -
   7.495 -lib_a-lseekr.o: lseekr.c
   7.496 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-lseekr.o `test -f 'lseekr.c' || echo '$(srcdir)/'`lseekr.c
   7.497 -
   7.498 -lib_a-lseekr.obj: lseekr.c
   7.499 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-lseekr.obj `if test -f 'lseekr.c'; then $(CYGPATH_W) 'lseekr.c'; else $(CYGPATH_W) '$(srcdir)/lseekr.c'; fi`
   7.500 -
   7.501 -lib_a-mkdirr.o: mkdirr.c
   7.502 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-mkdirr.o `test -f 'mkdirr.c' || echo '$(srcdir)/'`mkdirr.c
   7.503 -
   7.504 -lib_a-mkdirr.obj: mkdirr.c
   7.505 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-mkdirr.obj `if test -f 'mkdirr.c'; then $(CYGPATH_W) 'mkdirr.c'; else $(CYGPATH_W) '$(srcdir)/mkdirr.c'; fi`
   7.506 -
   7.507 -lib_a-openr.o: openr.c
   7.508 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-openr.o `test -f 'openr.c' || echo '$(srcdir)/'`openr.c
   7.509 -
   7.510 -lib_a-openr.obj: openr.c
   7.511 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-openr.obj `if test -f 'openr.c'; then $(CYGPATH_W) 'openr.c'; else $(CYGPATH_W) '$(srcdir)/openr.c'; fi`
   7.512 -
   7.513 -lib_a-readr.o: readr.c
   7.514 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-readr.o `test -f 'readr.c' || echo '$(srcdir)/'`readr.c
   7.515 -
   7.516 -lib_a-readr.obj: readr.c
   7.517 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-readr.obj `if test -f 'readr.c'; then $(CYGPATH_W) 'readr.c'; else $(CYGPATH_W) '$(srcdir)/readr.c'; fi`
   7.518 -
   7.519 -lib_a-renamer.o: renamer.c
   7.520 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-renamer.o `test -f 'renamer.c' || echo '$(srcdir)/'`renamer.c
   7.521 -
   7.522 -lib_a-renamer.obj: renamer.c
   7.523 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-renamer.obj `if test -f 'renamer.c'; then $(CYGPATH_W) 'renamer.c'; else $(CYGPATH_W) '$(srcdir)/renamer.c'; fi`
   7.524 -
   7.525 -lib_a-signalr.o: signalr.c
   7.526 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-signalr.o `test -f 'signalr.c' || echo '$(srcdir)/'`signalr.c
   7.527 -
   7.528 -lib_a-signalr.obj: signalr.c
   7.529 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-signalr.obj `if test -f 'signalr.c'; then $(CYGPATH_W) 'signalr.c'; else $(CYGPATH_W) '$(srcdir)/signalr.c'; fi`
   7.530 -
   7.531 -lib_a-signgam.o: signgam.c
   7.532 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-signgam.o `test -f 'signgam.c' || echo '$(srcdir)/'`signgam.c
   7.533 -
   7.534 -lib_a-signgam.obj: signgam.c
   7.535 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-signgam.obj `if test -f 'signgam.c'; then $(CYGPATH_W) 'signgam.c'; else $(CYGPATH_W) '$(srcdir)/signgam.c'; fi`
   7.536 -
   7.537 -lib_a-sbrkr.o: sbrkr.c
   7.538 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sbrkr.o `test -f 'sbrkr.c' || echo '$(srcdir)/'`sbrkr.c
   7.539 -
   7.540 -lib_a-sbrkr.obj: sbrkr.c
   7.541 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sbrkr.obj `if test -f 'sbrkr.c'; then $(CYGPATH_W) 'sbrkr.c'; else $(CYGPATH_W) '$(srcdir)/sbrkr.c'; fi`
   7.542 -
   7.543 -lib_a-statr.o: statr.c
   7.544 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-statr.o `test -f 'statr.c' || echo '$(srcdir)/'`statr.c
   7.545 -
   7.546 -lib_a-statr.obj: statr.c
   7.547 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-statr.obj `if test -f 'statr.c'; then $(CYGPATH_W) 'statr.c'; else $(CYGPATH_W) '$(srcdir)/statr.c'; fi`
   7.548 -
   7.549 -lib_a-timesr.o: timesr.c
   7.550 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-timesr.o `test -f 'timesr.c' || echo '$(srcdir)/'`timesr.c
   7.551 -
   7.552 -lib_a-timesr.obj: timesr.c
   7.553 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-timesr.obj `if test -f 'timesr.c'; then $(CYGPATH_W) 'timesr.c'; else $(CYGPATH_W) '$(srcdir)/timesr.c'; fi`
   7.554 -
   7.555 -lib_a-unlinkr.o: unlinkr.c
   7.556 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-unlinkr.o `test -f 'unlinkr.c' || echo '$(srcdir)/'`unlinkr.c
   7.557 -
   7.558 -lib_a-unlinkr.obj: unlinkr.c
   7.559 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-unlinkr.obj `if test -f 'unlinkr.c'; then $(CYGPATH_W) 'unlinkr.c'; else $(CYGPATH_W) '$(srcdir)/unlinkr.c'; fi`
   7.560 -
   7.561 -lib_a-writer.o: writer.c
   7.562 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-writer.o `test -f 'writer.c' || echo '$(srcdir)/'`writer.c
   7.563 -
   7.564 -lib_a-writer.obj: writer.c
   7.565 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-writer.obj `if test -f 'writer.c'; then $(CYGPATH_W) 'writer.c'; else $(CYGPATH_W) '$(srcdir)/writer.c'; fi`
   7.566 -
   7.567 -lib_a-fstat64r.o: fstat64r.c
   7.568 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fstat64r.o `test -f 'fstat64r.c' || echo '$(srcdir)/'`fstat64r.c
   7.569 -
   7.570 -lib_a-fstat64r.obj: fstat64r.c
   7.571 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fstat64r.obj `if test -f 'fstat64r.c'; then $(CYGPATH_W) 'fstat64r.c'; else $(CYGPATH_W) '$(srcdir)/fstat64r.c'; fi`
   7.572 -
   7.573 -lib_a-lseek64r.o: lseek64r.c
   7.574 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-lseek64r.o `test -f 'lseek64r.c' || echo '$(srcdir)/'`lseek64r.c
   7.575 -
   7.576 -lib_a-lseek64r.obj: lseek64r.c
   7.577 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-lseek64r.obj `if test -f 'lseek64r.c'; then $(CYGPATH_W) 'lseek64r.c'; else $(CYGPATH_W) '$(srcdir)/lseek64r.c'; fi`
   7.578 -
   7.579 -lib_a-stat64r.o: stat64r.c
   7.580 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-stat64r.o `test -f 'stat64r.c' || echo '$(srcdir)/'`stat64r.c
   7.581 -
   7.582 -lib_a-stat64r.obj: stat64r.c
   7.583 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-stat64r.obj `if test -f 'stat64r.c'; then $(CYGPATH_W) 'stat64r.c'; else $(CYGPATH_W) '$(srcdir)/stat64r.c'; fi`
   7.584 -
   7.585 -lib_a-open64r.o: open64r.c
   7.586 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-open64r.o `test -f 'open64r.c' || echo '$(srcdir)/'`open64r.c
   7.587 -
   7.588 -lib_a-open64r.obj: open64r.c
   7.589 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-open64r.obj `if test -f 'open64r.c'; then $(CYGPATH_W) 'open64r.c'; else $(CYGPATH_W) '$(srcdir)/open64r.c'; fi`
   7.590 -
   7.591 -lib_a-execr.o: execr.c
   7.592 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-execr.o `test -f 'execr.c' || echo '$(srcdir)/'`execr.c
   7.593 -
   7.594 -lib_a-execr.obj: execr.c
   7.595 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-execr.obj `if test -f 'execr.c'; then $(CYGPATH_W) 'execr.c'; else $(CYGPATH_W) '$(srcdir)/execr.c'; fi`
   7.596 -
   7.597 -mostlyclean-libtool:
   7.598 -	-rm -f *.lo
   7.599 -
   7.600 -clean-libtool:
   7.601 -	-rm -rf .libs _libs
   7.602 -
   7.603 -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
   7.604 -	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
   7.605 -	unique=`for i in $$list; do \
   7.606 -	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   7.607 -	  done | \
   7.608 -	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
   7.609 -	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   7.610 -	mkid -fID $$unique
   7.611 -tags: TAGS
   7.612 -
   7.613 -TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
   7.614 -		$(TAGS_FILES) $(LISP)
   7.615 -	set x; \
   7.616 -	here=`pwd`; \
   7.617 -	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
   7.618 -	unique=`for i in $$list; do \
   7.619 -	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   7.620 -	  done | \
   7.621 -	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
   7.622 -	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   7.623 -	shift; \
   7.624 -	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
   7.625 -	  test -n "$$unique" || unique=$$empty_fix; \
   7.626 -	  if test $$# -gt 0; then \
   7.627 -	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
   7.628 -	      "$$@" $$unique; \
   7.629 -	  else \
   7.630 -	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
   7.631 -	      $$unique; \
   7.632 -	  fi; \
   7.633 -	fi
   7.634 -ctags: CTAGS
   7.635 -CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
   7.636 -		$(TAGS_FILES) $(LISP)
   7.637 -	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
   7.638 -	unique=`for i in $$list; do \
   7.639 -	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   7.640 -	  done | \
   7.641 -	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
   7.642 -	      END { if (nonempty) { for (i in files) print i; }; }'`; \
   7.643 -	test -z "$(CTAGS_ARGS)$$unique" \
   7.644 -	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
   7.645 -	     $$unique
   7.646 -
   7.647 -GTAGS:
   7.648 -	here=`$(am__cd) $(top_builddir) && pwd` \
   7.649 -	  && $(am__cd) $(top_srcdir) \
   7.650 -	  && gtags -i $(GTAGS_ARGS) "$$here"
   7.651 -
   7.652 -distclean-tags:
   7.653 -	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
   7.654 -check-am:
   7.655 -check: check-am
   7.656 -all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(DATA)
   7.657 -installdirs:
   7.658 -install: install-am
   7.659 -install-exec: install-exec-am
   7.660 -install-data: install-data-am
   7.661 -uninstall: uninstall-am
   7.662 -
   7.663 -install-am: all-am
   7.664 -	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
   7.665 -
   7.666 -installcheck: installcheck-am
   7.667 -install-strip:
   7.668 -	if test -z '$(STRIP)'; then \
   7.669 -	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
   7.670 -	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
   7.671 -	      install; \
   7.672 -	else \
   7.673 -	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
   7.674 -	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
   7.675 -	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
   7.676 -	fi
   7.677 -mostlyclean-generic:
   7.678 -
   7.679 -clean-generic:
   7.680 -	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
   7.681 -
   7.682 -distclean-generic:
   7.683 -	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
   7.684 -	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
   7.685 -
   7.686 -maintainer-clean-generic:
   7.687 -	@echo "This command is intended for maintainers to use"
   7.688 -	@echo "it deletes files that may require special tools to rebuild."
   7.689 -clean: clean-am
   7.690 -
   7.691 -clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
   7.692 -	clean-noinstLTLIBRARIES mostlyclean-am
   7.693 -
   7.694 -distclean: distclean-am
   7.695 -	-rm -f Makefile
   7.696 -distclean-am: clean-am distclean-compile distclean-generic \
   7.697 -	distclean-tags
   7.698 -
   7.699 -dvi: dvi-am
   7.700 -
   7.701 -dvi-am:
   7.702 -
   7.703 -html: html-am
   7.704 -
   7.705 -html-am:
   7.706 -
   7.707 -info: info-am
   7.708 -
   7.709 -info-am:
   7.710 -
   7.711 -install-data-am:
   7.712 -
   7.713 -install-dvi: install-dvi-am
   7.714 -
   7.715 -install-dvi-am:
   7.716 -
   7.717 -install-exec-am:
   7.718 -
   7.719 -install-html: install-html-am
   7.720 -
   7.721 -install-html-am:
   7.722 -
   7.723 -install-info: install-info-am
   7.724 -
   7.725 -install-info-am:
   7.726 -
   7.727 -install-man:
   7.728 -
   7.729 -install-pdf: install-pdf-am
   7.730 -
   7.731 -install-pdf-am:
   7.732 -
   7.733 -install-ps: install-ps-am
   7.734 -
   7.735 -install-ps-am:
   7.736 -
   7.737 -installcheck-am:
   7.738 -
   7.739 -maintainer-clean: maintainer-clean-am
   7.740 -	-rm -f Makefile
   7.741 -maintainer-clean-am: distclean-am maintainer-clean-generic
   7.742 -
   7.743 -mostlyclean: mostlyclean-am
   7.744 -
   7.745 -mostlyclean-am: mostlyclean-compile mostlyclean-generic \
   7.746 -	mostlyclean-libtool
   7.747 -
   7.748 -pdf: pdf-am
   7.749 -
   7.750 -pdf-am:
   7.751 -
   7.752 -ps: ps-am
   7.753 -
   7.754 -ps-am:
   7.755 -
   7.756 -uninstall-am:
   7.757 -
   7.758 -.MAKE: install-am install-strip
   7.759 -
   7.760 -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
   7.761 -	clean-libtool clean-noinstLIBRARIES clean-noinstLTLIBRARIES \
   7.762 -	ctags distclean distclean-compile distclean-generic \
   7.763 -	distclean-libtool distclean-tags dvi dvi-am html html-am info \
   7.764 -	info-am install install-am install-data install-data-am \
   7.765 -	install-dvi install-dvi-am install-exec install-exec-am \
   7.766 -	install-html install-html-am install-info install-info-am \
   7.767 -	install-man install-pdf install-pdf-am install-ps \
   7.768 -	install-ps-am install-strip installcheck installcheck-am \
   7.769 -	installdirs maintainer-clean maintainer-clean-generic \
   7.770 -	mostlyclean mostlyclean-compile mostlyclean-generic \
   7.771 -	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
   7.772 -	uninstall-am
   7.773 -
   7.774 -objectlist.awk.in: $(noinst_LTLIBRARIES)
   7.775 -	-rm -f objectlist.awk.in
   7.776 -	for i in `ls *.lo` ; \
   7.777 -	do \
   7.778 -	  echo $$i `pwd`/$$i >> objectlist.awk.in ; \
   7.779 -	done
   7.780 -
   7.781 -.c.def:
   7.782 -	$(CHEW) < $< > $*.def || ( rm $*.def && false )
   7.783 -	@touch stmp-def
   7.784 -
   7.785 -TARGETDOC ?= ../tmp.texi
   7.786 -
   7.787 -doc: $(CHEWOUT_FILES)
   7.788 -	for chapter in $(CHAPTERS) ; \
   7.789 -	do \
   7.790 -	  cat $(srcdir)/$$chapter >> $(TARGETDOC) ; \
   7.791 -	done
   7.792 -
   7.793 -.c.xml:
   7.794 -	$(DOCBOOK_CHEW) < $< > $*.xml || ( rm $*.xml && false )
   7.795 -	@touch stmp-xml
   7.796 -
   7.797 -docbook: $(DOCBOOK_OUT_FILES)
   7.798 -	for chapter in $(DOCBOOK_CHAPTERS) ; \
   7.799 -	do \
   7.800 -	  ${top_srcdir}/../doc/chapter-texi2docbook.py <$(srcdir)/$${chapter%.xml}.tex >../$$chapter ; \
   7.801 -	done
   7.802 -
   7.803 -$(lpfx)impure.$(oext): $(srcdir)/impure.c $(srcdir)/../include/sys/reent.h
   7.804 -
   7.805 -# Tell versions [3.59,3.63) of GNU make to not export all variables.
   7.806 -# Otherwise a system limit (for SysV at least) may be exceeded.
   7.807 -.NOEXPORT:
     8.1 --- a/libc/reent/closer.c	Sat Dec 07 00:44:56 2019 +0100
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,52 +0,0 @@
     8.4 -/* Reentrant version of close system call.  */
     8.5 -
     8.6 -#include <reent.h>
     8.7 -#include <unistd.h>
     8.8 -#include <_syslist.h>
     8.9 -
    8.10 -/* Some targets provides their own versions of this functions.  Those
    8.11 -   targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS.  */
    8.12 -
    8.13 -#ifdef _REENT_ONLY
    8.14 -#ifndef REENTRANT_SYSCALLS_PROVIDED
    8.15 -#define REENTRANT_SYSCALLS_PROVIDED
    8.16 -#endif
    8.17 -#endif
    8.18 -
    8.19 -#ifndef REENTRANT_SYSCALLS_PROVIDED
    8.20 -
    8.21 -/* We use the errno variable used by the system dependent layer.  */
    8.22 -#undef errno
    8.23 -extern int errno;
    8.24 -
    8.25 -/*
    8.26 -FUNCTION
    8.27 -	<<_close_r>>---Reentrant version of close
    8.28 -	
    8.29 -INDEX
    8.30 -	_close_r
    8.31 -
    8.32 -SYNOPSIS
    8.33 -	#include <reent.h>
    8.34 -	int _close_r(struct _reent *<[ptr]>, int <[fd]>);
    8.35 -
    8.36 -DESCRIPTION
    8.37 -	This is a reentrant version of <<close>>.  It
    8.38 -	takes a pointer to the global data block, which holds
    8.39 -	<<errno>>.
    8.40 -*/
    8.41 -
    8.42 -int
    8.43 -_close_r (ptr, fd)
    8.44 -     struct _reent *ptr;
    8.45 -     int fd;
    8.46 -{
    8.47 -  int ret;
    8.48 -
    8.49 -  errno = 0;
    8.50 -  if ((ret = _close (fd)) == -1 && errno != 0)
    8.51 -    ptr->_errno = errno;
    8.52 -  return ret;
    8.53 -}
    8.54 -
    8.55 -#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
     9.1 --- a/libc/reent/execr.c	Sat Dec 07 00:44:56 2019 +0100
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,125 +0,0 @@
     9.4 -/* Reentrant versions of execution system calls.  These
     9.5 -   implementations just call the usual system calls.  */
     9.6 -
     9.7 -#include <reent.h>
     9.8 -#include <unistd.h>
     9.9 -#include <sys/wait.h>
    9.10 -#include <_syslist.h>
    9.11 -
    9.12 -/* Some targets provides their own versions of these functions.  Those
    9.13 -   targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS.  */
    9.14 -
    9.15 -#ifdef _REENT_ONLY
    9.16 -#ifndef REENTRANT_SYSCALLS_PROVIDED
    9.17 -#define REENTRANT_SYSCALLS_PROVIDED
    9.18 -#endif
    9.19 -#endif
    9.20 -
    9.21 -/* If NO_EXEC is defined, we don't need these functions.  */
    9.22 -
    9.23 -#if defined (REENTRANT_SYSCALLS_PROVIDED) || defined (NO_EXEC)
    9.24 -
    9.25 -int _dummy_exec_syscalls = 1;
    9.26 -
    9.27 -#else
    9.28 -
    9.29 -/* We use the errno variable used by the system dependent layer.  */
    9.30 -#undef errno
    9.31 -extern int errno;
    9.32 -
    9.33 -/*
    9.34 -FUNCTION
    9.35 -	<<_execve_r>>---Reentrant version of execve	
    9.36 -INDEX
    9.37 -	_execve_r
    9.38 -
    9.39 -SYNOPSIS
    9.40 -	#include <reent.h>
    9.41 -	int _execve_r(struct _reent *<[ptr]>, const char *<[name]>,
    9.42 -                      char *const <[argv]>[], char *const <[env]>[]);
    9.43 -
    9.44 -DESCRIPTION
    9.45 -	This is a reentrant version of <<execve>>.  It
    9.46 -	takes a pointer to the global data block, which holds
    9.47 -	<<errno>>.
    9.48 -*/
    9.49 -
    9.50 -int
    9.51 -_execve_r (struct _reent *ptr,
    9.52 -     const char *name,
    9.53 -     char *const argv[],
    9.54 -     char *const env[])
    9.55 -{
    9.56 -  int ret;
    9.57 -
    9.58 -  errno = 0;
    9.59 -  if ((ret = _execve (name, argv, env)) == -1 && errno != 0)
    9.60 -    ptr->_errno = errno;
    9.61 -  return ret;
    9.62 -}
    9.63 -
    9.64 -
    9.65 -/*
    9.66 -NEWPAGE
    9.67 -FUNCTION
    9.68 -	<<_fork_r>>---Reentrant version of fork
    9.69 -	
    9.70 -INDEX
    9.71 -	_fork_r
    9.72 -
    9.73 -SYNOPSIS
    9.74 -	#include <reent.h>
    9.75 -	int _fork_r(struct _reent *<[ptr]>);
    9.76 -
    9.77 -DESCRIPTION
    9.78 -	This is a reentrant version of <<fork>>.  It
    9.79 -	takes a pointer to the global data block, which holds
    9.80 -	<<errno>>.
    9.81 -*/
    9.82 -
    9.83 -#ifndef NO_FORK
    9.84 -
    9.85 -int
    9.86 -_fork_r (struct _reent *ptr)
    9.87 -{
    9.88 -  int ret;
    9.89 -
    9.90 -  errno = 0;
    9.91 -  if ((ret = _fork ()) == -1 && errno != 0)
    9.92 -    ptr->_errno = errno;
    9.93 -  return ret;
    9.94 -}
    9.95 -
    9.96 -#endif
    9.97 -
    9.98 -/*
    9.99 -NEWPAGE
   9.100 -FUNCTION
   9.101 -	<<_wait_r>>---Reentrant version of wait
   9.102 -	
   9.103 -INDEX
   9.104 -	_wait_r
   9.105 -
   9.106 -SYNOPSIS
   9.107 -	#include <reent.h>
   9.108 -	int _wait_r(struct _reent *<[ptr]>, int *<[status]>);
   9.109 -
   9.110 -DESCRIPTION
   9.111 -	This is a reentrant version of <<wait>>.  It
   9.112 -	takes a pointer to the global data block, which holds
   9.113 -	<<errno>>.
   9.114 -*/
   9.115 -
   9.116 -int
   9.117 -_wait_r (struct _reent *ptr,
   9.118 -     int *status)
   9.119 -{
   9.120 -  int ret;
   9.121 -
   9.122 -  errno = 0;
   9.123 -  if ((ret = _wait (status)) == -1 && errno != 0)
   9.124 -    ptr->_errno = errno;
   9.125 -  return ret;
   9.126 -}
   9.127 -
   9.128 -#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
    10.1 --- a/libc/reent/fcntlr.c	Sat Dec 07 00:44:56 2019 +0100
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,56 +0,0 @@
    10.4 -/* Reentrant versions of fcntl system call.  This implementation just
    10.5 -   calls the fcntl system call.  */
    10.6 -
    10.7 -#include <reent.h>
    10.8 -#include <fcntl.h>
    10.9 -#include <sys/stat.h>
   10.10 -#include <_syslist.h>
   10.11 -
   10.12 -/* Some targets provides their own versions of these functions.  Those
   10.13 -   targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS.  */
   10.14 -
   10.15 -#ifdef _REENT_ONLY
   10.16 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   10.17 -#define REENTRANT_SYSCALLS_PROVIDED
   10.18 -#endif
   10.19 -#endif
   10.20 -
   10.21 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   10.22 -
   10.23 -/* We use the errno variable used by the system dependent layer.  */
   10.24 -#undef errno
   10.25 -extern int errno;
   10.26 -
   10.27 -/*
   10.28 -FUNCTION
   10.29 -	<<_fcntl_r>>---Reentrant version of fcntl
   10.30 -	
   10.31 -INDEX
   10.32 -	_fcntl_r
   10.33 -
   10.34 -SYNOPSIS
   10.35 -	#include <reent.h>
   10.36 -	int _fcntl_r(struct _reent *<[ptr]>,
   10.37 -		     int <[fd]>, int <[cmd]>, <[arg]>);
   10.38 -
   10.39 -DESCRIPTION
   10.40 -	This is a reentrant version of <<fcntl>>.  It
   10.41 -	takes a pointer to the global data block, which holds
   10.42 -	<<errno>>.
   10.43 -*/
   10.44 -
   10.45 -int
   10.46 -_fcntl_r (struct _reent *ptr,
   10.47 -     int fd,
   10.48 -     int cmd,
   10.49 -     int arg)
   10.50 -{
   10.51 -  int ret;
   10.52 -
   10.53 -  errno = 0;
   10.54 -  if ((ret = _fcntl (fd, cmd, arg)) == -1 && errno != 0)
   10.55 -    ptr->_errno = errno;
   10.56 -  return ret;
   10.57 -}
   10.58 -
   10.59 -#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
    11.1 --- a/libc/reent/fstat64r.c	Sat Dec 07 00:44:56 2019 +0100
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,64 +0,0 @@
    11.4 -/* Reentrant versions of fstat system call.  This implementation just
    11.5 -   calls the fstat system call.  */
    11.6 -
    11.7 -#include <reent.h>
    11.8 -#include <unistd.h>
    11.9 -#include <sys/stat.h>
   11.10 -#include <_syslist.h>
   11.11 -
   11.12 -#ifdef __LARGE64_FILES
   11.13 -
   11.14 -/* Some targets provides their own versions of these functions.  Those
   11.15 -   targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS.  */
   11.16 -
   11.17 -#ifdef _REENT_ONLY
   11.18 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   11.19 -#define REENTRANT_SYSCALLS_PROVIDED
   11.20 -#endif
   11.21 -#endif
   11.22 -
   11.23 -#ifdef REENTRANT_SYSCALLS_PROVIDED
   11.24 -
   11.25 -int _dummy_fstat_syscalls = 1;
   11.26 -
   11.27 -#else
   11.28 -
   11.29 -/* We use the errno variable used by the system dependent layer.  */
   11.30 -#undef errno
   11.31 -extern int errno;
   11.32 -
   11.33 -/*
   11.34 -FUNCTION
   11.35 -	<<_fstat64_r>>---Reentrant version of fstat64
   11.36 -	
   11.37 -INDEX
   11.38 -	_fstat64_r
   11.39 -
   11.40 -SYNOPSIS
   11.41 -	#include <reent.h>
   11.42 -	int _fstat64_r(struct _reent *<[ptr]>,
   11.43 -		       int <[fd]>, struct stat64 *<[pstat]>);
   11.44 -
   11.45 -DESCRIPTION
   11.46 -	This is a reentrant version of <<fstat64>>.  It
   11.47 -	takes a pointer to the global data block, which holds
   11.48 -	<<errno>>.  This function is only enabled on systems
   11.49 -	that define __LARGE64_FILES.
   11.50 -*/
   11.51 -
   11.52 -int
   11.53 -_fstat64_r (struct _reent *ptr,
   11.54 -     int fd,
   11.55 -     struct stat64 *pstat)
   11.56 -{
   11.57 -  int ret;
   11.58 -
   11.59 -  errno = 0;
   11.60 -  if ((ret = _fstat64 (fd, pstat)) == -1 && errno != 0)
   11.61 -    ptr->_errno = errno;
   11.62 -  return ret;
   11.63 -}
   11.64 -
   11.65 -#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
   11.66 -
   11.67 -#endif /* __LARGE64_FILES */
    12.1 --- a/libc/reent/fstatr.c	Sat Dec 07 00:44:56 2019 +0100
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,60 +0,0 @@
    12.4 -/* Reentrant versions of fstat system call.  This implementation just
    12.5 -   calls the fstat system call.  */
    12.6 -
    12.7 -#include <reent.h>
    12.8 -#include <unistd.h>
    12.9 -#include <sys/stat.h>
   12.10 -#include <_syslist.h>
   12.11 -
   12.12 -/* Some targets provides their own versions of these functions.  Those
   12.13 -   targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS.  */
   12.14 -
   12.15 -#ifdef _REENT_ONLY
   12.16 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   12.17 -#define REENTRANT_SYSCALLS_PROVIDED
   12.18 -#endif
   12.19 -#endif
   12.20 -
   12.21 -#ifdef REENTRANT_SYSCALLS_PROVIDED
   12.22 -
   12.23 -int _dummy_fstat_syscalls = 1;
   12.24 -
   12.25 -#else
   12.26 -
   12.27 -/* We use the errno variable used by the system dependent layer.  */
   12.28 -#undef errno
   12.29 -extern int errno;
   12.30 -
   12.31 -/*
   12.32 -FUNCTION
   12.33 -	<<_fstat_r>>---Reentrant version of fstat
   12.34 -	
   12.35 -INDEX
   12.36 -	_fstat_r
   12.37 -
   12.38 -SYNOPSIS
   12.39 -	#include <reent.h>
   12.40 -	int _fstat_r(struct _reent *<[ptr]>,
   12.41 -		     int <[fd]>, struct stat *<[pstat]>);
   12.42 -
   12.43 -DESCRIPTION
   12.44 -	This is a reentrant version of <<fstat>>.  It
   12.45 -	takes a pointer to the global data block, which holds
   12.46 -	<<errno>>.
   12.47 -*/
   12.48 -
   12.49 -int
   12.50 -_fstat_r (ptr, fd, pstat)
   12.51 -     struct _reent *ptr;
   12.52 -     int fd;
   12.53 -     struct stat *pstat;
   12.54 -{
   12.55 -  int ret;
   12.56 -
   12.57 -  errno = 0;
   12.58 -  if ((ret = _fstat (fd, pstat)) == -1 && errno != 0)
   12.59 -    ptr->_errno = errno;
   12.60 -  return ret;
   12.61 -}
   12.62 -
   12.63 -#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
    13.1 --- a/libc/reent/getreent.c	Sat Dec 07 00:44:56 2019 +0100
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,22 +0,0 @@
    13.4 -/* default reentrant pointer when multithread enabled */
    13.5 -
    13.6 -#ifdef GETREENT_PROVIDED
    13.7 -
    13.8 -int _dummy_getreent;
    13.9 -
   13.10 -#else
   13.11 -
   13.12 -#include <_ansi.h>
   13.13 -#include <reent.h>
   13.14 -
   13.15 -#ifdef __getreent
   13.16 -#undef __getreent
   13.17 -#endif
   13.18 -
   13.19 -struct _reent *
   13.20 -__getreent (void)
   13.21 -{
   13.22 -  return _impure_ptr;
   13.23 -}
   13.24 -
   13.25 -#endif
    14.1 --- a/libc/reent/gettimeofdayr.c	Sat Dec 07 00:44:56 2019 +0100
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,67 +0,0 @@
    14.4 -/* Reentrant version of gettimeofday system call
    14.5 -   This implementation just calls the times/gettimeofday system calls.
    14.6 -   Gettimeofday may not be available on all targets.  It's presence
    14.7 -   here is dubious.  Consider it for internal use only.  */
    14.8 -
    14.9 -#include <reent.h>
   14.10 -#include <time.h>
   14.11 -#include <sys/time.h>
   14.12 -#include <sys/times.h>
   14.13 -#include <_syslist.h>
   14.14 -
   14.15 -/* Some targets provides their own versions of these functions.  Those
   14.16 -   targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS.  */
   14.17 -
   14.18 -#ifdef _REENT_ONLY
   14.19 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   14.20 -#define REENTRANT_SYSCALLS_PROVIDED
   14.21 -#endif
   14.22 -#endif
   14.23 -
   14.24 -#ifdef REENTRANT_SYSCALLS_PROVIDED
   14.25 -
   14.26 -int _dummy_gettimeofday_syscalls = 1;
   14.27 -
   14.28 -#else
   14.29 -
   14.30 -/* We use the errno variable used by the system dependent layer.  */
   14.31 -#undef errno
   14.32 -extern int errno;
   14.33 -
   14.34 -/*
   14.35 -FUNCTION
   14.36 -	<<_gettimeofday_r>>---Reentrant version of gettimeofday
   14.37 -
   14.38 -INDEX
   14.39 -	_gettimeofday_r
   14.40 -
   14.41 -SYNOPSIS
   14.42 -	#include <reent.h>
   14.43 -	#include <time.h>
   14.44 -	int _gettimeofday_r(struct _reent *<[ptr]>,
   14.45 -		struct timeval *<[ptimeval]>,
   14.46 -		void *<[ptimezone]>);
   14.47 -
   14.48 -DESCRIPTION
   14.49 -	This is a reentrant version of <<gettimeofday>>.  It
   14.50 -	takes a pointer to the global data block, which holds
   14.51 -	<<errno>>.
   14.52 -
   14.53 -	This function is only available for a few targets.
   14.54 -	Check libc.a to see if its available on yours.
   14.55 -*/
   14.56 -
   14.57 -int
   14.58 -_gettimeofday_r (struct _reent *ptr,
   14.59 -     struct timeval *ptimeval,
   14.60 -     void *ptimezone)
   14.61 -{
   14.62 -  int ret;
   14.63 -
   14.64 -  errno = 0;
   14.65 -  if ((ret = _gettimeofday (ptimeval, ptimezone)) == -1 && errno != 0)
   14.66 -    ptr->_errno = errno;
   14.67 -  return ret;
   14.68 -}
   14.69 -
   14.70 -#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
    15.1 --- a/libc/reent/impure.c	Sat Dec 07 00:44:56 2019 +0100
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,30 +0,0 @@
    15.4 -#include <reent.h>
    15.5 -
    15.6 -/* Note that there is a copy of this in sys/reent.h.  */
    15.7 -#ifndef __ATTRIBUTE_IMPURE_PTR__
    15.8 -#define __ATTRIBUTE_IMPURE_PTR__
    15.9 -#endif
   15.10 -
   15.11 -#ifndef __ATTRIBUTE_IMPURE_DATA__
   15.12 -#define __ATTRIBUTE_IMPURE_DATA__
   15.13 -#endif
   15.14 -
   15.15 -/* Redeclare these symbols locally as weak so that the file containing
   15.16 -   their definitions (along with a lot of other stuff) isn't sucked in
   15.17 -   unless they are actually used by other compilation units.  This is
   15.18 -   important to reduce image size for targets with very small amounts
   15.19 -   of memory.  */
   15.20 -#ifdef _REENT_SMALL
   15.21 -extern const struct __sFILE_fake __sf_fake_stdin _ATTRIBUTE ((weak));
   15.22 -extern const struct __sFILE_fake __sf_fake_stdout _ATTRIBUTE ((weak));
   15.23 -extern const struct __sFILE_fake __sf_fake_stderr _ATTRIBUTE ((weak));
   15.24 -#endif
   15.25 -
   15.26 -static struct _reent __ATTRIBUTE_IMPURE_DATA__ impure_data = _REENT_INIT (impure_data);
   15.27 -#ifdef __CYGWIN__
   15.28 -extern struct _reent reent_data __attribute__ ((alias("impure_data")));
   15.29 -#endif
   15.30 -struct _reent *__ATTRIBUTE_IMPURE_PTR__ _impure_ptr = &impure_data;
   15.31 -// PAUL: https://sourceware.org/ml/newlib/2014/msg00512.html
   15.32 -struct _reent *__ATTRIBUTE_IMPURE_PTR__ _global_impure_ptr = &impure_data;
   15.33 -//struct _reent *const __ATTRIBUTE_IMPURE_PTR__ _global_impure_ptr = &impure_data;
    16.1 --- a/libc/reent/isattyr.c	Sat Dec 07 00:44:56 2019 +0100
    16.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.3 @@ -1,57 +0,0 @@
    16.4 -/* Reentrant versions of isatty system call.  */
    16.5 -
    16.6 -#include <reent.h>
    16.7 -#include <unistd.h>
    16.8 -#include <_syslist.h>
    16.9 -
   16.10 -/* Some targets provides their own versions of these functions.  Those
   16.11 -   targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS.  */
   16.12 -
   16.13 -#ifdef _REENT_ONLY
   16.14 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   16.15 -#define REENTRANT_SYSCALLS_PROVIDED
   16.16 -#endif
   16.17 -#endif
   16.18 -
   16.19 -#ifdef REENTRANT_SYSCALLS_PROVIDED
   16.20 -
   16.21 -int _dummy_isatty_syscalls = 1;
   16.22 -
   16.23 -#else
   16.24 -
   16.25 -/* We use the errno variable used by the system dependent layer.  */
   16.26 -#undef errno
   16.27 -extern int errno;
   16.28 -
   16.29 -/*
   16.30 -FUNCTION
   16.31 -	<<_isatty_r>>---Reentrant version of isatty
   16.32 -	
   16.33 -INDEX
   16.34 -	_isatty_r
   16.35 -
   16.36 -SYNOPSIS
   16.37 -	#include <reent.h>
   16.38 -	int _isatty_r(struct _reent *<[ptr]>,
   16.39 -		     int <[fd]>);
   16.40 -
   16.41 -DESCRIPTION
   16.42 -	This is a reentrant version of <<isatty>>.  It
   16.43 -	takes a pointer to the global data block, which holds
   16.44 -	<<errno>>.
   16.45 -*/
   16.46 -
   16.47 -int
   16.48 -_isatty_r (ptr, fd)
   16.49 -     struct _reent *ptr;
   16.50 -     int fd;
   16.51 -{
   16.52 -  int ret;
   16.53 -
   16.54 -  errno = 0;
   16.55 -  if ((ret = _isatty (fd)) == -1 && errno != 0)
   16.56 -    ptr->_errno = errno;
   16.57 -  return ret;
   16.58 -}
   16.59 -
   16.60 -#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
    17.1 --- a/libc/reent/linkr.c	Sat Dec 07 00:44:56 2019 +0100
    17.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.3 @@ -1,54 +0,0 @@
    17.4 -/* Reentrant versions of file system calls.  These implementations
    17.5 -   just call the usual system calls.  */
    17.6 -
    17.7 -#include <reent.h>
    17.8 -#include <unistd.h>
    17.9 -#include <_syslist.h>
   17.10 -
   17.11 -/* Some targets provides their own versions of these functions.  Those
   17.12 -   targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS.  */
   17.13 -
   17.14 -#ifdef _REENT_ONLY
   17.15 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   17.16 -#define REENTRANT_SYSCALLS_PROVIDED
   17.17 -#endif
   17.18 -#endif
   17.19 -
   17.20 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   17.21 -
   17.22 -/* We use the errno variable used by the system dependent layer.  */
   17.23 -#undef errno
   17.24 -extern int errno;
   17.25 -
   17.26 -/*
   17.27 -FUNCTION
   17.28 -	<<_link_r>>---Reentrant version of link
   17.29 -	
   17.30 -INDEX
   17.31 -	_link_r
   17.32 -
   17.33 -SYNOPSIS
   17.34 -	#include <reent.h>
   17.35 -	int _link_r(struct _reent *<[ptr]>,
   17.36 -		    const char *<[old]>, const char *<[new]>);
   17.37 -
   17.38 -DESCRIPTION
   17.39 -	This is a reentrant version of <<link>>.  It
   17.40 -	takes a pointer to the global data block, which holds
   17.41 -	<<errno>>.
   17.42 -*/
   17.43 -
   17.44 -int
   17.45 -_link_r (struct _reent *ptr,
   17.46 -     const char *old,
   17.47 -     const char *new)
   17.48 -{
   17.49 -  int ret;
   17.50 -
   17.51 -  errno = 0;
   17.52 -  if ((ret = _link (old, new)) == -1 && errno != 0)
   17.53 -    ptr->_errno = errno;
   17.54 -  return ret;
   17.55 -}
   17.56 -
   17.57 -#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
    18.1 --- a/libc/reent/lseek64r.c	Sat Dec 07 00:44:56 2019 +0100
    18.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.3 @@ -1,59 +0,0 @@
    18.4 -/* Reentrant versions of lseek system call. */
    18.5 -
    18.6 -#include <reent.h>
    18.7 -#include <unistd.h>
    18.8 -#include <_syslist.h>
    18.9 -
   18.10 -/* Some targets provides their own versions of this functions.  Those
   18.11 -   targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS.  */
   18.12 -
   18.13 -#ifdef __LARGE64_FILES
   18.14 -
   18.15 -#ifdef _REENT_ONLY
   18.16 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   18.17 -#define REENTRANT_SYSCALLS_PROVIDED
   18.18 -#endif
   18.19 -#endif
   18.20 -
   18.21 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   18.22 -
   18.23 -/* We use the errno variable used by the system dependent layer.  */
   18.24 -#undef errno
   18.25 -extern int errno;
   18.26 -
   18.27 -/*
   18.28 -FUNCTION
   18.29 -	<<_lseek64_r>>---Reentrant version of lseek
   18.30 -	
   18.31 -INDEX
   18.32 -	_lseek64_r
   18.33 -
   18.34 -SYNOPSIS
   18.35 -	#include <reent.h>
   18.36 -	off64_t _lseek64_r(struct _reent *<[ptr]>,
   18.37 -		           int <[fd]>, off64_t <[pos]>, int <[whence]>);
   18.38 -
   18.39 -DESCRIPTION
   18.40 -	This is a reentrant version of <<lseek64>>.  It
   18.41 -	takes a pointer to the global data block, which holds
   18.42 -	<<errno>>.  This function only exists on a system
   18.43 -        with large file support.
   18.44 -*/
   18.45 -
   18.46 -_off64_t
   18.47 -_lseek64_r (struct _reent *ptr,
   18.48 -     int fd,
   18.49 -     _off64_t pos,
   18.50 -     int whence)
   18.51 -{
   18.52 -  _off64_t ret;
   18.53 -
   18.54 -  errno = 0;
   18.55 -  if ((ret = _lseek64 (fd, pos, whence)) == (_off64_t) -1 && errno != 0)
   18.56 -    ptr->_errno = errno;
   18.57 -  return ret;
   18.58 -}
   18.59 -
   18.60 -#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
   18.61 -
   18.62 -#endif /* __LARGE64_FILES */
    19.1 --- a/libc/reent/lseekr.c	Sat Dec 07 00:44:56 2019 +0100
    19.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.3 @@ -1,54 +0,0 @@
    19.4 -/* Reentrant versions of lseek system call. */
    19.5 -
    19.6 -#include <reent.h>
    19.7 -#include <unistd.h>
    19.8 -#include <_syslist.h>
    19.9 -
   19.10 -/* Some targets provides their own versions of this functions.  Those
   19.11 -   targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS.  */
   19.12 -
   19.13 -#ifdef _REENT_ONLY
   19.14 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   19.15 -#define REENTRANT_SYSCALLS_PROVIDED
   19.16 -#endif
   19.17 -#endif
   19.18 -
   19.19 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   19.20 -
   19.21 -/* We use the errno variable used by the system dependent layer.  */
   19.22 -#undef errno
   19.23 -extern int errno;
   19.24 -
   19.25 -/*
   19.26 -FUNCTION
   19.27 -	<<_lseek_r>>---Reentrant version of lseek
   19.28 -	
   19.29 -INDEX
   19.30 -	_lseek_r
   19.31 -
   19.32 -SYNOPSIS
   19.33 -	#include <reent.h>
   19.34 -	off_t _lseek_r(struct _reent *<[ptr]>,
   19.35 -		       int <[fd]>, off_t <[pos]>, int <[whence]>);
   19.36 -
   19.37 -DESCRIPTION
   19.38 -	This is a reentrant version of <<lseek>>.  It
   19.39 -	takes a pointer to the global data block, which holds
   19.40 -	<<errno>>.
   19.41 -*/
   19.42 -
   19.43 -_off_t
   19.44 -_lseek_r (struct _reent *ptr,
   19.45 -     int fd,
   19.46 -     _off_t pos,
   19.47 -     int whence)
   19.48 -{
   19.49 -  _off_t ret;
   19.50 -
   19.51 -  errno = 0;
   19.52 -  if ((ret = _lseek (fd, pos, whence)) == (_off_t) -1 && errno != 0)
   19.53 -    ptr->_errno = errno;
   19.54 -  return ret;
   19.55 -}
   19.56 -
   19.57 -#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
    20.1 --- a/libc/reent/mkdirr.c	Sat Dec 07 00:44:56 2019 +0100
    20.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.3 @@ -1,56 +0,0 @@
    20.4 -/* Reentrant versions of mkdir system call. */
    20.5 -
    20.6 -#include <reent.h>
    20.7 -#include <unistd.h>
    20.8 -#include <_syslist.h>
    20.9 -
   20.10 -/* Some targets provides their own versions of this functions.  Those
   20.11 -   targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS.  */
   20.12 -
   20.13 -#ifdef _REENT_ONLY
   20.14 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   20.15 -#define REENTRANT_SYSCALLS_PROVIDED
   20.16 -#endif
   20.17 -#endif
   20.18 -
   20.19 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   20.20 -
   20.21 -/* We use the errno variable used by the system dependent layer.  */
   20.22 -#undef errno
   20.23 -extern int errno;
   20.24 -
   20.25 -/*
   20.26 -FUNCTION
   20.27 -	<<_mkdir_r>>---Reentrant version of mkdir
   20.28 -	
   20.29 -INDEX
   20.30 -	_mkdir_r
   20.31 -
   20.32 -SYNOPSIS
   20.33 -	#include <reent.h>
   20.34 -	int _mkdir_r(struct _reent *<[ptr]>,
   20.35 -		     const char *<[path]>, int <[mode]>);
   20.36 -
   20.37 -DESCRIPTION
   20.38 -	This is a reentrant version of <<mkdir>>.  It
   20.39 -	takes a pointer to the global data block, which holds
   20.40 -	<<errno>>.
   20.41 -*/
   20.42 -
   20.43 -#include <sys/stat.h>
   20.44 -
   20.45 -int
   20.46 -_mkdir_r (struct _reent *ptr,
   20.47 -     const char *path,
   20.48 -     int mode)
   20.49 -{
   20.50 -  int ret;
   20.51 -
   20.52 -  errno = 0;
   20.53 -  if ((ret = _mkdir (path, mode)) == -1 && errno != 0)
   20.54 -    ptr->_errno = errno;
   20.55 -  return ret;
   20.56 -}
   20.57 -
   20.58 -
   20.59 -#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
    21.1 --- a/libc/reent/open64r.c	Sat Dec 07 00:44:56 2019 +0100
    21.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.3 @@ -1,61 +0,0 @@
    21.4 -/* Reentrant versions of open system call. */
    21.5 -
    21.6 -#include <reent.h>
    21.7 -#include <unistd.h>
    21.8 -#include <fcntl.h>
    21.9 -#include <_syslist.h>
   21.10 -
   21.11 -#ifdef __LARGE64_FILES
   21.12 -
   21.13 -/* Some targets provides their own versions of this functions.  Those
   21.14 -   targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS.  */
   21.15 -
   21.16 -#ifdef _REENT_ONLY
   21.17 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   21.18 -#define REENTRANT_SYSCALLS_PROVIDED
   21.19 -#endif
   21.20 -#endif
   21.21 -
   21.22 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   21.23 -
   21.24 -/* We use the errno variable used by the system dependent layer.  */
   21.25 -#undef errno
   21.26 -extern int errno;
   21.27 -
   21.28 -/*
   21.29 -FUNCTION
   21.30 -	<<_open64_r>>---Reentrant version of open64
   21.31 -	
   21.32 -INDEX
   21.33 -	_open64_r
   21.34 -
   21.35 -SYNOPSIS
   21.36 -	#include <reent.h>
   21.37 -	int _open64_r(struct _reent *<[ptr]>,
   21.38 -  		      const char *<[file]>, int <[flags]>, int <[mode]>);
   21.39 -
   21.40 -DESCRIPTION
   21.41 -	This is a reentrant version of <<open64>>.  It
   21.42 -	takes a pointer to the global data block, which holds
   21.43 -	<<errno>>.  This function only exists on systems with
   21.44 -        large file support.
   21.45 -*/
   21.46 -
   21.47 -int
   21.48 -_open64_r (ptr, file, flags, mode)
   21.49 -     struct _reent *ptr;
   21.50 -     const char *file;
   21.51 -     int flags;
   21.52 -     int mode;
   21.53 -{
   21.54 -  int ret;
   21.55 -
   21.56 -  errno = 0;
   21.57 -  if ((ret = _open64 (file, flags, mode)) == -1 && errno != 0)
   21.58 -    ptr->_errno = errno;
   21.59 -  return ret;
   21.60 -}
   21.61 -
   21.62 -#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
   21.63 -
   21.64 -#endif /* __LARGE64_FILES */
    22.1 --- a/libc/reent/openr.c	Sat Dec 07 00:44:56 2019 +0100
    22.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.3 @@ -1,56 +0,0 @@
    22.4 -/* Reentrant versions of open system call. */
    22.5 -
    22.6 -#include <reent.h>
    22.7 -#include <unistd.h>
    22.8 -#include <fcntl.h>
    22.9 -#include <_syslist.h>
   22.10 -
   22.11 -/* Some targets provides their own versions of this functions.  Those
   22.12 -   targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS.  */
   22.13 -
   22.14 -#ifdef _REENT_ONLY
   22.15 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   22.16 -#define REENTRANT_SYSCALLS_PROVIDED
   22.17 -#endif
   22.18 -#endif
   22.19 -
   22.20 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   22.21 -
   22.22 -/* We use the errno variable used by the system dependent layer.  */
   22.23 -#undef errno
   22.24 -extern int errno;
   22.25 -
   22.26 -/*
   22.27 -FUNCTION
   22.28 -	<<_open_r>>---Reentrant version of open
   22.29 -	
   22.30 -INDEX
   22.31 -	_open_r
   22.32 -
   22.33 -SYNOPSIS
   22.34 -	#include <reent.h>
   22.35 -	int _open_r(struct _reent *<[ptr]>,
   22.36 -		    const char *<[file]>, int <[flags]>, int <[mode]>);
   22.37 -
   22.38 -DESCRIPTION
   22.39 -	This is a reentrant version of <<open>>.  It
   22.40 -	takes a pointer to the global data block, which holds
   22.41 -	<<errno>>.
   22.42 -*/
   22.43 -
   22.44 -int
   22.45 -_open_r (struct _reent *ptr,
   22.46 -     const char *file,
   22.47 -     int flags,
   22.48 -     int mode)
   22.49 -{
   22.50 -  int ret;
   22.51 -
   22.52 -  errno = 0;
   22.53 -  if ((ret = _open (file, flags, mode)) == -1 && errno != 0)
   22.54 -    ptr->_errno = errno;
   22.55 -  return ret;
   22.56 -}
   22.57 -
   22.58 -
   22.59 -#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
    23.1 --- a/libc/reent/readr.c	Sat Dec 07 00:44:56 2019 +0100
    23.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.3 @@ -1,54 +0,0 @@
    23.4 -/* Reentrant versions of read system call. */
    23.5 -
    23.6 -#include <reent.h>
    23.7 -#include <unistd.h>
    23.8 -#include <_syslist.h>
    23.9 -
   23.10 -/* Some targets provides their own versions of this functions.  Those
   23.11 -   targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS.  */
   23.12 -
   23.13 -#ifdef _REENT_ONLY
   23.14 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   23.15 -#define REENTRANT_SYSCALLS_PROVIDED
   23.16 -#endif
   23.17 -#endif
   23.18 -
   23.19 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   23.20 -
   23.21 -/* We use the errno variable used by the system dependent layer.  */
   23.22 -#undef errno
   23.23 -extern int errno;
   23.24 -
   23.25 -/*
   23.26 -FUNCTION
   23.27 -	<<_read_r>>---Reentrant version of read
   23.28 -	
   23.29 -INDEX
   23.30 -	_read_r
   23.31 -
   23.32 -SYNOPSIS
   23.33 -	#include <reent.h>
   23.34 -	_ssize_t _read_r(struct _reent *<[ptr]>,
   23.35 -		         int <[fd]>, void *<[buf]>, size_t <[cnt]>);
   23.36 -
   23.37 -DESCRIPTION
   23.38 -	This is a reentrant version of <<read>>.  It
   23.39 -	takes a pointer to the global data block, which holds
   23.40 -	<<errno>>.
   23.41 -*/
   23.42 -
   23.43 -_ssize_t
   23.44 -_read_r (struct _reent *ptr,
   23.45 -     int fd,
   23.46 -     void *buf,
   23.47 -     size_t cnt)
   23.48 -{
   23.49 -  _ssize_t ret;
   23.50 -
   23.51 -  errno = 0;
   23.52 -  if ((ret = (_ssize_t)_read (fd, buf, cnt)) == -1 && errno != 0)
   23.53 -    ptr->_errno = errno;
   23.54 -  return ret;
   23.55 -}
   23.56 -
   23.57 -#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
    24.1 --- a/libc/reent/reent.c	Sat Dec 07 00:44:56 2019 +0100
    24.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.3 @@ -1,138 +0,0 @@
    24.4 -/*
    24.5 -FUNCTION
    24.6 -	<<reent>>---definition of impure data.
    24.7 -	
    24.8 -INDEX
    24.9 -	reent
   24.10 -
   24.11 -DESCRIPTION
   24.12 -	This module defines the impure data area used by the
   24.13 -	non-reentrant functions, such as strtok.
   24.14 -*/
   24.15 -
   24.16 -#include <stdlib.h>
   24.17 -#include <reent.h>
   24.18 -
   24.19 -#ifdef _REENT_ONLY
   24.20 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   24.21 -#define REENTRANT_SYSCALLS_PROVIDED
   24.22 -#endif
   24.23 -#endif
   24.24 -
   24.25 -#ifdef REENTRANT_SYSCALLS_PROVIDED
   24.26 -
   24.27 -int _dummy_link_syscalls = 1;
   24.28 -
   24.29 -#else
   24.30 -
   24.31 -/* We use the errno variable used by the system dependent layer.  */
   24.32 -#undef errno
   24.33 -int errno;
   24.34 -
   24.35 -#endif
   24.36 -
   24.37 -/* Interim cleanup code */
   24.38 -
   24.39 -void
   24.40 -cleanup_glue (struct _reent *ptr,
   24.41 -     struct _glue *glue)
   24.42 -{
   24.43 -  /* Have to reclaim these in reverse order: */
   24.44 -  if (glue->_next)
   24.45 -    cleanup_glue (ptr, glue->_next);
   24.46 -
   24.47 -  _free_r (ptr, glue);
   24.48 -}
   24.49 -
   24.50 -void
   24.51 -_reclaim_reent (struct _reent *ptr)
   24.52 -{
   24.53 -  if (ptr != _impure_ptr)
   24.54 -    {
   24.55 -      /* used by mprec routines. */
   24.56 -#ifdef _REENT_SMALL
   24.57 -      if (ptr->_mp)	/* don't bother allocating it! */
   24.58 -      {
   24.59 -#endif
   24.60 -      if (_REENT_MP_FREELIST(ptr))
   24.61 -	{
   24.62 -	  int i;
   24.63 -	  for (i = 0; i < _Kmax; i++) 
   24.64 -	    {
   24.65 -	      struct _Bigint *thisone, *nextone;
   24.66 -	
   24.67 -	      nextone = _REENT_MP_FREELIST(ptr)[i];
   24.68 -	      while (nextone)
   24.69 -		{
   24.70 -		  thisone = nextone;
   24.71 -		  nextone = nextone->_next;
   24.72 -		  _free_r (ptr, thisone);
   24.73 -		}
   24.74 -	    }    
   24.75 -
   24.76 -	  _free_r (ptr, _REENT_MP_FREELIST(ptr));
   24.77 -	}
   24.78 -      if (_REENT_MP_RESULT(ptr))
   24.79 -	_free_r (ptr, _REENT_MP_RESULT(ptr));
   24.80 -#ifdef _REENT_SMALL
   24.81 -      }
   24.82 -#endif
   24.83 -
   24.84 -#ifdef _REENT_SMALL
   24.85 -      if (ptr->_emergency)
   24.86 -	_free_r (ptr, ptr->_emergency);
   24.87 -      if (ptr->_mp)
   24.88 -	_free_r (ptr, ptr->_mp);
   24.89 -      if (ptr->_r48)
   24.90 -	_free_r (ptr, ptr->_r48);
   24.91 -      if (ptr->_localtime_buf)
   24.92 -	_free_r (ptr, ptr->_localtime_buf);
   24.93 -      if (ptr->_asctime_buf)
   24.94 -	_free_r (ptr, ptr->_asctime_buf);
   24.95 -	  if (ptr->_signal_buf)
   24.96 -	_free_r (ptr, ptr->_signal_buf);
   24.97 -	  if (ptr->_misc)
   24.98 -	_free_r (ptr, ptr->_misc);
   24.99 -#endif
  24.100 -
  24.101 -#ifndef _REENT_GLOBAL_ATEXIT
  24.102 -      /* atexit stuff */
  24.103 -# ifdef _REENT_SMALL
  24.104 -      if (ptr->_atexit && ptr->_atexit->_on_exit_args_ptr)
  24.105 -	_free_r (ptr, ptr->_atexit->_on_exit_args_ptr);
  24.106 -# else
  24.107 -      if ((ptr->_atexit) && (ptr->_atexit != &ptr->_atexit0))
  24.108 -	{
  24.109 -	  struct _atexit *p, *q;
  24.110 -	  for (p = ptr->_atexit; p != &ptr->_atexit0;)
  24.111 -	    {
  24.112 -	      q = p;
  24.113 -	      p = p->_next;
  24.114 -	      _free_r (ptr, q);
  24.115 -	    }
  24.116 -	}
  24.117 -# endif
  24.118 -#endif
  24.119 -
  24.120 -      if (ptr->_cvtbuf)
  24.121 -	_free_r (ptr, ptr->_cvtbuf);
  24.122 -    /* We should free _sig_func to avoid a memory leak, but how to
  24.123 -	   do it safely considering that a signal may be delivered immediately
  24.124 -	   after the free?
  24.125 -	  if (ptr->_sig_func)
  24.126 -	_free_r (ptr, ptr->_sig_func);*/
  24.127 -
  24.128 -      if (ptr->__sdidinit)
  24.129 -	{
  24.130 -	  /* cleanup won't reclaim memory 'coz usually it's run
  24.131 -	     before the program exits, and who wants to wait for that? */
  24.132 -	  ptr->__cleanup (ptr);
  24.133 -
  24.134 -	  if (ptr->__sglue._next)
  24.135 -	    cleanup_glue (ptr, ptr->__sglue._next);
  24.136 -	}
  24.137 -
  24.138 -      /* Malloc memory not reclaimed; no good way to return memory anyway. */
  24.139 -
  24.140 -    }
  24.141 -}
    25.1 --- a/libc/reent/reent.tex	Sat Dec 07 00:44:56 2019 +0100
    25.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.3 @@ -1,117 +0,0 @@
    25.4 -@node Reentrancy
    25.5 -@chapter Reentrancy
    25.6 -
    25.7 -@cindex reentrancy
    25.8 -Reentrancy is a characteristic of library functions which allows multiple
    25.9 -processes to use the same address space with assurance that the values stored
   25.10 -in those spaces will remain constant between calls. The Red Hat
   25.11 -newlib implementation of the library functions ensures that 
   25.12 -whenever possible, these library functions are reentrant.  However,
   25.13 -there are some functions that can not be trivially made reentrant.
   25.14 -Hooks have been provided to allow you to use these functions in a fully
   25.15 -reentrant fashion.
   25.16 -
   25.17 -@findex _reent
   25.18 -@findex reent.h
   25.19 -@cindex reentrancy structure
   25.20 -These hooks use the structure @code{_reent} defined in @file{reent.h}.
   25.21 -A variable defined as @samp{struct _reent} is called a @dfn{reentrancy
   25.22 -structure}.  All functions which must manipulate global information are
   25.23 -available in two versions.  The first version has the usual name, and
   25.24 -uses a single global instance of the reentrancy structure.  The second
   25.25 -has a different name, normally formed by prepending @samp{_} and
   25.26 -appending @samp{_r}, and takes a pointer to the particular reentrancy
   25.27 -structure to use.
   25.28 -
   25.29 -For example, the function @code{fopen} takes two arguments, @var{file}
   25.30 -and @var{mode}, and uses the global reentrancy structure.  The function
   25.31 -@code{_fopen_r} takes the arguments, @var{struct_reent}, which is a
   25.32 -pointer to an instance of the reentrancy structure, @var{file}
   25.33 -and @var{mode}.	
   25.34 -
   25.35 -There are two versions of @samp{struct _reent}, a normal one and one
   25.36 -for small memory systems, controlled by the @code{_REENT_SMALL}
   25.37 -definition from the (automatically included) @file{<sys/config.h>}.
   25.38 -
   25.39 -@cindex global reentrancy structure
   25.40 -@findex _impure_ptr
   25.41 -Each function which uses the global reentrancy structure uses the global
   25.42 -variable @code{_impure_ptr}, which points to a reentrancy structure.
   25.43 -
   25.44 -This means that you have two ways to achieve reentrancy.  Both require
   25.45 -that each thread of execution control initialize a unique global
   25.46 -variable of type @samp{struct _reent}:
   25.47 -
   25.48 -@enumerate
   25.49 -@item
   25.50 -@cindex extra argument, reentrant fns
   25.51 -Use the reentrant versions of the library functions, after initializing
   25.52 -a global reentrancy structure for each process.  Use the pointer to this
   25.53 -structure as the extra argument for all library functions.
   25.54 -
   25.55 -@item
   25.56 -Ensure that each thread of execution control has a pointer to its own
   25.57 -unique reentrancy structure in the global variable @code{_impure_ptr},
   25.58 -and call the standard library subroutines.
   25.59 -@end enumerate
   25.60 -
   25.61 -@cindex list of reentrant functions
   25.62 -@cindex reentrant function list
   25.63 -The following functions are provided in both reentrant
   25.64 -and non-reentrant versions.
   25.65 -
   25.66 -@example
   25.67 -@exdent @emph{Equivalent for errno variable:}
   25.68 -_errno_r
   25.69 -
   25.70 -@exdent @emph{Locale functions:}
   25.71 -_localeconv_r  _setlocale_r
   25.72 -
   25.73 -@exdent @emph{Equivalents for stdio variables:}
   25.74 -_stdin_r        _stdout_r       _stderr_r
   25.75 -
   25.76 -@page  
   25.77 -@exdent @emph{Stdio functions:}
   25.78 -_fdopen_r       _perror_r       _tempnam_r
   25.79 -_fopen_r        _putchar_r      _tmpnam_r
   25.80 -_getchar_r      _puts_r         _tmpfile_r
   25.81 -_gets_r         _remove_r       _vfprintf_r
   25.82 -_iprintf_r      _rename_r       _vsnprintf_r
   25.83 -_mkstemp_r      _snprintf_r     _vsprintf_r
   25.84 -_mktemp_t       _sprintf_r
   25.85 -
   25.86 -@exdent @emph{Signal functions:}
   25.87 -_init_signal_r  _signal_r
   25.88 -_kill_r         __sigtramp_r
   25.89 -_raise_r
   25.90 -
   25.91 -@exdent @emph{Stdlib functions:}
   25.92 -_calloc_r       _mblen_r        _setenv_r
   25.93 -_dtoa_r         _mbstowcs_r     _srand_r
   25.94 -_free_r         _mbtowc_r       _strtod_r
   25.95 -_getenv_r       _memalign_r     _strtol_r
   25.96 -_mallinfo_r     _mstats_r       _strtoul_r
   25.97 -_malloc_r       _putenv_r       _system_r
   25.98 -_malloc_r       _rand_r         _wcstombs_r
   25.99 -_malloc_stats_r _realloc_r      _wctomb_r
  25.100 -
  25.101 -@exdent @emph{String functions:}
  25.102 -_strdup_r       _strtok_r
  25.103 -
  25.104 -@exdent @emph{System functions:}
  25.105 -_close_r        _link_r         _unlink_r
  25.106 -_execve_r       _lseek_r        _wait_r
  25.107 -_fcntl_r        _open_r         _write_r 
  25.108 -_fork_r         _read_r
  25.109 -_fstat_r        _sbrk_r
  25.110 -_gettimeofday_r _stat_r
  25.111 -_getpid_r       _times_r
  25.112 -
  25.113 -@ifset STDIO64
  25.114 -@exdent @emph{Additional 64-bit I/O System functions:}
  25.115 -_fstat64_r	_lseek64_r	_open64_r
  25.116 -@end ifset
  25.117 -
  25.118 -@exdent @emph{Time function:}
  25.119 -_asctime_r
  25.120 -@end example
    26.1 --- a/libc/reent/renamer.c	Sat Dec 07 00:44:56 2019 +0100
    26.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.3 @@ -1,66 +0,0 @@
    26.4 -/* Reentrant version of rename system call.  */
    26.5 -
    26.6 -#include <reent.h>
    26.7 -#include <stdio.h>
    26.8 -#include <unistd.h>
    26.9 -#include <sys/stat.h>
   26.10 -#include <_syslist.h>
   26.11 -
   26.12 -/* Some targets provides their own versions of these functions.  Those
   26.13 -   targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS.  */
   26.14 -
   26.15 -#ifdef _REENT_ONLY
   26.16 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   26.17 -#define REENTRANT_SYSCALLS_PROVIDED
   26.18 -#endif
   26.19 -#endif
   26.20 -
   26.21 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   26.22 -
   26.23 -/* We use the errno variable used by the system dependent layer.  */
   26.24 -#undef errno
   26.25 -extern int errno;
   26.26 -
   26.27 -/*
   26.28 -FUNCTION
   26.29 -	<<_rename_r>>---Reentrant version of rename
   26.30 -	
   26.31 -INDEX
   26.32 -	_rename_r
   26.33 -
   26.34 -SYNOPSIS
   26.35 -	#include <reent.h>
   26.36 -	int _rename_r(struct _reent *<[ptr]>,
   26.37 -		const char *<[old]>, const char *<[new]>);
   26.38 -
   26.39 -DESCRIPTION
   26.40 -	This is a reentrant version of <<rename>>.  It
   26.41 -	takes a pointer to the global data block, which holds
   26.42 -	<<errno>>.
   26.43 -*/
   26.44 -
   26.45 -int
   26.46 -_rename_r (struct _reent *ptr,
   26.47 -     const char *old,
   26.48 -     const char *new)
   26.49 -{
   26.50 -  int ret = 0;
   26.51 -
   26.52 -#ifdef HAVE_RENAME
   26.53 -  errno = 0;
   26.54 -  if ((ret = _rename (old, new)) == -1 && errno != 0)
   26.55 -    ptr->_errno = errno;
   26.56 -#else
   26.57 -  if (_link_r (ptr, old, new) == -1)
   26.58 -    return -1;
   26.59 -
   26.60 -  if (_unlink_r (ptr, old) == -1)
   26.61 -    {
   26.62 -      /* ??? Should we unlink new? (rhetorical question) */
   26.63 -      return -1;
   26.64 -    }
   26.65 -#endif
   26.66 -  return ret;
   26.67 -}
   26.68 -
   26.69 -#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
    27.1 --- a/libc/reent/sbrkr.c	Sat Dec 07 00:44:56 2019 +0100
    27.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.3 @@ -1,56 +0,0 @@
    27.4 -/* Reentrant version of sbrk system call. */
    27.5 -
    27.6 -#include <reent.h>
    27.7 -#include <unistd.h>
    27.8 -#include <_syslist.h>
    27.9 -
   27.10 -/* Some targets provides their own versions of these functions.  Those
   27.11 -   targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS.  */
   27.12 -
   27.13 -#ifdef _REENT_ONLY
   27.14 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   27.15 -#define REENTRANT_SYSCALLS_PROVIDED
   27.16 -#endif
   27.17 -#endif
   27.18 -
   27.19 -#if defined (REENTRANT_SYSCALLS_PROVIDED)
   27.20 -
   27.21 -int _dummy_sbrk_syscalls = 1;
   27.22 -
   27.23 -#else
   27.24 -
   27.25 -/* We use the errno variable used by the system dependent layer.  */
   27.26 -#undef errno
   27.27 -extern int errno;
   27.28 -
   27.29 -/*
   27.30 -FUNCTION
   27.31 -	<<_sbrk_r>>---Reentrant version of sbrk
   27.32 -	
   27.33 -INDEX
   27.34 -	_sbrk_r
   27.35 -
   27.36 -SYNOPSIS
   27.37 -	#include <reent.h>
   27.38 -	void *_sbrk_r(struct _reent *<[ptr]>, ptrdiff_t <[incr]>);
   27.39 -
   27.40 -DESCRIPTION
   27.41 -	This is a reentrant version of <<sbrk>>.  It
   27.42 -	takes a pointer to the global data block, which holds
   27.43 -	<<errno>>.
   27.44 -*/
   27.45 -
   27.46 -void *
   27.47 -_sbrk_r (struct _reent *ptr,
   27.48 -     ptrdiff_t incr)
   27.49 -{
   27.50 -  char *ret;
   27.51 -  void *_sbrk(ptrdiff_t);
   27.52 -
   27.53 -  errno = 0;
   27.54 -  if ((ret = (char *)(_sbrk (incr))) == (void *) -1 && errno != 0)
   27.55 -    ptr->_errno = errno;
   27.56 -  return ret;
   27.57 -}
   27.58 -
   27.59 -#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
    28.1 --- a/libc/reent/signalr.c	Sat Dec 07 00:44:56 2019 +0100
    28.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.3 @@ -1,83 +0,0 @@
    28.4 -/* Reentrant versions of syscalls need to support signal/raise.
    28.5 -   These implementations just call the usual system calls.  */
    28.6 -
    28.7 -#include <reent.h>
    28.8 -#include <signal.h>
    28.9 -#include <unistd.h>
   28.10 -#include <_syslist.h>
   28.11 -
   28.12 -/* Some targets provides their own versions of these functions.  Those
   28.13 -   targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS.  */
   28.14 -
   28.15 -#ifdef _REENT_ONLY
   28.16 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   28.17 -#define REENTRANT_SYSCALLS_PROVIDED
   28.18 -#endif
   28.19 -#endif
   28.20 -
   28.21 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   28.22 -
   28.23 -/* We use the errno variable used by the system dependent layer.  */
   28.24 -#undef errno
   28.25 -extern int errno;
   28.26 -
   28.27 -/*
   28.28 -FUNCTION
   28.29 -	<<_kill_r>>---Reentrant version of kill
   28.30 -	
   28.31 -INDEX
   28.32 -	_kill_r
   28.33 -
   28.34 -SYNOPSIS
   28.35 -	#include <reent.h>
   28.36 -	int _kill_r(struct _reent *<[ptr]>, int <[pid]>, int <[sig]>);
   28.37 -
   28.38 -DESCRIPTION
   28.39 -	This is a reentrant version of <<kill>>.  It
   28.40 -	takes a pointer to the global data block, which holds
   28.41 -	<<errno>>.
   28.42 -*/
   28.43 -
   28.44 -int
   28.45 -_kill_r (struct _reent *ptr,
   28.46 -     int pid,
   28.47 -     int sig)
   28.48 -{
   28.49 -  int ret;
   28.50 -
   28.51 -  errno = 0;
   28.52 -  if ((ret = _kill (pid, sig)) == -1 && errno != 0)
   28.53 -    ptr->_errno = errno;
   28.54 -  return ret;
   28.55 -}
   28.56 -
   28.57 -/*
   28.58 -NEWPAGE
   28.59 -FUNCTION
   28.60 -	<<_getpid_r>>---Reentrant version of getpid
   28.61 -	
   28.62 -INDEX
   28.63 -	_getpid_r
   28.64 -
   28.65 -SYNOPSIS
   28.66 -	#include <reent.h>
   28.67 -	int _getpid_r(struct _reent *<[ptr]>);
   28.68 -
   28.69 -DESCRIPTION
   28.70 -	This is a reentrant version of <<getpid>>.  It
   28.71 -	takes a pointer to the global data block, which holds
   28.72 -	<<errno>>.
   28.73 -
   28.74 -	We never need <<errno>>, of course, but for consistency we
   28.75 -	still must have the reentrant pointer argument.
   28.76 -*/
   28.77 -
   28.78 -int
   28.79 -_getpid_r (struct _reent *ptr)
   28.80 -{
   28.81 -  int ret;
   28.82 -  ret = _getpid ();
   28.83 -  return ret;
   28.84 -}
   28.85 -
   28.86 -#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
    29.1 --- a/libc/reent/signgam.c	Sat Dec 07 00:44:56 2019 +0100
    29.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.3 @@ -1,16 +0,0 @@
    29.4 -/* The signgam variable is stored in the reentrancy structure.  This
    29.5 -   function returns its address for use by the macro signgam defined in
    29.6 -   math.h.  */
    29.7 -
    29.8 -#include <math.h>
    29.9 -#include <reent.h>
   29.10 -
   29.11 -#ifndef _REENT_ONLY
   29.12 -
   29.13 -int *
   29.14 -__signgam (void)
   29.15 -{
   29.16 -  return &_REENT_SIGNGAM(_REENT);
   29.17 -}
   29.18 -
   29.19 -#endif
    30.1 --- a/libc/reent/stat64r.c	Sat Dec 07 00:44:56 2019 +0100
    30.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.3 @@ -1,60 +0,0 @@
    30.4 -/* Reentrant versions of stat64 system call.  This implementation just
    30.5 -   calls the stat64 system call.  */
    30.6 -
    30.7 -#include <reent.h>
    30.8 -#include <unistd.h>
    30.9 -#include <sys/stat.h>
   30.10 -#include <_syslist.h>
   30.11 -
   30.12 -/* Some targets provides their own versions of these functions.  Those
   30.13 -   targets should define REENTRANT_SYSCALLS_PROVIDED in
   30.14 -   TARGET_CFLAGS.  */
   30.15 -
   30.16 -#ifdef _REENT_ONLY
   30.17 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   30.18 -#define REENTRANT_SYSCALLS_PROVIDED
   30.19 -#endif
   30.20 -#endif
   30.21 -
   30.22 -#ifdef REENTRANT_SYSCALLS_PROVIDED
   30.23 -
   30.24 -int _dummy_stat64_syscalls = 1;
   30.25 -
   30.26 -#else
   30.27 -
   30.28 -/* We use the errno variable used by the system dependent layer.  */
   30.29 -#undef errno
   30.30 -extern int errno;
   30.31 -
   30.32 -/*
   30.33 -FUNCTION
   30.34 -	<<_stat64_r>>---Reentrant version of stat64
   30.35 -	
   30.36 -INDEX
   30.37 -	_stat64_r
   30.38 -
   30.39 -SYNOPSIS
   30.40 -	#include <reent.h>
   30.41 -	int _stat64_r(struct _reent *<[ptr]>,
   30.42 -		    const char *<[file]>, struct stat64 *<[pstat]>);
   30.43 -
   30.44 -DESCRIPTION
   30.45 -	This is a reentrant version of <<stat64>>.  It
   30.46 -	takes a pointer to the global data block, which holds
   30.47 -	<<errno>>.
   30.48 -*/
   30.49 -
   30.50 -int
   30.51 -_stat64_r (struct _reent *ptr,
   30.52 -     const char *file,
   30.53 -     struct stat64 *pstat)
   30.54 -{
   30.55 -  int ret;
   30.56 -
   30.57 -  errno = 0;
   30.58 -  if ((ret = _stat64 (file, pstat)) == -1 && errno != 0)
   30.59 -    ptr->_errno = errno;
   30.60 -  return ret;
   30.61 -}
   30.62 -
   30.63 -#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
    31.1 --- a/libc/reent/statr.c	Sat Dec 07 00:44:56 2019 +0100
    31.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.3 @@ -1,60 +0,0 @@
    31.4 -/* Reentrant versions of stat system call.  This implementation just
    31.5 -   calls the stat system call.  */
    31.6 -
    31.7 -#include <reent.h>
    31.8 -#include <unistd.h>
    31.9 -#include <sys/stat.h>
   31.10 -#include <_syslist.h>
   31.11 -
   31.12 -/* Some targets provides their own versions of these functions.  Those
   31.13 -   targets should define REENTRANT_SYSCALLS_PROVIDED in
   31.14 -   TARGET_CFLAGS.  */
   31.15 -
   31.16 -#ifdef _REENT_ONLY
   31.17 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   31.18 -#define REENTRANT_SYSCALLS_PROVIDED
   31.19 -#endif
   31.20 -#endif
   31.21 -
   31.22 -#ifdef REENTRANT_SYSCALLS_PROVIDED
   31.23 -
   31.24 -int _dummy_stat_syscalls = 1;
   31.25 -
   31.26 -#else
   31.27 -
   31.28 -/* We use the errno variable used by the system dependent layer.  */
   31.29 -#undef errno
   31.30 -extern int errno;
   31.31 -
   31.32 -/*
   31.33 -FUNCTION
   31.34 -	<<_stat_r>>---Reentrant version of stat
   31.35 -	
   31.36 -INDEX
   31.37 -	_stat_r
   31.38 -
   31.39 -SYNOPSIS
   31.40 -	#include <reent.h>
   31.41 -	int _stat_r(struct _reent *<[ptr]>,
   31.42 -		    const char *<[file]>, struct stat *<[pstat]>);
   31.43 -
   31.44 -DESCRIPTION
   31.45 -	This is a reentrant version of <<stat>>.  It
   31.46 -	takes a pointer to the global data block, which holds
   31.47 -	<<errno>>.
   31.48 -*/
   31.49 -
   31.50 -int
   31.51 -_stat_r (struct _reent *ptr,
   31.52 -     const char *file,
   31.53 -     struct stat *pstat)
   31.54 -{
   31.55 -  int ret;
   31.56 -
   31.57 -  errno = 0;
   31.58 -  if ((ret = _stat (file, pstat)) == -1 && errno != 0)
   31.59 -    ptr->_errno = errno;
   31.60 -  return ret;
   31.61 -}
   31.62 -
   31.63 -#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
    32.1 --- a/libc/reent/timesr.c	Sat Dec 07 00:44:56 2019 +0100
    32.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.3 @@ -1,55 +0,0 @@
    32.4 -/* Reentrant versions of times system calls */
    32.5 -
    32.6 -#include <reent.h>
    32.7 -#include <time.h>
    32.8 -#include <sys/time.h>
    32.9 -#include <sys/times.h>
   32.10 -#include <_syslist.h>
   32.11 -
   32.12 -/* Some targets provides their own versions of these functions.  Those
   32.13 -   targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS.  */
   32.14 -
   32.15 -#ifdef _REENT_ONLY
   32.16 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   32.17 -#define REENTRANT_SYSCALLS_PROVIDED
   32.18 -#endif
   32.19 -#endif
   32.20 -
   32.21 -#ifdef REENTRANT_SYSCALLS_PROVIDED
   32.22 -
   32.23 -int _dummy_times_syscalls = 1;
   32.24 -
   32.25 -#else
   32.26 -
   32.27 -/* We use the errno variable used by the system dependent layer.  */
   32.28 -#undef errno
   32.29 -extern int errno;
   32.30 -
   32.31 -/*
   32.32 -FUNCTION
   32.33 -	<<_times_r>>---Reentrant version of times
   32.34 -
   32.35 -INDEX
   32.36 -	_times_r
   32.37 -
   32.38 -SYNOPSIS
   32.39 -	#include <reent.h>
   32.40 -	#include <sys/times.h>
   32.41 -	clock_t _times_r(struct _reent *<[ptr]>, struct tms *<[ptms]>);
   32.42 -
   32.43 -DESCRIPTION
   32.44 -	This is a reentrant version of <<times>>.  It
   32.45 -	takes a pointer to the global data block, which holds
   32.46 -	<<errno>>.
   32.47 -*/
   32.48 -
   32.49 -clock_t
   32.50 -_times_r (struct _reent *ptr,
   32.51 -     struct tms *ptms)
   32.52 -{
   32.53 -  clock_t ret;
   32.54 -
   32.55 -  ret = _times (ptms);
   32.56 -  return ret;
   32.57 -}
   32.58 -#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
    33.1 --- a/libc/reent/unlinkr.c	Sat Dec 07 00:44:56 2019 +0100
    33.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.3 @@ -1,52 +0,0 @@
    33.4 -/* Reentrant versions of file system calls.  These implementations
    33.5 -   just call the usual system calls.  */
    33.6 -
    33.7 -#include <reent.h>
    33.8 -#include <unistd.h>
    33.9 -#include <_syslist.h>
   33.10 -
   33.11 -/* Some targets provides their own versions of these functions.  Those
   33.12 -   targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS.  */
   33.13 -
   33.14 -#ifdef _REENT_ONLY
   33.15 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   33.16 -#define REENTRANT_SYSCALLS_PROVIDED
   33.17 -#endif
   33.18 -#endif
   33.19 -
   33.20 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   33.21 -
   33.22 -/* We use the errno variable used by the system dependent layer.  */
   33.23 -#undef errno
   33.24 -extern int errno;
   33.25 -
   33.26 -/*
   33.27 -FUNCTION
   33.28 -	<<_unlink_r>>---Reentrant version of unlink
   33.29 -	
   33.30 -INDEX
   33.31 -	_unlink_r
   33.32 -
   33.33 -SYNOPSIS
   33.34 -	#include <reent.h>
   33.35 -	int _unlink_r(struct _reent *<[ptr]>, const char *<[file]>);
   33.36 -
   33.37 -DESCRIPTION
   33.38 -	This is a reentrant version of <<unlink>>.  It
   33.39 -	takes a pointer to the global data block, which holds
   33.40 -	<<errno>>.
   33.41 -*/
   33.42 -
   33.43 -int
   33.44 -_unlink_r (struct _reent *ptr,
   33.45 -     const char *file)
   33.46 -{
   33.47 -  int ret;
   33.48 -
   33.49 -  errno = 0;
   33.50 -  if ((ret = _unlink (file)) == -1 && errno != 0)
   33.51 -    ptr->_errno = errno;
   33.52 -  return ret;
   33.53 -}
   33.54 -
   33.55 -#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
    34.1 --- a/libc/reent/writer.c	Sat Dec 07 00:44:56 2019 +0100
    34.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.3 @@ -1,54 +0,0 @@
    34.4 -/* Reentrant versions of write system call. */
    34.5 -
    34.6 -#include <reent.h>
    34.7 -#include <unistd.h>
    34.8 -#include <_syslist.h>
    34.9 -
   34.10 -/* Some targets provides their own versions of this functions.  Those
   34.11 -   targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS.  */
   34.12 -
   34.13 -#ifdef _REENT_ONLY
   34.14 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   34.15 -#define REENTRANT_SYSCALLS_PROVIDED
   34.16 -#endif
   34.17 -#endif
   34.18 -
   34.19 -#ifndef REENTRANT_SYSCALLS_PROVIDED
   34.20 -
   34.21 -/* We use the errno variable used by the system dependent layer.  */
   34.22 -#undef errno
   34.23 -extern int errno;
   34.24 -
   34.25 -/*
   34.26 -FUNCTION
   34.27 -	<<_write_r>>---Reentrant version of write
   34.28 -	
   34.29 -INDEX
   34.30 -	_write_r
   34.31 -
   34.32 -SYNOPSIS
   34.33 -	#include <reent.h>
   34.34 -	_ssize_t _write_r(struct _reent *<[ptr]>,
   34.35 -		          int <[fd]>, const void *<[buf]>, size_t <[cnt]>);
   34.36 -
   34.37 -DESCRIPTION
   34.38 -	This is a reentrant version of <<write>>.  It
   34.39 -	takes a pointer to the global data block, which holds
   34.40 -	<<errno>>.
   34.41 -*/
   34.42 -
   34.43 -_ssize_t
   34.44 -_write_r (struct _reent *ptr,
   34.45 -     int fd,
   34.46 -     const void *buf,
   34.47 -     size_t cnt)
   34.48 -{
   34.49 -  _ssize_t ret;
   34.50 -
   34.51 -  errno = 0;
   34.52 -  if ((ret = (_ssize_t)_write (fd, buf, cnt)) == -1 && errno != 0)
   34.53 -    ptr->_errno = errno;
   34.54 -  return ret;
   34.55 -}
   34.56 -
   34.57 -#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
    35.1 --- a/libc/stdlib/mlock.c	Sat Dec 07 00:44:56 2019 +0100
    35.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.3 @@ -1,57 +0,0 @@
    35.4 -#ifndef MALLOC_PROVIDED
    35.5 -/*
    35.6 -FUNCTION
    35.7 -<<__malloc_lock>>, <<__malloc_unlock>>---lock malloc pool
    35.8 -
    35.9 -INDEX
   35.10 -	__malloc_lock
   35.11 -INDEX
   35.12 -	__malloc_unlock
   35.13 -
   35.14 -SYNOPSIS
   35.15 -	#include <malloc.h>
   35.16 -	void __malloc_lock (struct _reent *<[reent]>);
   35.17 -	void __malloc_unlock (struct _reent *<[reent]>);
   35.18 -
   35.19 -DESCRIPTION
   35.20 -The <<malloc>> family of routines call these functions when they need to lock
   35.21 -the memory pool.  The version of these routines supplied in the library use
   35.22 -the lock API defined in sys/lock.h.  If multiple threads of execution can
   35.23 -call <<malloc>>, or if <<malloc>> can be called reentrantly, then you need to
   35.24 -define your own versions of these functions in order to safely lock the
   35.25 -memory pool during a call.  If you do not, the memory pool may become
   35.26 -corrupted.
   35.27 -
   35.28 -A call to <<malloc>> may call <<__malloc_lock>> recursively; that is,
   35.29 -the sequence of calls may go <<__malloc_lock>>, <<__malloc_lock>>,
   35.30 -<<__malloc_unlock>>, <<__malloc_unlock>>.  Any implementation of these
   35.31 -routines must be careful to avoid causing a thread to wait for a lock
   35.32 -that it already holds.
   35.33 -*/
   35.34 -
   35.35 -#include <malloc.h>
   35.36 -#include <sys/lock.h>
   35.37 -
   35.38 -#ifndef __SINGLE_THREAD__
   35.39 -__LOCK_INIT_RECURSIVE(static, __malloc_recursive_mutex);
   35.40 -#endif
   35.41 -
   35.42 -void
   35.43 -__malloc_lock (ptr)
   35.44 -     struct _reent *ptr;
   35.45 -{
   35.46 -#ifndef __SINGLE_THREAD__
   35.47 -  __lock_acquire_recursive (__malloc_recursive_mutex);
   35.48 -#endif
   35.49 -}
   35.50 -
   35.51 -void
   35.52 -__malloc_unlock (ptr)
   35.53 -     struct _reent *ptr;
   35.54 -{
   35.55 -#ifndef __SINGLE_THREAD__
   35.56 -  __lock_release_recursive (__malloc_recursive_mutex);
   35.57 -#endif
   35.58 -}
   35.59 -
   35.60 -#endif
    36.1 --- a/libc/stdlib/nano-mallocr.c	Sat Dec 07 00:44:56 2019 +0100
    36.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.3 @@ -1,637 +0,0 @@
    36.4 -/*
    36.5 - * Copyright (c) 2012, 2013 ARM Ltd
    36.6 - * All rights reserved.
    36.7 - *
    36.8 - * Redistribution and use in source and binary forms, with or without
    36.9 - * modification, are permitted provided that the following conditions
   36.10 - * are met:
   36.11 - * 1. Redistributions of source code must retain the above copyright
   36.12 - *    notice, this list of conditions and the following disclaimer.
   36.13 - * 2. Redistributions in binary form must reproduce the above copyright
   36.14 - *    notice, this list of conditions and the following disclaimer in the
   36.15 - *    documentation and/or other materials provided with the distribution.
   36.16 - * 3. The name of the company may not be used to endorse or promote
   36.17 - *    products derived from this software without specific prior written
   36.18 - *    permission.
   36.19 - *
   36.20 - * THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
   36.21 - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
   36.22 - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
   36.23 - * IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   36.24 - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
   36.25 - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
   36.26 - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
   36.27 - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
   36.28 - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
   36.29 - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   36.30 - */
   36.31 -
   36.32 -/* Implementation of <<malloc>> <<free>> <<calloc>> <<realloc>>, optional
   36.33 - * as to be reenterable.
   36.34 - *
   36.35 - * Interface documentation refer to malloc.c.
   36.36 - */
   36.37 -
   36.38 -#include <stdio.h>
   36.39 -#include <string.h>
   36.40 -#include <errno.h>
   36.41 -#include <malloc.h>
   36.42 -
   36.43 -#if DEBUG
   36.44 -#include <assert.h>
   36.45 -#else
   36.46 -#define assert(x) ((void)0)
   36.47 -#endif
   36.48 -
   36.49 -#ifndef MAX
   36.50 -#define MAX(a,b) ((a) >= (b) ? (a) : (b))
   36.51 -#endif
   36.52 -
   36.53 -#define _SBRK_R(X) _sbrk_r(X)
   36.54 -
   36.55 -#ifdef INTERNAL_NEWLIB
   36.56 -
   36.57 -#include <sys/config.h>
   36.58 -#include <reent.h>
   36.59 -
   36.60 -#define RARG struct _reent *reent_ptr,
   36.61 -#define RONEARG struct _reent *reent_ptr
   36.62 -#define RCALL reent_ptr,
   36.63 -#define RONECALL reent_ptr
   36.64 -
   36.65 -#define MALLOC_LOCK __malloc_lock(reent_ptr)
   36.66 -#define MALLOC_UNLOCK __malloc_unlock(reent_ptr)
   36.67 -
   36.68 -#define RERRNO reent_ptr->_errno
   36.69 -
   36.70 -#define nano_malloc		_malloc_r
   36.71 -#define nano_free		_free_r
   36.72 -#define nano_realloc		_realloc_r
   36.73 -#define nano_memalign		_memalign_r
   36.74 -#define nano_valloc		_valloc_r
   36.75 -#define nano_pvalloc		_pvalloc_r
   36.76 -#define nano_calloc		_calloc_r
   36.77 -#define nano_cfree		_cfree_r
   36.78 -#define nano_malloc_usable_size _malloc_usable_size_r
   36.79 -#define nano_malloc_stats	_malloc_stats_r
   36.80 -#define nano_mallinfo		_mallinfo_r
   36.81 -#define nano_mallopt		_mallopt_r
   36.82 -
   36.83 -#else /* ! INTERNAL_NEWLIB */
   36.84 -
   36.85 -#define RARG
   36.86 -#define RONEARG
   36.87 -#define RCALL
   36.88 -#define RONECALL
   36.89 -#define MALLOC_LOCK
   36.90 -#define MALLOC_UNLOCK
   36.91 -#define RERRNO errno
   36.92 -
   36.93 -#define nano_malloc		malloc
   36.94 -#define nano_free		free
   36.95 -#define nano_realloc		realloc
   36.96 -#define nano_memalign		memalign
   36.97 -#define nano_valloc		valloc
   36.98 -#define nano_pvalloc		pvalloc
   36.99 -#define nano_calloc		calloc
  36.100 -#define nano_cfree		cfree
  36.101 -#define nano_malloc_usable_size malloc_usable_size
  36.102 -#define nano_malloc_stats	malloc_stats
  36.103 -#define nano_mallinfo		mallinfo
  36.104 -#define nano_mallopt		mallopt
  36.105 -#endif /* ! INTERNAL_NEWLIB */
  36.106 -
  36.107 -/* Redefine names to avoid conflict with user names */
  36.108 -#define free_list __malloc_free_list
  36.109 -#define sbrk_start __malloc_sbrk_start
  36.110 -#define current_mallinfo __malloc_current_mallinfo
  36.111 -
  36.112 -#define ALIGN_TO(size, align) \
  36.113 -    (((size) + (align) -1L) & ~((align) -1L))
  36.114 -
  36.115 -/* Alignment of allocated block */
  36.116 -#define MALLOC_ALIGN (8U)
  36.117 -#define CHUNK_ALIGN (sizeof(void*))
  36.118 -#define MALLOC_PADDING ((MAX(MALLOC_ALIGN, CHUNK_ALIGN)) - CHUNK_ALIGN)
  36.119 -
  36.120 -/* as well as the minimal allocation size
  36.121 - * to hold a free pointer */
  36.122 -#define MALLOC_MINSIZE (sizeof(void *))
  36.123 -#define MALLOC_PAGE_ALIGN (0x1000)
  36.124 -#define MAX_ALLOC_SIZE (0x80000000U)
  36.125 -
  36.126 -typedef size_t malloc_size_t;
  36.127 -
  36.128 -typedef struct malloc_chunk
  36.129 -{
  36.130 -    /*          --------------------------------------
  36.131 -     *   chunk->| size                               |
  36.132 -     *          --------------------------------------
  36.133 -     *          | Padding for alignment              |
  36.134 -     *          | This includes padding inserted by  |
  36.135 -     *          | the compiler (to align fields) and |
  36.136 -     *          | explicit padding inserted by this  |
  36.137 -     *          | implementation. If any explicit    |
  36.138 -     *          | padding is being used then the     |
  36.139 -     *          | sizeof (size) bytes at             |
  36.140 -     *          | mem_ptr - CHUNK_OFFSET must be     |
  36.141 -     *          | initialized with the negative      |
  36.142 -     *          | offset to size.                    |
  36.143 -     *          --------------------------------------
  36.144 -     * mem_ptr->| When allocated: data               |
  36.145 -     *          | When freed: pointer to next free   |
  36.146 -     *          | chunk                              |
  36.147 -     *          --------------------------------------
  36.148 -     */
  36.149 -    /* size of the allocated payload area, including size before
  36.150 -       CHUNK_OFFSET */
  36.151 -    long size;
  36.152 -
  36.153 -    /* since here, the memory is either the next free block, or data load */
  36.154 -    struct malloc_chunk * next;
  36.155 -}chunk;
  36.156 -
  36.157 -
  36.158 -#define CHUNK_OFFSET ((malloc_size_t)(&(((struct malloc_chunk *)0)->next)))
  36.159 -
  36.160 -/* size of smallest possible chunk. A memory piece smaller than this size
  36.161 - * won't be able to create a chunk */
  36.162 -#define MALLOC_MINCHUNK (CHUNK_OFFSET + MALLOC_PADDING + MALLOC_MINSIZE)
  36.163 -
  36.164 -/* Forward data declarations */
  36.165 -extern chunk * free_list;
  36.166 -extern char * sbrk_start;
  36.167 -extern struct mallinfo current_mallinfo;
  36.168 -
  36.169 -/* Forward function declarations */
  36.170 -extern void * nano_malloc(RARG malloc_size_t);
  36.171 -extern void nano_free (RARG void * free_p);
  36.172 -extern void nano_cfree(RARG void * ptr);
  36.173 -extern void * nano_calloc(RARG malloc_size_t n, malloc_size_t elem);
  36.174 -extern void nano_malloc_stats(RONEARG);
  36.175 -extern malloc_size_t nano_malloc_usable_size(RARG void * ptr);
  36.176 -extern void * nano_realloc(RARG void * ptr, malloc_size_t size);
  36.177 -extern void * nano_memalign(RARG size_t align, size_t s);
  36.178 -extern int nano_mallopt(RARG int parameter_number, int parameter_value);
  36.179 -extern void * nano_valloc(RARG size_t s);
  36.180 -extern void * nano_pvalloc(RARG size_t s);
  36.181 -
  36.182 -static inline chunk * get_chunk_from_ptr(void * ptr)
  36.183 -{
  36.184 -    /* Assume that there is no explicit padding in the
  36.185 -       chunk, and that the chunk starts at ptr - CHUNK_OFFSET.  */
  36.186 -    chunk * c = (chunk *)((char *)ptr - CHUNK_OFFSET);
  36.187 -
  36.188 -    /* c->size being negative indicates that there is explicit padding in
  36.189 -       the chunk. In which case, c->size is currently the negative offset to
  36.190 -       the true size.  */
  36.191 -    if (c->size < 0) c = (chunk *)((char *)c + c->size);
  36.192 -    return c;
  36.193 -}
  36.194 -
  36.195 -#ifdef DEFINE_MALLOC
  36.196 -/* List list header of free blocks */
  36.197 -chunk * free_list = NULL;
  36.198 -
  36.199 -/* Starting point of memory allocated from system */
  36.200 -char * sbrk_start = NULL;
  36.201 -
  36.202 -/** Function sbrk_aligned
  36.203 -  * Algorithm:
  36.204 -  *   Use sbrk() to obtain more memory and ensure it is CHUNK_ALIGN aligned
  36.205 -  *   Optimise for the case that it is already aligned - only ask for extra
  36.206 -  *   padding after we know we need it
  36.207 -  */
  36.208 -static void* sbrk_aligned(RARG malloc_size_t s)
  36.209 -{
  36.210 -    char *p, *align_p;
  36.211 -
  36.212 -    if (sbrk_start == NULL) sbrk_start = _SBRK_R(RCALL 0);
  36.213 -
  36.214 -    p = _SBRK_R(RCALL s);
  36.215 -
  36.216 -    /* sbrk returns -1 if fail to allocate */
  36.217 -    if (p == (void *)-1)
  36.218 -        return p;
  36.219 -
  36.220 -    align_p = (char*)ALIGN_TO((unsigned long)p, CHUNK_ALIGN);
  36.221 -    if (align_p != p)
  36.222 -    {
  36.223 -        /* p is not aligned, ask for a few more bytes so that we have s
  36.224 -         * bytes reserved from align_p. */
  36.225 -        p = _SBRK_R(RCALL align_p - p);
  36.226 -        if (p == (void *)-1)
  36.227 -            return p;
  36.228 -    }
  36.229 -    return align_p;
  36.230 -}
  36.231 -
  36.232 -/** Function nano_malloc
  36.233 -  * Algorithm:
  36.234 -  *   Walk through the free list to find the first match. If fails to find
  36.235 -  *   one, call sbrk to allocate a new chunk.
  36.236 -  */
  36.237 -void * nano_malloc(RARG malloc_size_t s)
  36.238 -{
  36.239 -    chunk *p, *r;
  36.240 -    char * ptr, * align_ptr;
  36.241 -    int offset;
  36.242 -
  36.243 -    malloc_size_t alloc_size;
  36.244 -
  36.245 -    alloc_size = ALIGN_TO(s, CHUNK_ALIGN); /* size of aligned data load */
  36.246 -    alloc_size += MALLOC_PADDING; /* padding */
  36.247 -    alloc_size += CHUNK_OFFSET; /* size of chunk head */
  36.248 -    alloc_size = MAX(alloc_size, MALLOC_MINCHUNK);
  36.249 -
  36.250 -    if (alloc_size >= MAX_ALLOC_SIZE || alloc_size < s)
  36.251 -    {
  36.252 -        RERRNO = ENOMEM;
  36.253 -        return NULL;
  36.254 -    }
  36.255 -
  36.256 -    MALLOC_LOCK;
  36.257 -
  36.258 -    p = free_list;
  36.259 -    r = p;
  36.260 -
  36.261 -    while (r)
  36.262 -    {
  36.263 -        int rem = r->size - alloc_size;
  36.264 -        if (rem >= 0)
  36.265 -        {
  36.266 -            if (rem >= MALLOC_MINCHUNK)
  36.267 -            {
  36.268 -                /* Find a chunk that much larger than required size, break
  36.269 -                * it into two chunks and return the second one */
  36.270 -                r->size = rem;
  36.271 -                r = (chunk *)((char *)r + rem);
  36.272 -                r->size = alloc_size;
  36.273 -            }
  36.274 -            /* Find a chunk that is exactly the size or slightly bigger
  36.275 -             * than requested size, just return this chunk */
  36.276 -            else if (p == r)
  36.277 -            {
  36.278 -                /* Now it implies p==r==free_list. Move the free_list
  36.279 -                 * to next chunk */
  36.280 -                free_list = r->next;
  36.281 -            }
  36.282 -            else
  36.283 -            {
  36.284 -                /* Normal case. Remove it from free_list */
  36.285 -                p->next = r->next;
  36.286 -            }
  36.287 -            break;
  36.288 -        }
  36.289 -        p=r;
  36.290 -        r=r->next;
  36.291 -    }
  36.292 -
  36.293 -    /* Failed to find a appropriate chunk. Ask for more memory */
  36.294 -    if (r == NULL)
  36.295 -    {
  36.296 -        r = sbrk_aligned(RCALL alloc_size);
  36.297 -
  36.298 -        /* sbrk returns -1 if fail to allocate */
  36.299 -        if (r == (void *)-1)
  36.300 -        {
  36.301 -            RERRNO = ENOMEM;
  36.302 -            MALLOC_UNLOCK;
  36.303 -            return NULL;
  36.304 -        }
  36.305 -        r->size = alloc_size;
  36.306 -    }
  36.307 -    MALLOC_UNLOCK;
  36.308 -
  36.309 -    ptr = (char *)r + CHUNK_OFFSET;
  36.310 -
  36.311 -    align_ptr = (char *)ALIGN_TO((unsigned long)ptr, MALLOC_ALIGN);
  36.312 -    offset = align_ptr - ptr;
  36.313 -
  36.314 -    if (offset)
  36.315 -    {
  36.316 -        /* Initialize sizeof (malloc_chunk.size) bytes at
  36.317 -           align_ptr - CHUNK_OFFSET with negative offset to the
  36.318 -           size field (at the start of the chunk).
  36.319 -
  36.320 -           The negative offset to size from align_ptr - CHUNK_OFFSET is
  36.321 -           the size of any remaining padding minus CHUNK_OFFSET.  This is
  36.322 -           equivalent to the total size of the padding, because the size of
  36.323 -           any remaining padding is the total size of the padding minus
  36.324 -           CHUNK_OFFSET.
  36.325 -
  36.326 -           Note that the size of the padding must be at least CHUNK_OFFSET.
  36.327 -
  36.328 -           The rest of the padding is not initialized.  */
  36.329 -        *(long *)((char *)r + offset) = -offset;
  36.330 -    }
  36.331 -
  36.332 -    assert(align_ptr + size <= (char *)r + alloc_size);
  36.333 -    return align_ptr;
  36.334 -}
  36.335 -#endif /* DEFINE_MALLOC */
  36.336 -
  36.337 -#ifdef DEFINE_FREE
  36.338 -#define MALLOC_CHECK_DOUBLE_FREE
  36.339 -
  36.340 -/** Function nano_free
  36.341 -  * Implementation of libc free.
  36.342 -  * Algorithm:
  36.343 -  *  Maintain a global free chunk single link list, headed by global
  36.344 -  *  variable free_list.
  36.345 -  *  When free, insert the to-be-freed chunk into free list. The place to
  36.346 -  *  insert should make sure all chunks are sorted by address from low to
  36.347 -  *  high.  Then merge with neighbor chunks if adjacent.
  36.348 -  */
  36.349 -void nano_free (RARG void * free_p)
  36.350 -{
  36.351 -    chunk * p_to_free;
  36.352 -    chunk * p, * q;
  36.353 -
  36.354 -    if (free_p == NULL) return;
  36.355 -
  36.356 -    p_to_free = get_chunk_from_ptr(free_p);
  36.357 -
  36.358 -    MALLOC_LOCK;
  36.359 -    if (free_list == NULL)
  36.360 -    {
  36.361 -        /* Set first free list element */
  36.362 -        p_to_free->next = free_list;
  36.363 -        free_list = p_to_free;
  36.364 -        MALLOC_UNLOCK;
  36.365 -        return;
  36.366 -    }
  36.367 -
  36.368 -    if (p_to_free < free_list)
  36.369 -    {
  36.370 -        if ((char *)p_to_free + p_to_free->size == (char *)free_list)
  36.371 -        {
  36.372 -            /* Chunk to free is just before the first element of
  36.373 -             * free list  */
  36.374 -            p_to_free->size += free_list->size;
  36.375 -            p_to_free->next = free_list->next;
  36.376 -        }
  36.377 -        else
  36.378 -        {
  36.379 -            /* Insert before current free_list */
  36.380 -            p_to_free->next = free_list;
  36.381 -        }
  36.382 -        free_list = p_to_free;
  36.383 -        MALLOC_UNLOCK;
  36.384 -        return;
  36.385 -    }
  36.386 -
  36.387 -    q = free_list;
  36.388 -    /* Walk through the free list to find the place for insert. */
  36.389 -    do
  36.390 -    {
  36.391 -        p = q;
  36.392 -        q = q->next;
  36.393 -    } while (q && q <= p_to_free);
  36.394 -
  36.395 -    /* Now p <= p_to_free and either q == NULL or q > p_to_free
  36.396 -     * Try to merge with chunks immediately before/after it. */
  36.397 -
  36.398 -    if ((char *)p + p->size == (char *)p_to_free)
  36.399 -    {
  36.400 -        /* Chunk to be freed is adjacent
  36.401 -         * to a free chunk before it */
  36.402 -        p->size += p_to_free->size;
  36.403 -        /* If the merged chunk is also adjacent
  36.404 -         * to the chunk after it, merge again */
  36.405 -        if ((char *)p + p->size == (char *) q)
  36.406 -        {
  36.407 -            p->size += q->size;
  36.408 -            p->next = q->next;
  36.409 -        }
  36.410 -    }
  36.411 -#ifdef MALLOC_CHECK_DOUBLE_FREE
  36.412 -    else if ((char *)p + p->size > (char *)p_to_free)
  36.413 -    {
  36.414 -        /* Report double free fault */
  36.415 -        RERRNO = ENOMEM;
  36.416 -        MALLOC_UNLOCK;
  36.417 -        return;
  36.418 -    }
  36.419 -#endif
  36.420 -    else if ((char *)p_to_free + p_to_free->size == (char *) q)
  36.421 -    {
  36.422 -        /* Chunk to be freed is adjacent
  36.423 -         * to a free chunk after it */
  36.424 -        p_to_free->size += q->size;
  36.425 -        p_to_free->next = q->next;
  36.426 -        p->next = p_to_free;
  36.427 -    }
  36.428 -    else
  36.429 -    {
  36.430 -        /* Not adjacent to any chunk. Just insert it. Resulting
  36.431 -         * a fragment. */
  36.432 -        p_to_free->next = q;
  36.433 -        p->next = p_to_free;
  36.434 -    }
  36.435 -    MALLOC_UNLOCK;
  36.436 -}
  36.437 -#endif /* DEFINE_FREE */
  36.438 -
  36.439 -#ifdef DEFINE_CFREE
  36.440 -void nano_cfree(RARG void * ptr)
  36.441 -{
  36.442 -    nano_free(RCALL ptr);
  36.443 -}
  36.444 -#endif /* DEFINE_CFREE */
  36.445 -
  36.446 -#ifdef DEFINE_CALLOC
  36.447 -/* Function nano_calloc
  36.448 - * Implement calloc simply by calling malloc and set zero */
  36.449 -void * nano_calloc(RARG malloc_size_t n, malloc_size_t elem)
  36.450 -{
  36.451 -    void * mem = nano_malloc(RCALL n * elem);
  36.452 -    if (mem != NULL) memset(mem, 0, n * elem);
  36.453 -    return mem;
  36.454 -}
  36.455 -#endif /* DEFINE_CALLOC */
  36.456 -
  36.457 -#ifdef DEFINE_REALLOC
  36.458 -/* Function nano_realloc
  36.459 - * Implement realloc by malloc + memcpy */
  36.460 -void * nano_realloc(RARG void * ptr, malloc_size_t size)
  36.461 -{
  36.462 -    void * mem;
  36.463 -    chunk * p_to_realloc;
  36.464 -
  36.465 -    if (ptr == NULL) return nano_malloc(RCALL size);
  36.466 -
  36.467 -    if (size == 0)
  36.468 -    {
  36.469 -        nano_free(RCALL ptr);
  36.470 -        return NULL;
  36.471 -    }
  36.472 -
  36.473 -    /* TODO: There is chance to shrink the chunk if newly requested
  36.474 -     * size is much small */
  36.475 -    if (nano_malloc_usable_size(RCALL ptr) >= size)
  36.476 -      return ptr;
  36.477 -
  36.478 -    mem = nano_malloc(RCALL size);
  36.479 -    if (mem != NULL)
  36.480 -    {
  36.481 -        memcpy(mem, ptr, size);
  36.482 -        nano_free(RCALL ptr);
  36.483 -    }
  36.484 -    return mem;
  36.485 -}
  36.486 -#endif /* DEFINE_REALLOC */
  36.487 -
  36.488 -#ifdef DEFINE_MALLINFO
  36.489 -struct mallinfo current_mallinfo={0,0,0,0,0,0,0,0,0,0};
  36.490 -
  36.491 -struct mallinfo nano_mallinfo(RONEARG)
  36.492 -{
  36.493 -    char * sbrk_now;
  36.494 -    chunk * pf;
  36.495 -    size_t free_size = 0;
  36.496 -    size_t total_size;
  36.497 -
  36.498 -    MALLOC_LOCK;
  36.499 -
  36.500 -    if (sbrk_start == NULL) total_size = 0;
  36.501 -    else {
  36.502 -        sbrk_now = _SBRK_R(RCALL 0);
  36.503 -
  36.504 -        if (sbrk_now == (void *)-1)
  36.505 -            total_size = (size_t)-1;
  36.506 -        else
  36.507 -            total_size = (size_t) (sbrk_now - sbrk_start);
  36.508 -    }
  36.509 -
  36.510 -    for (pf = free_list; pf; pf = pf->next)
  36.511 -        free_size += pf->size;
  36.512 -
  36.513 -    current_mallinfo.arena = total_size;
  36.514 -    current_mallinfo.fordblks = free_size;
  36.515 -    current_mallinfo.uordblks = total_size - free_size;
  36.516 -
  36.517 -    MALLOC_UNLOCK;
  36.518 -    return current_mallinfo;
  36.519 -}
  36.520 -#endif /* DEFINE_MALLINFO */
  36.521 -
  36.522 -#ifdef DEFINE_MALLOC_STATS
  36.523 -void nano_malloc_stats(RONEARG)
  36.524 -{
  36.525 -    nano_mallinfo(RONECALL);
  36.526 -    fiprintf(stderr, "max system bytes = %10u\n",
  36.527 -             current_mallinfo.arena);
  36.528 -    fiprintf(stderr, "system bytes     = %10u\n",
  36.529 -             current_mallinfo.arena);
  36.530 -    fiprintf(stderr, "in use bytes     = %10u\n",
  36.531 -             current_mallinfo.uordblks);
  36.532 -}
  36.533 -#endif /* DEFINE_MALLOC_STATS */
  36.534 -
  36.535 -#ifdef DEFINE_MALLOC_USABLE_SIZE
  36.536 -malloc_size_t nano_malloc_usable_size(RARG void * ptr)
  36.537 -{
  36.538 -    chunk * c = (chunk *)((char *)ptr - CHUNK_OFFSET);
  36.539 -    int size_or_offset = c->size;
  36.540 -
  36.541 -    if (size_or_offset < 0)
  36.542 -    {
  36.543 -        /* Padding is used. Excluding the padding size */
  36.544 -        c = (chunk *)((char *)c + c->size);
  36.545 -        return c->size - CHUNK_OFFSET + size_or_offset;
  36.546 -    }
  36.547 -    return c->size - CHUNK_OFFSET;
  36.548 -}
  36.549 -#endif /* DEFINE_MALLOC_USABLE_SIZE */
  36.550 -
  36.551 -#ifdef DEFINE_MEMALIGN
  36.552 -/* Function nano_memalign
  36.553 - * Allocate memory block aligned at specific boundary.
  36.554 - *   align: required alignment. Must be power of 2. Return NULL
  36.555 - *          if not power of 2. Undefined behavior is bigger than
  36.556 - *          pointer value range.
  36.557 - *   s: required size.
  36.558 - * Return: allocated memory pointer aligned to align
  36.559 - * Algorithm: Malloc a big enough block, padding pointer to aligned
  36.560 - *            address, then truncate and free the tail if too big.
  36.561 - *            Record the offset of align pointer and original pointer
  36.562 - *            in the padding area.
  36.563 - */
  36.564 -void * nano_memalign(RARG size_t align, size_t s)
  36.565 -{
  36.566 -    chunk * chunk_p;
  36.567 -    malloc_size_t size_allocated, offset, ma_size, size_with_padding;
  36.568 -    char * allocated, * aligned_p;
  36.569 -
  36.570 -    /* Return NULL if align isn't power of 2 */
  36.571 -    if ((align & (align-1)) != 0) return NULL;
  36.572 -
  36.573 -    align = MAX(align, MALLOC_ALIGN);
  36.574 -    ma_size = ALIGN_TO(MAX(s, MALLOC_MINSIZE), CHUNK_ALIGN);
  36.575 -    size_with_padding = ma_size + align - MALLOC_ALIGN;
  36.576 -
  36.577 -    allocated = nano_malloc(RCALL size_with_padding);
  36.578 -    if (allocated == NULL) return NULL;
  36.579 -
  36.580 -    chunk_p = get_chunk_from_ptr(allocated);
  36.581 -    aligned_p = (char *)ALIGN_TO(
  36.582 -                  (unsigned long)((char *)chunk_p + CHUNK_OFFSET),
  36.583 -                  (unsigned long)align);
  36.584 -    offset = aligned_p - ((char *)chunk_p + CHUNK_OFFSET);
  36.585 -
  36.586 -    if (offset)
  36.587 -    {
  36.588 -        if (offset >= MALLOC_MINCHUNK)
  36.589 -        {
  36.590 -            /* Padding is too large, free it */
  36.591 -            chunk * front_chunk = chunk_p;
  36.592 -            chunk_p = (chunk *)((char *)chunk_p + offset);
  36.593 -            chunk_p->size = front_chunk->size - offset;
  36.594 -            front_chunk->size = offset;
  36.595 -            nano_free(RCALL (char *)front_chunk + CHUNK_OFFSET);
  36.596 -        }
  36.597 -        else
  36.598 -        {
  36.599 -            /* Padding is used. Need to set a jump offset for aligned pointer
  36.600 -            * to get back to chunk head */
  36.601 -            assert(offset >= sizeof(int));
  36.602 -            *(long *)((char *)chunk_p + offset) = -offset;
  36.603 -        }
  36.604 -    }
  36.605 -
  36.606 -    size_allocated = chunk_p->size;
  36.607 -    if ((char *)chunk_p + size_allocated >
  36.608 -         (aligned_p + ma_size + MALLOC_MINCHUNK))
  36.609 -    {
  36.610 -        /* allocated much more than what's required for padding, free
  36.611 -         * tail part */
  36.612 -        chunk * tail_chunk = (chunk *)(aligned_p + ma_size);
  36.613 -        chunk_p->size = aligned_p + ma_size - (char *)chunk_p;
  36.614 -        tail_chunk->size = size_allocated - chunk_p->size;
  36.615 -        nano_free(RCALL (char *)tail_chunk + CHUNK_OFFSET);
  36.616 -    }
  36.617 -    return aligned_p;
  36.618 -}
  36.619 -#endif /* DEFINE_MEMALIGN */
  36.620 -
  36.621 -#ifdef DEFINE_MALLOPT
  36.622 -int nano_mallopt(RARG int parameter_number, int parameter_value)
  36.623 -{
  36.624 -    return 0;
  36.625 -}
  36.626 -#endif /* DEFINE_MALLOPT */
  36.627 -
  36.628 -#ifdef DEFINE_VALLOC
  36.629 -void * nano_valloc(RARG size_t s)
  36.630 -{
  36.631 -    return nano_memalign(RCALL MALLOC_PAGE_ALIGN, s);
  36.632 -}
  36.633 -#endif /* DEFINE_VALLOC */
  36.634 -
  36.635 -#ifdef DEFINE_PVALLOC
  36.636 -void * nano_pvalloc(RARG size_t s)
  36.637 -{
  36.638 -    return nano_valloc(RCALL ALIGN_TO(s, MALLOC_PAGE_ALIGN));
  36.639 -}
  36.640 -#endif /* DEFINE_PVALLOC */
    37.1 --- a/libc/string/Makefile.am	Sat Dec 07 00:44:56 2019 +0100
    37.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.3 @@ -1,170 +0,0 @@
    37.4 -## Process this file with automake to generate Makefile.in
    37.5 -
    37.6 -AUTOMAKE_OPTIONS = cygnus
    37.7 -
    37.8 -INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
    37.9 -
   37.10 -GENERAL_SOURCES = \
   37.11 -	bcopy.c \
   37.12 -	bzero.c \
   37.13 -	explicit_bzero.c \
   37.14 -	ffsl.c \
   37.15 -	ffsll.c \
   37.16 -	fls.c \
   37.17 -	flsl.c \
   37.18 -	flsll.c \
   37.19 -	index.c \
   37.20 -	memchr.c \
   37.21 -	memcmp.c \
   37.22 -	memcpy.c \
   37.23 -	memmove.c \
   37.24 -	memset.c \
   37.25 -	rindex.c \
   37.26 -	strcasecmp.c \
   37.27 -	strcat.c \
   37.28 -	strchr.c \
   37.29 -	strcmp.c \
   37.30 -	strcoll.c \
   37.31 -	strcpy.c \
   37.32 -	strcspn.c \
   37.33 -	strdup.c \
   37.34 -	strdup_r.c \
   37.35 -	strerror.c \
   37.36 -	strerror_r.c \
   37.37 -	strlcat.c \
   37.38 -	strlcpy.c \
   37.39 -	strlen.c  \
   37.40 -	strlwr.c \
   37.41 -	strncasecmp.c \
   37.42 -	strncat.c \
   37.43 -	strncmp.c \
   37.44 -	strncpy.c \
   37.45 -	strnlen.c \
   37.46 -	strnstr.c \
   37.47 -	strpbrk.c \
   37.48 -	strrchr.c \
   37.49 -	strsep.c \
   37.50 -	strsignal.c \
   37.51 -	strspn.c \
   37.52 -	strtok.c \
   37.53 -	strtok_r.c \
   37.54 -	strupr.c \
   37.55 -	strxfrm.c  \
   37.56 -	strstr.c \
   37.57 -	swab.c \
   37.58 -	timingsafe_bcmp.c \
   37.59 -	timingsafe_memcmp.c \
   37.60 -	u_strerr.c \
   37.61 -	wcscat.c \
   37.62 -	wcschr.c \
   37.63 -	wcscmp.c \
   37.64 -	wcscoll.c \
   37.65 -	wcscpy.c \
   37.66 -	wcscspn.c \
   37.67 -	wcslcat.c \
   37.68 -	wcslcpy.c \
   37.69 -	wcslen.c \
   37.70 -	wcsncat.c \
   37.71 -	wcsncmp.c \
   37.72 -	wcsncpy.c \
   37.73 -	wcsnlen.c \
   37.74 -	wcspbrk.c \
   37.75 -	wcsrchr.c \
   37.76 -	wcsspn.c \
   37.77 -	wcsstr.c \
   37.78 -	wcstok.c \
   37.79 -	wcswidth.c \
   37.80 -	wcsxfrm.c \
   37.81 -	wcwidth.c \
   37.82 -	wmemchr.c \
   37.83 -	wmemcmp.c \
   37.84 -	wmemcpy.c \
   37.85 -	wmemmove.c \
   37.86 -	wmemset.c \
   37.87 -	xpg_strerror_r.c
   37.88 -
   37.89 -if ELIX_LEVEL_1
   37.90 -ELIX_2_SOURCES =
   37.91 -else
   37.92 -ELIX_2_SOURCES = \
   37.93 -	bcmp.c \
   37.94 -	memccpy.c \
   37.95 -	mempcpy.c \
   37.96 -	stpcpy.c \
   37.97 -	stpncpy.c \
   37.98 -	strndup.c \
   37.99 -	strcasestr.c \
  37.100 -	strchrnul.c \
  37.101 -	strndup_r.c \
  37.102 -	wcpcpy.c \
  37.103 -	wcpncpy.c \
  37.104 -	wcsdup.c
  37.105 -endif !ELIX_LEVEL_1
  37.106 -
  37.107 -if ELIX_LEVEL_1
  37.108 -ELIX_4_SOURCES =
  37.109 -else
  37.110 -if ELIX_LEVEL_2
  37.111 -ELIX_4_SOURCES =
  37.112 -else
  37.113 -if ELIX_LEVEL_3
  37.114 -ELIX_4_SOURCES =
  37.115 -else
  37.116 -ELIX_4_SOURCES = \
  37.117 -	gnu_basename.c \
  37.118 -	memmem.c \
  37.119 -	memrchr.c \
  37.120 -	rawmemchr.c \
  37.121 -	strcasecmp_l.c \
  37.122 -	strcoll_l.c \
  37.123 -	strncasecmp_l.c \
  37.124 -	strverscmp.c \
  37.125 -	strxfrm_l.c \
  37.126 -	wcscasecmp.c \
  37.127 -	wcscasecmp_l.c \
  37.128 -	wcscoll_l.c \
  37.129 -	wcsncasecmp.c \
  37.130 -	wcsncasecmp_l.c \
  37.131 -	wcsxfrm_l.c \
  37.132 -	wmempcpy.c
  37.133 -endif !ELIX_LEVEL_3
  37.134 -endif !ELIX_LEVEL_2
  37.135 -endif !ELIX_LEVEL_1
  37.136 -
  37.137 -libstring_la_LDFLAGS = -Xcompiler -nostdlib
  37.138 -
  37.139 -if USE_LIBTOOL
  37.140 -noinst_LTLIBRARIES = libstring.la
  37.141 -libstring_la_SOURCES = $(GENERAL_SOURCES) $(ELIX_2_SOURCES) $(ELIX_4_SOURCES)
  37.142 -noinst_DATA = objectlist.awk.in
  37.143 -else
  37.144 -noinst_LIBRARIES = lib.a
  37.145 -lib_a_SOURCES = $(GENERAL_SOURCES) $(ELIX_2_SOURCES) $(ELIX_4_SOURCES)
  37.146 -lib_a_CFLAGS = $(AM_CFLAGS)
  37.147 -noinst_DATA =
  37.148 -endif # USE_LIBTOOL
  37.149 -
  37.150 -include $(srcdir)/../../Makefile.shared
  37.151 -
  37.152 -CHEWOUT_FILES=\
  37.153 -bcmp.def	memcpy.def	strcmp.def	strncat.def strstr.def \
  37.154 -bcopy.def	memmove.def	strcoll.def	strncmp.def strtok.def \
  37.155 -bzero.def	memset.def	strcpy.def	strncpy.def strxfrm.def \
  37.156 -index.def	rindex.def	strcspn.def	strpbrk.def swab.def \
  37.157 -memchr.def	strcat.def	strerror.def	strerror_r.def strrchr.def \
  37.158 -memcmp.def	strchr.def	strlen.def	strnlen.def strspn.def \
  37.159 -strcasecmp.def	strncasecmp.def strcasestr.def	strlwr.def  strupr.def \
  37.160 -memccpy.def 	mempcpy.def	stpcpy.def	stpncpy.def strsignal.def \
  37.161 -wcscasecmp.def	wcscat.def	wcschr.def	wcscmp.def wcscoll.def \
  37.162 -wcscpy.def	wcscspn.def	wcpcpy.def	wcpncpy.def wcsdup.def \
  37.163 -wcslcat.def	wcslcpy.def	wcslen.def	wcsncasecmp.def wcsncat.def \
  37.164 -wcsncmp.def	wcsncpy.def	wcsnlen.def	wcspbrk.def \
  37.165 -wcsrchr.def	wcsspn.def	wcsstr.def 	wcstok.def  \
  37.166 -wcswidth.def	wcsxfrm.def	wcwidth.def	wmemchr.def \
  37.167 -wmemcmp.def	wmemcpy.def	wmemmove.def	wmemset.def \
  37.168 -memmem.def	memrchr.def	rawmemchr.def	strchrnul.def \
  37.169 -strcasecmp_l.def strcoll_l.def	strncasecmp_l.def strxfrm_l.def \
  37.170 -wcscasecmp_l.def wcscoll_l.def	wcsncasecmp_l.def wcsxfrm_l.def \
  37.171 -strverscmp.def	strnstr.def	wmempcpy.def
  37.172 -
  37.173 -CHAPTERS = strings.tex wcstrings.tex
    38.1 --- a/libc/string/Makefile.in	Sat Dec 07 00:44:56 2019 +0100
    38.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.3 @@ -1,1418 +0,0 @@
    38.4 -# Makefile.in generated by automake 1.11.6 from Makefile.am.
    38.5 -# @configure_input@
    38.6 -
    38.7 -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
    38.8 -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
    38.9 -# Foundation, Inc.
   38.10 -# This Makefile.in is free software; the Free Software Foundation
   38.11 -# gives unlimited permission to copy and/or distribute it,
   38.12 -# with or without modifications, as long as this notice is preserved.
   38.13 -
   38.14 -# This program is distributed in the hope that it will be useful,
   38.15 -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
   38.16 -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
   38.17 -# PARTICULAR PURPOSE.
   38.18 -
   38.19 -@SET_MAKE@
   38.20 -
   38.21 -
   38.22 -
   38.23 -VPATH = @srcdir@
   38.24 -am__make_dryrun = \
   38.25 -  { \
   38.26 -    am__dry=no; \
   38.27 -    case $$MAKEFLAGS in \
   38.28 -      *\\[\ \	]*) \
   38.29 -        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
   38.30 -          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
   38.31 -      *) \
   38.32 -        for am__flg in $$MAKEFLAGS; do \
   38.33 -          case $$am__flg in \
   38.34 -            *=*|--*) ;; \
   38.35 -            *n*) am__dry=yes; break;; \
   38.36 -          esac; \
   38.37 -        done;; \
   38.38 -    esac; \
   38.39 -    test $$am__dry = yes; \
   38.40 -  }
   38.41 -pkgdatadir = $(datadir)/@PACKAGE@
   38.42 -pkgincludedir = $(includedir)/@PACKAGE@
   38.43 -pkglibdir = $(libdir)/@PACKAGE@
   38.44 -pkglibexecdir = $(libexecdir)/@PACKAGE@
   38.45 -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
   38.46 -install_sh_DATA = $(install_sh) -c -m 644
   38.47 -install_sh_PROGRAM = $(install_sh) -c
   38.48 -install_sh_SCRIPT = $(install_sh) -c
   38.49 -INSTALL_HEADER = $(INSTALL_DATA)
   38.50 -transform = $(program_transform_name)
   38.51 -NORMAL_INSTALL = :
   38.52 -PRE_INSTALL = :
   38.53 -POST_INSTALL = :
   38.54 -NORMAL_UNINSTALL = :
   38.55 -PRE_UNINSTALL = :
   38.56 -POST_UNINSTALL = :
   38.57 -build_triplet = @build@
   38.58 -host_triplet = @host@
   38.59 -DIST_COMMON = $(srcdir)/../../Makefile.shared $(srcdir)/Makefile.in \
   38.60 -	$(srcdir)/Makefile.am
   38.61 -subdir = string
   38.62 -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
   38.63 -am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \
   38.64 -	$(top_srcdir)/../../ltoptions.m4 \
   38.65 -	$(top_srcdir)/../../ltsugar.m4 \
   38.66 -	$(top_srcdir)/../../ltversion.m4 \
   38.67 -	$(top_srcdir)/../../lt~obsolete.m4 \
   38.68 -	$(top_srcdir)/../acinclude.m4 $(top_srcdir)/configure.in
   38.69 -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
   38.70 -	$(ACLOCAL_M4)
   38.71 -mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs
   38.72 -CONFIG_CLEAN_FILES =
   38.73 -CONFIG_CLEAN_VPATH_FILES =
   38.74 -LIBRARIES = $(noinst_LIBRARIES)
   38.75 -ARFLAGS = cru
   38.76 -lib_a_AR = $(AR) $(ARFLAGS)
   38.77 -lib_a_LIBADD =
   38.78 -am__objects_1 = lib_a-bcopy.$(OBJEXT) lib_a-bzero.$(OBJEXT) \
   38.79 -	lib_a-explicit_bzero.$(OBJEXT) lib_a-ffsl.$(OBJEXT) \
   38.80 -	lib_a-ffsll.$(OBJEXT) lib_a-fls.$(OBJEXT) lib_a-flsl.$(OBJEXT) \
   38.81 -	lib_a-flsll.$(OBJEXT) lib_a-index.$(OBJEXT) \
   38.82 -	lib_a-memchr.$(OBJEXT) lib_a-memcmp.$(OBJEXT) \
   38.83 -	lib_a-memcpy.$(OBJEXT) lib_a-memmove.$(OBJEXT) \
   38.84 -	lib_a-memset.$(OBJEXT) lib_a-rindex.$(OBJEXT) \
   38.85 -	lib_a-strcasecmp.$(OBJEXT) lib_a-strcat.$(OBJEXT) \
   38.86 -	lib_a-strchr.$(OBJEXT) lib_a-strcmp.$(OBJEXT) \
   38.87 -	lib_a-strcoll.$(OBJEXT) lib_a-strcpy.$(OBJEXT) \
   38.88 -	lib_a-strcspn.$(OBJEXT) lib_a-strdup.$(OBJEXT) \
   38.89 -	lib_a-strdup_r.$(OBJEXT) lib_a-strerror.$(OBJEXT) \
   38.90 -	lib_a-strerror_r.$(OBJEXT) lib_a-strlcat.$(OBJEXT) \
   38.91 -	lib_a-strlcpy.$(OBJEXT) lib_a-strlen.$(OBJEXT) \
   38.92 -	lib_a-strlwr.$(OBJEXT) lib_a-strncasecmp.$(OBJEXT) \
   38.93 -	lib_a-strncat.$(OBJEXT) lib_a-strncmp.$(OBJEXT) \
   38.94 -	lib_a-strncpy.$(OBJEXT) lib_a-strnlen.$(OBJEXT) \
   38.95 -	lib_a-strnstr.$(OBJEXT) lib_a-strpbrk.$(OBJEXT) \
   38.96 -	lib_a-strrchr.$(OBJEXT) lib_a-strsep.$(OBJEXT) \
   38.97 -	lib_a-strsignal.$(OBJEXT) lib_a-strspn.$(OBJEXT) \
   38.98 -	lib_a-strtok.$(OBJEXT) lib_a-strtok_r.$(OBJEXT) \
   38.99 -	lib_a-strupr.$(OBJEXT) lib_a-strxfrm.$(OBJEXT) \
  38.100 -	lib_a-strstr.$(OBJEXT) lib_a-swab.$(OBJEXT) \
  38.101 -	lib_a-timingsafe_bcmp.$(OBJEXT) \
  38.102 -	lib_a-timingsafe_memcmp.$(OBJEXT) lib_a-u_strerr.$(OBJEXT) \
  38.103 -	lib_a-wcscat.$(OBJEXT) lib_a-wcschr.$(OBJEXT) \
  38.104 -	lib_a-wcscmp.$(OBJEXT) lib_a-wcscoll.$(OBJEXT) \
  38.105 -	lib_a-wcscpy.$(OBJEXT) lib_a-wcscspn.$(OBJEXT) \
  38.106 -	lib_a-wcslcat.$(OBJEXT) lib_a-wcslcpy.$(OBJEXT) \
  38.107 -	lib_a-wcslen.$(OBJEXT) lib_a-wcsncat.$(OBJEXT) \
  38.108 -	lib_a-wcsncmp.$(OBJEXT) lib_a-wcsncpy.$(OBJEXT) \
  38.109 -	lib_a-wcsnlen.$(OBJEXT) lib_a-wcspbrk.$(OBJEXT) \
  38.110 -	lib_a-wcsrchr.$(OBJEXT) lib_a-wcsspn.$(OBJEXT) \
  38.111 -	lib_a-wcsstr.$(OBJEXT) lib_a-wcstok.$(OBJEXT) \
  38.112 -	lib_a-wcswidth.$(OBJEXT) lib_a-wcsxfrm.$(OBJEXT) \
  38.113 -	lib_a-wcwidth.$(OBJEXT) lib_a-wmemchr.$(OBJEXT) \
  38.114 -	lib_a-wmemcmp.$(OBJEXT) lib_a-wmemcpy.$(OBJEXT) \
  38.115 -	lib_a-wmemmove.$(OBJEXT) lib_a-wmemset.$(OBJEXT) \
  38.116 -	lib_a-xpg_strerror_r.$(OBJEXT)
  38.117 -@ELIX_LEVEL_1_FALSE@am__objects_2 = lib_a-bcmp.$(OBJEXT) \
  38.118 -@ELIX_LEVEL_1_FALSE@	lib_a-memccpy.$(OBJEXT) \
  38.119 -@ELIX_LEVEL_1_FALSE@	lib_a-mempcpy.$(OBJEXT) \
  38.120 -@ELIX_LEVEL_1_FALSE@	lib_a-stpcpy.$(OBJEXT) \
  38.121 -@ELIX_LEVEL_1_FALSE@	lib_a-stpncpy.$(OBJEXT) \
  38.122 -@ELIX_LEVEL_1_FALSE@	lib_a-strndup.$(OBJEXT) \
  38.123 -@ELIX_LEVEL_1_FALSE@	lib_a-strcasestr.$(OBJEXT) \
  38.124 -@ELIX_LEVEL_1_FALSE@	lib_a-strchrnul.$(OBJEXT) \
  38.125 -@ELIX_LEVEL_1_FALSE@	lib_a-strndup_r.$(OBJEXT) \
  38.126 -@ELIX_LEVEL_1_FALSE@	lib_a-wcpcpy.$(OBJEXT) \
  38.127 -@ELIX_LEVEL_1_FALSE@	lib_a-wcpncpy.$(OBJEXT) \
  38.128 -@ELIX_LEVEL_1_FALSE@	lib_a-wcsdup.$(OBJEXT)
  38.129 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@am__objects_3 = lib_a-gnu_basename.$(OBJEXT) \
  38.130 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-memmem.$(OBJEXT) \
  38.131 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-memrchr.$(OBJEXT) \
  38.132 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-rawmemchr.$(OBJEXT) \
  38.133 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-strcasecmp_l.$(OBJEXT) \
  38.134 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-strcoll_l.$(OBJEXT) \
  38.135 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-strncasecmp_l.$(OBJEXT) \
  38.136 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-strverscmp.$(OBJEXT) \
  38.137 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-strxfrm_l.$(OBJEXT) \
  38.138 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-wcscasecmp.$(OBJEXT) \
  38.139 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-wcscasecmp_l.$(OBJEXT) \
  38.140 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-wcscoll_l.$(OBJEXT) \
  38.141 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-wcsncasecmp.$(OBJEXT) \
  38.142 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-wcsncasecmp_l.$(OBJEXT) \
  38.143 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-wcsxfrm_l.$(OBJEXT) \
  38.144 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	lib_a-wmempcpy.$(OBJEXT)
  38.145 -@USE_LIBTOOL_FALSE@am_lib_a_OBJECTS = $(am__objects_1) \
  38.146 -@USE_LIBTOOL_FALSE@	$(am__objects_2) $(am__objects_3)
  38.147 -lib_a_OBJECTS = $(am_lib_a_OBJECTS)
  38.148 -LTLIBRARIES = $(noinst_LTLIBRARIES)
  38.149 -libstring_la_LIBADD =
  38.150 -am__objects_4 = bcopy.lo bzero.lo explicit_bzero.lo ffsl.lo ffsll.lo \
  38.151 -	fls.lo flsl.lo flsll.lo index.lo memchr.lo memcmp.lo memcpy.lo \
  38.152 -	memmove.lo memset.lo rindex.lo strcasecmp.lo strcat.lo \
  38.153 -	strchr.lo strcmp.lo strcoll.lo strcpy.lo strcspn.lo strdup.lo \
  38.154 -	strdup_r.lo strerror.lo strerror_r.lo strlcat.lo strlcpy.lo \
  38.155 -	strlen.lo strlwr.lo strncasecmp.lo strncat.lo strncmp.lo \
  38.156 -	strncpy.lo strnlen.lo strnstr.lo strpbrk.lo strrchr.lo \
  38.157 -	strsep.lo strsignal.lo strspn.lo strtok.lo strtok_r.lo \
  38.158 -	strupr.lo strxfrm.lo strstr.lo swab.lo timingsafe_bcmp.lo \
  38.159 -	timingsafe_memcmp.lo u_strerr.lo wcscat.lo wcschr.lo wcscmp.lo \
  38.160 -	wcscoll.lo wcscpy.lo wcscspn.lo wcslcat.lo wcslcpy.lo \
  38.161 -	wcslen.lo wcsncat.lo wcsncmp.lo wcsncpy.lo wcsnlen.lo \
  38.162 -	wcspbrk.lo wcsrchr.lo wcsspn.lo wcsstr.lo wcstok.lo \
  38.163 -	wcswidth.lo wcsxfrm.lo wcwidth.lo wmemchr.lo wmemcmp.lo \
  38.164 -	wmemcpy.lo wmemmove.lo wmemset.lo xpg_strerror_r.lo
  38.165 -@ELIX_LEVEL_1_FALSE@am__objects_5 = bcmp.lo memccpy.lo mempcpy.lo \
  38.166 -@ELIX_LEVEL_1_FALSE@	stpcpy.lo stpncpy.lo strndup.lo \
  38.167 -@ELIX_LEVEL_1_FALSE@	strcasestr.lo strchrnul.lo strndup_r.lo \
  38.168 -@ELIX_LEVEL_1_FALSE@	wcpcpy.lo wcpncpy.lo wcsdup.lo
  38.169 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@am__objects_6 = gnu_basename.lo \
  38.170 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	memmem.lo \
  38.171 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	memrchr.lo \
  38.172 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	rawmemchr.lo \
  38.173 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	strcasecmp_l.lo \
  38.174 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	strcoll_l.lo \
  38.175 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	strncasecmp_l.lo \
  38.176 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	strverscmp.lo \
  38.177 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	strxfrm_l.lo \
  38.178 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	wcscasecmp.lo \
  38.179 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	wcscasecmp_l.lo \
  38.180 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	wcscoll_l.lo \
  38.181 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	wcsncasecmp.lo \
  38.182 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	wcsncasecmp_l.lo \
  38.183 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	wcsxfrm_l.lo \
  38.184 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	wmempcpy.lo
  38.185 -@USE_LIBTOOL_TRUE@am_libstring_la_OBJECTS = $(am__objects_4) \
  38.186 -@USE_LIBTOOL_TRUE@	$(am__objects_5) $(am__objects_6)
  38.187 -libstring_la_OBJECTS = $(am_libstring_la_OBJECTS)
  38.188 -libstring_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
  38.189 -	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
  38.190 -	$(libstring_la_LDFLAGS) $(LDFLAGS) -o $@
  38.191 -@USE_LIBTOOL_TRUE@am_libstring_la_rpath =
  38.192 -DEFAULT_INCLUDES = -I.@am__isrc@
  38.193 -depcomp =
  38.194 -am__depfiles_maybe =
  38.195 -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
  38.196 -	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
  38.197 -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
  38.198 -	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
  38.199 -	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
  38.200 -CCLD = $(CC)
  38.201 -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
  38.202 -	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
  38.203 -	$(LDFLAGS) -o $@
  38.204 -SOURCES = $(lib_a_SOURCES) $(libstring_la_SOURCES)
  38.205 -am__can_run_installinfo = \
  38.206 -  case $$AM_UPDATE_INFO_DIR in \
  38.207 -    n|no|NO) false;; \
  38.208 -    *) (install-info --version) >/dev/null 2>&1;; \
  38.209 -  esac
  38.210 -DATA = $(noinst_DATA)
  38.211 -ETAGS = etags
  38.212 -CTAGS = ctags
  38.213 -ACLOCAL = @ACLOCAL@
  38.214 -AMTAR = @AMTAR@
  38.215 -AR = @AR@
  38.216 -AS = @AS@
  38.217 -AUTOCONF = @AUTOCONF@
  38.218 -AUTOHEADER = @AUTOHEADER@
  38.219 -AUTOMAKE = @AUTOMAKE@
  38.220 -AWK = @AWK@
  38.221 -CC = @CC@
  38.222 -CCAS = @CCAS@
  38.223 -CCASFLAGS = @CCASFLAGS@
  38.224 -CCDEPMODE = @CCDEPMODE@
  38.225 -CFLAGS = @CFLAGS@
  38.226 -CPP = @CPP@
  38.227 -CPPFLAGS = @CPPFLAGS@
  38.228 -CRT0 = @CRT0@
  38.229 -CYGPATH_W = @CYGPATH_W@
  38.230 -DEFS = @DEFS@
  38.231 -DEPDIR = @DEPDIR@
  38.232 -DLLTOOL = @DLLTOOL@
  38.233 -DSYMUTIL = @DSYMUTIL@
  38.234 -DUMPBIN = @DUMPBIN@
  38.235 -ECHO_C = @ECHO_C@
  38.236 -ECHO_N = @ECHO_N@
  38.237 -ECHO_T = @ECHO_T@
  38.238 -EGREP = @EGREP@
  38.239 -EXEEXT = @EXEEXT@
  38.240 -FGREP = @FGREP@
  38.241 -GREP = @GREP@
  38.242 -INSTALL = @INSTALL@
  38.243 -INSTALL_DATA = @INSTALL_DATA@
  38.244 -INSTALL_PROGRAM = @INSTALL_PROGRAM@
  38.245 -INSTALL_SCRIPT = @INSTALL_SCRIPT@
  38.246 -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
  38.247 -LD = @LD@
  38.248 -LDFLAGS = @LDFLAGS@
  38.249 -LIBC_EXTRA_DEF = @LIBC_EXTRA_DEF@
  38.250 -LIBC_EXTRA_LIB = @LIBC_EXTRA_LIB@
  38.251 -LIBC_MACHINE_LIB = @LIBC_MACHINE_LIB@
  38.252 -LIBC_POSIX_DEF = @LIBC_POSIX_DEF@
  38.253 -LIBC_POSIX_LIB = @LIBC_POSIX_LIB@
  38.254 -LIBC_SIGNAL_DEF = @LIBC_SIGNAL_DEF@
  38.255 -LIBC_SIGNAL_LIB = @LIBC_SIGNAL_LIB@
  38.256 -LIBC_STDIO64_DEF = @LIBC_STDIO64_DEF@
  38.257 -LIBC_STDIO64_LIB = @LIBC_STDIO64_LIB@
  38.258 -LIBC_STDIO_DEF = @LIBC_STDIO_DEF@
  38.259 -LIBC_STDIO_LIB = @LIBC_STDIO_LIB@
  38.260 -LIBC_SYSCALL_LIB = @LIBC_SYSCALL_LIB@
  38.261 -LIBC_SYS_LIB = @LIBC_SYS_LIB@
  38.262 -LIBC_UNIX_LIB = @LIBC_UNIX_LIB@
  38.263 -LIBC_XDR_DEF = @LIBC_XDR_DEF@
  38.264 -LIBC_XDR_LIB = @LIBC_XDR_LIB@
  38.265 -LIBOBJS = @LIBOBJS@
  38.266 -LIBS = @LIBS@
  38.267 -LIBTOOL = @LIBTOOL@
  38.268 -LIPO = @LIPO@
  38.269 -LN_S = @LN_S@
  38.270 -LTLIBOBJS = @LTLIBOBJS@
  38.271 -MAINT = @MAINT@
  38.272 -MAKEINFO = @MAKEINFO@
  38.273 -MKDIR_P = @MKDIR_P@
  38.274 -NEWLIB_CFLAGS = @NEWLIB_CFLAGS@
  38.275 -NM = @NM@
  38.276 -NMEDIT = @NMEDIT@
  38.277 -NO_INCLUDE_LIST = @NO_INCLUDE_LIST@
  38.278 -OBJDUMP = @OBJDUMP@
  38.279 -OBJEXT = @OBJEXT@
  38.280 -OTOOL = @OTOOL@
  38.281 -OTOOL64 = @OTOOL64@
  38.282 -PACKAGE = @PACKAGE@
  38.283 -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
  38.284 -PACKAGE_NAME = @PACKAGE_NAME@
  38.285 -PACKAGE_STRING = @PACKAGE_STRING@
  38.286 -PACKAGE_TARNAME = @PACKAGE_TARNAME@
  38.287 -PACKAGE_URL = @PACKAGE_URL@
  38.288 -PACKAGE_VERSION = @PACKAGE_VERSION@
  38.289 -PATH_SEPARATOR = @PATH_SEPARATOR@
  38.290 -RANLIB = @RANLIB@
  38.291 -READELF = @READELF@
  38.292 -SED = @SED@
  38.293 -SET_MAKE = @SET_MAKE@
  38.294 -SHELL = @SHELL@
  38.295 -STRIP = @STRIP@
  38.296 -VERSION = @VERSION@
  38.297 -abs_builddir = @abs_builddir@
  38.298 -abs_srcdir = @abs_srcdir@
  38.299 -abs_top_builddir = @abs_top_builddir@
  38.300 -abs_top_srcdir = @abs_top_srcdir@
  38.301 -ac_ct_CC = @ac_ct_CC@
  38.302 -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
  38.303 -aext = @aext@
  38.304 -am__include = @am__include@
  38.305 -am__leading_dot = @am__leading_dot@
  38.306 -am__quote = @am__quote@
  38.307 -am__tar = @am__tar@
  38.308 -am__untar = @am__untar@
  38.309 -bindir = @bindir@
  38.310 -build = @build@
  38.311 -build_alias = @build_alias@
  38.312 -build_cpu = @build_cpu@
  38.313 -build_os = @build_os@
  38.314 -build_vendor = @build_vendor@
  38.315 -builddir = @builddir@
  38.316 -datadir = @datadir@
  38.317 -datarootdir = @datarootdir@
  38.318 -docdir = @docdir@
  38.319 -dvidir = @dvidir@
  38.320 -exec_prefix = @exec_prefix@
  38.321 -extra_dir = @extra_dir@
  38.322 -host = @host@
  38.323 -host_alias = @host_alias@
  38.324 -host_cpu = @host_cpu@
  38.325 -host_os = @host_os@
  38.326 -host_vendor = @host_vendor@
  38.327 -htmldir = @htmldir@
  38.328 -includedir = @includedir@
  38.329 -infodir = @infodir@
  38.330 -install_sh = @install_sh@
  38.331 -libdir = @libdir@
  38.332 -libexecdir = @libexecdir@
  38.333 -libm_machine_dir = @libm_machine_dir@
  38.334 -localedir = @localedir@
  38.335 -localstatedir = @localstatedir@
  38.336 -lpfx = @lpfx@
  38.337 -machine_dir = @machine_dir@
  38.338 -mandir = @mandir@
  38.339 -mkdir_p = @mkdir_p@
  38.340 -newlib_basedir = @newlib_basedir@
  38.341 -oext = @oext@
  38.342 -oldincludedir = @oldincludedir@
  38.343 -pdfdir = @pdfdir@
  38.344 -prefix = @prefix@
  38.345 -program_transform_name = @program_transform_name@
  38.346 -psdir = @psdir@
  38.347 -sbindir = @sbindir@
  38.348 -sharedstatedir = @sharedstatedir@
  38.349 -srcdir = @srcdir@
  38.350 -subdirs = @subdirs@
  38.351 -sys_dir = @sys_dir@
  38.352 -sysconfdir = @sysconfdir@
  38.353 -target_alias = @target_alias@
  38.354 -top_build_prefix = @top_build_prefix@
  38.355 -top_builddir = @top_builddir@
  38.356 -top_srcdir = @top_srcdir@
  38.357 -AUTOMAKE_OPTIONS = cygnus
  38.358 -INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
  38.359 -GENERAL_SOURCES = \
  38.360 -	bcopy.c \
  38.361 -	bzero.c \
  38.362 -	explicit_bzero.c \
  38.363 -	ffsl.c \
  38.364 -	ffsll.c \
  38.365 -	fls.c \
  38.366 -	flsl.c \
  38.367 -	flsll.c \
  38.368 -	index.c \
  38.369 -	memchr.c \
  38.370 -	memcmp.c \
  38.371 -	memcpy.c \
  38.372 -	memmove.c \
  38.373 -	memset.c \
  38.374 -	rindex.c \
  38.375 -	strcasecmp.c \
  38.376 -	strcat.c \
  38.377 -	strchr.c \
  38.378 -	strcmp.c \
  38.379 -	strcoll.c \
  38.380 -	strcpy.c \
  38.381 -	strcspn.c \
  38.382 -	strdup.c \
  38.383 -	strdup_r.c \
  38.384 -	strerror.c \
  38.385 -	strerror_r.c \
  38.386 -	strlcat.c \
  38.387 -	strlcpy.c \
  38.388 -	strlen.c  \
  38.389 -	strlwr.c \
  38.390 -	strncasecmp.c \
  38.391 -	strncat.c \
  38.392 -	strncmp.c \
  38.393 -	strncpy.c \
  38.394 -	strnlen.c \
  38.395 -	strnstr.c \
  38.396 -	strpbrk.c \
  38.397 -	strrchr.c \
  38.398 -	strsep.c \
  38.399 -	strsignal.c \
  38.400 -	strspn.c \
  38.401 -	strtok.c \
  38.402 -	strtok_r.c \
  38.403 -	strupr.c \
  38.404 -	strxfrm.c  \
  38.405 -	strstr.c \
  38.406 -	swab.c \
  38.407 -	timingsafe_bcmp.c \
  38.408 -	timingsafe_memcmp.c \
  38.409 -	u_strerr.c \
  38.410 -	wcscat.c \
  38.411 -	wcschr.c \
  38.412 -	wcscmp.c \
  38.413 -	wcscoll.c \
  38.414 -	wcscpy.c \
  38.415 -	wcscspn.c \
  38.416 -	wcslcat.c \
  38.417 -	wcslcpy.c \
  38.418 -	wcslen.c \
  38.419 -	wcsncat.c \
  38.420 -	wcsncmp.c \
  38.421 -	wcsncpy.c \
  38.422 -	wcsnlen.c \
  38.423 -	wcspbrk.c \
  38.424 -	wcsrchr.c \
  38.425 -	wcsspn.c \
  38.426 -	wcsstr.c \
  38.427 -	wcstok.c \
  38.428 -	wcswidth.c \
  38.429 -	wcsxfrm.c \
  38.430 -	wcwidth.c \
  38.431 -	wmemchr.c \
  38.432 -	wmemcmp.c \
  38.433 -	wmemcpy.c \
  38.434 -	wmemmove.c \
  38.435 -	wmemset.c \
  38.436 -	xpg_strerror_r.c
  38.437 -
  38.438 -@ELIX_LEVEL_1_FALSE@ELIX_2_SOURCES = \
  38.439 -@ELIX_LEVEL_1_FALSE@	bcmp.c \
  38.440 -@ELIX_LEVEL_1_FALSE@	memccpy.c \
  38.441 -@ELIX_LEVEL_1_FALSE@	mempcpy.c \
  38.442 -@ELIX_LEVEL_1_FALSE@	stpcpy.c \
  38.443 -@ELIX_LEVEL_1_FALSE@	stpncpy.c \
  38.444 -@ELIX_LEVEL_1_FALSE@	strndup.c \
  38.445 -@ELIX_LEVEL_1_FALSE@	strcasestr.c \
  38.446 -@ELIX_LEVEL_1_FALSE@	strchrnul.c \
  38.447 -@ELIX_LEVEL_1_FALSE@	strndup_r.c \
  38.448 -@ELIX_LEVEL_1_FALSE@	wcpcpy.c \
  38.449 -@ELIX_LEVEL_1_FALSE@	wcpncpy.c \
  38.450 -@ELIX_LEVEL_1_FALSE@	wcsdup.c
  38.451 -
  38.452 -@ELIX_LEVEL_1_TRUE@ELIX_2_SOURCES = 
  38.453 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ELIX_4_SOURCES = \
  38.454 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	gnu_basename.c \
  38.455 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	memmem.c \
  38.456 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	memrchr.c \
  38.457 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	rawmemchr.c \
  38.458 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	strcasecmp_l.c \
  38.459 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	strcoll_l.c \
  38.460 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	strncasecmp_l.c \
  38.461 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	strverscmp.c \
  38.462 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	strxfrm_l.c \
  38.463 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	wcscasecmp.c \
  38.464 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	wcscasecmp_l.c \
  38.465 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	wcscoll_l.c \
  38.466 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	wcsncasecmp.c \
  38.467 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	wcsncasecmp_l.c \
  38.468 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	wcsxfrm_l.c \
  38.469 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@	wmempcpy.c
  38.470 -
  38.471 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_TRUE@ELIX_4_SOURCES = 
  38.472 -@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@ELIX_4_SOURCES = 
  38.473 -@ELIX_LEVEL_1_TRUE@ELIX_4_SOURCES = 
  38.474 -libstring_la_LDFLAGS = -Xcompiler -nostdlib
  38.475 -@USE_LIBTOOL_TRUE@noinst_LTLIBRARIES = libstring.la
  38.476 -@USE_LIBTOOL_TRUE@libstring_la_SOURCES = $(GENERAL_SOURCES) $(ELIX_2_SOURCES) $(ELIX_4_SOURCES)
  38.477 -@USE_LIBTOOL_FALSE@noinst_DATA = 
  38.478 -@USE_LIBTOOL_TRUE@noinst_DATA = objectlist.awk.in
  38.479 -@USE_LIBTOOL_FALSE@noinst_LIBRARIES = lib.a
  38.480 -@USE_LIBTOOL_FALSE@lib_a_SOURCES = $(GENERAL_SOURCES) $(ELIX_2_SOURCES) $(ELIX_4_SOURCES)
  38.481 -@USE_LIBTOOL_FALSE@lib_a_CFLAGS = $(AM_CFLAGS)
  38.482 -
  38.483 -#
  38.484 -# documentation rules
  38.485 -#
  38.486 -SUFFIXES = .def .xml
  38.487 -CHEW = ${top_builddir}/../doc/makedoc -f $(top_srcdir)/../doc/doc.str
  38.488 -DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py
  38.489 -DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml)
  38.490 -DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml)
  38.491 -CLEANFILES = $(CHEWOUT_FILES) $(DOCBOOK_OUT_FILES)
  38.492 -CHEWOUT_FILES = \
  38.493 -bcmp.def	memcpy.def	strcmp.def	strncat.def strstr.def \
  38.494 -bcopy.def	memmove.def	strcoll.def	strncmp.def strtok.def \
  38.495 -bzero.def	memset.def	strcpy.def	strncpy.def strxfrm.def \
  38.496 -index.def	rindex.def	strcspn.def	strpbrk.def swab.def \
  38.497 -memchr.def	strcat.def	strerror.def	strerror_r.def strrchr.def \
  38.498 -memcmp.def	strchr.def	strlen.def	strnlen.def strspn.def \
  38.499 -strcasecmp.def	strncasecmp.def strcasestr.def	strlwr.def  strupr.def \
  38.500 -memccpy.def 	mempcpy.def	stpcpy.def	stpncpy.def strsignal.def \
  38.501 -wcscasecmp.def	wcscat.def	wcschr.def	wcscmp.def wcscoll.def \
  38.502 -wcscpy.def	wcscspn.def	wcpcpy.def	wcpncpy.def wcsdup.def \
  38.503 -wcslcat.def	wcslcpy.def	wcslen.def	wcsncasecmp.def wcsncat.def \
  38.504 -wcsncmp.def	wcsncpy.def	wcsnlen.def	wcspbrk.def \
  38.505 -wcsrchr.def	wcsspn.def	wcsstr.def 	wcstok.def  \
  38.506 -wcswidth.def	wcsxfrm.def	wcwidth.def	wmemchr.def \
  38.507 -wmemcmp.def	wmemcpy.def	wmemmove.def	wmemset.def \
  38.508 -memmem.def	memrchr.def	rawmemchr.def	strchrnul.def \
  38.509 -strcasecmp_l.def strcoll_l.def	strncasecmp_l.def strxfrm_l.def \
  38.510 -wcscasecmp_l.def wcscoll_l.def	wcsncasecmp_l.def wcsxfrm_l.def \
  38.511 -strverscmp.def	strnstr.def	wmempcpy.def
  38.512 -
  38.513 -CHAPTERS = strings.tex wcstrings.tex
  38.514 -all: all-am
  38.515 -
  38.516 -.SUFFIXES:
  38.517 -.SUFFIXES: .def .xml .c .lo .o .obj
  38.518 -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(am__configure_deps)
  38.519 -	@for dep in $?; do \
  38.520 -	  case '$(am__configure_deps)' in \
  38.521 -	    *$$dep*) \
  38.522 -	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
  38.523 -	        && { if test -f $@; then exit 0; else break; fi; }; \
  38.524 -	      exit 1;; \
  38.525 -	  esac; \
  38.526 -	done; \
  38.527 -	echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus string/Makefile'; \
  38.528 -	$(am__cd) $(top_srcdir) && \
  38.529 -	  $(AUTOMAKE) --cygnus string/Makefile
  38.530 -.PRECIOUS: Makefile
  38.531 -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  38.532 -	@case '$?' in \
  38.533 -	  *config.status*) \
  38.534 -	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
  38.535 -	  *) \
  38.536 -	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
  38.537 -	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
  38.538 -	esac;
  38.539 -$(srcdir)/../../Makefile.shared:
  38.540 -
  38.541 -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
  38.542 -	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
  38.543 -
  38.544 -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
  38.545 -	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
  38.546 -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
  38.547 -	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
  38.548 -$(am__aclocal_m4_deps):
  38.549 -
  38.550 -clean-noinstLIBRARIES:
  38.551 -	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
  38.552 -lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES) $(EXTRA_lib_a_DEPENDENCIES) 
  38.553 -	-rm -f lib.a
  38.554 -	$(lib_a_AR) lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD)
  38.555 -	$(RANLIB) lib.a
  38.556 -
  38.557 -clean-noinstLTLIBRARIES:
  38.558 -	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
  38.559 -	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
  38.560 -	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
  38.561 -	  test "$$dir" != "$$p" || dir=.; \
  38.562 -	  echo "rm -f \"$${dir}/so_locations\""; \
  38.563 -	  rm -f "$${dir}/so_locations"; \
  38.564 -	done
  38.565 -libstring.la: $(libstring_la_OBJECTS) $(libstring_la_DEPENDENCIES) $(EXTRA_libstring_la_DEPENDENCIES) 
  38.566 -	$(libstring_la_LINK) $(am_libstring_la_rpath) $(libstring_la_OBJECTS) $(libstring_la_LIBADD) $(LIBS)
  38.567 -
  38.568 -mostlyclean-compile:
  38.569 -	-rm -f *.$(OBJEXT)
  38.570 -
  38.571 -distclean-compile:
  38.572 -	-rm -f *.tab.c
  38.573 -
  38.574 -.c.o:
  38.575 -	$(COMPILE) -c $<
  38.576 -
  38.577 -.c.obj:
  38.578 -	$(COMPILE) -c `$(CYGPATH_W) '$<'`
  38.579 -
  38.580 -.c.lo:
  38.581 -	$(LTCOMPILE) -c -o $@ $<
  38.582 -
  38.583 -lib_a-bcopy.o: bcopy.c
  38.584 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-bcopy.o `test -f 'bcopy.c' || echo '$(srcdir)/'`bcopy.c
  38.585 -
  38.586 -lib_a-bcopy.obj: bcopy.c
  38.587 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-bcopy.obj `if test -f 'bcopy.c'; then $(CYGPATH_W) 'bcopy.c'; else $(CYGPATH_W) '$(srcdir)/bcopy.c'; fi`
  38.588 -
  38.589 -lib_a-bzero.o: bzero.c
  38.590 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-bzero.o `test -f 'bzero.c' || echo '$(srcdir)/'`bzero.c
  38.591 -
  38.592 -lib_a-bzero.obj: bzero.c
  38.593 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-bzero.obj `if test -f 'bzero.c'; then $(CYGPATH_W) 'bzero.c'; else $(CYGPATH_W) '$(srcdir)/bzero.c'; fi`
  38.594 -
  38.595 -lib_a-explicit_bzero.o: explicit_bzero.c
  38.596 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-explicit_bzero.o `test -f 'explicit_bzero.c' || echo '$(srcdir)/'`explicit_bzero.c
  38.597 -
  38.598 -lib_a-explicit_bzero.obj: explicit_bzero.c
  38.599 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-explicit_bzero.obj `if test -f 'explicit_bzero.c'; then $(CYGPATH_W) 'explicit_bzero.c'; else $(CYGPATH_W) '$(srcdir)/explicit_bzero.c'; fi`
  38.600 -
  38.601 -lib_a-ffsl.o: ffsl.c
  38.602 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ffsl.o `test -f 'ffsl.c' || echo '$(srcdir)/'`ffsl.c
  38.603 -
  38.604 -lib_a-ffsl.obj: ffsl.c
  38.605 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ffsl.obj `if test -f 'ffsl.c'; then $(CYGPATH_W) 'ffsl.c'; else $(CYGPATH_W) '$(srcdir)/ffsl.c'; fi`
  38.606 -
  38.607 -lib_a-ffsll.o: ffsll.c
  38.608 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ffsll.o `test -f 'ffsll.c' || echo '$(srcdir)/'`ffsll.c
  38.609 -
  38.610 -lib_a-ffsll.obj: ffsll.c
  38.611 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ffsll.obj `if test -f 'ffsll.c'; then $(CYGPATH_W) 'ffsll.c'; else $(CYGPATH_W) '$(srcdir)/ffsll.c'; fi`
  38.612 -
  38.613 -lib_a-fls.o: fls.c
  38.614 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fls.o `test -f 'fls.c' || echo '$(srcdir)/'`fls.c
  38.615 -
  38.616 -lib_a-fls.obj: fls.c
  38.617 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fls.obj `if test -f 'fls.c'; then $(CYGPATH_W) 'fls.c'; else $(CYGPATH_W) '$(srcdir)/fls.c'; fi`
  38.618 -
  38.619 -lib_a-flsl.o: flsl.c
  38.620 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-flsl.o `test -f 'flsl.c' || echo '$(srcdir)/'`flsl.c
  38.621 -
  38.622 -lib_a-flsl.obj: flsl.c
  38.623 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-flsl.obj `if test -f 'flsl.c'; then $(CYGPATH_W) 'flsl.c'; else $(CYGPATH_W) '$(srcdir)/flsl.c'; fi`
  38.624 -
  38.625 -lib_a-flsll.o: flsll.c
  38.626 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-flsll.o `test -f 'flsll.c' || echo '$(srcdir)/'`flsll.c
  38.627 -
  38.628 -lib_a-flsll.obj: flsll.c
  38.629 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-flsll.obj `if test -f 'flsll.c'; then $(CYGPATH_W) 'flsll.c'; else $(CYGPATH_W) '$(srcdir)/flsll.c'; fi`
  38.630 -
  38.631 -lib_a-index.o: index.c
  38.632 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-index.o `test -f 'index.c' || echo '$(srcdir)/'`index.c
  38.633 -
  38.634 -lib_a-index.obj: index.c
  38.635 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-index.obj `if test -f 'index.c'; then $(CYGPATH_W) 'index.c'; else $(CYGPATH_W) '$(srcdir)/index.c'; fi`
  38.636 -
  38.637 -lib_a-memchr.o: memchr.c
  38.638 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memchr.o `test -f 'memchr.c' || echo '$(srcdir)/'`memchr.c
  38.639 -
  38.640 -lib_a-memchr.obj: memchr.c
  38.641 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memchr.obj `if test -f 'memchr.c'; then $(CYGPATH_W) 'memchr.c'; else $(CYGPATH_W) '$(srcdir)/memchr.c'; fi`
  38.642 -
  38.643 -lib_a-memcmp.o: memcmp.c
  38.644 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memcmp.o `test -f 'memcmp.c' || echo '$(srcdir)/'`memcmp.c
  38.645 -
  38.646 -lib_a-memcmp.obj: memcmp.c
  38.647 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memcmp.obj `if test -f 'memcmp.c'; then $(CYGPATH_W) 'memcmp.c'; else $(CYGPATH_W) '$(srcdir)/memcmp.c'; fi`
  38.648 -
  38.649 -lib_a-memcpy.o: memcpy.c
  38.650 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memcpy.o `test -f 'memcpy.c' || echo '$(srcdir)/'`memcpy.c
  38.651 -
  38.652 -lib_a-memcpy.obj: memcpy.c
  38.653 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memcpy.obj `if test -f 'memcpy.c'; then $(CYGPATH_W) 'memcpy.c'; else $(CYGPATH_W) '$(srcdir)/memcpy.c'; fi`
  38.654 -
  38.655 -lib_a-memmove.o: memmove.c
  38.656 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memmove.o `test -f 'memmove.c' || echo '$(srcdir)/'`memmove.c
  38.657 -
  38.658 -lib_a-memmove.obj: memmove.c
  38.659 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memmove.obj `if test -f 'memmove.c'; then $(CYGPATH_W) 'memmove.c'; else $(CYGPATH_W) '$(srcdir)/memmove.c'; fi`
  38.660 -
  38.661 -lib_a-memset.o: memset.c
  38.662 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memset.o `test -f 'memset.c' || echo '$(srcdir)/'`memset.c
  38.663 -
  38.664 -lib_a-memset.obj: memset.c
  38.665 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memset.obj `if test -f 'memset.c'; then $(CYGPATH_W) 'memset.c'; else $(CYGPATH_W) '$(srcdir)/memset.c'; fi`
  38.666 -
  38.667 -lib_a-rindex.o: rindex.c
  38.668 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-rindex.o `test -f 'rindex.c' || echo '$(srcdir)/'`rindex.c
  38.669 -
  38.670 -lib_a-rindex.obj: rindex.c
  38.671 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-rindex.obj `if test -f 'rindex.c'; then $(CYGPATH_W) 'rindex.c'; else $(CYGPATH_W) '$(srcdir)/rindex.c'; fi`
  38.672 -
  38.673 -lib_a-strcasecmp.o: strcasecmp.c
  38.674 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strcasecmp.o `test -f 'strcasecmp.c' || echo '$(srcdir)/'`strcasecmp.c
  38.675 -
  38.676 -lib_a-strcasecmp.obj: strcasecmp.c
  38.677 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strcasecmp.obj `if test -f 'strcasecmp.c'; then $(CYGPATH_W) 'strcasecmp.c'; else $(CYGPATH_W) '$(srcdir)/strcasecmp.c'; fi`
  38.678 -
  38.679 -lib_a-strcat.o: strcat.c
  38.680 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strcat.o `test -f 'strcat.c' || echo '$(srcdir)/'`strcat.c
  38.681 -
  38.682 -lib_a-strcat.obj: strcat.c
  38.683 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strcat.obj `if test -f 'strcat.c'; then $(CYGPATH_W) 'strcat.c'; else $(CYGPATH_W) '$(srcdir)/strcat.c'; fi`
  38.684 -
  38.685 -lib_a-strchr.o: strchr.c
  38.686 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strchr.o `test -f 'strchr.c' || echo '$(srcdir)/'`strchr.c
  38.687 -
  38.688 -lib_a-strchr.obj: strchr.c
  38.689 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strchr.obj `if test -f 'strchr.c'; then $(CYGPATH_W) 'strchr.c'; else $(CYGPATH_W) '$(srcdir)/strchr.c'; fi`
  38.690 -
  38.691 -lib_a-strcmp.o: strcmp.c
  38.692 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strcmp.o `test -f 'strcmp.c' || echo '$(srcdir)/'`strcmp.c
  38.693 -
  38.694 -lib_a-strcmp.obj: strcmp.c
  38.695 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strcmp.obj `if test -f 'strcmp.c'; then $(CYGPATH_W) 'strcmp.c'; else $(CYGPATH_W) '$(srcdir)/strcmp.c'; fi`
  38.696 -
  38.697 -lib_a-strcoll.o: strcoll.c
  38.698 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strcoll.o `test -f 'strcoll.c' || echo '$(srcdir)/'`strcoll.c
  38.699 -
  38.700 -lib_a-strcoll.obj: strcoll.c
  38.701 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strcoll.obj `if test -f 'strcoll.c'; then $(CYGPATH_W) 'strcoll.c'; else $(CYGPATH_W) '$(srcdir)/strcoll.c'; fi`
  38.702 -
  38.703 -lib_a-strcpy.o: strcpy.c
  38.704 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strcpy.o `test -f 'strcpy.c' || echo '$(srcdir)/'`strcpy.c
  38.705 -
  38.706 -lib_a-strcpy.obj: strcpy.c
  38.707 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strcpy.obj `if test -f 'strcpy.c'; then $(CYGPATH_W) 'strcpy.c'; else $(CYGPATH_W) '$(srcdir)/strcpy.c'; fi`
  38.708 -
  38.709 -lib_a-strcspn.o: strcspn.c
  38.710 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strcspn.o `test -f 'strcspn.c' || echo '$(srcdir)/'`strcspn.c
  38.711 -
  38.712 -lib_a-strcspn.obj: strcspn.c
  38.713 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strcspn.obj `if test -f 'strcspn.c'; then $(CYGPATH_W) 'strcspn.c'; else $(CYGPATH_W) '$(srcdir)/strcspn.c'; fi`
  38.714 -
  38.715 -lib_a-strdup.o: strdup.c
  38.716 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strdup.o `test -f 'strdup.c' || echo '$(srcdir)/'`strdup.c
  38.717 -
  38.718 -lib_a-strdup.obj: strdup.c
  38.719 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strdup.obj `if test -f 'strdup.c'; then $(CYGPATH_W) 'strdup.c'; else $(CYGPATH_W) '$(srcdir)/strdup.c'; fi`
  38.720 -
  38.721 -lib_a-strdup_r.o: strdup_r.c
  38.722 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strdup_r.o `test -f 'strdup_r.c' || echo '$(srcdir)/'`strdup_r.c
  38.723 -
  38.724 -lib_a-strdup_r.obj: strdup_r.c
  38.725 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strdup_r.obj `if test -f 'strdup_r.c'; then $(CYGPATH_W) 'strdup_r.c'; else $(CYGPATH_W) '$(srcdir)/strdup_r.c'; fi`
  38.726 -
  38.727 -lib_a-strerror.o: strerror.c
  38.728 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strerror.o `test -f 'strerror.c' || echo '$(srcdir)/'`strerror.c
  38.729 -
  38.730 -lib_a-strerror.obj: strerror.c
  38.731 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strerror.obj `if test -f 'strerror.c'; then $(CYGPATH_W) 'strerror.c'; else $(CYGPATH_W) '$(srcdir)/strerror.c'; fi`
  38.732 -
  38.733 -lib_a-strerror_r.o: strerror_r.c
  38.734 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strerror_r.o `test -f 'strerror_r.c' || echo '$(srcdir)/'`strerror_r.c
  38.735 -
  38.736 -lib_a-strerror_r.obj: strerror_r.c
  38.737 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strerror_r.obj `if test -f 'strerror_r.c'; then $(CYGPATH_W) 'strerror_r.c'; else $(CYGPATH_W) '$(srcdir)/strerror_r.c'; fi`
  38.738 -
  38.739 -lib_a-strlcat.o: strlcat.c
  38.740 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strlcat.o `test -f 'strlcat.c' || echo '$(srcdir)/'`strlcat.c
  38.741 -
  38.742 -lib_a-strlcat.obj: strlcat.c
  38.743 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strlcat.obj `if test -f 'strlcat.c'; then $(CYGPATH_W) 'strlcat.c'; else $(CYGPATH_W) '$(srcdir)/strlcat.c'; fi`
  38.744 -
  38.745 -lib_a-strlcpy.o: strlcpy.c
  38.746 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strlcpy.o `test -f 'strlcpy.c' || echo '$(srcdir)/'`strlcpy.c
  38.747 -
  38.748 -lib_a-strlcpy.obj: strlcpy.c
  38.749 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strlcpy.obj `if test -f 'strlcpy.c'; then $(CYGPATH_W) 'strlcpy.c'; else $(CYGPATH_W) '$(srcdir)/strlcpy.c'; fi`
  38.750 -
  38.751 -lib_a-strlen.o: strlen.c
  38.752 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strlen.o `test -f 'strlen.c' || echo '$(srcdir)/'`strlen.c
  38.753 -
  38.754 -lib_a-strlen.obj: strlen.c
  38.755 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strlen.obj `if test -f 'strlen.c'; then $(CYGPATH_W) 'strlen.c'; else $(CYGPATH_W) '$(srcdir)/strlen.c'; fi`
  38.756 -
  38.757 -lib_a-strlwr.o: strlwr.c
  38.758 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strlwr.o `test -f 'strlwr.c' || echo '$(srcdir)/'`strlwr.c
  38.759 -
  38.760 -lib_a-strlwr.obj: strlwr.c
  38.761 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strlwr.obj `if test -f 'strlwr.c'; then $(CYGPATH_W) 'strlwr.c'; else $(CYGPATH_W) '$(srcdir)/strlwr.c'; fi`
  38.762 -
  38.763 -lib_a-strncasecmp.o: strncasecmp.c
  38.764 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strncasecmp.o `test -f 'strncasecmp.c' || echo '$(srcdir)/'`strncasecmp.c
  38.765 -
  38.766 -lib_a-strncasecmp.obj: strncasecmp.c
  38.767 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strncasecmp.obj `if test -f 'strncasecmp.c'; then $(CYGPATH_W) 'strncasecmp.c'; else $(CYGPATH_W) '$(srcdir)/strncasecmp.c'; fi`
  38.768 -
  38.769 -lib_a-strncat.o: strncat.c
  38.770 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strncat.o `test -f 'strncat.c' || echo '$(srcdir)/'`strncat.c
  38.771 -
  38.772 -lib_a-strncat.obj: strncat.c
  38.773 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strncat.obj `if test -f 'strncat.c'; then $(CYGPATH_W) 'strncat.c'; else $(CYGPATH_W) '$(srcdir)/strncat.c'; fi`
  38.774 -
  38.775 -lib_a-strncmp.o: strncmp.c
  38.776 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strncmp.o `test -f 'strncmp.c' || echo '$(srcdir)/'`strncmp.c
  38.777 -
  38.778 -lib_a-strncmp.obj: strncmp.c
  38.779 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strncmp.obj `if test -f 'strncmp.c'; then $(CYGPATH_W) 'strncmp.c'; else $(CYGPATH_W) '$(srcdir)/strncmp.c'; fi`
  38.780 -
  38.781 -lib_a-strncpy.o: strncpy.c
  38.782 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strncpy.o `test -f 'strncpy.c' || echo '$(srcdir)/'`strncpy.c
  38.783 -
  38.784 -lib_a-strncpy.obj: strncpy.c
  38.785 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strncpy.obj `if test -f 'strncpy.c'; then $(CYGPATH_W) 'strncpy.c'; else $(CYGPATH_W) '$(srcdir)/strncpy.c'; fi`
  38.786 -
  38.787 -lib_a-strnlen.o: strnlen.c
  38.788 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strnlen.o `test -f 'strnlen.c' || echo '$(srcdir)/'`strnlen.c
  38.789 -
  38.790 -lib_a-strnlen.obj: strnlen.c
  38.791 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strnlen.obj `if test -f 'strnlen.c'; then $(CYGPATH_W) 'strnlen.c'; else $(CYGPATH_W) '$(srcdir)/strnlen.c'; fi`
  38.792 -
  38.793 -lib_a-strnstr.o: strnstr.c
  38.794 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strnstr.o `test -f 'strnstr.c' || echo '$(srcdir)/'`strnstr.c
  38.795 -
  38.796 -lib_a-strnstr.obj: strnstr.c
  38.797 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strnstr.obj `if test -f 'strnstr.c'; then $(CYGPATH_W) 'strnstr.c'; else $(CYGPATH_W) '$(srcdir)/strnstr.c'; fi`
  38.798 -
  38.799 -lib_a-strpbrk.o: strpbrk.c
  38.800 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strpbrk.o `test -f 'strpbrk.c' || echo '$(srcdir)/'`strpbrk.c
  38.801 -
  38.802 -lib_a-strpbrk.obj: strpbrk.c
  38.803 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strpbrk.obj `if test -f 'strpbrk.c'; then $(CYGPATH_W) 'strpbrk.c'; else $(CYGPATH_W) '$(srcdir)/strpbrk.c'; fi`
  38.804 -
  38.805 -lib_a-strrchr.o: strrchr.c
  38.806 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strrchr.o `test -f 'strrchr.c' || echo '$(srcdir)/'`strrchr.c
  38.807 -
  38.808 -lib_a-strrchr.obj: strrchr.c
  38.809 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strrchr.obj `if test -f 'strrchr.c'; then $(CYGPATH_W) 'strrchr.c'; else $(CYGPATH_W) '$(srcdir)/strrchr.c'; fi`
  38.810 -
  38.811 -lib_a-strsep.o: strsep.c
  38.812 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strsep.o `test -f 'strsep.c' || echo '$(srcdir)/'`strsep.c
  38.813 -
  38.814 -lib_a-strsep.obj: strsep.c
  38.815 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strsep.obj `if test -f 'strsep.c'; then $(CYGPATH_W) 'strsep.c'; else $(CYGPATH_W) '$(srcdir)/strsep.c'; fi`
  38.816 -
  38.817 -lib_a-strsignal.o: strsignal.c
  38.818 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strsignal.o `test -f 'strsignal.c' || echo '$(srcdir)/'`strsignal.c
  38.819 -
  38.820 -lib_a-strsignal.obj: strsignal.c
  38.821 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strsignal.obj `if test -f 'strsignal.c'; then $(CYGPATH_W) 'strsignal.c'; else $(CYGPATH_W) '$(srcdir)/strsignal.c'; fi`
  38.822 -
  38.823 -lib_a-strspn.o: strspn.c
  38.824 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strspn.o `test -f 'strspn.c' || echo '$(srcdir)/'`strspn.c
  38.825 -
  38.826 -lib_a-strspn.obj: strspn.c
  38.827 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strspn.obj `if test -f 'strspn.c'; then $(CYGPATH_W) 'strspn.c'; else $(CYGPATH_W) '$(srcdir)/strspn.c'; fi`
  38.828 -
  38.829 -lib_a-strtok.o: strtok.c
  38.830 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strtok.o `test -f 'strtok.c' || echo '$(srcdir)/'`strtok.c
  38.831 -
  38.832 -lib_a-strtok.obj: strtok.c
  38.833 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strtok.obj `if test -f 'strtok.c'; then $(CYGPATH_W) 'strtok.c'; else $(CYGPATH_W) '$(srcdir)/strtok.c'; fi`
  38.834 -
  38.835 -lib_a-strtok_r.o: strtok_r.c
  38.836 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strtok_r.o `test -f 'strtok_r.c' || echo '$(srcdir)/'`strtok_r.c
  38.837 -
  38.838 -lib_a-strtok_r.obj: strtok_r.c
  38.839 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strtok_r.obj `if test -f 'strtok_r.c'; then $(CYGPATH_W) 'strtok_r.c'; else $(CYGPATH_W) '$(srcdir)/strtok_r.c'; fi`
  38.840 -
  38.841 -lib_a-strupr.o: strupr.c
  38.842 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strupr.o `test -f 'strupr.c' || echo '$(srcdir)/'`strupr.c
  38.843 -
  38.844 -lib_a-strupr.obj: strupr.c
  38.845 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strupr.obj `if test -f 'strupr.c'; then $(CYGPATH_W) 'strupr.c'; else $(CYGPATH_W) '$(srcdir)/strupr.c'; fi`
  38.846 -
  38.847 -lib_a-strxfrm.o: strxfrm.c
  38.848 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strxfrm.o `test -f 'strxfrm.c' || echo '$(srcdir)/'`strxfrm.c
  38.849 -
  38.850 -lib_a-strxfrm.obj: strxfrm.c
  38.851 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strxfrm.obj `if test -f 'strxfrm.c'; then $(CYGPATH_W) 'strxfrm.c'; else $(CYGPATH_W) '$(srcdir)/strxfrm.c'; fi`
  38.852 -
  38.853 -lib_a-strstr.o: strstr.c
  38.854 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strstr.o `test -f 'strstr.c' || echo '$(srcdir)/'`strstr.c
  38.855 -
  38.856 -lib_a-strstr.obj: strstr.c
  38.857 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strstr.obj `if test -f 'strstr.c'; then $(CYGPATH_W) 'strstr.c'; else $(CYGPATH_W) '$(srcdir)/strstr.c'; fi`
  38.858 -
  38.859 -lib_a-swab.o: swab.c
  38.860 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-swab.o `test -f 'swab.c' || echo '$(srcdir)/'`swab.c
  38.861 -
  38.862 -lib_a-swab.obj: swab.c
  38.863 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-swab.obj `if test -f 'swab.c'; then $(CYGPATH_W) 'swab.c'; else $(CYGPATH_W) '$(srcdir)/swab.c'; fi`
  38.864 -
  38.865 -lib_a-timingsafe_bcmp.o: timingsafe_bcmp.c
  38.866 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-timingsafe_bcmp.o `test -f 'timingsafe_bcmp.c' || echo '$(srcdir)/'`timingsafe_bcmp.c
  38.867 -
  38.868 -lib_a-timingsafe_bcmp.obj: timingsafe_bcmp.c
  38.869 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-timingsafe_bcmp.obj `if test -f 'timingsafe_bcmp.c'; then $(CYGPATH_W) 'timingsafe_bcmp.c'; else $(CYGPATH_W) '$(srcdir)/timingsafe_bcmp.c'; fi`
  38.870 -
  38.871 -lib_a-timingsafe_memcmp.o: timingsafe_memcmp.c
  38.872 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-timingsafe_memcmp.o `test -f 'timingsafe_memcmp.c' || echo '$(srcdir)/'`timingsafe_memcmp.c
  38.873 -
  38.874 -lib_a-timingsafe_memcmp.obj: timingsafe_memcmp.c
  38.875 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-timingsafe_memcmp.obj `if test -f 'timingsafe_memcmp.c'; then $(CYGPATH_W) 'timingsafe_memcmp.c'; else $(CYGPATH_W) '$(srcdir)/timingsafe_memcmp.c'; fi`
  38.876 -
  38.877 -lib_a-u_strerr.o: u_strerr.c
  38.878 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-u_strerr.o `test -f 'u_strerr.c' || echo '$(srcdir)/'`u_strerr.c
  38.879 -
  38.880 -lib_a-u_strerr.obj: u_strerr.c
  38.881 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-u_strerr.obj `if test -f 'u_strerr.c'; then $(CYGPATH_W) 'u_strerr.c'; else $(CYGPATH_W) '$(srcdir)/u_strerr.c'; fi`
  38.882 -
  38.883 -lib_a-wcscat.o: wcscat.c
  38.884 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcscat.o `test -f 'wcscat.c' || echo '$(srcdir)/'`wcscat.c
  38.885 -
  38.886 -lib_a-wcscat.obj: wcscat.c
  38.887 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcscat.obj `if test -f 'wcscat.c'; then $(CYGPATH_W) 'wcscat.c'; else $(CYGPATH_W) '$(srcdir)/wcscat.c'; fi`
  38.888 -
  38.889 -lib_a-wcschr.o: wcschr.c
  38.890 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcschr.o `test -f 'wcschr.c' || echo '$(srcdir)/'`wcschr.c
  38.891 -
  38.892 -lib_a-wcschr.obj: wcschr.c
  38.893 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcschr.obj `if test -f 'wcschr.c'; then $(CYGPATH_W) 'wcschr.c'; else $(CYGPATH_W) '$(srcdir)/wcschr.c'; fi`
  38.894 -
  38.895 -lib_a-wcscmp.o: wcscmp.c
  38.896 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcscmp.o `test -f 'wcscmp.c' || echo '$(srcdir)/'`wcscmp.c
  38.897 -
  38.898 -lib_a-wcscmp.obj: wcscmp.c
  38.899 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcscmp.obj `if test -f 'wcscmp.c'; then $(CYGPATH_W) 'wcscmp.c'; else $(CYGPATH_W) '$(srcdir)/wcscmp.c'; fi`
  38.900 -
  38.901 -lib_a-wcscoll.o: wcscoll.c
  38.902 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcscoll.o `test -f 'wcscoll.c' || echo '$(srcdir)/'`wcscoll.c
  38.903 -
  38.904 -lib_a-wcscoll.obj: wcscoll.c
  38.905 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcscoll.obj `if test -f 'wcscoll.c'; then $(CYGPATH_W) 'wcscoll.c'; else $(CYGPATH_W) '$(srcdir)/wcscoll.c'; fi`
  38.906 -
  38.907 -lib_a-wcscpy.o: wcscpy.c
  38.908 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcscpy.o `test -f 'wcscpy.c' || echo '$(srcdir)/'`wcscpy.c
  38.909 -
  38.910 -lib_a-wcscpy.obj: wcscpy.c
  38.911 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcscpy.obj `if test -f 'wcscpy.c'; then $(CYGPATH_W) 'wcscpy.c'; else $(CYGPATH_W) '$(srcdir)/wcscpy.c'; fi`
  38.912 -
  38.913 -lib_a-wcscspn.o: wcscspn.c
  38.914 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcscspn.o `test -f 'wcscspn.c' || echo '$(srcdir)/'`wcscspn.c
  38.915 -
  38.916 -lib_a-wcscspn.obj: wcscspn.c
  38.917 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcscspn.obj `if test -f 'wcscspn.c'; then $(CYGPATH_W) 'wcscspn.c'; else $(CYGPATH_W) '$(srcdir)/wcscspn.c'; fi`
  38.918 -
  38.919 -lib_a-wcslcat.o: wcslcat.c
  38.920 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcslcat.o `test -f 'wcslcat.c' || echo '$(srcdir)/'`wcslcat.c
  38.921 -
  38.922 -lib_a-wcslcat.obj: wcslcat.c
  38.923 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcslcat.obj `if test -f 'wcslcat.c'; then $(CYGPATH_W) 'wcslcat.c'; else $(CYGPATH_W) '$(srcdir)/wcslcat.c'; fi`
  38.924 -
  38.925 -lib_a-wcslcpy.o: wcslcpy.c
  38.926 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcslcpy.o `test -f 'wcslcpy.c' || echo '$(srcdir)/'`wcslcpy.c
  38.927 -
  38.928 -lib_a-wcslcpy.obj: wcslcpy.c
  38.929 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcslcpy.obj `if test -f 'wcslcpy.c'; then $(CYGPATH_W) 'wcslcpy.c'; else $(CYGPATH_W) '$(srcdir)/wcslcpy.c'; fi`
  38.930 -
  38.931 -lib_a-wcslen.o: wcslen.c
  38.932 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcslen.o `test -f 'wcslen.c' || echo '$(srcdir)/'`wcslen.c
  38.933 -
  38.934 -lib_a-wcslen.obj: wcslen.c
  38.935 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcslen.obj `if test -f 'wcslen.c'; then $(CYGPATH_W) 'wcslen.c'; else $(CYGPATH_W) '$(srcdir)/wcslen.c'; fi`
  38.936 -
  38.937 -lib_a-wcsncat.o: wcsncat.c
  38.938 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsncat.o `test -f 'wcsncat.c' || echo '$(srcdir)/'`wcsncat.c
  38.939 -
  38.940 -lib_a-wcsncat.obj: wcsncat.c
  38.941 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsncat.obj `if test -f 'wcsncat.c'; then $(CYGPATH_W) 'wcsncat.c'; else $(CYGPATH_W) '$(srcdir)/wcsncat.c'; fi`
  38.942 -
  38.943 -lib_a-wcsncmp.o: wcsncmp.c
  38.944 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsncmp.o `test -f 'wcsncmp.c' || echo '$(srcdir)/'`wcsncmp.c
  38.945 -
  38.946 -lib_a-wcsncmp.obj: wcsncmp.c
  38.947 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsncmp.obj `if test -f 'wcsncmp.c'; then $(CYGPATH_W) 'wcsncmp.c'; else $(CYGPATH_W) '$(srcdir)/wcsncmp.c'; fi`
  38.948 -
  38.949 -lib_a-wcsncpy.o: wcsncpy.c
  38.950 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsncpy.o `test -f 'wcsncpy.c' || echo '$(srcdir)/'`wcsncpy.c
  38.951 -
  38.952 -lib_a-wcsncpy.obj: wcsncpy.c
  38.953 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsncpy.obj `if test -f 'wcsncpy.c'; then $(CYGPATH_W) 'wcsncpy.c'; else $(CYGPATH_W) '$(srcdir)/wcsncpy.c'; fi`
  38.954 -
  38.955 -lib_a-wcsnlen.o: wcsnlen.c
  38.956 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsnlen.o `test -f 'wcsnlen.c' || echo '$(srcdir)/'`wcsnlen.c
  38.957 -
  38.958 -lib_a-wcsnlen.obj: wcsnlen.c
  38.959 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsnlen.obj `if test -f 'wcsnlen.c'; then $(CYGPATH_W) 'wcsnlen.c'; else $(CYGPATH_W) '$(srcdir)/wcsnlen.c'; fi`
  38.960 -
  38.961 -lib_a-wcspbrk.o: wcspbrk.c
  38.962 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcspbrk.o `test -f 'wcspbrk.c' || echo '$(srcdir)/'`wcspbrk.c
  38.963 -
  38.964 -lib_a-wcspbrk.obj: wcspbrk.c
  38.965 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcspbrk.obj `if test -f 'wcspbrk.c'; then $(CYGPATH_W) 'wcspbrk.c'; else $(CYGPATH_W) '$(srcdir)/wcspbrk.c'; fi`
  38.966 -
  38.967 -lib_a-wcsrchr.o: wcsrchr.c
  38.968 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsrchr.o `test -f 'wcsrchr.c' || echo '$(srcdir)/'`wcsrchr.c
  38.969 -
  38.970 -lib_a-wcsrchr.obj: wcsrchr.c
  38.971 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsrchr.obj `if test -f 'wcsrchr.c'; then $(CYGPATH_W) 'wcsrchr.c'; else $(CYGPATH_W) '$(srcdir)/wcsrchr.c'; fi`
  38.972 -
  38.973 -lib_a-wcsspn.o: wcsspn.c
  38.974 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsspn.o `test -f 'wcsspn.c' || echo '$(srcdir)/'`wcsspn.c
  38.975 -
  38.976 -lib_a-wcsspn.obj: wcsspn.c
  38.977 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsspn.obj `if test -f 'wcsspn.c'; then $(CYGPATH_W) 'wcsspn.c'; else $(CYGPATH_W) '$(srcdir)/wcsspn.c'; fi`
  38.978 -
  38.979 -lib_a-wcsstr.o: wcsstr.c
  38.980 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsstr.o `test -f 'wcsstr.c' || echo '$(srcdir)/'`wcsstr.c
  38.981 -
  38.982 -lib_a-wcsstr.obj: wcsstr.c
  38.983 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsstr.obj `if test -f 'wcsstr.c'; then $(CYGPATH_W) 'wcsstr.c'; else $(CYGPATH_W) '$(srcdir)/wcsstr.c'; fi`
  38.984 -
  38.985 -lib_a-wcstok.o: wcstok.c
  38.986 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcstok.o `test -f 'wcstok.c' || echo '$(srcdir)/'`wcstok.c
  38.987 -
  38.988 -lib_a-wcstok.obj: wcstok.c
  38.989 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcstok.obj `if test -f 'wcstok.c'; then $(CYGPATH_W) 'wcstok.c'; else $(CYGPATH_W) '$(srcdir)/wcstok.c'; fi`
  38.990 -
  38.991 -lib_a-wcswidth.o: wcswidth.c
  38.992 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcswidth.o `test -f 'wcswidth.c' || echo '$(srcdir)/'`wcswidth.c
  38.993 -
  38.994 -lib_a-wcswidth.obj: wcswidth.c
  38.995 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcswidth.obj `if test -f 'wcswidth.c'; then $(CYGPATH_W) 'wcswidth.c'; else $(CYGPATH_W) '$(srcdir)/wcswidth.c'; fi`
  38.996 -
  38.997 -lib_a-wcsxfrm.o: wcsxfrm.c
  38.998 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsxfrm.o `test -f 'wcsxfrm.c' || echo '$(srcdir)/'`wcsxfrm.c
  38.999 -
 38.1000 -lib_a-wcsxfrm.obj: wcsxfrm.c
 38.1001 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsxfrm.obj `if test -f 'wcsxfrm.c'; then $(CYGPATH_W) 'wcsxfrm.c'; else $(CYGPATH_W) '$(srcdir)/wcsxfrm.c'; fi`
 38.1002 -
 38.1003 -lib_a-wcwidth.o: wcwidth.c
 38.1004 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcwidth.o `test -f 'wcwidth.c' || echo '$(srcdir)/'`wcwidth.c
 38.1005 -
 38.1006 -lib_a-wcwidth.obj: wcwidth.c
 38.1007 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcwidth.obj `if test -f 'wcwidth.c'; then $(CYGPATH_W) 'wcwidth.c'; else $(CYGPATH_W) '$(srcdir)/wcwidth.c'; fi`
 38.1008 -
 38.1009 -lib_a-wmemchr.o: wmemchr.c
 38.1010 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wmemchr.o `test -f 'wmemchr.c' || echo '$(srcdir)/'`wmemchr.c
 38.1011 -
 38.1012 -lib_a-wmemchr.obj: wmemchr.c
 38.1013 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wmemchr.obj `if test -f 'wmemchr.c'; then $(CYGPATH_W) 'wmemchr.c'; else $(CYGPATH_W) '$(srcdir)/wmemchr.c'; fi`
 38.1014 -
 38.1015 -lib_a-wmemcmp.o: wmemcmp.c
 38.1016 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wmemcmp.o `test -f 'wmemcmp.c' || echo '$(srcdir)/'`wmemcmp.c
 38.1017 -
 38.1018 -lib_a-wmemcmp.obj: wmemcmp.c
 38.1019 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wmemcmp.obj `if test -f 'wmemcmp.c'; then $(CYGPATH_W) 'wmemcmp.c'; else $(CYGPATH_W) '$(srcdir)/wmemcmp.c'; fi`
 38.1020 -
 38.1021 -lib_a-wmemcpy.o: wmemcpy.c
 38.1022 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wmemcpy.o `test -f 'wmemcpy.c' || echo '$(srcdir)/'`wmemcpy.c
 38.1023 -
 38.1024 -lib_a-wmemcpy.obj: wmemcpy.c
 38.1025 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wmemcpy.obj `if test -f 'wmemcpy.c'; then $(CYGPATH_W) 'wmemcpy.c'; else $(CYGPATH_W) '$(srcdir)/wmemcpy.c'; fi`
 38.1026 -
 38.1027 -lib_a-wmemmove.o: wmemmove.c
 38.1028 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wmemmove.o `test -f 'wmemmove.c' || echo '$(srcdir)/'`wmemmove.c
 38.1029 -
 38.1030 -lib_a-wmemmove.obj: wmemmove.c
 38.1031 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wmemmove.obj `if test -f 'wmemmove.c'; then $(CYGPATH_W) 'wmemmove.c'; else $(CYGPATH_W) '$(srcdir)/wmemmove.c'; fi`
 38.1032 -
 38.1033 -lib_a-wmemset.o: wmemset.c
 38.1034 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wmemset.o `test -f 'wmemset.c' || echo '$(srcdir)/'`wmemset.c
 38.1035 -
 38.1036 -lib_a-wmemset.obj: wmemset.c
 38.1037 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wmemset.obj `if test -f 'wmemset.c'; then $(CYGPATH_W) 'wmemset.c'; else $(CYGPATH_W) '$(srcdir)/wmemset.c'; fi`
 38.1038 -
 38.1039 -lib_a-xpg_strerror_r.o: xpg_strerror_r.c
 38.1040 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-xpg_strerror_r.o `test -f 'xpg_strerror_r.c' || echo '$(srcdir)/'`xpg_strerror_r.c
 38.1041 -
 38.1042 -lib_a-xpg_strerror_r.obj: xpg_strerror_r.c
 38.1043 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-xpg_strerror_r.obj `if test -f 'xpg_strerror_r.c'; then $(CYGPATH_W) 'xpg_strerror_r.c'; else $(CYGPATH_W) '$(srcdir)/xpg_strerror_r.c'; fi`
 38.1044 -
 38.1045 -lib_a-bcmp.o: bcmp.c
 38.1046 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-bcmp.o `test -f 'bcmp.c' || echo '$(srcdir)/'`bcmp.c
 38.1047 -
 38.1048 -lib_a-bcmp.obj: bcmp.c
 38.1049 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-bcmp.obj `if test -f 'bcmp.c'; then $(CYGPATH_W) 'bcmp.c'; else $(CYGPATH_W) '$(srcdir)/bcmp.c'; fi`
 38.1050 -
 38.1051 -lib_a-memccpy.o: memccpy.c
 38.1052 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memccpy.o `test -f 'memccpy.c' || echo '$(srcdir)/'`memccpy.c
 38.1053 -
 38.1054 -lib_a-memccpy.obj: memccpy.c
 38.1055 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memccpy.obj `if test -f 'memccpy.c'; then $(CYGPATH_W) 'memccpy.c'; else $(CYGPATH_W) '$(srcdir)/memccpy.c'; fi`
 38.1056 -
 38.1057 -lib_a-mempcpy.o: mempcpy.c
 38.1058 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-mempcpy.o `test -f 'mempcpy.c' || echo '$(srcdir)/'`mempcpy.c
 38.1059 -
 38.1060 -lib_a-mempcpy.obj: mempcpy.c
 38.1061 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-mempcpy.obj `if test -f 'mempcpy.c'; then $(CYGPATH_W) 'mempcpy.c'; else $(CYGPATH_W) '$(srcdir)/mempcpy.c'; fi`
 38.1062 -
 38.1063 -lib_a-stpcpy.o: stpcpy.c
 38.1064 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-stpcpy.o `test -f 'stpcpy.c' || echo '$(srcdir)/'`stpcpy.c
 38.1065 -
 38.1066 -lib_a-stpcpy.obj: stpcpy.c
 38.1067 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-stpcpy.obj `if test -f 'stpcpy.c'; then $(CYGPATH_W) 'stpcpy.c'; else $(CYGPATH_W) '$(srcdir)/stpcpy.c'; fi`
 38.1068 -
 38.1069 -lib_a-stpncpy.o: stpncpy.c
 38.1070 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-stpncpy.o `test -f 'stpncpy.c' || echo '$(srcdir)/'`stpncpy.c
 38.1071 -
 38.1072 -lib_a-stpncpy.obj: stpncpy.c
 38.1073 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-stpncpy.obj `if test -f 'stpncpy.c'; then $(CYGPATH_W) 'stpncpy.c'; else $(CYGPATH_W) '$(srcdir)/stpncpy.c'; fi`
 38.1074 -
 38.1075 -lib_a-strndup.o: strndup.c
 38.1076 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strndup.o `test -f 'strndup.c' || echo '$(srcdir)/'`strndup.c
 38.1077 -
 38.1078 -lib_a-strndup.obj: strndup.c
 38.1079 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strndup.obj `if test -f 'strndup.c'; then $(CYGPATH_W) 'strndup.c'; else $(CYGPATH_W) '$(srcdir)/strndup.c'; fi`
 38.1080 -
 38.1081 -lib_a-strcasestr.o: strcasestr.c
 38.1082 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strcasestr.o `test -f 'strcasestr.c' || echo '$(srcdir)/'`strcasestr.c
 38.1083 -
 38.1084 -lib_a-strcasestr.obj: strcasestr.c
 38.1085 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strcasestr.obj `if test -f 'strcasestr.c'; then $(CYGPATH_W) 'strcasestr.c'; else $(CYGPATH_W) '$(srcdir)/strcasestr.c'; fi`
 38.1086 -
 38.1087 -lib_a-strchrnul.o: strchrnul.c
 38.1088 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strchrnul.o `test -f 'strchrnul.c' || echo '$(srcdir)/'`strchrnul.c
 38.1089 -
 38.1090 -lib_a-strchrnul.obj: strchrnul.c
 38.1091 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strchrnul.obj `if test -f 'strchrnul.c'; then $(CYGPATH_W) 'strchrnul.c'; else $(CYGPATH_W) '$(srcdir)/strchrnul.c'; fi`
 38.1092 -
 38.1093 -lib_a-strndup_r.o: strndup_r.c
 38.1094 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strndup_r.o `test -f 'strndup_r.c' || echo '$(srcdir)/'`strndup_r.c
 38.1095 -
 38.1096 -lib_a-strndup_r.obj: strndup_r.c
 38.1097 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strndup_r.obj `if test -f 'strndup_r.c'; then $(CYGPATH_W) 'strndup_r.c'; else $(CYGPATH_W) '$(srcdir)/strndup_r.c'; fi`
 38.1098 -
 38.1099 -lib_a-wcpcpy.o: wcpcpy.c
 38.1100 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcpcpy.o `test -f 'wcpcpy.c' || echo '$(srcdir)/'`wcpcpy.c
 38.1101 -
 38.1102 -lib_a-wcpcpy.obj: wcpcpy.c
 38.1103 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcpcpy.obj `if test -f 'wcpcpy.c'; then $(CYGPATH_W) 'wcpcpy.c'; else $(CYGPATH_W) '$(srcdir)/wcpcpy.c'; fi`
 38.1104 -
 38.1105 -lib_a-wcpncpy.o: wcpncpy.c
 38.1106 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcpncpy.o `test -f 'wcpncpy.c' || echo '$(srcdir)/'`wcpncpy.c
 38.1107 -
 38.1108 -lib_a-wcpncpy.obj: wcpncpy.c
 38.1109 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcpncpy.obj `if test -f 'wcpncpy.c'; then $(CYGPATH_W) 'wcpncpy.c'; else $(CYGPATH_W) '$(srcdir)/wcpncpy.c'; fi`
 38.1110 -
 38.1111 -lib_a-wcsdup.o: wcsdup.c
 38.1112 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsdup.o `test -f 'wcsdup.c' || echo '$(srcdir)/'`wcsdup.c
 38.1113 -
 38.1114 -lib_a-wcsdup.obj: wcsdup.c
 38.1115 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsdup.obj `if test -f 'wcsdup.c'; then $(CYGPATH_W) 'wcsdup.c'; else $(CYGPATH_W) '$(srcdir)/wcsdup.c'; fi`
 38.1116 -
 38.1117 -lib_a-gnu_basename.o: gnu_basename.c
 38.1118 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-gnu_basename.o `test -f 'gnu_basename.c' || echo '$(srcdir)/'`gnu_basename.c
 38.1119 -
 38.1120 -lib_a-gnu_basename.obj: gnu_basename.c
 38.1121 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-gnu_basename.obj `if test -f 'gnu_basename.c'; then $(CYGPATH_W) 'gnu_basename.c'; else $(CYGPATH_W) '$(srcdir)/gnu_basename.c'; fi`
 38.1122 -
 38.1123 -lib_a-memmem.o: memmem.c
 38.1124 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memmem.o `test -f 'memmem.c' || echo '$(srcdir)/'`memmem.c
 38.1125 -
 38.1126 -lib_a-memmem.obj: memmem.c
 38.1127 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memmem.obj `if test -f 'memmem.c'; then $(CYGPATH_W) 'memmem.c'; else $(CYGPATH_W) '$(srcdir)/memmem.c'; fi`
 38.1128 -
 38.1129 -lib_a-memrchr.o: memrchr.c
 38.1130 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memrchr.o `test -f 'memrchr.c' || echo '$(srcdir)/'`memrchr.c
 38.1131 -
 38.1132 -lib_a-memrchr.obj: memrchr.c
 38.1133 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memrchr.obj `if test -f 'memrchr.c'; then $(CYGPATH_W) 'memrchr.c'; else $(CYGPATH_W) '$(srcdir)/memrchr.c'; fi`
 38.1134 -
 38.1135 -lib_a-rawmemchr.o: rawmemchr.c
 38.1136 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-rawmemchr.o `test -f 'rawmemchr.c' || echo '$(srcdir)/'`rawmemchr.c
 38.1137 -
 38.1138 -lib_a-rawmemchr.obj: rawmemchr.c
 38.1139 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-rawmemchr.obj `if test -f 'rawmemchr.c'; then $(CYGPATH_W) 'rawmemchr.c'; else $(CYGPATH_W) '$(srcdir)/rawmemchr.c'; fi`
 38.1140 -
 38.1141 -lib_a-strcasecmp_l.o: strcasecmp_l.c
 38.1142 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strcasecmp_l.o `test -f 'strcasecmp_l.c' || echo '$(srcdir)/'`strcasecmp_l.c
 38.1143 -
 38.1144 -lib_a-strcasecmp_l.obj: strcasecmp_l.c
 38.1145 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strcasecmp_l.obj `if test -f 'strcasecmp_l.c'; then $(CYGPATH_W) 'strcasecmp_l.c'; else $(CYGPATH_W) '$(srcdir)/strcasecmp_l.c'; fi`
 38.1146 -
 38.1147 -lib_a-strcoll_l.o: strcoll_l.c
 38.1148 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strcoll_l.o `test -f 'strcoll_l.c' || echo '$(srcdir)/'`strcoll_l.c
 38.1149 -
 38.1150 -lib_a-strcoll_l.obj: strcoll_l.c
 38.1151 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strcoll_l.obj `if test -f 'strcoll_l.c'; then $(CYGPATH_W) 'strcoll_l.c'; else $(CYGPATH_W) '$(srcdir)/strcoll_l.c'; fi`
 38.1152 -
 38.1153 -lib_a-strncasecmp_l.o: strncasecmp_l.c
 38.1154 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strncasecmp_l.o `test -f 'strncasecmp_l.c' || echo '$(srcdir)/'`strncasecmp_l.c
 38.1155 -
 38.1156 -lib_a-strncasecmp_l.obj: strncasecmp_l.c
 38.1157 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strncasecmp_l.obj `if test -f 'strncasecmp_l.c'; then $(CYGPATH_W) 'strncasecmp_l.c'; else $(CYGPATH_W) '$(srcdir)/strncasecmp_l.c'; fi`
 38.1158 -
 38.1159 -lib_a-strverscmp.o: strverscmp.c
 38.1160 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strverscmp.o `test -f 'strverscmp.c' || echo '$(srcdir)/'`strverscmp.c
 38.1161 -
 38.1162 -lib_a-strverscmp.obj: strverscmp.c
 38.1163 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strverscmp.obj `if test -f 'strverscmp.c'; then $(CYGPATH_W) 'strverscmp.c'; else $(CYGPATH_W) '$(srcdir)/strverscmp.c'; fi`
 38.1164 -
 38.1165 -lib_a-strxfrm_l.o: strxfrm_l.c
 38.1166 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strxfrm_l.o `test -f 'strxfrm_l.c' || echo '$(srcdir)/'`strxfrm_l.c
 38.1167 -
 38.1168 -lib_a-strxfrm_l.obj: strxfrm_l.c
 38.1169 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strxfrm_l.obj `if test -f 'strxfrm_l.c'; then $(CYGPATH_W) 'strxfrm_l.c'; else $(CYGPATH_W) '$(srcdir)/strxfrm_l.c'; fi`
 38.1170 -
 38.1171 -lib_a-wcscasecmp.o: wcscasecmp.c
 38.1172 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcscasecmp.o `test -f 'wcscasecmp.c' || echo '$(srcdir)/'`wcscasecmp.c
 38.1173 -
 38.1174 -lib_a-wcscasecmp.obj: wcscasecmp.c
 38.1175 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcscasecmp.obj `if test -f 'wcscasecmp.c'; then $(CYGPATH_W) 'wcscasecmp.c'; else $(CYGPATH_W) '$(srcdir)/wcscasecmp.c'; fi`
 38.1176 -
 38.1177 -lib_a-wcscasecmp_l.o: wcscasecmp_l.c
 38.1178 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcscasecmp_l.o `test -f 'wcscasecmp_l.c' || echo '$(srcdir)/'`wcscasecmp_l.c
 38.1179 -
 38.1180 -lib_a-wcscasecmp_l.obj: wcscasecmp_l.c
 38.1181 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcscasecmp_l.obj `if test -f 'wcscasecmp_l.c'; then $(CYGPATH_W) 'wcscasecmp_l.c'; else $(CYGPATH_W) '$(srcdir)/wcscasecmp_l.c'; fi`
 38.1182 -
 38.1183 -lib_a-wcscoll_l.o: wcscoll_l.c
 38.1184 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcscoll_l.o `test -f 'wcscoll_l.c' || echo '$(srcdir)/'`wcscoll_l.c
 38.1185 -
 38.1186 -lib_a-wcscoll_l.obj: wcscoll_l.c
 38.1187 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcscoll_l.obj `if test -f 'wcscoll_l.c'; then $(CYGPATH_W) 'wcscoll_l.c'; else $(CYGPATH_W) '$(srcdir)/wcscoll_l.c'; fi`
 38.1188 -
 38.1189 -lib_a-wcsncasecmp.o: wcsncasecmp.c
 38.1190 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsncasecmp.o `test -f 'wcsncasecmp.c' || echo '$(srcdir)/'`wcsncasecmp.c
 38.1191 -
 38.1192 -lib_a-wcsncasecmp.obj: wcsncasecmp.c
 38.1193 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsncasecmp.obj `if test -f 'wcsncasecmp.c'; then $(CYGPATH_W) 'wcsncasecmp.c'; else $(CYGPATH_W) '$(srcdir)/wcsncasecmp.c'; fi`
 38.1194 -
 38.1195 -lib_a-wcsncasecmp_l.o: wcsncasecmp_l.c
 38.1196 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsncasecmp_l.o `test -f 'wcsncasecmp_l.c' || echo '$(srcdir)/'`wcsncasecmp_l.c
 38.1197 -
 38.1198 -lib_a-wcsncasecmp_l.obj: wcsncasecmp_l.c
 38.1199 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsncasecmp_l.obj `if test -f 'wcsncasecmp_l.c'; then $(CYGPATH_W) 'wcsncasecmp_l.c'; else $(CYGPATH_W) '$(srcdir)/wcsncasecmp_l.c'; fi`
 38.1200 -
 38.1201 -lib_a-wcsxfrm_l.o: wcsxfrm_l.c
 38.1202 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsxfrm_l.o `test -f 'wcsxfrm_l.c' || echo '$(srcdir)/'`wcsxfrm_l.c
 38.1203 -
 38.1204 -lib_a-wcsxfrm_l.obj: wcsxfrm_l.c
 38.1205 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wcsxfrm_l.obj `if test -f 'wcsxfrm_l.c'; then $(CYGPATH_W) 'wcsxfrm_l.c'; else $(CYGPATH_W) '$(srcdir)/wcsxfrm_l.c'; fi`
 38.1206 -
 38.1207 -lib_a-wmempcpy.o: wmempcpy.c
 38.1208 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wmempcpy.o `test -f 'wmempcpy.c' || echo '$(srcdir)/'`wmempcpy.c
 38.1209 -
 38.1210 -lib_a-wmempcpy.obj: wmempcpy.c
 38.1211 -	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wmempcpy.obj `if test -f 'wmempcpy.c'; then $(CYGPATH_W) 'wmempcpy.c'; else $(CYGPATH_W) '$(srcdir)/wmempcpy.c'; fi`
 38.1212 -
 38.1213 -mostlyclean-libtool:
 38.1214 -	-rm -f *.lo
 38.1215 -
 38.1216 -clean-libtool:
 38.1217 -	-rm -rf .libs _libs
 38.1218 -
 38.1219 -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 38.1220 -	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
 38.1221 -	unique=`for i in $$list; do \
 38.1222 -	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 38.1223 -	  done | \
 38.1224 -	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 38.1225 -	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 38.1226 -	mkid -fID $$unique
 38.1227 -tags: TAGS
 38.1228 -
 38.1229 -TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 38.1230 -		$(TAGS_FILES) $(LISP)
 38.1231 -	set x; \
 38.1232 -	here=`pwd`; \
 38.1233 -	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 38.1234 -	unique=`for i in $$list; do \
 38.1235 -	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 38.1236 -	  done | \
 38.1237 -	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 38.1238 -	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 38.1239 -	shift; \
 38.1240 -	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
 38.1241 -	  test -n "$$unique" || unique=$$empty_fix; \
 38.1242 -	  if test $$# -gt 0; then \
 38.1243 -	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
 38.1244 -	      "$$@" $$unique; \
 38.1245 -	  else \
 38.1246 -	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
 38.1247 -	      $$unique; \
 38.1248 -	  fi; \
 38.1249 -	fi
 38.1250 -ctags: CTAGS
 38.1251 -CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
 38.1252 -		$(TAGS_FILES) $(LISP)
 38.1253 -	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
 38.1254 -	unique=`for i in $$list; do \
 38.1255 -	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
 38.1256 -	  done | \
 38.1257 -	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
 38.1258 -	      END { if (nonempty) { for (i in files) print i; }; }'`; \
 38.1259 -	test -z "$(CTAGS_ARGS)$$unique" \
 38.1260 -	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
 38.1261 -	     $$unique
 38.1262 -
 38.1263 -GTAGS:
 38.1264 -	here=`$(am__cd) $(top_builddir) && pwd` \
 38.1265 -	  && $(am__cd) $(top_srcdir) \
 38.1266 -	  && gtags -i $(GTAGS_ARGS) "$$here"
 38.1267 -
 38.1268 -distclean-tags:
 38.1269 -	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 38.1270 -check-am:
 38.1271 -check: check-am
 38.1272 -all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(DATA)
 38.1273 -installdirs:
 38.1274 -install: install-am
 38.1275 -install-exec: install-exec-am
 38.1276 -install-data: install-data-am
 38.1277 -uninstall: uninstall-am
 38.1278 -
 38.1279 -install-am: all-am
 38.1280 -	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
 38.1281 -
 38.1282 -installcheck: installcheck-am
 38.1283 -install-strip:
 38.1284 -	if test -z '$(STRIP)'; then \
 38.1285 -	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
 38.1286 -	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
 38.1287 -	      install; \
 38.1288 -	else \
 38.1289 -	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
 38.1290 -	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
 38.1291 -	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
 38.1292 -	fi
 38.1293 -mostlyclean-generic:
 38.1294 -
 38.1295 -clean-generic:
 38.1296 -	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
 38.1297 -
 38.1298 -distclean-generic:
 38.1299 -	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
 38.1300 -	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 38.1301 -
 38.1302 -maintainer-clean-generic:
 38.1303 -	@echo "This command is intended for maintainers to use"
 38.1304 -	@echo "it deletes files that may require special tools to rebuild."
 38.1305 -clean: clean-am
 38.1306 -
 38.1307 -clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
 38.1308 -	clean-noinstLTLIBRARIES mostlyclean-am
 38.1309 -
 38.1310 -distclean: distclean-am
 38.1311 -	-rm -f Makefile
 38.1312 -distclean-am: clean-am distclean-compile distclean-generic \
 38.1313 -	distclean-tags
 38.1314 -
 38.1315 -dvi: dvi-am
 38.1316 -
 38.1317 -dvi-am:
 38.1318 -
 38.1319 -html: html-am
 38.1320 -
 38.1321 -html-am:
 38.1322 -
 38.1323 -info: info-am
 38.1324 -
 38.1325 -info-am:
 38.1326 -
 38.1327 -install-data-am:
 38.1328 -
 38.1329 -install-dvi: install-dvi-am
 38.1330 -
 38.1331 -install-dvi-am:
 38.1332 -
 38.1333 -install-exec-am:
 38.1334 -
 38.1335 -install-html: install-html-am
 38.1336 -
 38.1337 -install-html-am:
 38.1338 -
 38.1339 -install-info: install-info-am
 38.1340 -
 38.1341 -install-info-am:
 38.1342 -
 38.1343 -install-man:
 38.1344 -
 38.1345 -install-pdf: install-pdf-am
 38.1346 -
 38.1347 -install-pdf-am:
 38.1348 -
 38.1349 -install-ps: install-ps-am
 38.1350 -
 38.1351 -install-ps-am:
 38.1352 -
 38.1353 -installcheck-am:
 38.1354 -
 38.1355 -maintainer-clean: maintainer-clean-am
 38.1356 -	-rm -f Makefile
 38.1357 -maintainer-clean-am: distclean-am maintainer-clean-generic
 38.1358 -
 38.1359 -mostlyclean: mostlyclean-am
 38.1360 -
 38.1361 -mostlyclean-am: mostlyclean-compile mostlyclean-generic \
 38.1362 -	mostlyclean-libtool
 38.1363 -
 38.1364 -pdf: pdf-am
 38.1365 -
 38.1366 -pdf-am:
 38.1367 -
 38.1368 -ps: ps-am
 38.1369 -
 38.1370 -ps-am:
 38.1371 -
 38.1372 -uninstall-am:
 38.1373 -
 38.1374 -.MAKE: install-am install-strip
 38.1375 -
 38.1376 -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
 38.1377 -	clean-libtool clean-noinstLIBRARIES clean-noinstLTLIBRARIES \
 38.1378 -	ctags distclean distclean-compile distclean-generic \
 38.1379 -	distclean-libtool distclean-tags dvi dvi-am html html-am info \
 38.1380 -	info-am install install-am install-data install-data-am \
 38.1381 -	install-dvi install-dvi-am install-exec install-exec-am \
 38.1382 -	install-html install-html-am install-info install-info-am \
 38.1383 -	install-man install-pdf install-pdf-am install-ps \
 38.1384 -	install-ps-am install-strip installcheck installcheck-am \
 38.1385 -	installdirs maintainer-clean maintainer-clean-generic \
 38.1386 -	mostlyclean mostlyclean-compile mostlyclean-generic \
 38.1387 -	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
 38.1388 -	uninstall-am
 38.1389 -
 38.1390 -objectlist.awk.in: $(noinst_LTLIBRARIES)
 38.1391 -	-rm -f objectlist.awk.in
 38.1392 -	for i in `ls *.lo` ; \
 38.1393 -	do \
 38.1394 -	  echo $$i `pwd`/$$i >> objectlist.awk.in ; \
 38.1395 -	done
 38.1396 -
 38.1397 -.c.def:
 38.1398 -	$(CHEW) < $< > $*.def || ( rm $*.def && false )
 38.1399 -	@touch stmp-def
 38.1400 -
 38.1401 -TARGETDOC ?= ../tmp.texi
 38.1402 -
 38.1403 -doc: $(CHEWOUT_FILES)
 38.1404 -	for chapter in $(CHAPTERS) ; \
 38.1405 -	do \
 38.1406 -	  cat $(srcdir)/$$chapter >> $(TARGETDOC) ; \
 38.1407 -	done
 38.1408 -
 38.1409 -.c.xml:
 38.1410 -	$(DOCBOOK_CHEW) < $< > $*.xml || ( rm $*.xml && false )
 38.1411 -	@touch stmp-xml
 38.1412 -
 38.1413 -docbook: $(DOCBOOK_OUT_FILES)
 38.1414 -	for chapter in $(DOCBOOK_CHAPTERS) ; \
 38.1415 -	do \
 38.1416 -	  ${top_srcdir}/../doc/chapter-texi2docbook.py <$(srcdir)/$${chapter%.xml}.tex >../$$chapter ; \
 38.1417 -	done
 38.1418 -
 38.1419 -# Tell versions [3.59,3.63) of GNU make to not export all variables.
 38.1420 -# Otherwise a system limit (for SysV at least) may be exceeded.
 38.1421 -.NOEXPORT:
    39.1 --- a/libc/string/WIDTH-A	Sat Dec 07 00:44:56 2019 +0100
    39.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.3 @@ -1,569 +0,0 @@
    39.4 -# UAX #11: East Asian Ambiguous
    39.5 -
    39.6 -# Plane 00
    39.7 -# Rows	Positions (Cells)
    39.8 -
    39.9 -  00	A1 A4 A7-A8 AA AD-AE B0-B4 B6-BA BC-BF C6 D0 D7-D8 DE-E1 E6 E8-EA
   39.10 -  00	EC-ED F0 F2-F3 F7-FA FC FE
   39.11 -  01	01 11 13 1B 26-27 2B 31-33 38 3F-42 44 48-4B 4D 52-53 66-67 6B
   39.12 -  01	CE D0 D2 D4 D6 D8 DA DC
   39.13 -  02	51 61 C4 C7 C9-CB CD D0 D8-DB DD DF
   39.14 -  03	00-6F 91-A1 A3-A9 B1-C1 C3-C9
   39.15 -  04	01 10-4F 51
   39.16 -  20	10 13-16 18-19 1C-1D 20-22 24-27 30 32-33 35 3B 3E 74 7F 81-84
   39.17 -  20	AC
   39.18 -  21	03 05 09 13 16 21-22 26 2B 53-54 5B-5E 60-6B 70-79 89 90-99 B8-B9
   39.19 -  21	D2 D4 E7
   39.20 -  22	00 02-03 07-08 0B 0F 11 15 1A 1D-20 23 25 27-2C 2E 34-37 3C-3D
   39.21 -  22	48 4C 52 60-61 64-67 6A-6B 6E-6F 82-83 86-87 95 99 A5 BF
   39.22 -  23	12
   39.23 -  24	60-E9 EB-FF
   39.24 -  25	00-4B 50-73 80-8F 92-95 A0-A1 A3-A9 B2-B3 B6-B7 BC-BD C0-C1 C6-C8
   39.25 -  25	CB CE-D1 E2-E5 EF
   39.26 -  26	05-06 09 0E-0F 1C 1E 40 42 60-61 63-65 67-6A 6C-6D 6F 9E-9F BF
   39.27 -  26	C6-CD CF-D3 D5-E1 E3 E8-E9 EB-F1 F4 F6-F9 FB-FC FE-FF
   39.28 -  27	3D 76-7F
   39.29 -  2B	56-59
   39.30 -  32	48-4F
   39.31 -  E0	00-FF
   39.32 -  E1	00-FF
   39.33 -  E2	00-FF
   39.34 -  E3	00-FF
   39.35 -  E4	00-FF
   39.36 -  E5	00-FF
   39.37 -  E6	00-FF
   39.38 -  E7	00-FF
   39.39 -  E8	00-FF
   39.40 -  E9	00-FF
   39.41 -  EA	00-FF
   39.42 -  EB	00-FF
   39.43 -  EC	00-FF
   39.44 -  ED	00-FF
   39.45 -  EE	00-FF
   39.46 -  EF	00-FF
   39.47 -  F0	00-FF
   39.48 -  F1	00-FF
   39.49 -  F2	00-FF
   39.50 -  F3	00-FF
   39.51 -  F4	00-FF
   39.52 -  F5	00-FF
   39.53 -  F6	00-FF
   39.54 -  F7	00-FF
   39.55 -  F8	00-FF
   39.56 -  FE	00-0F
   39.57 -  FF	FD
   39.58 -  1F1	00-0A 10-2D 30-69 70-8D 8F-90 9B-AC
   39.59 -  E01	00-EF
   39.60 -  F00	00-FF
   39.61 -  F01	00-FF
   39.62 -  F02	00-FF
   39.63 -  F03	00-FF
   39.64 -  F04	00-FF
   39.65 -  F05	00-FF
   39.66 -  F06	00-FF
   39.67 -  F07	00-FF
   39.68 -  F08	00-FF
   39.69 -  F09	00-FF
   39.70 -  F0A	00-FF
   39.71 -  F0B	00-FF
   39.72 -  F0C	00-FF
   39.73 -  F0D	00-FF
   39.74 -  F0E	00-FF
   39.75 -  F0F	00-FF
   39.76 -  F10	00-FF
   39.77 -  F11	00-FF
   39.78 -  F12	00-FF
   39.79 -  F13	00-FF
   39.80 -  F14	00-FF
   39.81 -  F15	00-FF
   39.82 -  F16	00-FF
   39.83 -  F17	00-FF
   39.84 -  F18	00-FF
   39.85 -  F19	00-FF
   39.86 -  F1A	00-FF
   39.87 -  F1B	00-FF
   39.88 -  F1C	00-FF
   39.89 -  F1D	00-FF
   39.90 -  F1E	00-FF
   39.91 -  F1F	00-FF
   39.92 -  F20	00-FF
   39.93 -  F21	00-FF
   39.94 -  F22	00-FF
   39.95 -  F23	00-FF
   39.96 -  F24	00-FF
   39.97 -  F25	00-FF
   39.98 -  F26	00-FF
   39.99 -  F27	00-FF
  39.100 -  F28	00-FF
  39.101 -  F29	00-FF
  39.102 -  F2A	00-FF
  39.103 -  F2B	00-FF
  39.104 -  F2C	00-FF
  39.105 -  F2D	00-FF
  39.106 -  F2E	00-FF
  39.107 -  F2F	00-FF
  39.108 -  F30	00-FF
  39.109 -  F31	00-FF
  39.110 -  F32	00-FF
  39.111 -  F33	00-FF
  39.112 -  F34	00-FF
  39.113 -  F35	00-FF
  39.114 -  F36	00-FF
  39.115 -  F37	00-FF
  39.116 -  F38	00-FF
  39.117 -  F39	00-FF
  39.118 -  F3A	00-FF
  39.119 -  F3B	00-FF
  39.120 -  F3C	00-FF
  39.121 -  F3D	00-FF
  39.122 -  F3E	00-FF
  39.123 -  F3F	00-FF
  39.124 -  F40	00-FF
  39.125 -  F41	00-FF
  39.126 -  F42	00-FF
  39.127 -  F43	00-FF
  39.128 -  F44	00-FF
  39.129 -  F45	00-FF
  39.130 -  F46	00-FF
  39.131 -  F47	00-FF
  39.132 -  F48	00-FF
  39.133 -  F49	00-FF
  39.134 -  F4A	00-FF
  39.135 -  F4B	00-FF
  39.136 -  F4C	00-FF
  39.137 -  F4D	00-FF
  39.138 -  F4E	00-FF
  39.139 -  F4F	00-FF
  39.140 -  F50	00-FF
  39.141 -  F51	00-FF
  39.142 -  F52	00-FF
  39.143 -  F53	00-FF
  39.144 -  F54	00-FF
  39.145 -  F55	00-FF
  39.146 -  F56	00-FF
  39.147 -  F57	00-FF
  39.148 -  F58	00-FF
  39.149 -  F59	00-FF
  39.150 -  F5A	00-FF
  39.151 -  F5B	00-FF
  39.152 -  F5C	00-FF
  39.153 -  F5D	00-FF
  39.154 -  F5E	00-FF
  39.155 -  F5F	00-FF
  39.156 -  F60	00-FF
  39.157 -  F61	00-FF
  39.158 -  F62	00-FF
  39.159 -  F63	00-FF
  39.160 -  F64	00-FF
  39.161 -  F65	00-FF
  39.162 -  F66	00-FF
  39.163 -  F67	00-FF
  39.164 -  F68	00-FF
  39.165 -  F69	00-FF
  39.166 -  F6A	00-FF
  39.167 -  F6B	00-FF
  39.168 -  F6C	00-FF
  39.169 -  F6D	00-FF
  39.170 -  F6E	00-FF
  39.171 -  F6F	00-FF
  39.172 -  F70	00-FF
  39.173 -  F71	00-FF
  39.174 -  F72	00-FF
  39.175 -  F73	00-FF
  39.176 -  F74	00-FF
  39.177 -  F75	00-FF
  39.178 -  F76	00-FF
  39.179 -  F77	00-FF
  39.180 -  F78	00-FF
  39.181 -  F79	00-FF
  39.182 -  F7A	00-FF
  39.183 -  F7B	00-FF
  39.184 -  F7C	00-FF
  39.185 -  F7D	00-FF
  39.186 -  F7E	00-FF
  39.187 -  F7F	00-FF
  39.188 -  F80	00-FF
  39.189 -  F81	00-FF
  39.190 -  F82	00-FF
  39.191 -  F83	00-FF
  39.192 -  F84	00-FF
  39.193 -  F85	00-FF
  39.194 -  F86	00-FF
  39.195 -  F87	00-FF
  39.196 -  F88	00-FF
  39.197 -  F89	00-FF
  39.198 -  F8A	00-FF
  39.199 -  F8B	00-FF
  39.200 -  F8C	00-FF
  39.201 -  F8D	00-FF
  39.202 -  F8E	00-FF
  39.203 -  F8F	00-FF
  39.204 -  F90	00-FF
  39.205 -  F91	00-FF
  39.206 -  F92	00-FF
  39.207 -  F93	00-FF
  39.208 -  F94	00-FF
  39.209 -  F95	00-FF
  39.210 -  F96	00-FF
  39.211 -  F97	00-FF
  39.212 -  F98	00-FF
  39.213 -  F99	00-FF
  39.214 -  F9A	00-FF
  39.215 -  F9B	00-FF
  39.216 -  F9C	00-FF
  39.217 -  F9D	00-FF
  39.218 -  F9E	00-FF
  39.219 -  F9F	00-FF
  39.220 -  FA0	00-FF
  39.221 -  FA1	00-FF
  39.222 -  FA2	00-FF
  39.223 -  FA3	00-FF
  39.224 -  FA4	00-FF
  39.225 -  FA5	00-FF
  39.226 -  FA6	00-FF
  39.227 -  FA7	00-FF
  39.228 -  FA8	00-FF
  39.229 -  FA9	00-FF
  39.230 -  FAA	00-FF
  39.231 -  FAB	00-FF
  39.232 -  FAC	00-FF
  39.233 -  FAD	00-FF
  39.234 -  FAE	00-FF
  39.235 -  FAF	00-FF
  39.236 -  FB0	00-FF
  39.237 -  FB1	00-FF
  39.238 -  FB2	00-FF
  39.239 -  FB3	00-FF
  39.240 -  FB4	00-FF
  39.241 -  FB5	00-FF
  39.242 -  FB6	00-FF
  39.243 -  FB7	00-FF
  39.244 -  FB8	00-FF
  39.245 -  FB9	00-FF
  39.246 -  FBA	00-FF
  39.247 -  FBB	00-FF
  39.248 -  FBC	00-FF
  39.249 -  FBD	00-FF
  39.250 -  FBE	00-FF
  39.251 -  FBF	00-FF
  39.252 -  FC0	00-FF
  39.253 -  FC1	00-FF
  39.254 -  FC2	00-FF
  39.255 -  FC3	00-FF
  39.256 -  FC4	00-FF
  39.257 -  FC5	00-FF
  39.258 -  FC6	00-FF
  39.259 -  FC7	00-FF
  39.260 -  FC8	00-FF
  39.261 -  FC9	00-FF
  39.262 -  FCA	00-FF
  39.263 -  FCB	00-FF
  39.264 -  FCC	00-FF
  39.265 -  FCD	00-FF
  39.266 -  FCE	00-FF
  39.267 -  FCF	00-FF
  39.268 -  FD0	00-FF
  39.269 -  FD1	00-FF
  39.270 -  FD2	00-FF
  39.271 -  FD3	00-FF
  39.272 -  FD4	00-FF
  39.273 -  FD5	00-FF
  39.274 -  FD6	00-FF
  39.275 -  FD7	00-FF
  39.276 -  FD8	00-FF
  39.277 -  FD9	00-FF
  39.278 -  FDA	00-FF
  39.279 -  FDB	00-FF
  39.280 -  FDC	00-FF
  39.281 -  FDD	00-FF
  39.282 -  FDE	00-FF
  39.283 -  FDF	00-FF
  39.284 -  FE0	00-FF
  39.285 -  FE1	00-FF
  39.286 -  FE2	00-FF
  39.287 -  FE3	00-FF
  39.288 -  FE4	00-FF
  39.289 -  FE5	00-FF
  39.290 -  FE6	00-FF
  39.291 -  FE7	00-FF
  39.292 -  FE8	00-FF
  39.293 -  FE9	00-FF
  39.294 -  FEA	00-FF
  39.295 -  FEB	00-FF
  39.296 -  FEC	00-FF
  39.297 -  FED	00-FF
  39.298 -  FEE	00-FF
  39.299 -  FEF	00-FF
  39.300 -  FF0	00-FF
  39.301 -  FF1	00-FF
  39.302 -  FF2	00-FF
  39.303 -  FF3	00-FF
  39.304 -  FF4	00-FF
  39.305 -  FF5	00-FF
  39.306 -  FF6	00-FF
  39.307 -  FF7	00-FF
  39.308 -  FF8	00-FF
  39.309 -  FF9	00-FF
  39.310 -  FFA	00-FF
  39.311 -  FFB	00-FF
  39.312 -  FFC	00-FF
  39.313 -  FFD	00-FF
  39.314 -  FFE	00-FF
  39.315 -  FFF	00-FD
  39.316 -  1000	00-FF
  39.317 -  1001	00-FF
  39.318 -  1002	00-FF
  39.319 -  1003	00-FF
  39.320 -  1004	00-FF
  39.321 -  1005	00-FF
  39.322 -  1006	00-FF
  39.323 -  1007	00-FF
  39.324 -  1008	00-FF
  39.325 -  1009	00-FF
  39.326 -  100A	00-FF
  39.327 -  100B	00-FF
  39.328 -  100C	00-FF
  39.329 -  100D	00-FF
  39.330 -  100E	00-FF
  39.331 -  100F	00-FF
  39.332 -  1010	00-FF
  39.333 -  1011	00-FF
  39.334 -  1012	00-FF
  39.335 -  1013	00-FF
  39.336 -  1014	00-FF
  39.337 -  1015	00-FF
  39.338 -  1016	00-FF
  39.339 -  1017	00-FF
  39.340 -  1018	00-FF
  39.341 -  1019	00-FF
  39.342 -  101A	00-FF
  39.343 -  101B	00-FF
  39.344 -  101C	00-FF
  39.345 -  101D	00-FF
  39.346 -  101E	00-FF
  39.347 -  101F	00-FF
  39.348 -  1020	00-FF
  39.349 -  1021	00-FF
  39.350 -  1022	00-FF
  39.351 -  1023	00-FF
  39.352 -  1024	00-FF
  39.353 -  1025	00-FF
  39.354 -  1026	00-FF
  39.355 -  1027	00-FF
  39.356 -  1028	00-FF
  39.357 -  1029	00-FF
  39.358 -  102A	00-FF
  39.359 -  102B	00-FF
  39.360 -  102C	00-FF
  39.361 -  102D	00-FF
  39.362 -  102E	00-FF
  39.363 -  102F	00-FF
  39.364 -  1030	00-FF
  39.365 -  1031	00-FF
  39.366 -  1032	00-FF
  39.367 -  1033	00-FF
  39.368 -  1034	00-FF
  39.369 -  1035	00-FF
  39.370 -  1036	00-FF
  39.371 -  1037	00-FF
  39.372 -  1038	00-FF
  39.373 -  1039	00-FF
  39.374 -  103A	00-FF
  39.375 -  103B	00-FF
  39.376 -  103C	00-FF
  39.377 -  103D	00-FF
  39.378 -  103E	00-FF
  39.379 -  103F	00-FF
  39.380 -  1040	00-FF
  39.381 -  1041	00-FF
  39.382 -  1042	00-FF
  39.383 -  1043	00-FF
  39.384 -  1044	00-FF
  39.385 -  1045	00-FF
  39.386 -  1046	00-FF
  39.387 -  1047	00-FF
  39.388 -  1048	00-FF
  39.389 -  1049	00-FF
  39.390 -  104A	00-FF
  39.391 -  104B	00-FF
  39.392 -  104C	00-FF
  39.393 -  104D	00-FF
  39.394 -  104E	00-FF
  39.395 -  104F	00-FF
  39.396 -  1050	00-FF
  39.397 -  1051	00-FF
  39.398 -  1052	00-FF
  39.399 -  1053	00-FF
  39.400 -  1054	00-FF
  39.401 -  1055	00-FF
  39.402 -  1056	00-FF
  39.403 -  1057	00-FF
  39.404 -  1058	00-FF
  39.405 -  1059	00-FF
  39.406 -  105A	00-FF
  39.407 -  105B	00-FF
  39.408 -  105C	00-FF
  39.409 -  105D	00-FF
  39.410 -  105E	00-FF
  39.411 -  105F	00-FF
  39.412 -  1060	00-FF
  39.413 -  1061	00-FF
  39.414 -  1062	00-FF
  39.415 -  1063	00-FF
  39.416 -  1064	00-FF
  39.417 -  1065	00-FF
  39.418 -  1066	00-FF
  39.419 -  1067	00-FF
  39.420 -  1068	00-FF
  39.421 -  1069	00-FF
  39.422 -  106A	00-FF
  39.423 -  106B	00-FF
  39.424 -  106C	00-FF
  39.425 -  106D	00-FF
  39.426 -  106E	00-FF
  39.427 -  106F	00-FF
  39.428 -  1070	00-FF
  39.429 -  1071	00-FF
  39.430 -  1072	00-FF
  39.431 -  1073	00-FF
  39.432 -  1074	00-FF
  39.433 -  1075	00-FF
  39.434 -  1076	00-FF
  39.435 -  1077	00-FF
  39.436 -  1078	00-FF
  39.437 -  1079	00-FF
  39.438 -  107A	00-FF
  39.439 -  107B	00-FF
  39.440 -  107C	00-FF
  39.441 -  107D	00-FF
  39.442 -  107E	00-FF
  39.443 -  107F	00-FF
  39.444 -  1080	00-FF
  39.445 -  1081	00-FF
  39.446 -  1082	00-FF
  39.447 -  1083	00-FF
  39.448 -  1084	00-FF
  39.449 -  1085	00-FF
  39.450 -  1086	00-FF
  39.451 -  1087	00-FF
  39.452 -  1088	00-FF
  39.453 -  1089	00-FF
  39.454 -  108A	00-FF
  39.455 -  108B	00-FF
  39.456 -  108C	00-FF
  39.457 -  108D	00-FF
  39.458 -  108E	00-FF
  39.459 -  108F	00-FF
  39.460 -  1090	00-FF
  39.461 -  1091	00-FF
  39.462 -  1092	00-FF
  39.463 -  1093	00-FF
  39.464 -  1094	00-FF
  39.465 -  1095	00-FF
  39.466 -  1096	00-FF
  39.467 -  1097	00-FF
  39.468 -  1098	00-FF
  39.469 -  1099	00-FF
  39.470 -  109A	00-FF
  39.471 -  109B	00-FF
  39.472 -  109C	00-FF
  39.473 -  109D	00-FF
  39.474 -  109E	00-FF
  39.475 -  109F	00-FF
  39.476 -  10A0	00-FF
  39.477 -  10A1	00-FF
  39.478 -  10A2	00-FF
  39.479 -  10A3	00-FF
  39.480 -  10A4	00-FF
  39.481 -  10A5	00-FF
  39.482 -  10A6	00-FF
  39.483 -  10A7	00-FF
  39.484 -  10A8	00-FF
  39.485 -  10A9	00-FF
  39.486 -  10AA	00-FF
  39.487 -  10AB	00-FF
  39.488 -  10AC	00-FF
  39.489 -  10AD	00-FF
  39.490 -  10AE	00-FF
  39.491 -  10AF	00-FF
  39.492 -  10B0	00-FF
  39.493 -  10B1	00-FF
  39.494 -  10B2	00-FF
  39.495 -  10B3	00-FF
  39.496 -  10B4	00-FF
  39.497 -  10B5	00-FF
  39.498 -  10B6	00-FF
  39.499 -  10B7	00-FF
  39.500 -  10B8	00-FF
  39.501 -  10B9	00-FF
  39.502 -  10BA	00-FF
  39.503 -  10BB	00-FF
  39.504 -  10BC	00-FF
  39.505 -  10BD	00-FF
  39.506 -  10BE	00-FF
  39.507 -  10BF	00-FF
  39.508 -  10C0	00-FF
  39.509 -  10C1	00-FF
  39.510 -  10C2	00-FF
  39.511 -  10C3	00-FF
  39.512 -  10C4	00-FF
  39.513 -  10C5	00-FF
  39.514 -  10C6	00-FF
  39.515 -  10C7	00-FF
  39.516 -  10C8	00-FF
  39.517 -  10C9	00-FF
  39.518 -  10CA	00-FF
  39.519 -  10CB	00-FF
  39.520 -  10CC	00-FF
  39.521 -  10CD	00-FF
  39.522 -  10CE	00-FF
  39.523 -  10CF	00-FF
  39.524 -  10D0	00-FF
  39.525 -  10D1	00-FF
  39.526 -  10D2	00-FF
  39.527 -  10D3	00-FF
  39.528 -  10D4	00-FF
  39.529 -  10D5	00-FF
  39.530 -  10D6	00-FF
  39.531 -  10D7	00-FF
  39.532 -  10D8	00-FF
  39.533 -  10D9	00-FF
  39.534 -  10DA	00-FF
  39.535 -  10DB	00-FF
  39.536 -  10DC	00-FF
  39.537 -  10DD	00-FF
  39.538 -  10DE	00-FF
  39.539 -  10DF	00-FF
  39.540 -  10E0	00-FF
  39.541 -  10E1	00-FF
  39.542 -  10E2	00-FF
  39.543 -  10E3	00-FF
  39.544 -  10E4	00-FF
  39.545 -  10E5	00-FF
  39.546 -  10E6	00-FF
  39.547 -  10E7	00-FF
  39.548 -  10E8	00-FF
  39.549 -  10E9	00-FF
  39.550 -  10EA	00-FF
  39.551 -  10EB	00-FF
  39.552 -  10EC	00-FF
  39.553 -  10ED	00-FF
  39.554 -  10EE	00-FF
  39.555 -  10EF	00-FF
  39.556 -  10F0	00-FF
  39.557 -  10F1	00-FF
  39.558 -  10F2	00-FF
  39.559 -  10F3	00-FF
  39.560 -  10F4	00-FF
  39.561 -  10F5	00-FF
  39.562 -  10F6	00-FF
  39.563 -  10F7	00-FF
  39.564 -  10F8	00-FF
  39.565 -  10F9	00-FF
  39.566 -  10FA	00-FF
  39.567 -  10FB	00-FF
  39.568 -  10FC	00-FF
  39.569 -  10FD	00-FF
  39.570 -  10FE	00-FF
  39.571 -  10FF	00-FD
  39.572 -
    40.1 --- a/libc/string/ambiguous.t	Sat Dec 07 00:44:56 2019 +0100
    40.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.3 @@ -1,61 +0,0 @@
    40.4 -{
    40.5 -  { 0x00A1, 0x00A1 }, { 0x00A4, 0x00A4 }, { 0x00A7, 0x00A8 },
    40.6 -  { 0x00AA, 0x00AA }, { 0x00AE, 0x00AE }, { 0x00B0, 0x00B4 },
    40.7 -  { 0x00B6, 0x00BA }, { 0x00BC, 0x00BF }, { 0x00C6, 0x00C6 },
    40.8 -  { 0x00D0, 0x00D0 }, { 0x00D7, 0x00D8 }, { 0x00DE, 0x00E1 },
    40.9 -  { 0x00E6, 0x00E6 }, { 0x00E8, 0x00EA }, { 0x00EC, 0x00ED },
   40.10 -  { 0x00F0, 0x00F0 }, { 0x00F2, 0x00F3 }, { 0x00F7, 0x00FA },
   40.11 -  { 0x00FC, 0x00FC }, { 0x00FE, 0x00FE }, { 0x0101, 0x0101 },
   40.12 -  { 0x0111, 0x0111 }, { 0x0113, 0x0113 }, { 0x011B, 0x011B },
   40.13 -  { 0x0126, 0x0127 }, { 0x012B, 0x012B }, { 0x0131, 0x0133 },
   40.14 -  { 0x0138, 0x0138 }, { 0x013F, 0x0142 }, { 0x0144, 0x0144 },
   40.15 -  { 0x0148, 0x014B }, { 0x014D, 0x014D }, { 0x0152, 0x0153 },
   40.16 -  { 0x0166, 0x0167 }, { 0x016B, 0x016B }, { 0x01CE, 0x01CE },
   40.17 -  { 0x01D0, 0x01D0 }, { 0x01D2, 0x01D2 }, { 0x01D4, 0x01D4 },
   40.18 -  { 0x01D6, 0x01D6 }, { 0x01D8, 0x01D8 }, { 0x01DA, 0x01DA },
   40.19 -  { 0x01DC, 0x01DC }, { 0x0251, 0x0251 }, { 0x0261, 0x0261 },
   40.20 -  { 0x02C4, 0x02C4 }, { 0x02C7, 0x02C7 }, { 0x02C9, 0x02CB },
   40.21 -  { 0x02CD, 0x02CD }, { 0x02D0, 0x02D0 }, { 0x02D8, 0x02DB },
   40.22 -  { 0x02DD, 0x02DD }, { 0x02DF, 0x02DF }, { 0x0391, 0x03A1 },
   40.23 -  { 0x03A3, 0x03A9 }, { 0x03B1, 0x03C1 }, { 0x03C3, 0x03C9 },
   40.24 -  { 0x0401, 0x0401 }, { 0x0410, 0x044F }, { 0x0451, 0x0451 },
   40.25 -  { 0x2010, 0x2010 }, { 0x2013, 0x2016 }, { 0x2018, 0x2019 },
   40.26 -  { 0x201C, 0x201D }, { 0x2020, 0x2022 }, { 0x2024, 0x2027 },
   40.27 -  { 0x2030, 0x2030 }, { 0x2032, 0x2033 }, { 0x2035, 0x2035 },
   40.28 -  { 0x203B, 0x203B }, { 0x203E, 0x203E }, { 0x2074, 0x2074 },
   40.29 -  { 0x207F, 0x207F }, { 0x2081, 0x2084 }, { 0x20AC, 0x20AC },
   40.30 -  { 0x2103, 0x2103 }, { 0x2105, 0x2105 }, { 0x2109, 0x2109 },
   40.31 -  { 0x2113, 0x2113 }, { 0x2116, 0x2116 }, { 0x2121, 0x2122 },
   40.32 -  { 0x2126, 0x2126 }, { 0x212B, 0x212B }, { 0x2153, 0x2154 },
   40.33 -  { 0x215B, 0x215E }, { 0x2160, 0x216B }, { 0x2170, 0x2179 },
   40.34 -  { 0x2189, 0x2189 }, { 0x2190, 0x2199 }, { 0x21B8, 0x21B9 },
   40.35 -  { 0x21D2, 0x21D2 }, { 0x21D4, 0x21D4 }, { 0x21E7, 0x21E7 },
   40.36 -  { 0x2200, 0x2200 }, { 0x2202, 0x2203 }, { 0x2207, 0x2208 },
   40.37 -  { 0x220B, 0x220B }, { 0x220F, 0x220F }, { 0x2211, 0x2211 },
   40.38 -  { 0x2215, 0x2215 }, { 0x221A, 0x221A }, { 0x221D, 0x2220 },
   40.39 -  { 0x2223, 0x2223 }, { 0x2225, 0x2225 }, { 0x2227, 0x222C },
   40.40 -  { 0x222E, 0x222E }, { 0x2234, 0x2237 }, { 0x223C, 0x223D },
   40.41 -  { 0x2248, 0x2248 }, { 0x224C, 0x224C }, { 0x2252, 0x2252 },
   40.42 -  { 0x2260, 0x2261 }, { 0x2264, 0x2267 }, { 0x226A, 0x226B },
   40.43 -  { 0x226E, 0x226F }, { 0x2282, 0x2283 }, { 0x2286, 0x2287 },
   40.44 -  { 0x2295, 0x2295 }, { 0x2299, 0x2299 }, { 0x22A5, 0x22A5 },
   40.45 -  { 0x22BF, 0x22BF }, { 0x2312, 0x2312 }, { 0x2460, 0x24E9 },
   40.46 -  { 0x24EB, 0x254B }, { 0x2550, 0x2573 }, { 0x2580, 0x258F },
   40.47 -  { 0x2592, 0x2595 }, { 0x25A0, 0x25A1 }, { 0x25A3, 0x25A9 },
   40.48 -  { 0x25B2, 0x25B3 }, { 0x25B6, 0x25B7 }, { 0x25BC, 0x25BD },
   40.49 -  { 0x25C0, 0x25C1 }, { 0x25C6, 0x25C8 }, { 0x25CB, 0x25CB },
   40.50 -  { 0x25CE, 0x25D1 }, { 0x25E2, 0x25E5 }, { 0x25EF, 0x25EF },
   40.51 -  { 0x2605, 0x2606 }, { 0x2609, 0x2609 }, { 0x260E, 0x260F },
   40.52 -  { 0x261C, 0x261C }, { 0x261E, 0x261E }, { 0x2640, 0x2640 },
   40.53 -  { 0x2642, 0x2642 }, { 0x2660, 0x2661 }, { 0x2663, 0x2665 },
   40.54 -  { 0x2667, 0x266A }, { 0x266C, 0x266D }, { 0x266F, 0x266F },
   40.55 -  { 0x269E, 0x269F }, { 0x26BF, 0x26BF }, { 0x26C6, 0x26CD },
   40.56 -  { 0x26CF, 0x26D3 }, { 0x26D5, 0x26E1 }, { 0x26E3, 0x26E3 },
   40.57 -  { 0x26E8, 0x26E9 }, { 0x26EB, 0x26F1 }, { 0x26F4, 0x26F4 },
   40.58 -  { 0x26F6, 0x26F9 }, { 0x26FB, 0x26FC }, { 0x26FE, 0x26FF },
   40.59 -  { 0x273D, 0x273D }, { 0x2776, 0x277F }, { 0x2B56, 0x2B59 },
   40.60 -  { 0x3248, 0x324F }, { 0xE000, 0xF8FF }, { 0xFFFD, 0xFFFD },
   40.61 -  { 0x1F100, 0x1F10A }, { 0x1F110, 0x1F12D }, { 0x1F130, 0x1F169 },
   40.62 -  { 0x1F170, 0x1F18D }, { 0x1F18F, 0x1F190 }, { 0x1F19B, 0x1F1AC },
   40.63 -  { 0xF0000, 0xFFFFD }, { 0x100000, 0x10FFFD }
   40.64 -};
    41.1 --- a/libc/string/bcmp.c	Sat Dec 07 00:44:56 2019 +0100
    41.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.3 @@ -1,41 +0,0 @@
    41.4 -/*
    41.5 -FUNCTION
    41.6 -	<<bcmp>>---compare two memory areas
    41.7 -
    41.8 -INDEX
    41.9 -	bcmp
   41.10 -
   41.11 -SYNOPSIS
   41.12 -	#include <strings.h>
   41.13 -	int bcmp(const void *<[s1]>, const void *<[s2]>, size_t <[n]>);
   41.14 -
   41.15 -DESCRIPTION
   41.16 -	This function compares not more than <[n]> bytes of the
   41.17 -	object pointed to by <[s1]> with the object pointed to by <[s2]>.
   41.18 -
   41.19 -	This function is identical to <<memcmp>>.
   41.20 -
   41.21 -RETURNS
   41.22 -	The function returns an integer greater than, equal to or
   41.23 -	less than zero 	according to whether the object pointed to by
   41.24 -	<[s1]> is greater than, equal to or less than the object
   41.25 -	pointed to by <[s2]>.
   41.26 -
   41.27 -PORTABILITY
   41.28 -<<bcmp>> requires no supporting OS subroutines.
   41.29 -
   41.30 -QUICKREF
   41.31 -	bcmp ansi pure
   41.32 -*/
   41.33 -
   41.34 -#include <string.h>
   41.35 -#include <strings.h>
   41.36 -
   41.37 -int
   41.38 -bcmp (const void *m1,
   41.39 -	const void *m2,
   41.40 -	size_t n)
   41.41 -
   41.42 -{
   41.43 -  return memcmp (m1, m2, n);
   41.44 -}
    42.1 --- a/libc/string/bcopy.c	Sat Dec 07 00:44:56 2019 +0100
    42.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.3 @@ -1,32 +0,0 @@
    42.4 -/*
    42.5 -FUNCTION
    42.6 -	<<bcopy>>---copy memory regions
    42.7 -
    42.8 -SYNOPSIS
    42.9 -	#include <strings.h>
   42.10 -	void bcopy(const void *<[in]>, void *<[out]>, size_t <[n]>);
   42.11 -
   42.12 -DESCRIPTION
   42.13 -	This function copies <[n]> bytes from the memory region
   42.14 -	pointed to by <[in]> to the memory region pointed to by
   42.15 -	<[out]>.
   42.16 -
   42.17 -	This function is implemented in term of <<memmove>>.
   42.18 -
   42.19 -PORTABILITY
   42.20 -<<bcopy>> requires no supporting OS subroutines.
   42.21 -
   42.22 -QUICKREF
   42.23 -	bcopy - pure
   42.24 -*/
   42.25 -
   42.26 -#include <string.h>
   42.27 -#include <strings.h>
   42.28 -
   42.29 -void
   42.30 -bcopy (const void *b1,
   42.31 -	void *b2,
   42.32 -	size_t length)
   42.33 -{
   42.34 -  memmove (b2, b1, length);
   42.35 -}
    43.1 --- a/libc/string/bzero.c	Sat Dec 07 00:44:56 2019 +0100
    43.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.3 @@ -1,34 +0,0 @@
    43.4 -/*
    43.5 -FUNCTION
    43.6 -<<bzero>>---initialize memory to zero
    43.7 -
    43.8 -INDEX
    43.9 -	bzero
   43.10 -
   43.11 -SYNOPSIS
   43.12 -	#include <strings.h>
   43.13 -	void bzero(void *<[b]>, size_t <[length]>);
   43.14 -
   43.15 -DESCRIPTION
   43.16 -<<bzero>> initializes <[length]> bytes of memory, starting at address
   43.17 -<[b]>, to zero.
   43.18 -
   43.19 -RETURNS
   43.20 -<<bzero>> does not return a result.
   43.21 -
   43.22 -PORTABILITY
   43.23 -<<bzero>> is in the Berkeley Software Distribution.
   43.24 -Neither ANSI C nor the System V Interface Definition (Issue 2) require
   43.25 -<<bzero>>.
   43.26 -
   43.27 -<<bzero>> requires no supporting OS subroutines.
   43.28 -*/
   43.29 -
   43.30 -#include <string.h>
   43.31 -
   43.32 -void
   43.33 -bzero(void *b, size_t length)
   43.34 -{
   43.35 -
   43.36 -	memset(b, 0, length);
   43.37 -}
    44.1 --- a/libc/string/combining.t	Sat Dec 07 00:44:56 2019 +0100
    44.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.3 @@ -1,111 +0,0 @@
    44.4 -{
    44.5 -  { 0x0300, 0x036F }, { 0x0483, 0x0489 }, { 0x0591, 0x05BD },
    44.6 -  { 0x05BF, 0x05BF }, { 0x05C1, 0x05C2 }, { 0x05C4, 0x05C5 },
    44.7 -  { 0x05C7, 0x05C7 }, { 0x0600, 0x0605 }, { 0x0610, 0x061A },
    44.8 -  { 0x061C, 0x061C }, { 0x064B, 0x065F }, { 0x0670, 0x0670 },
    44.9 -  { 0x06D6, 0x06DD }, { 0x06DF, 0x06E4 }, { 0x06E7, 0x06E8 },
   44.10 -  { 0x06EA, 0x06ED }, { 0x070F, 0x070F }, { 0x0711, 0x0711 },
   44.11 -  { 0x0730, 0x074A }, { 0x07A6, 0x07B0 }, { 0x07EB, 0x07F3 },
   44.12 -  { 0x07FD, 0x07FD }, { 0x0816, 0x0819 }, { 0x081B, 0x0823 },
   44.13 -  { 0x0825, 0x0827 }, { 0x0829, 0x082D }, { 0x0859, 0x085B },
   44.14 -  { 0x08D3, 0x0902 }, { 0x093A, 0x093A }, { 0x093C, 0x093C },
   44.15 -  { 0x0941, 0x0948 }, { 0x094D, 0x094D }, { 0x0951, 0x0957 },
   44.16 -  { 0x0962, 0x0963 }, { 0x0981, 0x0981 }, { 0x09BC, 0x09BC },
   44.17 -  { 0x09C1, 0x09C4 }, { 0x09CD, 0x09CD }, { 0x09E2, 0x09E3 },
   44.18 -  { 0x09FE, 0x09FE }, { 0x0A01, 0x0A02 }, { 0x0A3C, 0x0A3C },
   44.19 -  { 0x0A41, 0x0A42 }, { 0x0A47, 0x0A48 }, { 0x0A4B, 0x0A4D },
   44.20 -  { 0x0A51, 0x0A51 }, { 0x0A70, 0x0A71 }, { 0x0A75, 0x0A75 },
   44.21 -  { 0x0A81, 0x0A82 }, { 0x0ABC, 0x0ABC }, { 0x0AC1, 0x0AC5 },
   44.22 -  { 0x0AC7, 0x0AC8 }, { 0x0ACD, 0x0ACD }, { 0x0AE2, 0x0AE3 },
   44.23 -  { 0x0AFA, 0x0AFF }, { 0x0B01, 0x0B01 }, { 0x0B3C, 0x0B3C },
   44.24 -  { 0x0B3F, 0x0B3F }, { 0x0B41, 0x0B44 }, { 0x0B4D, 0x0B4D },
   44.25 -  { 0x0B56, 0x0B56 }, { 0x0B62, 0x0B63 }, { 0x0B82, 0x0B82 },
   44.26 -  { 0x0BC0, 0x0BC0 }, { 0x0BCD, 0x0BCD }, { 0x0C00, 0x0C00 },
   44.27 -  { 0x0C04, 0x0C04 }, { 0x0C3E, 0x0C40 }, { 0x0C46, 0x0C48 },
   44.28 -  { 0x0C4A, 0x0C4D }, { 0x0C55, 0x0C56 }, { 0x0C62, 0x0C63 },
   44.29 -  { 0x0C81, 0x0C81 }, { 0x0CBC, 0x0CBC }, { 0x0CBF, 0x0CBF },
   44.30 -  { 0x0CC6, 0x0CC6 }, { 0x0CCC, 0x0CCD }, { 0x0CE2, 0x0CE3 },
   44.31 -  { 0x0D00, 0x0D01 }, { 0x0D3B, 0x0D3C }, { 0x0D41, 0x0D44 },
   44.32 -  { 0x0D4D, 0x0D4D }, { 0x0D62, 0x0D63 }, { 0x0DCA, 0x0DCA },
   44.33 -  { 0x0DD2, 0x0DD4 }, { 0x0DD6, 0x0DD6 }, { 0x0E31, 0x0E31 },
   44.34 -  { 0x0E34, 0x0E3A }, { 0x0E47, 0x0E4E }, { 0x0EB1, 0x0EB1 },
   44.35 -  { 0x0EB4, 0x0EB9 }, { 0x0EBB, 0x0EBC }, { 0x0EC8, 0x0ECD },
   44.36 -  { 0x0F18, 0x0F19 }, { 0x0F35, 0x0F35 }, { 0x0F37, 0x0F37 },
   44.37 -  { 0x0F39, 0x0F39 }, { 0x0F71, 0x0F7E }, { 0x0F80, 0x0F84 },
   44.38 -  { 0x0F86, 0x0F87 }, { 0x0F8D, 0x0F97 }, { 0x0F99, 0x0FBC },
   44.39 -  { 0x0FC6, 0x0FC6 }, { 0x102D, 0x1030 }, { 0x1032, 0x1037 },
   44.40 -  { 0x1039, 0x103A }, { 0x103D, 0x103E }, { 0x1058, 0x1059 },
   44.41 -  { 0x105E, 0x1060 }, { 0x1071, 0x1074 }, { 0x1082, 0x1082 },
   44.42 -  { 0x1085, 0x1086 }, { 0x108D, 0x108D }, { 0x109D, 0x109D },
   44.43 -  { 0x1160, 0x11FF }, { 0x135D, 0x135F }, { 0x1712, 0x1714 },
   44.44 -  { 0x1732, 0x1734 }, { 0x1752, 0x1753 }, { 0x1772, 0x1773 },
   44.45 -  { 0x17B4, 0x17B5 }, { 0x17B7, 0x17BD }, { 0x17C6, 0x17C6 },
   44.46 -  { 0x17C9, 0x17D3 }, { 0x17DD, 0x17DD }, { 0x180B, 0x180E },
   44.47 -  { 0x1885, 0x1886 }, { 0x18A9, 0x18A9 }, { 0x1920, 0x1922 },
   44.48 -  { 0x1927, 0x1928 }, { 0x1932, 0x1932 }, { 0x1939, 0x193B },
   44.49 -  { 0x1A17, 0x1A18 }, { 0x1A1B, 0x1A1B }, { 0x1A56, 0x1A56 },
   44.50 -  { 0x1A58, 0x1A5E }, { 0x1A60, 0x1A60 }, { 0x1A62, 0x1A62 },
   44.51 -  { 0x1A65, 0x1A6C }, { 0x1A73, 0x1A7C }, { 0x1A7F, 0x1A7F },
   44.52 -  { 0x1AB0, 0x1ABE }, { 0x1B00, 0x1B03 }, { 0x1B34, 0x1B34 },
   44.53 -  { 0x1B36, 0x1B3A }, { 0x1B3C, 0x1B3C }, { 0x1B42, 0x1B42 },
   44.54 -  { 0x1B6B, 0x1B73 }, { 0x1B80, 0x1B81 }, { 0x1BA2, 0x1BA5 },
   44.55 -  { 0x1BA8, 0x1BA9 }, { 0x1BAB, 0x1BAD }, { 0x1BE6, 0x1BE6 },
   44.56 -  { 0x1BE8, 0x1BE9 }, { 0x1BED, 0x1BED }, { 0x1BEF, 0x1BF1 },
   44.57 -  { 0x1C2C, 0x1C33 }, { 0x1C36, 0x1C37 }, { 0x1CD0, 0x1CD2 },
   44.58 -  { 0x1CD4, 0x1CE0 }, { 0x1CE2, 0x1CE8 }, { 0x1CED, 0x1CED },
   44.59 -  { 0x1CF4, 0x1CF4 }, { 0x1CF8, 0x1CF9 }, { 0x1DC0, 0x1DF9 },
   44.60 -  { 0x1DFB, 0x1DFF }, { 0x200B, 0x200F }, { 0x202A, 0x202E },
   44.61 -  { 0x2060, 0x2064 }, { 0x2066, 0x206F }, { 0x20D0, 0x20F0 },
   44.62 -  { 0x2CEF, 0x2CF1 }, { 0x2D7F, 0x2D7F }, { 0x2DE0, 0x2DFF },
   44.63 -  { 0x302A, 0x302D }, { 0x3099, 0x309A }, { 0xA66F, 0xA672 },
   44.64 -  { 0xA674, 0xA67D }, { 0xA69E, 0xA69F }, { 0xA6F0, 0xA6F1 },
   44.65 -  { 0xA802, 0xA802 }, { 0xA806, 0xA806 }, { 0xA80B, 0xA80B },
   44.66 -  { 0xA825, 0xA826 }, { 0xA8C4, 0xA8C5 }, { 0xA8E0, 0xA8F1 },
   44.67 -  { 0xA8FF, 0xA8FF }, { 0xA926, 0xA92D }, { 0xA947, 0xA951 },
   44.68 -  { 0xA980, 0xA982 }, { 0xA9B3, 0xA9B3 }, { 0xA9B6, 0xA9B9 },
   44.69 -  { 0xA9BC, 0xA9BC }, { 0xA9E5, 0xA9E5 }, { 0xAA29, 0xAA2E },
   44.70 -  { 0xAA31, 0xAA32 }, { 0xAA35, 0xAA36 }, { 0xAA43, 0xAA43 },
   44.71 -  { 0xAA4C, 0xAA4C }, { 0xAA7C, 0xAA7C }, { 0xAAB0, 0xAAB0 },
   44.72 -  { 0xAAB2, 0xAAB4 }, { 0xAAB7, 0xAAB8 }, { 0xAABE, 0xAABF },
   44.73 -  { 0xAAC1, 0xAAC1 }, { 0xAAEC, 0xAAED }, { 0xAAF6, 0xAAF6 },
   44.74 -  { 0xABE5, 0xABE5 }, { 0xABE8, 0xABE8 }, { 0xABED, 0xABED },
   44.75 -  { 0xD7B0, 0xD7C6 }, { 0xD7CB, 0xD7FB }, { 0xFB1E, 0xFB1E },
   44.76 -  { 0xFE00, 0xFE0F }, { 0xFE20, 0xFE2F }, { 0xFEFF, 0xFEFF },
   44.77 -  { 0xFFF9, 0xFFFB }, { 0x101FD, 0x101FD }, { 0x102E0, 0x102E0 },
   44.78 -  { 0x10376, 0x1037A }, { 0x10A01, 0x10A03 }, { 0x10A05, 0x10A06 },
   44.79 -  { 0x10A0C, 0x10A0F }, { 0x10A38, 0x10A3A }, { 0x10A3F, 0x10A3F },
   44.80 -  { 0x10AE5, 0x10AE6 }, { 0x10D24, 0x10D27 }, { 0x10F46, 0x10F50 },
   44.81 -  { 0x11001, 0x11001 }, { 0x11038, 0x11046 }, { 0x1107F, 0x11081 },
   44.82 -  { 0x110B3, 0x110B6 }, { 0x110B9, 0x110BA }, { 0x110BD, 0x110BD },
   44.83 -  { 0x110CD, 0x110CD }, { 0x11100, 0x11102 }, { 0x11127, 0x1112B },
   44.84 -  { 0x1112D, 0x11134 }, { 0x11173, 0x11173 }, { 0x11180, 0x11181 },
   44.85 -  { 0x111B6, 0x111BE }, { 0x111C9, 0x111CC }, { 0x1122F, 0x11231 },
   44.86 -  { 0x11234, 0x11234 }, { 0x11236, 0x11237 }, { 0x1123E, 0x1123E },
   44.87 -  { 0x112DF, 0x112DF }, { 0x112E3, 0x112EA }, { 0x11300, 0x11301 },
   44.88 -  { 0x1133B, 0x1133C }, { 0x11340, 0x11340 }, { 0x11366, 0x1136C },
   44.89 -  { 0x11370, 0x11374 }, { 0x11438, 0x1143F }, { 0x11442, 0x11444 },
   44.90 -  { 0x11446, 0x11446 }, { 0x1145E, 0x1145E }, { 0x114B3, 0x114B8 },
   44.91 -  { 0x114BA, 0x114BA }, { 0x114BF, 0x114C0 }, { 0x114C2, 0x114C3 },
   44.92 -  { 0x115B2, 0x115B5 }, { 0x115BC, 0x115BD }, { 0x115BF, 0x115C0 },
   44.93 -  { 0x115DC, 0x115DD }, { 0x11633, 0x1163A }, { 0x1163D, 0x1163D },
   44.94 -  { 0x1163F, 0x11640 }, { 0x116AB, 0x116AB }, { 0x116AD, 0x116AD },
   44.95 -  { 0x116B0, 0x116B5 }, { 0x116B7, 0x116B7 }, { 0x1171D, 0x1171F },
   44.96 -  { 0x11722, 0x11725 }, { 0x11727, 0x1172B }, { 0x1182F, 0x11837 },
   44.97 -  { 0x11839, 0x1183A }, { 0x11A01, 0x11A0A }, { 0x11A33, 0x11A38 },
   44.98 -  { 0x11A3B, 0x11A3E }, { 0x11A47, 0x11A47 }, { 0x11A51, 0x11A56 },
   44.99 -  { 0x11A59, 0x11A5B }, { 0x11A8A, 0x11A96 }, { 0x11A98, 0x11A99 },
  44.100 -  { 0x11C30, 0x11C36 }, { 0x11C38, 0x11C3D }, { 0x11C3F, 0x11C3F },
  44.101 -  { 0x11C92, 0x11CA7 }, { 0x11CAA, 0x11CB0 }, { 0x11CB2, 0x11CB3 },
  44.102 -  { 0x11CB5, 0x11CB6 }, { 0x11D31, 0x11D36 }, { 0x11D3A, 0x11D3A },
  44.103 -  { 0x11D3C, 0x11D3D }, { 0x11D3F, 0x11D45 }, { 0x11D47, 0x11D47 },
  44.104 -  { 0x11D90, 0x11D91 }, { 0x11D95, 0x11D95 }, { 0x11D97, 0x11D97 },
  44.105 -  { 0x11EF3, 0x11EF4 }, { 0x16AF0, 0x16AF4 }, { 0x16B30, 0x16B36 },
  44.106 -  { 0x16F8F, 0x16F92 }, { 0x1BC9D, 0x1BC9E }, { 0x1BCA0, 0x1BCA3 },
  44.107 -  { 0x1D167, 0x1D169 }, { 0x1D173, 0x1D182 }, { 0x1D185, 0x1D18B },
  44.108 -  { 0x1D1AA, 0x1D1AD }, { 0x1D242, 0x1D244 }, { 0x1DA00, 0x1DA36 },
  44.109 -  { 0x1DA3B, 0x1DA6C }, { 0x1DA75, 0x1DA75 }, { 0x1DA84, 0x1DA84 },
  44.110 -  { 0x1DA9B, 0x1DA9F }, { 0x1DAA1, 0x1DAAF }, { 0x1E000, 0x1E006 },
  44.111 -  { 0x1E008, 0x1E018 }, { 0x1E01B, 0x1E021 }, { 0x1E023, 0x1E024 },
  44.112 -  { 0x1E026, 0x1E02A }, { 0x1E8D0, 0x1E8D6 }, { 0x1E944, 0x1E94A },
  44.113 -  { 0xE0001, 0xE0001 }, { 0xE0020, 0xE007F }, { 0xE0100, 0xE01EF }
  44.114 -};
    45.1 --- a/libc/string/explicit_bzero.c	Sat Dec 07 00:44:56 2019 +0100
    45.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.3 @@ -1,16 +0,0 @@
    45.4 -/*	$OpenBSD: explicit_bzero.c,v 1.2 2014/06/10 04:17:37 deraadt Exp $ */
    45.5 -/*
    45.6 - * Public domain.
    45.7 - * Written by Ted Unangst
    45.8 - */
    45.9 -
   45.10 -#include <string.h>
   45.11 -
   45.12 -/*
   45.13 - * explicit_bzero - don't let the compiler optimize away bzero
   45.14 - */
   45.15 -void
   45.16 -explicit_bzero(void *p, size_t n)
   45.17 -{
   45.18 -	bzero(p, n);
   45.19 -}
    46.1 --- a/libc/string/ffsl.c	Sat Dec 07 00:44:56 2019 +0100
    46.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.3 @@ -1,34 +0,0 @@
    46.4 -/*-
    46.5 - * Copyright (c) 2017 embedded brains GmbH
    46.6 - * All rights reserved.
    46.7 - *
    46.8 - * Redistribution and use in source and binary forms, with or without
    46.9 - * modification, are permitted provided that the following conditions
   46.10 - * are met:
   46.11 - * 1. Redistributions of source code must retain the above copyright
   46.12 - *    notice, this list of conditions and the following disclaimer.
   46.13 - * 2. Redistributions in binary form must reproduce the above copyright
   46.14 - *    notice, this list of conditions and the following disclaimer in the
   46.15 - *    documentation and/or other materials provided with the distribution.
   46.16 - *
   46.17 - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
   46.18 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   46.19 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   46.20 - * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
   46.21 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   46.22 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   46.23 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   46.24 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   46.25 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   46.26 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   46.27 - * SUCH DAMAGE.
   46.28 - */
   46.29 -
   46.30 -#include <strings.h>
   46.31 -
   46.32 -int
   46.33 -ffsl(long i)
   46.34 -{
   46.35 -
   46.36 -	return (__builtin_ffsl(i));
   46.37 -}
    47.1 --- a/libc/string/ffsll.c	Sat Dec 07 00:44:56 2019 +0100
    47.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    47.3 @@ -1,34 +0,0 @@
    47.4 -/*-
    47.5 - * Copyright (c) 2017 embedded brains GmbH
    47.6 - * All rights reserved.
    47.7 - *
    47.8 - * Redistribution and use in source and binary forms, with or without
    47.9 - * modification, are permitted provided that the following conditions
   47.10 - * are met:
   47.11 - * 1. Redistributions of source code must retain the above copyright
   47.12 - *    notice, this list of conditions and the following disclaimer.
   47.13 - * 2. Redistributions in binary form must reproduce the above copyright
   47.14 - *    notice, this list of conditions and the following disclaimer in the
   47.15 - *    documentation and/or other materials provided with the distribution.
   47.16 - *
   47.17 - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
   47.18 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   47.19 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   47.20 - * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
   47.21 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   47.22 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   47.23 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   47.24 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   47.25 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   47.26 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   47.27 - * SUCH DAMAGE.
   47.28 - */
   47.29 -
   47.30 -#include <strings.h>
   47.31 -
   47.32 -int
   47.33 -ffsll(long long i)
   47.34 -{
   47.35 -
   47.36 -	return (__builtin_ffsll(i));
   47.37 -}
    48.1 --- a/libc/string/fls.c	Sat Dec 07 00:44:56 2019 +0100
    48.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    48.3 @@ -1,38 +0,0 @@
    48.4 -/*-
    48.5 - * Copyright (c) 2017 embedded brains GmbH
    48.6 - * All rights reserved.
    48.7 - *
    48.8 - * Redistribution and use in source and binary forms, with or without
    48.9 - * modification, are permitted provided that the following conditions
   48.10 - * are met:
   48.11 - * 1. Redistributions of source code must retain the above copyright
   48.12 - *    notice, this list of conditions and the following disclaimer.
   48.13 - * 2. Redistributions in binary form must reproduce the above copyright
   48.14 - *    notice, this list of conditions and the following disclaimer in the
   48.15 - *    documentation and/or other materials provided with the distribution.
   48.16 - *
   48.17 - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
   48.18 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   48.19 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   48.20 - * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
   48.21 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   48.22 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   48.23 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   48.24 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   48.25 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   48.26 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   48.27 - * SUCH DAMAGE.
   48.28 - */
   48.29 -
   48.30 -#include <strings.h>
   48.31 -#include <limits.h>
   48.32 -
   48.33 -int
   48.34 -fls(int i)
   48.35 -{
   48.36 -
   48.37 -	if (i == 0)
   48.38 -		return 0;
   48.39 -
   48.40 -	return (sizeof(i) * CHAR_BIT - __builtin_clz(i));
   48.41 -}
    49.1 --- a/libc/string/flsl.c	Sat Dec 07 00:44:56 2019 +0100
    49.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    49.3 @@ -1,38 +0,0 @@
    49.4 -/*-
    49.5 - * Copyright (c) 2017 embedded brains GmbH
    49.6 - * All rights reserved.
    49.7 - *
    49.8 - * Redistribution and use in source and binary forms, with or without
    49.9 - * modification, are permitted provided that the following conditions
   49.10 - * are met:
   49.11 - * 1. Redistributions of source code must retain the above copyright
   49.12 - *    notice, this list of conditions and the following disclaimer.
   49.13 - * 2. Redistributions in binary form must reproduce the above copyright
   49.14 - *    notice, this list of conditions and the following disclaimer in the
   49.15 - *    documentation and/or other materials provided with the distribution.
   49.16 - *
   49.17 - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
   49.18 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   49.19 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   49.20 - * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
   49.21 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   49.22 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   49.23 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   49.24 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   49.25 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   49.26 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   49.27 - * SUCH DAMAGE.
   49.28 - */
   49.29 -
   49.30 -#include <strings.h>
   49.31 -#include <limits.h>
   49.32 -
   49.33 -int
   49.34 -flsl(long i)
   49.35 -{
   49.36 -
   49.37 -	if (i == 0)
   49.38 -		return 0;
   49.39 -
   49.40 -	return (sizeof(i) * CHAR_BIT - __builtin_clzl(i));
   49.41 -}
    50.1 --- a/libc/string/flsll.c	Sat Dec 07 00:44:56 2019 +0100
    50.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    50.3 @@ -1,38 +0,0 @@
    50.4 -/*-
    50.5 - * Copyright (c) 2017 embedded brains GmbH
    50.6 - * All rights reserved.
    50.7 - *
    50.8 - * Redistribution and use in source and binary forms, with or without
    50.9 - * modification, are permitted provided that the following conditions
   50.10 - * are met:
   50.11 - * 1. Redistributions of source code must retain the above copyright
   50.12 - *    notice, this list of conditions and the following disclaimer.
   50.13 - * 2. Redistributions in binary form must reproduce the above copyright
   50.14 - *    notice, this list of conditions and the following disclaimer in the
   50.15 - *    documentation and/or other materials provided with the distribution.
   50.16 - *
   50.17 - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
   50.18 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   50.19 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   50.20 - * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
   50.21 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   50.22 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   50.23 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   50.24 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   50.25 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   50.26 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   50.27 - * SUCH DAMAGE.
   50.28 - */
   50.29 -
   50.30 -#include <strings.h>
   50.31 -#include <limits.h>
   50.32 -
   50.33 -int
   50.34 -flsll(long long i)
   50.35 -{
   50.36 -
   50.37 -	if (i == 0)
   50.38 -		return 0;
   50.39 -
   50.40 -	return (sizeof(i) * CHAR_BIT - __builtin_clzll(i));
   50.41 -}
    51.1 --- a/libc/string/gnu_basename.c	Sat Dec 07 00:44:56 2019 +0100
    51.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    51.3 @@ -1,25 +0,0 @@
    51.4 -#ifndef _NO_BASENAME
    51.5 -/* Copyright 2015 Red Hat, Inc.
    51.6 - * Permission to use, copy, modify, and distribute this software
    51.7 - * is freely granted, provided that this notice is preserved.
    51.8 - */
    51.9 -
   51.10 -/* The differences with the POSIX version (unix/basename.c):
   51.11 - * - declared in <string.h> (instead of <libgen.h>);
   51.12 - * - the argument is never modified, and therefore is marked const;
   51.13 - * - the empty string is returned if path is an empty string, "/", or ends
   51.14 - *   with a trailing slash.
   51.15 - */
   51.16 -
   51.17 -#include <string.h>
   51.18 -
   51.19 -char *
   51.20 -__gnu_basename (const char *path)
   51.21 -{
   51.22 -  char *p;
   51.23 -  if ((p = strrchr (path, '/')))
   51.24 -    return p + 1;
   51.25 -  return (char *) path;
   51.26 -}
   51.27 -
   51.28 -#endif /* !_NO_BASENAME  */
    52.1 --- a/libc/string/index.c	Sat Dec 07 00:44:56 2019 +0100
    52.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    52.3 @@ -1,38 +0,0 @@
    52.4 -/*
    52.5 -FUNCTION
    52.6 -	<<index>>---search for character in string
    52.7 -
    52.8 -INDEX
    52.9 -	index
   52.10 -
   52.11 -SYNOPSIS
   52.12 -	#include <strings.h>
   52.13 -	char * index(const char *<[string]>, int <[c]>);
   52.14 -
   52.15 -DESCRIPTION
   52.16 -	This function finds the first occurence of <[c]> (converted to
   52.17 -	a char) in the string pointed to by <[string]> (including the
   52.18 -	terminating null character).
   52.19 -
   52.20 -	This function is identical to <<strchr>>.
   52.21 -
   52.22 -RETURNS
   52.23 -	Returns a pointer to the located character, or a null pointer
   52.24 -	if <[c]> does not occur in <[string]>.
   52.25 -
   52.26 -PORTABILITY
   52.27 -<<index>> requires no supporting OS subroutines.
   52.28 -
   52.29 -QUICKREF
   52.30 -	index - pure
   52.31 -*/
   52.32 -
   52.33 -#include <string.h>
   52.34 -#include <strings.h>
   52.35 -
   52.36 -char *
   52.37 -index (const char *s,
   52.38 -	int c)
   52.39 -{
   52.40 -  return strchr (s, c);
   52.41 -}
    53.1 --- a/libc/string/local.h	Sat Dec 07 00:44:56 2019 +0100
    53.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    53.3 @@ -1,20 +0,0 @@
    53.4 -#include <_ansi.h>
    53.5 -#include "../ctype/local.h"
    53.6 -
    53.7 -/* internal function to compute width of wide char. */
    53.8 -int __wcwidth (wint_t);
    53.9 -
   53.10 -/*
   53.11 -   Taken from glibc:
   53.12 -   Add the compiler optimization to inhibit loop transformation to library
   53.13 -   calls.  This is used to avoid recursive calls in memset and memmove
   53.14 -   default implementations.
   53.15 -*/
   53.16 -#ifdef _HAVE_CC_INHIBIT_LOOP_TO_LIBCALL
   53.17 -# define __inhibit_loop_to_libcall \
   53.18 -  __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns")))
   53.19 -#else
   53.20 -# define __inhibit_loop_to_libcall
   53.21 -#endif
   53.22 -
   53.23 -
    54.1 --- a/libc/string/memccpy.c	Sat Dec 07 00:44:56 2019 +0100
    54.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    54.3 @@ -1,136 +0,0 @@
    54.4 -/*
    54.5 -FUNCTION
    54.6 -        <<memccpy>>---copy memory regions with end-token check
    54.7 -
    54.8 -SYNOPSIS
    54.9 -        #include <string.h>
   54.10 -        void* memccpy(void *restrict <[out]>, const void *restrict <[in]>, 
   54.11 -                      int <[endchar]>, size_t <[n]>);
   54.12 -
   54.13 -DESCRIPTION
   54.14 -        This function copies up to <[n]> bytes from the memory region
   54.15 -        pointed to by <[in]> to the memory region pointed to by
   54.16 -        <[out]>.  If a byte matching the <[endchar]> is encountered,
   54.17 -	the byte is copied and copying stops.
   54.18 -
   54.19 -        If the regions overlap, the behavior is undefined.
   54.20 -
   54.21 -RETURNS
   54.22 -        <<memccpy>> returns a pointer to the first byte following the
   54.23 -	<[endchar]> in the <[out]> region.  If no byte matching
   54.24 -	<[endchar]> was copied, then <<NULL>> is returned.
   54.25 -
   54.26 -PORTABILITY
   54.27 -<<memccpy>> is a GNU extension.
   54.28 -
   54.29 -<<memccpy>> requires no supporting OS subroutines.
   54.30 -
   54.31 -	*/
   54.32 -
   54.33 -#include <_ansi.h>
   54.34 -#include <stddef.h>
   54.35 -#include <string.h>
   54.36 -#include <limits.h>
   54.37 -
   54.38 -/* Nonzero if either X or Y is not aligned on a "long" boundary.  */
   54.39 -#define UNALIGNED(X, Y) \
   54.40 -  (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
   54.41 -
   54.42 -/* How many bytes are copied each iteration of the word copy loop.  */
   54.43 -#define LITTLEBLOCKSIZE (sizeof (long))
   54.44 -
   54.45 -/* Threshhold for punting to the byte copier.  */
   54.46 -#define TOO_SMALL(LEN)  ((LEN) < LITTLEBLOCKSIZE)
   54.47 -
   54.48 -/* Macros for detecting endchar */
   54.49 -#if LONG_MAX == 2147483647L
   54.50 -#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
   54.51 -#else
   54.52 -#if LONG_MAX == 9223372036854775807L
   54.53 -/* Nonzero if X (a long int) contains a NULL byte. */
   54.54 -#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
   54.55 -#else
   54.56 -#error long int is not a 32bit or 64bit type.
   54.57 -#endif
   54.58 -#endif
   54.59 -
   54.60 -
   54.61 -void *
   54.62 -memccpy (void *__restrict dst0,
   54.63 -	const void *__restrict src0,
   54.64 -	int endchar0,
   54.65 -	size_t len0)
   54.66 -{
   54.67 -
   54.68 -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
   54.69 -  void *ptr = NULL;
   54.70 -  char *dst = (char *) dst0;
   54.71 -  char *src = (char *) src0;
   54.72 -  char endchar = endchar0 & 0xff;
   54.73 -
   54.74 -  while (len0--)
   54.75 -    {
   54.76 -      if ((*dst++ = *src++) == endchar)
   54.77 -        {
   54.78 -          ptr = dst;
   54.79 -          break;
   54.80 -        }
   54.81 -    }
   54.82 -
   54.83 -  return ptr;
   54.84 -#else
   54.85 -  void *ptr = NULL;
   54.86 -  char *dst = dst0;
   54.87 -  const char *src = src0;
   54.88 -  long *aligned_dst;
   54.89 -  const long *aligned_src;
   54.90 -  char endchar = endchar0 & 0xff;
   54.91 -
   54.92 -  /* If the size is small, or either SRC or DST is unaligned,
   54.93 -     then punt into the byte copy loop.  This should be rare.  */
   54.94 -  if (!TOO_SMALL(len0) && !UNALIGNED (src, dst))
   54.95 -    {
   54.96 -      unsigned int i;
   54.97 -      unsigned long mask = 0;
   54.98 -
   54.99 -      aligned_dst = (long*)dst;
  54.100 -      aligned_src = (long*)src;
  54.101 -
  54.102 -      /* The fast code reads the ASCII one word at a time and only
  54.103 -         performs the bytewise search on word-sized segments if they
  54.104 -         contain the search character, which is detected by XORing
  54.105 -         the word-sized segment with a word-sized block of the search
  54.106 -         character and then detecting for the presence of NULL in the
  54.107 -         result.  */
  54.108 -      for (i = 0; i < LITTLEBLOCKSIZE; i++)
  54.109 -        mask = (mask << 8) + endchar;
  54.110 -
  54.111 -
  54.112 -      /* Copy one long word at a time if possible.  */
  54.113 -      while (len0 >= LITTLEBLOCKSIZE)
  54.114 -        {
  54.115 -          unsigned long buffer = (unsigned long)(*aligned_src);
  54.116 -          buffer ^=  mask;
  54.117 -          if (DETECTNULL (buffer))
  54.118 -            break; /* endchar is found, go byte by byte from here */
  54.119 -          *aligned_dst++ = *aligned_src++;
  54.120 -          len0 -= LITTLEBLOCKSIZE;
  54.121 -        }
  54.122 -
  54.123 -       /* Pick up any residual with a byte copier.  */
  54.124 -      dst = (char*)aligned_dst;
  54.125 -      src = (char*)aligned_src;
  54.126 -    }
  54.127 -
  54.128 -  while (len0--)
  54.129 -    {
  54.130 -      if ((*dst++ = *src++) == endchar)
  54.131 -        {
  54.132 -          ptr = dst;
  54.133 -          break;
  54.134 -        }
  54.135 -    }
  54.136 -
  54.137 -  return ptr;
  54.138 -#endif /* not PREFER_SIZE_OVER_SPEED */
  54.139 -}
    55.1 --- a/libc/string/memchr.c	Sat Dec 07 00:44:56 2019 +0100
    55.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    55.3 @@ -1,126 +0,0 @@
    55.4 -/*
    55.5 -FUNCTION
    55.6 -	<<memchr>>---find character in memory
    55.7 -
    55.8 -INDEX
    55.9 -	memchr
   55.10 -
   55.11 -SYNOPSIS
   55.12 -	#include <string.h>
   55.13 -	void *memchr(const void *<[src]>, int <[c]>, size_t <[length]>);
   55.14 -
   55.15 -DESCRIPTION
   55.16 -	This function searches memory starting at <<*<[src]>>> for the
   55.17 -	character <[c]>.  The search only ends with the first
   55.18 -	occurrence of <[c]>, or after <[length]> characters; in
   55.19 -	particular, <<NUL>> does not terminate the search.
   55.20 -
   55.21 -RETURNS
   55.22 -	If the character <[c]> is found within <[length]> characters
   55.23 -	of <<*<[src]>>>, a pointer to the character is returned. If
   55.24 -	<[c]> is not found, then <<NULL>> is returned.
   55.25 -
   55.26 -PORTABILITY
   55.27 -<<memchr>> is ANSI C.
   55.28 -
   55.29 -<<memchr>> requires no supporting OS subroutines.
   55.30 -
   55.31 -QUICKREF
   55.32 -	memchr ansi pure
   55.33 -*/
   55.34 -
   55.35 -#include <_ansi.h>
   55.36 -#include <string.h>
   55.37 -#include <limits.h>
   55.38 -
   55.39 -/* Nonzero if either X or Y is not aligned on a "long" boundary.  */
   55.40 -#define UNALIGNED(X) ((long)X & (sizeof (long) - 1))
   55.41 -
   55.42 -/* How many bytes are loaded each iteration of the word copy loop.  */
   55.43 -#define LBLOCKSIZE (sizeof (long))
   55.44 -
   55.45 -/* Threshhold for punting to the bytewise iterator.  */
   55.46 -#define TOO_SMALL(LEN)  ((LEN) < LBLOCKSIZE)
   55.47 -
   55.48 -#if LONG_MAX == 2147483647L
   55.49 -#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
   55.50 -#else
   55.51 -#if LONG_MAX == 9223372036854775807L
   55.52 -/* Nonzero if X (a long int) contains a NULL byte. */
   55.53 -#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
   55.54 -#else
   55.55 -#error long int is not a 32bit or 64bit type.
   55.56 -#endif
   55.57 -#endif
   55.58 -
   55.59 -#ifndef DETECTNULL
   55.60 -#error long int is not a 32bit or 64bit byte
   55.61 -#endif
   55.62 -
   55.63 -/* DETECTCHAR returns nonzero if (long)X contains the byte used
   55.64 -   to fill (long)MASK. */
   55.65 -#define DETECTCHAR(X,MASK) (DETECTNULL(X ^ MASK))
   55.66 -
   55.67 -void *
   55.68 -memchr (const void *src_void,
   55.69 -	int c,
   55.70 -	size_t length)
   55.71 -{
   55.72 -  const unsigned char *src = (const unsigned char *) src_void;
   55.73 -  unsigned char d = c;
   55.74 -
   55.75 -#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__)
   55.76 -  unsigned long *asrc;
   55.77 -  unsigned long  mask;
   55.78 -  unsigned int i;
   55.79 -
   55.80 -  while (UNALIGNED (src))
   55.81 -    {
   55.82 -      if (!length--)
   55.83 -        return NULL;
   55.84 -      if (*src == d)
   55.85 -        return (void *) src;
   55.86 -      src++;
   55.87 -    }
   55.88 -
   55.89 -  if (!TOO_SMALL (length))
   55.90 -    {
   55.91 -      /* If we get this far, we know that length is large and src is
   55.92 -         word-aligned. */
   55.93 -      /* The fast code reads the source one word at a time and only
   55.94 -         performs the bytewise search on word-sized segments if they
   55.95 -         contain the search character, which is detected by XORing
   55.96 -         the word-sized segment with a word-sized block of the search
   55.97 -         character and then detecting for the presence of NUL in the
   55.98 -         result.  */
   55.99 -      asrc = (unsigned long *) src;
  55.100 -      mask = d << 8 | d;
  55.101 -      mask = mask << 16 | mask;
  55.102 -      for (i = 32; i < LBLOCKSIZE * 8; i <<= 1)
  55.103 -        mask = (mask << i) | mask;
  55.104 -
  55.105 -      while (length >= LBLOCKSIZE)
  55.106 -        {
  55.107 -          if (DETECTCHAR (*asrc, mask))
  55.108 -            break;
  55.109 -          length -= LBLOCKSIZE;
  55.110 -          asrc++;
  55.111 -        }
  55.112 -
  55.113 -      /* If there are fewer than LBLOCKSIZE characters left,
  55.114 -         then we resort to the bytewise loop.  */
  55.115 -
  55.116 -      src = (unsigned char *) asrc;
  55.117 -    }
  55.118 -
  55.119 -#endif /* not PREFER_SIZE_OVER_SPEED */
  55.120 -
  55.121 -  while (length--)
  55.122 -    {
  55.123 -      if (*src == d)
  55.124 -        return (void *) src;
  55.125 -      src++;
  55.126 -    }
  55.127 -
  55.128 -  return NULL;
  55.129 -}
    56.1 --- a/libc/string/memcmp.c	Sat Dec 07 00:44:56 2019 +0100
    56.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    56.3 @@ -1,105 +0,0 @@
    56.4 -/*
    56.5 -FUNCTION
    56.6 -	<<memcmp>>---compare two memory areas
    56.7 -
    56.8 -INDEX
    56.9 -	memcmp
   56.10 -
   56.11 -SYNOPSIS
   56.12 -	#include <string.h>
   56.13 -	int memcmp(const void *<[s1]>, const void *<[s2]>, size_t <[n]>);
   56.14 -
   56.15 -DESCRIPTION
   56.16 -	This function compares not more than <[n]> characters of the
   56.17 -	object pointed to by <[s1]> with the object pointed to by <[s2]>.
   56.18 -
   56.19 -
   56.20 -RETURNS
   56.21 -	The function returns an integer greater than, equal to or
   56.22 -	less than zero 	according to whether the object pointed to by
   56.23 -	<[s1]> is greater than, equal to or less than the object
   56.24 -	pointed to by <[s2]>.
   56.25 -
   56.26 -PORTABILITY
   56.27 -<<memcmp>> is ANSI C.
   56.28 -
   56.29 -<<memcmp>> requires no supporting OS subroutines.
   56.30 -
   56.31 -QUICKREF
   56.32 -	memcmp ansi pure
   56.33 -*/
   56.34 -
   56.35 -#include <string.h>
   56.36 -
   56.37 -
   56.38 -/* Nonzero if either X or Y is not aligned on a "long" boundary.  */
   56.39 -#define UNALIGNED(X, Y) \
   56.40 -  (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
   56.41 -
   56.42 -/* How many bytes are copied each iteration of the word copy loop.  */
   56.43 -#define LBLOCKSIZE (sizeof (long))
   56.44 -
   56.45 -/* Threshhold for punting to the byte copier.  */
   56.46 -#define TOO_SMALL(LEN)  ((LEN) < LBLOCKSIZE)
   56.47 -
   56.48 -int
   56.49 -memcmp (const void *m1,
   56.50 -	const void *m2,
   56.51 -	size_t n)
   56.52 -{
   56.53 -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
   56.54 -  unsigned char *s1 = (unsigned char *) m1;
   56.55 -  unsigned char *s2 = (unsigned char *) m2;
   56.56 -
   56.57 -  while (n--)
   56.58 -    {
   56.59 -      if (*s1 != *s2)
   56.60 -	{
   56.61 -	  return *s1 - *s2;
   56.62 -	}
   56.63 -      s1++;
   56.64 -      s2++;
   56.65 -    }
   56.66 -  return 0;
   56.67 -#else  
   56.68 -  unsigned char *s1 = (unsigned char *) m1;
   56.69 -  unsigned char *s2 = (unsigned char *) m2;
   56.70 -  unsigned long *a1;
   56.71 -  unsigned long *a2;
   56.72 -
   56.73 -  /* If the size is too small, or either pointer is unaligned,
   56.74 -     then we punt to the byte compare loop.  Hopefully this will
   56.75 -     not turn up in inner loops.  */
   56.76 -  if (!TOO_SMALL(n) && !UNALIGNED(s1,s2))
   56.77 -    {
   56.78 -      /* Otherwise, load and compare the blocks of memory one 
   56.79 -         word at a time.  */
   56.80 -      a1 = (unsigned long*) s1;
   56.81 -      a2 = (unsigned long*) s2;
   56.82 -      while (n >= LBLOCKSIZE)
   56.83 -        {
   56.84 -          if (*a1 != *a2) 
   56.85 -   	    break;
   56.86 -          a1++;
   56.87 -          a2++;
   56.88 -          n -= LBLOCKSIZE;
   56.89 -        }
   56.90 -
   56.91 -      /* check m mod LBLOCKSIZE remaining characters */
   56.92 -
   56.93 -      s1 = (unsigned char*)a1;
   56.94 -      s2 = (unsigned char*)a2;
   56.95 -    }
   56.96 -
   56.97 -  while (n--)
   56.98 -    {
   56.99 -      if (*s1 != *s2)
  56.100 -	return *s1 - *s2;
  56.101 -      s1++;
  56.102 -      s2++;
  56.103 -    }
  56.104 -
  56.105 -  return 0;
  56.106 -#endif /* not PREFER_SIZE_OVER_SPEED */
  56.107 -}
  56.108 -
    57.1 --- a/libc/string/memcpy.c	Sat Dec 07 00:44:56 2019 +0100
    57.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    57.3 @@ -1,105 +0,0 @@
    57.4 -/*
    57.5 -FUNCTION
    57.6 -        <<memcpy>>---copy memory regions
    57.7 -
    57.8 -SYNOPSIS
    57.9 -        #include <string.h>
   57.10 -        void* memcpy(void *restrict <[out]>, const void *restrict <[in]>,
   57.11 -                     size_t <[n]>);
   57.12 -
   57.13 -DESCRIPTION
   57.14 -        This function copies <[n]> bytes from the memory region
   57.15 -        pointed to by <[in]> to the memory region pointed to by
   57.16 -        <[out]>.
   57.17 -
   57.18 -        If the regions overlap, the behavior is undefined.
   57.19 -
   57.20 -RETURNS
   57.21 -        <<memcpy>> returns a pointer to the first byte of the <[out]>
   57.22 -        region.
   57.23 -
   57.24 -PORTABILITY
   57.25 -<<memcpy>> is ANSI C.
   57.26 -
   57.27 -<<memcpy>> requires no supporting OS subroutines.
   57.28 -
   57.29 -QUICKREF
   57.30 -        memcpy ansi pure
   57.31 -	*/
   57.32 -
   57.33 -#include <_ansi.h>
   57.34 -#include <string.h>
   57.35 -#include "local.h"
   57.36 -
   57.37 -/* Nonzero if either X or Y is not aligned on a "long" boundary.  */
   57.38 -#define UNALIGNED(X, Y) \
   57.39 -  (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
   57.40 -
   57.41 -/* How many bytes are copied each iteration of the 4X unrolled loop.  */
   57.42 -#define BIGBLOCKSIZE    (sizeof (long) << 2)
   57.43 -
   57.44 -/* How many bytes are copied each iteration of the word copy loop.  */
   57.45 -#define LITTLEBLOCKSIZE (sizeof (long))
   57.46 -
   57.47 -/* Threshhold for punting to the byte copier.  */
   57.48 -#define TOO_SMALL(LEN)  ((LEN) < BIGBLOCKSIZE)
   57.49 -
   57.50 -void *
   57.51 -__inhibit_loop_to_libcall
   57.52 -memcpy (void *__restrict dst0,
   57.53 -	const void *__restrict src0,
   57.54 -	size_t len0)
   57.55 -{
   57.56 -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
   57.57 -  char *dst = (char *) dst0;
   57.58 -  char *src = (char *) src0;
   57.59 -
   57.60 -  void *save = dst0;
   57.61 -
   57.62 -  while (len0--)
   57.63 -    {
   57.64 -      *dst++ = *src++;
   57.65 -    }
   57.66 -
   57.67 -  return save;
   57.68 -#else
   57.69 -  char *dst = dst0;
   57.70 -  const char *src = src0;
   57.71 -  long *aligned_dst;
   57.72 -  const long *aligned_src;
   57.73 -
   57.74 -  /* If the size is small, or either SRC or DST is unaligned,
   57.75 -     then punt into the byte copy loop.  This should be rare.  */
   57.76 -  if (!TOO_SMALL(len0) && !UNALIGNED (src, dst))
   57.77 -    {
   57.78 -      aligned_dst = (long*)dst;
   57.79 -      aligned_src = (long*)src;
   57.80 -
   57.81 -      /* Copy 4X long words at a time if possible.  */
   57.82 -      while (len0 >= BIGBLOCKSIZE)
   57.83 -        {
   57.84 -          *aligned_dst++ = *aligned_src++;
   57.85 -          *aligned_dst++ = *aligned_src++;
   57.86 -          *aligned_dst++ = *aligned_src++;
   57.87 -          *aligned_dst++ = *aligned_src++;
   57.88 -          len0 -= BIGBLOCKSIZE;
   57.89 -        }
   57.90 -
   57.91 -      /* Copy one long word at a time if possible.  */
   57.92 -      while (len0 >= LITTLEBLOCKSIZE)
   57.93 -        {
   57.94 -          *aligned_dst++ = *aligned_src++;
   57.95 -          len0 -= LITTLEBLOCKSIZE;
   57.96 -        }
   57.97 -
   57.98 -       /* Pick up any residual with a byte copier.  */
   57.99 -      dst = (char*)aligned_dst;
  57.100 -      src = (char*)aligned_src;
  57.101 -    }
  57.102 -
  57.103 -  while (len0--)
  57.104 -    *dst++ = *src++;
  57.105 -
  57.106 -  return dst0;
  57.107 -#endif /* not PREFER_SIZE_OVER_SPEED */
  57.108 -}
    58.1 --- a/libc/string/memmem.c	Sat Dec 07 00:44:56 2019 +0100
    58.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    58.3 @@ -1,187 +0,0 @@
    58.4 -/* Optimized memmem function.
    58.5 -   Copyright (c) 2018 Arm Ltd.  All rights reserved.
    58.6 -
    58.7 -   SPDX-License-Identifier: BSD-3-Clause
    58.8 -
    58.9 -   Redistribution and use in source and binary forms, with or without
   58.10 -   modification, are permitted provided that the following conditions
   58.11 -   are met:
   58.12 -   1. Redistributions of source code must retain the above copyright
   58.13 -      notice, this list of conditions and the following disclaimer.
   58.14 -   2. Redistributions in binary form must reproduce the above copyright
   58.15 -      notice, this list of conditions and the following disclaimer in the
   58.16 -      documentation and/or other materials provided with the distribution.
   58.17 -   3. The name of the company may not be used to endorse or promote
   58.18 -      products derived from this software without specific prior written
   58.19 -      permission.
   58.20 -
   58.21 -   THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
   58.22 -   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
   58.23 -   MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
   58.24 -   IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   58.25 -   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
   58.26 -   TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
   58.27 -   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
   58.28 -   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
   58.29 -   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
   58.30 -   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
   58.31 -
   58.32 -/*
   58.33 -FUNCTION
   58.34 -	<<memmem>>---find memory segment
   58.35 -
   58.36 -INDEX
   58.37 -	memmem
   58.38 -
   58.39 -SYNOPSIS
   58.40 -	#include <string.h>
   58.41 -	void *memmem(const void *<[s1]>, size_t <[l1]>, const void *<[s2]>,
   58.42 -		     size_t <[l2]>);
   58.43 -
   58.44 -DESCRIPTION
   58.45 -
   58.46 -	Locates the first occurrence in the memory region pointed to
   58.47 -	by <[s1]> with length <[l1]> of the sequence of bytes pointed
   58.48 -	to by <[s2]> of length <[l2]>.  If you already know the
   58.49 -	lengths of your haystack and needle, <<memmem>> is much faster
   58.50 -	than <<strstr>>.
   58.51 -
   58.52 -RETURNS
   58.53 -	Returns a pointer to the located segment, or a null pointer if
   58.54 -	<[s2]> is not found. If <[l2]> is 0, <[s1]> is returned.
   58.55 -
   58.56 -PORTABILITY
   58.57 -<<memmem>> is a newlib extension.
   58.58 -
   58.59 -<<memmem>> requires no supporting OS subroutines.
   58.60 -
   58.61 -QUICKREF
   58.62 -	memmem pure
   58.63 -*/
   58.64 -
   58.65 -#include <string.h>
   58.66 -#include <stdint.h>
   58.67 -
   58.68 -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
   58.69 -
   58.70 -/* Small and efficient memmem implementation (quadratic worst-case).  */
   58.71 -void *
   58.72 -memmem (const void *haystack, size_t hs_len, const void *needle, size_t ne_len)
   58.73 -{
   58.74 -  const char *hs = haystack;
   58.75 -  const char *ne = needle;
   58.76 -
   58.77 -  if (ne_len == 0)
   58.78 -    return (void *)hs;
   58.79 -  int i;
   58.80 -  int c = ne[0];
   58.81 -  const char *end = hs + hs_len - ne_len;
   58.82 -
   58.83 -  for ( ; hs <= end; hs++)
   58.84 -  {
   58.85 -    if (hs[0] != c)
   58.86 -      continue;
   58.87 -    for (i = ne_len - 1; i != 0; i--)
   58.88 -      if (hs[i] != ne[i])
   58.89 -	break;
   58.90 -    if (i == 0)
   58.91 -      return (void *)hs;
   58.92 -  }
   58.93 -
   58.94 -  return NULL;
   58.95 -}
   58.96 -
   58.97 -#else
   58.98 -
   58.99 -# define RETURN_TYPE void *
  58.100 -# define AVAILABLE(h, h_l, j, n_l) ((j) <= (h_l) - (n_l))
  58.101 -# include "str-two-way.h"
  58.102 -
  58.103 -#define hash2(p) (((size_t)(p)[0] - ((size_t)(p)[-1] << 3)) % sizeof (shift))
  58.104 -
  58.105 -/* Fast memmem algorithm with guaranteed linear-time performance.
  58.106 -   Small needles up to size 2 use a dedicated linear search.  Longer needles
  58.107 -   up to size 256 use a novel modified Horspool algorithm.  It hashes pairs
  58.108 -   of characters to quickly skip past mismatches.  The main search loop only
  58.109 -   exits if the last 2 characters match, avoiding unnecessary calls to memcmp
  58.110 -   and allowing for a larger skip if there is no match.  A self-adapting
  58.111 -   filtering check is used to quickly detect mismatches in long needles.
  58.112 -   By limiting the needle length to 256, the shift table can be reduced to 8
  58.113 -   bits per entry, lowering preprocessing overhead and minimizing cache effects.
  58.114 -   The limit also implies worst-case performance is linear.
  58.115 -   Needles larger than 256 characters use the linear-time Two-Way algorithm.  */
  58.116 -void *
  58.117 -memmem (const void *haystack, size_t hs_len, const void *needle, size_t ne_len)
  58.118 -{
  58.119 -  const unsigned char *hs = haystack;
  58.120 -  const unsigned char *ne = needle;
  58.121 -
  58.122 -  if (ne_len == 0)
  58.123 -    return (void *) hs;
  58.124 -  if (ne_len == 1)
  58.125 -    return (void *) memchr (hs, ne[0], hs_len);
  58.126 -
  58.127 -  /* Ensure haystack length is >= needle length.  */
  58.128 -  if (hs_len < ne_len)
  58.129 -    return NULL;
  58.130 -
  58.131 -  const unsigned char *end = hs + hs_len - ne_len;
  58.132 -
  58.133 -  if (ne_len == 2)
  58.134 -    {
  58.135 -      uint32_t nw = ne[0] << 16 | ne[1], hw = hs[0] << 16 | hs[1];
  58.136 -      for (hs++; hs <= end && hw != nw; )
  58.137 -	hw = hw << 16 | *++hs;
  58.138 -      return hw == nw ? (void *)(hs - 1) : NULL;
  58.139 -    }
  58.140 -
  58.141 -  /* Use Two-Way algorithm for very long needles.  */
  58.142 -  if (__builtin_expect (ne_len > 256, 0))
  58.143 -    return two_way_long_needle (hs, hs_len, ne, ne_len);
  58.144 -
  58.145 -  uint8_t shift[256];
  58.146 -  size_t tmp, shift1;
  58.147 -  size_t m1 = ne_len - 1;
  58.148 -  size_t offset = 0;
  58.149 -  int i;
  58.150 -
  58.151 -  /* Initialize bad character shift hash table.  */
  58.152 -  memset (shift, 0, sizeof (shift));
  58.153 -  for (i = 1; i < m1; i++)
  58.154 -    shift[hash2 (ne + i)] = i;
  58.155 -  shift1 = m1 - shift[hash2 (ne + m1)];
  58.156 -  shift[hash2 (ne + m1)] = m1;
  58.157 -
  58.158 -  for ( ; hs <= end; )
  58.159 -    {
  58.160 -      /* Skip past character pairs not in the needle.  */
  58.161 -      do
  58.162 -	{
  58.163 -	  hs += m1;
  58.164 -	  tmp = shift[hash2 (hs)];
  58.165 -	}
  58.166 -      while (hs <= end && tmp == 0);
  58.167 -
  58.168 -      /* If the match is not at the end of the needle, shift to the end
  58.169 -	 and continue until we match the last 2 characters.  */
  58.170 -      hs -= tmp;
  58.171 -      if (tmp < m1)
  58.172 -	continue;
  58.173 -
  58.174 -      /* The last 2 characters match.  If the needle is long, check a
  58.175 -	 fixed number of characters first to quickly filter out mismatches.  */
  58.176 -      if (m1 <= 15 || memcmp (hs + offset, ne + offset, sizeof (long)) == 0)
  58.177 -	{
  58.178 -	  if (memcmp (hs, ne, m1) == 0)
  58.179 -	    return (void *) hs;
  58.180 -
  58.181 -	  /* Adjust filter offset when it doesn't find the mismatch.  */
  58.182 -	  offset = (offset >= sizeof (long) ? offset : m1) - sizeof (long);
  58.183 -	}
  58.184 -
  58.185 -      /* Skip based on matching the last 2 characters.  */
  58.186 -      hs += shift1;
  58.187 -    }
  58.188 -  return NULL;
  58.189 -}
  58.190 -#endif /* Compilation for speed.  */
    59.1 --- a/libc/string/memmove.c	Sat Dec 07 00:44:56 2019 +0100
    59.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    59.3 @@ -1,136 +0,0 @@
    59.4 -/*
    59.5 -FUNCTION
    59.6 -	<<memmove>>---move possibly overlapping memory
    59.7 -
    59.8 -INDEX
    59.9 -	memmove
   59.10 -
   59.11 -SYNOPSIS
   59.12 -	#include <string.h>
   59.13 -	void *memmove(void *<[dst]>, const void *<[src]>, size_t <[length]>);
   59.14 -
   59.15 -DESCRIPTION
   59.16 -	This function moves <[length]> characters from the block of
   59.17 -	memory starting at <<*<[src]>>> to the memory starting at
   59.18 -	<<*<[dst]>>>. <<memmove>> reproduces the characters correctly
   59.19 -	at <<*<[dst]>>> even if the two areas overlap.
   59.20 -
   59.21 -
   59.22 -RETURNS
   59.23 -	The function returns <[dst]> as passed.
   59.24 -
   59.25 -PORTABILITY
   59.26 -<<memmove>> is ANSI C.
   59.27 -
   59.28 -<<memmove>> requires no supporting OS subroutines.
   59.29 -
   59.30 -QUICKREF
   59.31 -	memmove ansi pure
   59.32 -*/
   59.33 -
   59.34 -#include <string.h>
   59.35 -#include <_ansi.h>
   59.36 -#include <stddef.h>
   59.37 -#include <limits.h>
   59.38 -#include "local.h"
   59.39 -
   59.40 -/* Nonzero if either X or Y is not aligned on a "long" boundary.  */
   59.41 -#define UNALIGNED(X, Y) \
   59.42 -  (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
   59.43 -
   59.44 -/* How many bytes are copied each iteration of the 4X unrolled loop.  */
   59.45 -#define BIGBLOCKSIZE    (sizeof (long) << 2)
   59.46 -
   59.47 -/* How many bytes are copied each iteration of the word copy loop.  */
   59.48 -#define LITTLEBLOCKSIZE (sizeof (long))
   59.49 -
   59.50 -/* Threshhold for punting to the byte copier.  */
   59.51 -#define TOO_SMALL(LEN)  ((LEN) < BIGBLOCKSIZE)
   59.52 -
   59.53 -/*SUPPRESS 20*/
   59.54 -void *
   59.55 -__inhibit_loop_to_libcall
   59.56 -memmove (void *dst_void,
   59.57 -	const void *src_void,
   59.58 -	size_t length)
   59.59 -{
   59.60 -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
   59.61 -  char *dst = dst_void;
   59.62 -  const char *src = src_void;
   59.63 -
   59.64 -  if (src < dst && dst < src + length)
   59.65 -    {
   59.66 -      /* Have to copy backwards */
   59.67 -      src += length;
   59.68 -      dst += length;
   59.69 -      while (length--)
   59.70 -	{
   59.71 -	  *--dst = *--src;
   59.72 -	}
   59.73 -    }
   59.74 -  else
   59.75 -    {
   59.76 -      while (length--)
   59.77 -	{
   59.78 -	  *dst++ = *src++;
   59.79 -	}
   59.80 -    }
   59.81 -
   59.82 -  return dst_void;
   59.83 -#else
   59.84 -  char *dst = dst_void;
   59.85 -  const char *src = src_void;
   59.86 -  long *aligned_dst;
   59.87 -  const long *aligned_src;
   59.88 -
   59.89 -  if (src < dst && dst < src + length)
   59.90 -    {
   59.91 -      /* Destructive overlap...have to copy backwards */
   59.92 -      src += length;
   59.93 -      dst += length;
   59.94 -      while (length--)
   59.95 -	{
   59.96 -	  *--dst = *--src;
   59.97 -	}
   59.98 -    }
   59.99 -  else
  59.100 -    {
  59.101 -      /* Use optimizing algorithm for a non-destructive copy to closely 
  59.102 -         match memcpy. If the size is small or either SRC or DST is unaligned,
  59.103 -         then punt into the byte copy loop.  This should be rare.  */
  59.104 -      if (!TOO_SMALL(length) && !UNALIGNED (src, dst))
  59.105 -        {
  59.106 -          aligned_dst = (long*)dst;
  59.107 -          aligned_src = (long*)src;
  59.108 -
  59.109 -          /* Copy 4X long words at a time if possible.  */
  59.110 -          while (length >= BIGBLOCKSIZE)
  59.111 -            {
  59.112 -              *aligned_dst++ = *aligned_src++;
  59.113 -              *aligned_dst++ = *aligned_src++;
  59.114 -              *aligned_dst++ = *aligned_src++;
  59.115 -              *aligned_dst++ = *aligned_src++;
  59.116 -              length -= BIGBLOCKSIZE;
  59.117 -            }
  59.118 -
  59.119 -          /* Copy one long word at a time if possible.  */
  59.120 -          while (length >= LITTLEBLOCKSIZE)
  59.121 -            {
  59.122 -              *aligned_dst++ = *aligned_src++;
  59.123 -              length -= LITTLEBLOCKSIZE;
  59.124 -            }
  59.125 -
  59.126 -          /* Pick up any residual with a byte copier.  */
  59.127 -          dst = (char*)aligned_dst;
  59.128 -          src = (char*)aligned_src;
  59.129 -        }
  59.130 -
  59.131 -      while (length--)
  59.132 -        {
  59.133 -          *dst++ = *src++;
  59.134 -        }
  59.135 -    }
  59.136 -
  59.137 -  return dst_void;
  59.138 -#endif /* not PREFER_SIZE_OVER_SPEED */
  59.139 -}
    60.1 --- a/libc/string/mempcpy.c	Sat Dec 07 00:44:56 2019 +0100
    60.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    60.3 @@ -1,100 +0,0 @@
    60.4 -/*
    60.5 -FUNCTION
    60.6 -        <<mempcpy>>---copy memory regions and return end pointer
    60.7 -
    60.8 -SYNOPSIS
    60.9 -        #include <string.h>
   60.10 -        void* mempcpy(void *<[out]>, const void *<[in]>, size_t <[n]>);
   60.11 -
   60.12 -DESCRIPTION
   60.13 -        This function copies <[n]> bytes from the memory region
   60.14 -        pointed to by <[in]> to the memory region pointed to by
   60.15 -        <[out]>.
   60.16 -
   60.17 -        If the regions overlap, the behavior is undefined.
   60.18 -
   60.19 -RETURNS
   60.20 -        <<mempcpy>> returns a pointer to the byte following the
   60.21 -        last byte copied to the <[out]> region.
   60.22 -
   60.23 -PORTABILITY
   60.24 -<<mempcpy>> is a GNU extension.
   60.25 -
   60.26 -<<mempcpy>> requires no supporting OS subroutines.
   60.27 -
   60.28 -	*/
   60.29 -
   60.30 -#include <_ansi.h>
   60.31 -#include <stddef.h>
   60.32 -#include <limits.h>
   60.33 -#include <string.h>
   60.34 -
   60.35 -/* Nonzero if either X or Y is not aligned on a "long" boundary.  */
   60.36 -#define UNALIGNED(X, Y) \
   60.37 -  (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
   60.38 -
   60.39 -/* How many bytes are copied each iteration of the 4X unrolled loop.  */
   60.40 -#define BIGBLOCKSIZE    (sizeof (long) << 2)
   60.41 -
   60.42 -/* How many bytes are copied each iteration of the word copy loop.  */
   60.43 -#define LITTLEBLOCKSIZE (sizeof (long))
   60.44 -
   60.45 -/* Threshhold for punting to the byte copier.  */
   60.46 -#define TOO_SMALL(LEN)  ((LEN) < BIGBLOCKSIZE)
   60.47 -
   60.48 -void *
   60.49 -mempcpy (void *dst0,
   60.50 -	const void *src0,
   60.51 -	size_t len0)
   60.52 -{
   60.53 -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
   60.54 -  char *dst = (char *) dst0;
   60.55 -  char *src = (char *) src0;
   60.56 -
   60.57 -  while (len0--)
   60.58 -    {
   60.59 -      *dst++ = *src++;
   60.60 -    }
   60.61 -
   60.62 -  return dst;
   60.63 -#else
   60.64 -  char *dst = dst0;
   60.65 -  const char *src = src0;
   60.66 -  long *aligned_dst;
   60.67 -  const long *aligned_src;
   60.68 -
   60.69 -  /* If the size is small, or either SRC or DST is unaligned,
   60.70 -     then punt into the byte copy loop.  This should be rare.  */
   60.71 -  if (!TOO_SMALL(len0) && !UNALIGNED (src, dst))
   60.72 -    {
   60.73 -      aligned_dst = (long*)dst;
   60.74 -      aligned_src = (long*)src;
   60.75 -
   60.76 -      /* Copy 4X long words at a time if possible.  */
   60.77 -      while (len0 >= BIGBLOCKSIZE)
   60.78 -        {
   60.79 -          *aligned_dst++ = *aligned_src++;
   60.80 -          *aligned_dst++ = *aligned_src++;
   60.81 -          *aligned_dst++ = *aligned_src++;
   60.82 -          *aligned_dst++ = *aligned_src++;
   60.83 -          len0 -= BIGBLOCKSIZE;
   60.84 -        }
   60.85 -
   60.86 -      /* Copy one long word at a time if possible.  */
   60.87 -      while (len0 >= LITTLEBLOCKSIZE)
   60.88 -        {
   60.89 -          *aligned_dst++ = *aligned_src++;
   60.90 -          len0 -= LITTLEBLOCKSIZE;
   60.91 -        }
   60.92 -
   60.93 -       /* Pick up any residual with a byte copier.  */
   60.94 -      dst = (char*)aligned_dst;
   60.95 -      src = (char*)aligned_src;
   60.96 -    }
   60.97 -
   60.98 -  while (len0--)
   60.99 -    *dst++ = *src++;
  60.100 -
  60.101 -  return dst;
  60.102 -#endif /* not PREFER_SIZE_OVER_SPEED */
  60.103 -}
    61.1 --- a/libc/string/memrchr.c	Sat Dec 07 00:44:56 2019 +0100
    61.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    61.3 @@ -1,126 +0,0 @@
    61.4 -/*
    61.5 -FUNCTION
    61.6 -	<<memrchr>>---reverse search for character in memory
    61.7 -
    61.8 -INDEX
    61.9 -	memrchr
   61.10 -
   61.11 -SYNOPSIS
   61.12 -	#include <string.h>
   61.13 -	void *memrchr(const void *<[src]>, int <[c]>, size_t <[length]>);
   61.14 -
   61.15 -DESCRIPTION
   61.16 -	This function searches memory starting at <[length]> bytes
   61.17 -	beyond <<*<[src]>>> backwards for the character <[c]>.
   61.18 -	The search only ends with the first occurrence of <[c]>; in
   61.19 -	particular, <<NUL>> does not terminate the search.
   61.20 -
   61.21 -RETURNS
   61.22 -	If the character <[c]> is found within <[length]> characters
   61.23 -	of <<*<[src]>>>, a pointer to the character is returned. If
   61.24 -	<[c]> is not found, then <<NULL>> is returned.
   61.25 -
   61.26 -PORTABILITY
   61.27 -<<memrchr>> is a GNU extension.
   61.28 -
   61.29 -<<memrchr>> requires no supporting OS subroutines.
   61.30 -
   61.31 -QUICKREF
   61.32 -	memrchr
   61.33 -*/
   61.34 -
   61.35 -#include <_ansi.h>
   61.36 -#include <string.h>
   61.37 -#include <limits.h>
   61.38 -
   61.39 -/* Nonzero if X is not aligned on a "long" boundary.  */
   61.40 -#define UNALIGNED(X) ((long)(X + 1) & (sizeof (long) - 1))
   61.41 -
   61.42 -/* How many bytes are loaded each iteration of the word copy loop.  */
   61.43 -#define LBLOCKSIZE (sizeof (long))
   61.44 -
   61.45 -/* Threshhold for punting to the bytewise iterator.  */
   61.46 -#define TOO_SMALL(LEN)  ((LEN) < LBLOCKSIZE)
   61.47 -
   61.48 -#if LONG_MAX == 2147483647L
   61.49 -#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
   61.50 -#else
   61.51 -#if LONG_MAX == 9223372036854775807L
   61.52 -/* Nonzero if X (a long int) contains a NULL byte. */
   61.53 -#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
   61.54 -#else
   61.55 -#error long int is not a 32bit or 64bit type.
   61.56 -#endif
   61.57 -#endif
   61.58 -
   61.59 -#ifndef DETECTNULL
   61.60 -#error long int is not a 32bit or 64bit byte
   61.61 -#endif
   61.62 -
   61.63 -/* DETECTCHAR returns nonzero if (long)X contains the byte used
   61.64 -   to fill (long)MASK. */
   61.65 -#define DETECTCHAR(X,MASK) (DETECTNULL(X ^ MASK))
   61.66 -
   61.67 -void *
   61.68 -memrchr (const void *src_void,
   61.69 -	int c,
   61.70 -	size_t length)
   61.71 -{
   61.72 -  const unsigned char *src = (const unsigned char *) src_void + length - 1;
   61.73 -  unsigned char d = c;
   61.74 -
   61.75 -#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__)
   61.76 -  unsigned long *asrc;
   61.77 -  unsigned long  mask;
   61.78 -  unsigned int i;
   61.79 -
   61.80 -  while (UNALIGNED (src))
   61.81 -    {
   61.82 -      if (!length--)
   61.83 -        return NULL;
   61.84 -      if (*src == d)
   61.85 -        return (void *) src;
   61.86 -      src--;
   61.87 -    }
   61.88 -
   61.89 -  if (!TOO_SMALL (length))
   61.90 -    {
   61.91 -      /* If we get this far, we know that length is large and src is
   61.92 -         word-aligned. */
   61.93 -      /* The fast code reads the source one word at a time and only
   61.94 -         performs the bytewise search on word-sized segments if they
   61.95 -         contain the search character, which is detected by XORing
   61.96 -         the word-sized segment with a word-sized block of the search
   61.97 -         character and then detecting for the presence of NUL in the
   61.98 -         result.  */
   61.99 -      asrc = (unsigned long *) (src - LBLOCKSIZE + 1);
  61.100 -      mask = d << 8 | d;
  61.101 -      mask = mask << 16 | mask;
  61.102 -      for (i = 32; i < LBLOCKSIZE * 8; i <<= 1)
  61.103 -        mask = (mask << i) | mask;
  61.104 -
  61.105 -      while (length >= LBLOCKSIZE)
  61.106 -        {
  61.107 -          if (DETECTCHAR (*asrc, mask))
  61.108 -            break;
  61.109 -          length -= LBLOCKSIZE;
  61.110 -          asrc--;
  61.111 -        }
  61.112 -
  61.113 -      /* If there are fewer than LBLOCKSIZE characters left,
  61.114 -         then we resort to the bytewise loop.  */
  61.115 -
  61.116 -      src = (unsigned char *) asrc + LBLOCKSIZE - 1;
  61.117 -    }
  61.118 -
  61.119 -#endif /* not PREFER_SIZE_OVER_SPEED */
  61.120 -
  61.121 -  while (length--)
  61.122 -    {
  61.123 -      if (*src == d)
  61.124 -        return (void *) src;
  61.125 -      src--;
  61.126 -    }
  61.127 -
  61.128 -  return NULL;
  61.129 -}
    62.1 --- a/libc/string/memset.c	Sat Dec 07 00:44:56 2019 +0100
    62.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    62.3 @@ -1,96 +0,0 @@
    62.4 -/*
    62.5 -FUNCTION
    62.6 -	<<memset>>---set an area of memory
    62.7 -
    62.8 -INDEX
    62.9 -	memset
   62.10 -
   62.11 -SYNOPSIS
   62.12 -	#include <string.h>
   62.13 -	void *memset(void *<[dst]>, int <[c]>, size_t <[length]>);
   62.14 -
   62.15 -DESCRIPTION
   62.16 -	This function converts the argument <[c]> into an unsigned
   62.17 -	char and fills the first <[length]> characters of the array
   62.18 -	pointed to by <[dst]> to the value.
   62.19 -
   62.20 -RETURNS
   62.21 -	<<memset>> returns the value of <[dst]>.
   62.22 -
   62.23 -PORTABILITY
   62.24 -<<memset>> is ANSI C.
   62.25 -
   62.26 -    <<memset>> requires no supporting OS subroutines.
   62.27 -
   62.28 -QUICKREF
   62.29 -	memset ansi pure
   62.30 -*/
   62.31 -
   62.32 -#include <string.h>
   62.33 -#include "local.h"
   62.34 -
   62.35 -#define LBLOCKSIZE (sizeof(long))
   62.36 -#define UNALIGNED(X)   ((long)X & (LBLOCKSIZE - 1))
   62.37 -#define TOO_SMALL(LEN) ((LEN) < LBLOCKSIZE)
   62.38 -
   62.39 -void *
   62.40 -__inhibit_loop_to_libcall
   62.41 -memset (void *m,
   62.42 -	int c,
   62.43 -	size_t n)
   62.44 -{
   62.45 -  char *s = (char *) m;
   62.46 -
   62.47 -#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__)
   62.48 -  unsigned int i;
   62.49 -  unsigned long buffer;
   62.50 -  unsigned long *aligned_addr;
   62.51 -  unsigned int d = c & 0xff;	/* To avoid sign extension, copy C to an
   62.52 -				   unsigned variable.  */
   62.53 -
   62.54 -  while (UNALIGNED (s))
   62.55 -    {
   62.56 -      if (n--)
   62.57 -        *s++ = (char) c;
   62.58 -      else
   62.59 -        return m;
   62.60 -    }
   62.61 -
   62.62 -  if (!TOO_SMALL (n))
   62.63 -    {
   62.64 -      /* If we get this far, we know that n is large and s is word-aligned. */
   62.65 -      aligned_addr = (unsigned long *) s;
   62.66 -
   62.67 -      /* Store D into each char sized location in BUFFER so that
   62.68 -         we can set large blocks quickly.  */
   62.69 -      buffer = (d << 8) | d;
   62.70 -      buffer |= (buffer << 16);
   62.71 -      for (i = 32; i < LBLOCKSIZE * 8; i <<= 1)
   62.72 -        buffer = (buffer << i) | buffer;
   62.73 -
   62.74 -      /* Unroll the loop.  */
   62.75 -      while (n >= LBLOCKSIZE*4)
   62.76 -        {
   62.77 -          *aligned_addr++ = buffer;
   62.78 -          *aligned_addr++ = buffer;
   62.79 -          *aligned_addr++ = buffer;
   62.80 -          *aligned_addr++ = buffer;
   62.81 -          n -= 4*LBLOCKSIZE;
   62.82 -        }
   62.83 -
   62.84 -      while (n >= LBLOCKSIZE)
   62.85 -        {
   62.86 -          *aligned_addr++ = buffer;
   62.87 -          n -= LBLOCKSIZE;
   62.88 -        }
   62.89 -      /* Pick up the remainder with a bytewise loop.  */
   62.90 -      s = (char*)aligned_addr;
   62.91 -    }
   62.92 -
   62.93 -#endif /* not PREFER_SIZE_OVER_SPEED */
   62.94 -
   62.95 -  while (n--)
   62.96 -    *s++ = (char) c;
   62.97 -
   62.98 -  return m;
   62.99 -}
    63.1 --- a/libc/string/mkunidata	Sat Dec 07 00:44:56 2019 +0100
    63.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    63.3 @@ -1,71 +0,0 @@
    63.4 -#! /bin/sh
    63.5 -
    63.6 -echo Generating Unicode width data for newlib/libc/string/wcwidth.c
    63.7 -
    63.8 -cd `dirname $0`
    63.9 -PATH="$PATH":.	# ensure access to uniset tool
   63.10 -
   63.11 -#############################################################################
   63.12 -# checks and (with option -u) downloads
   63.13 -
   63.14 -case "$1" in
   63.15 --h)	echo "Usage: $0 [-h|-u|-i]"
   63.16 -	echo "Generate width data tables ambiguous.t, combining.t, wide.t"
   63.17 -	echo "from local Unicode files UnicodeData.txt, Blocks.txt, EastAsianWidth.txt."
   63.18 -	echo ""
   63.19 -	echo "Options:"
   63.20 -	echo "  -u    download files from unicode.org first, download uniset tool"
   63.21 -	echo "  -i    copy files from /usr/share/unicode/ucd first"
   63.22 -	echo "  -h    show this"
   63.23 -	exit
   63.24 -	;;
   63.25 --u)
   63.26 -	wget () {
   63.27 -		curl -R -O --connect-timeout 55 -z "`basename $1`" "$1"
   63.28 -	}
   63.29 -
   63.30 -	echo downloading uniset tool
   63.31 -	wget http://www.cl.cam.ac.uk/~mgk25/download/uniset.tar.gz
   63.32 -	gzip -dc uniset.tar.gz | tar xvf - uniset
   63.33 -
   63.34 -	echo downloading data from unicode.org
   63.35 -	for data in UnicodeData.txt Blocks.txt EastAsianWidth.txt
   63.36 -	do	wget http://unicode.org/Public/UNIDATA/$data
   63.37 -	done
   63.38 -	;;
   63.39 --i)
   63.40 -	echo copying data from /usr/share/unicode/ucd
   63.41 -	for data in UnicodeData.txt Blocks.txt EastAsianWidth.txt
   63.42 -	do	cp /usr/share/unicode/ucd/$data .
   63.43 -	done
   63.44 -	;;
   63.45 -esac
   63.46 -
   63.47 -echo checking uniset tool
   63.48 -type uniset || exit 9
   63.49 -
   63.50 -echo checking Unicode data files
   63.51 -for data in UnicodeData.txt Blocks.txt EastAsianWidth.txt
   63.52 -do	if [ -r $data ]
   63.53 -	then	true
   63.54 -	else	echo $data not available, skipping table generation
   63.55 -		exit
   63.56 -	fi
   63.57 -done
   63.58 -
   63.59 -echo generating from Unicode version `sed -e 's,[^.0-9],,g' -e 1q Blocks.txt`
   63.60 -
   63.61 -#############################################################################
   63.62 -# table generation
   63.63 -
   63.64 -echo generating combining characters table
   63.65 -uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B +D7B0-D7C6 +D7CB-D7FB c > combining.t
   63.66 -
   63.67 -echo generating ambiguous width characters table
   63.68 -sh ./mkwidthA && uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c > ambiguous.t
   63.69 -
   63.70 -echo generating wide characters table
   63.71 -sh ./mkwide
   63.72 -
   63.73 -#############################################################################
   63.74 -# end
    64.1 --- a/libc/string/mkwide	Sat Dec 07 00:44:56 2019 +0100
    64.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    64.3 @@ -1,49 +0,0 @@
    64.4 -#! /bin/sh
    64.5 -
    64.6 -# generate list of wide characters, with convex closure
    64.7 -
    64.8 -skipcheck=false
    64.9 -
   64.10 -if [ ! -r EastAsianWidth.txt ]
   64.11 -then	ln -s /usr/share/unicode/ucd/EastAsianWidth.txt . || exit 1
   64.12 -fi
   64.13 -if [ ! -r UnicodeData.txt ]
   64.14 -then	ln -s /usr/share/unicode/ucd/UnicodeData.txt . || exit 1
   64.15 -fi
   64.16 -if [ ! -r Blocks.txt ]
   64.17 -then	ln -s /usr/share/unicode/ucd/Blocks.txt . || exit 1
   64.18 -fi
   64.19 -
   64.20 -sed -e "s,^\([^;]*\);[NAH],\1," -e t -e d EastAsianWidth.txt > wide.na
   64.21 -sed -e "s,^\([^;]*\);[WF],\1," -e t -e d EastAsianWidth.txt > wide.fw
   64.22 -
   64.23 -PATH="$PATH:." # for uniset
   64.24 -
   64.25 -nrfw=`uniset +wide.fw nr | sed -e 's,.*:,,'`
   64.26 -echo FW $nrfw
   64.27 -nrna=`uniset +wide.na nr | sed -e 's,.*:,,'`
   64.28 -echo NAH $nrna
   64.29 -
   64.30 -extrablocks="2E80-303E"
   64.31 -
   64.32 -# check all blocks
   64.33 -includes () {
   64.34 -	nr=`uniset +wide.$2 -$1 nr | sed -e 's,.*:,,'`
   64.35 -	test $nr != $3
   64.36 -}
   64.37 -echo "adding compact closure of wide ranges, this may take ~10min"
   64.38 -for b in $extrablocks `sed -e 's,^\([0-9A-F]*\)\.\.\([0-9A-F]*\).*,\1-\2,' -e t -e d Blocks.txt`
   64.39 -do	range=$b
   64.40 -	echo checking $range $* >&2
   64.41 -	if includes $range fw $nrfw && ! includes $range na $nrna
   64.42 -	then	echo $range
   64.43 -	fi
   64.44 -done > wide.blocks
   64.45 -
   64.46 -(
   64.47 -sed -e "s,^,//," -e 1q EastAsianWidth.txt
   64.48 -sed -e "s,^,//," -e 1q Blocks.txt
   64.49 -uniset `sed -e 's,^,+,' wide.blocks` +wide.fw c
   64.50 -) > wide.t
   64.51 -
   64.52 -rm -f wide.na wide.fw wide.blocks
    65.1 --- a/libc/string/mkwidthA	Sat Dec 07 00:44:56 2019 +0100
    65.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    65.3 @@ -1,20 +0,0 @@
    65.4 -#! /bin/sh
    65.5 -
    65.6 -# generate WIDTH-A file, listing Unicode characters with width property
    65.7 -# Ambiguous, from EastAsianWidth.txt
    65.8 -
    65.9 -if [ ! -r EastAsianWidth.txt ]
   65.10 -then	ln -s /usr/share/unicode/ucd/EastAsianWidth.txt . || exit 1
   65.11 -fi
   65.12 -if [ ! -r UnicodeData.txt ]
   65.13 -then	ln -s /usr/share/unicode/ucd/UnicodeData.txt . || exit 1
   65.14 -fi
   65.15 -if [ ! -r Blocks.txt ]
   65.16 -then	ln -s /usr/share/unicode/ucd/Blocks.txt . || exit 1
   65.17 -fi
   65.18 -
   65.19 -sed -e "s,^\([^;]*\);A,\1," -e t -e d EastAsianWidth.txt > width-a-new
   65.20 -rm -f WIDTH-A
   65.21 -echo "# UAX #11: East Asian Ambiguous" > WIDTH-A
   65.22 -PATH="$PATH:." uniset +width-a-new compact >> WIDTH-A
   65.23 -rm -f width-a-new
    66.1 --- a/libc/string/rawmemchr.c	Sat Dec 07 00:44:56 2019 +0100
    66.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    66.3 @@ -1,114 +0,0 @@
    66.4 -/*
    66.5 -FUNCTION
    66.6 -	<<rawmemchr>>---find character in memory
    66.7 -
    66.8 -INDEX
    66.9 -	rawmemchr
   66.10 -
   66.11 -SYNOPSIS
   66.12 -	#include <string.h>
   66.13 -	void *rawmemchr(const void *<[src]>, int <[c]>);
   66.14 -
   66.15 -DESCRIPTION
   66.16 -	This function searches memory starting at <<*<[src]>>> for the
   66.17 -	character <[c]>.  The search only ends with the first occurrence
   66.18 -	of <[c]>; in particular, <<NUL>> does not terminate the search.
   66.19 -	No bounds checking is performed, so this function should only
   66.20 -	be used when it is certain that the character <[c]> will be found.
   66.21 -
   66.22 -RETURNS
   66.23 -	A pointer to the first occurance of character <[c]>.
   66.24 -
   66.25 -PORTABILITY
   66.26 -<<rawmemchr>> is a GNU extension.
   66.27 -
   66.28 -<<rawmemchr>> requires no supporting OS subroutines.
   66.29 -
   66.30 -QUICKREF
   66.31 -	rawmemchr
   66.32 -*/
   66.33 -
   66.34 -#include <_ansi.h>
   66.35 -#include <string.h>
   66.36 -#include <limits.h>
   66.37 -
   66.38 -/* Nonzero if X is not aligned on a "long" boundary.  */
   66.39 -#define UNALIGNED(X) ((long)X & (sizeof (long) - 1))
   66.40 -
   66.41 -/* How many bytes are loaded each iteration of the word copy loop.  */
   66.42 -#define LBLOCKSIZE (sizeof (long))
   66.43 -
   66.44 -/* Threshhold for punting to the bytewise iterator.  */
   66.45 -#define TOO_SMALL(LEN)  ((LEN) < LBLOCKSIZE)
   66.46 -
   66.47 -#if LONG_MAX == 2147483647L
   66.48 -#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
   66.49 -#else
   66.50 -#if LONG_MAX == 9223372036854775807L
   66.51 -/* Nonzero if X (a long int) contains a NULL byte. */
   66.52 -#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
   66.53 -#else
   66.54 -#error long int is not a 32bit or 64bit type.
   66.55 -#endif
   66.56 -#endif
   66.57 -
   66.58 -#ifndef DETECTNULL
   66.59 -#error long int is not a 32bit or 64bit byte
   66.60 -#endif
   66.61 -
   66.62 -/* DETECTCHAR returns nonzero if (long)X contains the byte used
   66.63 -   to fill (long)MASK. */
   66.64 -#define DETECTCHAR(X,MASK) (DETECTNULL(X ^ MASK))
   66.65 -
   66.66 -void *
   66.67 -rawmemchr (const void *src_void,
   66.68 -	int c)
   66.69 -{
   66.70 -  const unsigned char *src = (const unsigned char *) src_void;
   66.71 -  unsigned char d = c;
   66.72 -
   66.73 -#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__)
   66.74 -  unsigned long *asrc;
   66.75 -  unsigned long  mask;
   66.76 -  unsigned int i;
   66.77 -
   66.78 -  while (UNALIGNED (src))
   66.79 -    {
   66.80 -      if (*src == d)
   66.81 -        return (void *) src;
   66.82 -      src++;
   66.83 -    }
   66.84 -
   66.85 -  /* If we get this far, we know that src is word-aligned. */
   66.86 -  /* The fast code reads the source one word at a time and only
   66.87 -     performs the bytewise search on word-sized segments if they
   66.88 -     contain the search character, which is detected by XORing
   66.89 -     the word-sized segment with a word-sized block of the search
   66.90 -     character and then detecting for the presence of NUL in the
   66.91 -     result.  */
   66.92 -  asrc = (unsigned long *) src;
   66.93 -  mask = d << 8 | d;
   66.94 -  mask = mask << 16 | mask;
   66.95 -  for (i = 32; i < LBLOCKSIZE * 8; i <<= 1)
   66.96 -    mask = (mask << i) | mask;
   66.97 -
   66.98 -  while (1)
   66.99 -    {
  66.100 -      if (DETECTCHAR (*asrc, mask))
  66.101 -        break;
  66.102 -      asrc++;
  66.103 -    }
  66.104 -
  66.105 -  /* We have the matching word, now we resort to a bytewise loop. */
  66.106 -
  66.107 -  src = (unsigned char *) asrc;
  66.108 -
  66.109 -#endif /* !PREFER_SIZE_OVER_SPEED && !__OPTIMIZE_SIZE__ */
  66.110 -
  66.111 -  while (1)
  66.112 -    {
  66.113 -      if (*src == d)
  66.114 -        return (void *) src;
  66.115 -      src++;
  66.116 -    }
  66.117 -}
    67.1 --- a/libc/string/rindex.c	Sat Dec 07 00:44:56 2019 +0100
    67.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    67.3 @@ -1,38 +0,0 @@
    67.4 -/*
    67.5 -FUNCTION
    67.6 -	<<rindex>>---reverse search for character in string
    67.7 -
    67.8 -INDEX
    67.9 -	rindex
   67.10 -
   67.11 -SYNOPSIS
   67.12 -	#include <string.h>
   67.13 -	char * rindex(const char *<[string]>, int <[c]>);
   67.14 -
   67.15 -DESCRIPTION
   67.16 -	This function finds the last occurence of <[c]> (converted to
   67.17 -	a char) in the string pointed to by <[string]> (including the
   67.18 -	terminating null character).
   67.19 -
   67.20 -	This function is identical to <<strrchr>>.
   67.21 -
   67.22 -RETURNS
   67.23 -	Returns a pointer to the located character, or a null pointer
   67.24 -	if <[c]> does not occur in <[string]>.
   67.25 -
   67.26 -PORTABILITY
   67.27 -<<rindex>> requires no supporting OS subroutines.
   67.28 -
   67.29 -QUICKREF
   67.30 -	rindex - pure
   67.31 -*/
   67.32 -
   67.33 -#include <string.h>
   67.34 -#include <strings.h>
   67.35 -
   67.36 -char *
   67.37 -rindex (const char *s,
   67.38 -	int c)
   67.39 -{
   67.40 -  return strrchr (s, c);
   67.41 -}
    68.1 --- a/libc/string/stpcpy.c	Sat Dec 07 00:44:56 2019 +0100
    68.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    68.3 @@ -1,84 +0,0 @@
    68.4 -/*
    68.5 -FUNCTION
    68.6 -	<<stpcpy>>---copy string returning a pointer to its end
    68.7 -
    68.8 -INDEX
    68.9 -	stpcpy
   68.10 -
   68.11 -SYNOPSIS
   68.12 -	#include <string.h>
   68.13 -	char *stpcpy(char *restrict <[dst]>, const char *restrict <[src]>);
   68.14 -
   68.15 -DESCRIPTION
   68.16 -	<<stpcpy>> copies the string pointed to by <[src]>
   68.17 -	(including the terminating null character) to the array
   68.18 -	pointed to by <[dst]>.
   68.19 -
   68.20 -RETURNS
   68.21 -	This function returns a pointer to the end of the destination string,
   68.22 -	thus pointing to the trailing '\0'.
   68.23 -
   68.24 -PORTABILITY
   68.25 -<<stpcpy>> is a GNU extension, candidate for inclusion into POSIX/SUSv4.
   68.26 -
   68.27 -<<stpcpy>> requires no supporting OS subroutines.
   68.28 -
   68.29 -QUICKREF
   68.30 -	stpcpy gnu
   68.31 -*/
   68.32 -
   68.33 -#include <string.h>
   68.34 -#include <limits.h>
   68.35 -
   68.36 -/*SUPPRESS 560*/
   68.37 -/*SUPPRESS 530*/
   68.38 -
   68.39 -/* Nonzero if either X or Y is not aligned on a "long" boundary.  */
   68.40 -#define UNALIGNED(X, Y) \
   68.41 -  (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
   68.42 -
   68.43 -#if LONG_MAX == 2147483647L
   68.44 -#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
   68.45 -#else
   68.46 -#if LONG_MAX == 9223372036854775807L
   68.47 -/* Nonzero if X (a long int) contains a NULL byte. */
   68.48 -#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
   68.49 -#else
   68.50 -#error long int is not a 32bit or 64bit type.
   68.51 -#endif
   68.52 -#endif
   68.53 -
   68.54 -#ifndef DETECTNULL
   68.55 -#error long int is not a 32bit or 64bit byte
   68.56 -#endif
   68.57 -
   68.58 -char*
   68.59 -stpcpy (char *__restrict dst,
   68.60 -	const char *__restrict src)
   68.61 -{
   68.62 -#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__)
   68.63 -  long *aligned_dst;
   68.64 -  const long *aligned_src;
   68.65 -
   68.66 -  /* If SRC or DEST is unaligned, then copy bytes.  */
   68.67 -  if (!UNALIGNED (src, dst))
   68.68 -    {
   68.69 -      aligned_dst = (long*)dst;
   68.70 -      aligned_src = (long*)src;
   68.71 -
   68.72 -      /* SRC and DEST are both "long int" aligned, try to do "long int"
   68.73 -         sized copies.  */
   68.74 -      while (!DETECTNULL(*aligned_src))
   68.75 -        {
   68.76 -          *aligned_dst++ = *aligned_src++;
   68.77 -        }
   68.78 -
   68.79 -      dst = (char*)aligned_dst;
   68.80 -      src = (char*)aligned_src;
   68.81 -    }
   68.82 -#endif /* not PREFER_SIZE_OVER_SPEED */
   68.83 -
   68.84 -  while ((*dst++ = *src++))
   68.85 -    ;
   68.86 -  return --dst;
   68.87 -}
    69.1 --- a/libc/string/stpncpy.c	Sat Dec 07 00:44:56 2019 +0100
    69.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    69.3 @@ -1,107 +0,0 @@
    69.4 -/*
    69.5 -FUNCTION
    69.6 -	<<stpncpy>>---counted copy string returning a pointer to its end
    69.7 -
    69.8 -INDEX
    69.9 -	stpncpy
   69.10 -
   69.11 -SYNOPSIS
   69.12 -	#include <string.h>
   69.13 -	char *stpncpy(char *restrict <[dst]>, const char *restrict <[src]>,
   69.14 -                      size_t <[length]>);
   69.15 -
   69.16 -DESCRIPTION
   69.17 -	<<stpncpy>> copies not more than <[length]> characters from the
   69.18 -	the string pointed to by <[src]> (including the terminating
   69.19 -	null character) to the array pointed to by <[dst]>.  If the
   69.20 -	string pointed to by <[src]> is shorter than <[length]>
   69.21 -	characters, null characters are appended to the destination
   69.22 -	array until a total of <[length]> characters have been
   69.23 -	written.
   69.24 -
   69.25 -RETURNS
   69.26 -	This function returns a pointer to the end of the destination string,
   69.27 -	thus pointing to the trailing '\0', or, if the destination string is
   69.28 -	not null-terminated, pointing to dst + n.
   69.29 -
   69.30 -PORTABILITY
   69.31 -<<stpncpy>> is a GNU extension, candidate for inclusion into POSIX/SUSv4.
   69.32 -
   69.33 -<<stpncpy>> requires no supporting OS subroutines.
   69.34 -
   69.35 -QUICKREF
   69.36 -	stpncpy gnu
   69.37 -*/
   69.38 -
   69.39 -#include <string.h>
   69.40 -#include <limits.h>
   69.41 -
   69.42 -/*SUPPRESS 560*/
   69.43 -/*SUPPRESS 530*/
   69.44 -
   69.45 -/* Nonzero if either X or Y is not aligned on a "long" boundary.  */
   69.46 -#define UNALIGNED(X, Y) \
   69.47 -  (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
   69.48 -
   69.49 -#if LONG_MAX == 2147483647L
   69.50 -#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
   69.51 -#else
   69.52 -#if LONG_MAX == 9223372036854775807L
   69.53 -/* Nonzero if X (a long int) contains a NULL byte. */
   69.54 -#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
   69.55 -#else
   69.56 -#error long int is not a 32bit or 64bit type.
   69.57 -#endif
   69.58 -#endif
   69.59 -
   69.60 -#ifndef DETECTNULL
   69.61 -#error long int is not a 32bit or 64bit byte
   69.62 -#endif
   69.63 -
   69.64 -#define TOO_SMALL(LEN) ((LEN) < sizeof (long))
   69.65 -
   69.66 -char *
   69.67 -stpncpy (char *__restrict dst,
   69.68 -	const char *__restrict src,
   69.69 -	size_t count)
   69.70 -{
   69.71 -  char *ret = NULL;
   69.72 -
   69.73 -#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__)
   69.74 -  long *aligned_dst;
   69.75 -  const long *aligned_src;
   69.76 -
   69.77 -  /* If SRC and DEST is aligned and count large enough, then copy words.  */
   69.78 -  if (!UNALIGNED (src, dst) && !TOO_SMALL (count))
   69.79 -    {
   69.80 -      aligned_dst = (long*)dst;
   69.81 -      aligned_src = (long*)src;
   69.82 -
   69.83 -      /* SRC and DEST are both "long int" aligned, try to do "long int"
   69.84 -	 sized copies.  */
   69.85 -      while (count >= sizeof (long int) && !DETECTNULL(*aligned_src))
   69.86 -	{
   69.87 -	  count -= sizeof (long int);
   69.88 -	  *aligned_dst++ = *aligned_src++;
   69.89 -	}
   69.90 -
   69.91 -      dst = (char*)aligned_dst;
   69.92 -      src = (char*)aligned_src;
   69.93 -    }
   69.94 -#endif /* not PREFER_SIZE_OVER_SPEED */
   69.95 -
   69.96 -  while (count > 0)
   69.97 -    {
   69.98 -      --count;
   69.99 -      if ((*dst++ = *src++) == '\0')
  69.100 -	{
  69.101 -	  ret = dst - 1;
  69.102 -	  break;
  69.103 -	}
  69.104 -    }
  69.105 -
  69.106 -  while (count-- > 0)
  69.107 -    *dst++ = '\0';
  69.108 -
  69.109 -  return ret ? ret : dst;
  69.110 -}
    70.1 --- a/libc/string/str-two-way.h	Sat Dec 07 00:44:56 2019 +0100
    70.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    70.3 @@ -1,416 +0,0 @@
    70.4 -/* Byte-wise substring search, using the Two-Way algorithm.
    70.5 - * Copyright (C) 2008, 2010 Eric Blake
    70.6 - * Permission to use, copy, modify, and distribute this software
    70.7 - * is freely granted, provided that this notice is preserved.
    70.8 - */
    70.9 -
   70.10 -
   70.11 -/* Before including this file, you need to include <string.h>, and define:
   70.12 -     RESULT_TYPE		A macro that expands to the return type.
   70.13 -     AVAILABLE(h, h_l, j, n_l)	A macro that returns nonzero if there are
   70.14 -				at least N_L bytes left starting at
   70.15 -				H[J].  H is 'unsigned char *', H_L, J,
   70.16 -				and N_L are 'size_t'; H_L is an
   70.17 -				lvalue.  For NUL-terminated searches,
   70.18 -				H_L can be modified each iteration to
   70.19 -				avoid having to compute the end of H
   70.20 -				up front.
   70.21 -
   70.22 -  For case-insensitivity, you may optionally define:
   70.23 -     CMP_FUNC(p1, p2, l)	A macro that returns 0 iff the first L
   70.24 -				characters of P1 and P2 are equal.
   70.25 -     CANON_ELEMENT(c)		A macro that canonicalizes an element
   70.26 -				right after it has been fetched from
   70.27 -				one of the two strings.  The argument
   70.28 -				is an 'unsigned char'; the result must
   70.29 -				be an 'unsigned char' as well.
   70.30 -
   70.31 -  This file undefines the macros documented above, and defines
   70.32 -  LONG_NEEDLE_THRESHOLD.
   70.33 -*/
   70.34 -
   70.35 -#include <limits.h>
   70.36 -#include <stdint.h>
   70.37 -#include <_ansi.h>
   70.38 -
   70.39 -/* We use the Two-Way string matching algorithm, which guarantees
   70.40 -   linear complexity with constant space.  Additionally, for long
   70.41 -   needles, we also use a bad character shift table similar to the
   70.42 -   Boyer-Moore algorithm to achieve improved (potentially sub-linear)
   70.43 -   performance.
   70.44 -
   70.45 -   See http://www-igm.univ-mlv.fr/~lecroq/string/node26.html#SECTION00260
   70.46 -   and http://en.wikipedia.org/wiki/Boyer-Moore_string_search_algorithm
   70.47 -*/
   70.48 -
   70.49 -/* Point at which computing a bad-byte shift table is likely to be
   70.50 -   worthwhile.  Small needles should not compute a table, since it
   70.51 -   adds (1 << CHAR_BIT) + NEEDLE_LEN computations of preparation for a
   70.52 -   speedup no greater than a factor of NEEDLE_LEN.  The larger the
   70.53 -   needle, the better the potential performance gain.  On the other
   70.54 -   hand, on non-POSIX systems with CHAR_BIT larger than eight, the
   70.55 -   memory required for the table is prohibitive.  */
   70.56 -#if CHAR_BIT < 10
   70.57 -# define LONG_NEEDLE_THRESHOLD 32U
   70.58 -#else
   70.59 -# define LONG_NEEDLE_THRESHOLD SIZE_MAX
   70.60 -#endif
   70.61 -
   70.62 -#define MAX(a, b) ((a < b) ? (b) : (a))
   70.63 -
   70.64 -#ifndef CANON_ELEMENT
   70.65 -# define CANON_ELEMENT(c) c
   70.66 -#endif
   70.67 -#ifndef CMP_FUNC
   70.68 -# define CMP_FUNC memcmp
   70.69 -#endif
   70.70 -
   70.71 -/* Perform a critical factorization of NEEDLE, of length NEEDLE_LEN.
   70.72 -   Return the index of the first byte in the right half, and set
   70.73 -   *PERIOD to the global period of the right half.
   70.74 -
   70.75 -   The global period of a string is the smallest index (possibly its
   70.76 -   length) at which all remaining bytes in the string are repetitions
   70.77 -   of the prefix (the last repetition may be a subset of the prefix).
   70.78 -
   70.79 -   When NEEDLE is factored into two halves, a local period is the
   70.80 -   length of the smallest word that shares a suffix with the left half
   70.81 -   and shares a prefix with the right half.  All factorizations of a
   70.82 -   non-empty NEEDLE have a local period of at least 1 and no greater
   70.83 -   than NEEDLE_LEN.
   70.84 -
   70.85 -   A critical factorization has the property that the local period
   70.86 -   equals the global period.  All strings have at least one critical
   70.87 -   factorization with the left half smaller than the global period.
   70.88 -
   70.89 -   Given an ordered alphabet, a critical factorization can be computed
   70.90 -   in linear time, with 2 * NEEDLE_LEN comparisons, by computing the
   70.91 -   larger of two ordered maximal suffixes.  The ordered maximal
   70.92 -   suffixes are determined by lexicographic comparison of
   70.93 -   periodicity.  */
   70.94 -static size_t
   70.95 -critical_factorization (const unsigned char *needle, size_t needle_len,
   70.96 -			size_t *period)
   70.97 -{
   70.98 -  /* Index of last byte of left half, or SIZE_MAX.  */
   70.99 -  size_t max_suffix, max_suffix_rev;
  70.100 -  size_t j; /* Index into NEEDLE for current candidate suffix.  */
  70.101 -  size_t k; /* Offset into current period.  */
  70.102 -  size_t p; /* Intermediate period.  */
  70.103 -  unsigned char a, b; /* Current comparison bytes.  */
  70.104 -
  70.105 -  /* Invariants:
  70.106 -     0 <= j < NEEDLE_LEN - 1
  70.107 -     -1 <= max_suffix{,_rev} < j (treating SIZE_MAX as if it were signed)
  70.108 -     min(max_suffix, max_suffix_rev) < global period of NEEDLE
  70.109 -     1 <= p <= global period of NEEDLE
  70.110 -     p == global period of the substring NEEDLE[max_suffix{,_rev}+1...j]
  70.111 -     1 <= k <= p
  70.112 -  */
  70.113 -
  70.114 -  /* Perform lexicographic search.  */
  70.115 -  max_suffix = SIZE_MAX;
  70.116 -  j = 0;
  70.117 -  k = p = 1;
  70.118 -  while (j + k < needle_len)
  70.119 -    {
  70.120 -      a = CANON_ELEMENT (needle[j + k]);
  70.121 -      b = CANON_ELEMENT (needle[(size_t)(max_suffix + k)]);
  70.122 -      if (a < b)
  70.123 -	{
  70.124 -	  /* Suffix is smaller, period is entire prefix so far.  */
  70.125 -	  j += k;
  70.126 -	  k = 1;
  70.127 -	  p = j - max_suffix;
  70.128 -	}
  70.129 -      else if (a == b)
  70.130 -	{
  70.131 -	  /* Advance through repetition of the current period.  */
  70.132 -	  if (k != p)
  70.133 -	    ++k;
  70.134 -	  else
  70.135 -	    {
  70.136 -	      j += p;
  70.137 -	      k = 1;
  70.138 -	    }
  70.139 -	}
  70.140 -      else /* b < a */
  70.141 -	{
  70.142 -	  /* Suffix is larger, start over from current location.  */
  70.143 -	  max_suffix = j++;
  70.144 -	  k = p = 1;
  70.145 -	}
  70.146 -    }
  70.147 -  *period = p;
  70.148 -
  70.149 -  /* Perform reverse lexicographic search.  */
  70.150 -  max_suffix_rev = SIZE_MAX;
  70.151 -  j = 0;
  70.152 -  k = p = 1;
  70.153 -  while (j + k < needle_len)
  70.154 -    {
  70.155 -      a = CANON_ELEMENT (needle[j + k]);
  70.156 -      b = CANON_ELEMENT (needle[max_suffix_rev + k]);
  70.157 -      if (b < a)
  70.158 -	{
  70.159 -	  /* Suffix is smaller, period is entire prefix so far.  */
  70.160 -	  j += k;
  70.161 -	  k = 1;
  70.162 -	  p = j - max_suffix_rev;
  70.163 -	}
  70.164 -      else if (a == b)
  70.165 -	{
  70.166 -	  /* Advance through repetition of the current period.  */
  70.167 -	  if (k != p)
  70.168 -	    ++k;
  70.169 -	  else
  70.170 -	    {
  70.171 -	      j += p;
  70.172 -	      k = 1;
  70.173 -	    }
  70.174 -	}
  70.175 -      else /* a < b */
  70.176 -	{
  70.177 -	  /* Suffix is larger, start over from current location.  */
  70.178 -	  max_suffix_rev = j++;
  70.179 -	  k = p = 1;
  70.180 -	}
  70.181 -    }
  70.182 -
  70.183 -  /* Choose the longer suffix.  Return the first byte of the right
  70.184 -     half, rather than the last byte of the left half.  */
  70.185 -  if (max_suffix_rev + 1 < max_suffix + 1)
  70.186 -    return max_suffix + 1;
  70.187 -  *period = p;
  70.188 -  return max_suffix_rev + 1;
  70.189 -}
  70.190 -
  70.191 -/* Return the first location of non-empty NEEDLE within HAYSTACK, or
  70.192 -   NULL.  HAYSTACK_LEN is the minimum known length of HAYSTACK.  This
  70.193 -   method is optimized for NEEDLE_LEN < LONG_NEEDLE_THRESHOLD.
  70.194 -   Performance is guaranteed to be linear, with an initialization cost
  70.195 -   of 2 * NEEDLE_LEN comparisons.
  70.196 -
  70.197 -   If AVAILABLE does not modify HAYSTACK_LEN (as in memmem), then at
  70.198 -   most 2 * HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching.
  70.199 -   If AVAILABLE modifies HAYSTACK_LEN (as in strstr), then at most 3 *
  70.200 -   HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching.  */
  70.201 -static RETURN_TYPE
  70.202 -two_way_short_needle (const unsigned char *haystack, size_t haystack_len,
  70.203 -		      const unsigned char *needle, size_t needle_len)
  70.204 -{
  70.205 -  size_t i; /* Index into current byte of NEEDLE.  */
  70.206 -  size_t j; /* Index into current window of HAYSTACK.  */
  70.207 -  size_t period; /* The period of the right half of needle.  */
  70.208 -  size_t suffix; /* The index of the right half of needle.  */
  70.209 -
  70.210 -  /* Factor the needle into two halves, such that the left half is
  70.211 -     smaller than the global period, and the right half is
  70.212 -     periodic (with a period as large as NEEDLE_LEN - suffix).  */
  70.213 -  suffix = critical_factorization (needle, needle_len, &period);
  70.214 -
  70.215 -  /* Perform the search.  Each iteration compares the right half
  70.216 -     first.  */
  70.217 -  if (CMP_FUNC (needle, needle + period, suffix) == 0)
  70.218 -    {
  70.219 -      /* Entire needle is periodic; a mismatch can only advance by the
  70.220 -	 period, so use memory to avoid rescanning known occurrences
  70.221 -	 of the period.  */
  70.222 -      size_t memory = 0;
  70.223 -      j = 0;
  70.224 -      while (AVAILABLE (haystack, haystack_len, j, needle_len))
  70.225 -	{
  70.226 -	  /* Scan for matches in right half.  */
  70.227 -	  i = MAX (suffix, memory);
  70.228 -	  while (i < needle_len && (CANON_ELEMENT (needle[i])
  70.229 -				    == CANON_ELEMENT (haystack[i + j])))
  70.230 -	    ++i;
  70.231 -	  if (needle_len <= i)
  70.232 -	    {
  70.233 -	      /* Scan for matches in left half.  */
  70.234 -	      i = suffix - 1;
  70.235 -	      while (memory < i + 1 && (CANON_ELEMENT (needle[i])
  70.236 -					== CANON_ELEMENT (haystack[i + j])))
  70.237 -		--i;
  70.238 -	      if (i + 1 < memory + 1)
  70.239 -		return (RETURN_TYPE) (haystack + j);
  70.240 -	      /* No match, so remember how many repetitions of period
  70.241 -		 on the right half were scanned.  */
  70.242 -	      j += period;
  70.243 -	      memory = needle_len - period;
  70.244 -	    }
  70.245 -	  else
  70.246 -	    {
  70.247 -	      j += i - suffix + 1;
  70.248 -	      memory = 0;
  70.249 -	    }
  70.250 -	}
  70.251 -    }
  70.252 -  else
  70.253 -    {
  70.254 -      /* The two halves of needle are distinct; no extra memory is
  70.255 -	 required, and any mismatch results in a maximal shift.  */
  70.256 -      period = MAX (suffix, needle_len - suffix) + 1;
  70.257 -      j = 0;
  70.258 -      while (AVAILABLE (haystack, haystack_len, j, needle_len))
  70.259 -	{
  70.260 -	  /* Scan for matches in right half.  */
  70.261 -	  i = suffix;
  70.262 -	  while (i < needle_len && (CANON_ELEMENT (needle[i])
  70.263 -				    == CANON_ELEMENT (haystack[i + j])))
  70.264 -	    ++i;
  70.265 -	  if (needle_len <= i)
  70.266 -	    {
  70.267 -	      /* Scan for matches in left half.  */
  70.268 -	      i = suffix - 1;
  70.269 -	      while (i != SIZE_MAX && (CANON_ELEMENT (needle[i])
  70.270 -				       == CANON_ELEMENT (haystack[i + j])))
  70.271 -		--i;
  70.272 -	      if (i == SIZE_MAX)
  70.273 -		return (RETURN_TYPE) (haystack + j);
  70.274 -	      j += period;
  70.275 -	    }
  70.276 -	  else
  70.277 -	    j += i - suffix + 1;
  70.278 -	}
  70.279 -    }
  70.280 -  return NULL;
  70.281 -}
  70.282 -
  70.283 -/* Return the first location of non-empty NEEDLE within HAYSTACK, or
  70.284 -   NULL.  HAYSTACK_LEN is the minimum known length of HAYSTACK.  This
  70.285 -   method is optimized for LONG_NEEDLE_THRESHOLD <= NEEDLE_LEN.
  70.286 -   Performance is guaranteed to be linear, with an initialization cost
  70.287 -   of 3 * NEEDLE_LEN + (1 << CHAR_BIT) operations.
  70.288 -
  70.289 -   If AVAILABLE does not modify HAYSTACK_LEN (as in memmem), then at
  70.290 -   most 2 * HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching,
  70.291 -   and sublinear performance O(HAYSTACK_LEN / NEEDLE_LEN) is possible.
  70.292 -   If AVAILABLE modifies HAYSTACK_LEN (as in strstr), then at most 3 *
  70.293 -   HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching, and
  70.294 -   sublinear performance is not possible.  */
  70.295 -_NOINLINE_STATIC RETURN_TYPE
  70.296 -two_way_long_needle (const unsigned char *haystack, size_t haystack_len,
  70.297 -		     const unsigned char *needle, size_t needle_len)
  70.298 -{
  70.299 -  size_t i; /* Index into current byte of NEEDLE.  */
  70.300 -  size_t j; /* Index into current window of HAYSTACK.  */
  70.301 -  size_t period; /* The period of the right half of needle.  */
  70.302 -  size_t suffix; /* The index of the right half of needle.  */
  70.303 -  size_t shift_table[1U << CHAR_BIT]; /* See below.  */
  70.304 -
  70.305 -  /* Factor the needle into two halves, such that the left half is
  70.306 -     smaller than the global period, and the right half is
  70.307 -     periodic (with a period as large as NEEDLE_LEN - suffix).  */
  70.308 -  suffix = critical_factorization (needle, needle_len, &period);
  70.309 -
  70.310 -  /* Populate shift_table.  For each possible byte value c,
  70.311 -     shift_table[c] is the distance from the last occurrence of c to
  70.312 -     the end of NEEDLE, or NEEDLE_LEN if c is absent from the NEEDLE.
  70.313 -     shift_table[NEEDLE[NEEDLE_LEN - 1]] contains the only 0.  */
  70.314 -  for (i = 0; i < 1U << CHAR_BIT; i++)
  70.315 -    shift_table[i] = needle_len;
  70.316 -  for (i = 0; i < needle_len; i++)
  70.317 -    shift_table[CANON_ELEMENT (needle[i])] = needle_len - i - 1;
  70.318 -
  70.319 -  /* Perform the search.  Each iteration compares the right half
  70.320 -     first.  */
  70.321 -  if (CMP_FUNC (needle, needle + period, suffix) == 0)
  70.322 -    {
  70.323 -      /* Entire needle is periodic; a mismatch can only advance by the
  70.324 -	 period, so use memory to avoid rescanning known occurrences
  70.325 -	 of the period.  */
  70.326 -      size_t memory = 0;
  70.327 -      size_t shift;
  70.328 -      j = 0;
  70.329 -      while (AVAILABLE (haystack, haystack_len, j, needle_len))
  70.330 -	{
  70.331 -	  /* Check the last byte first; if it does not match, then
  70.332 -	     shift to the next possible match location.  */
  70.333 -	  shift = shift_table[CANON_ELEMENT (haystack[j + needle_len - 1])];
  70.334 -	  if (0 < shift)
  70.335 -	    {
  70.336 -	      if (memory && shift < period)
  70.337 -		{
  70.338 -		  /* Since needle is periodic, but the last period has
  70.339 -		     a byte out of place, there can be no match until
  70.340 -		     after the mismatch.  */
  70.341 -		  shift = needle_len - period;
  70.342 -		}
  70.343 -	      memory = 0;
  70.344 -	      j += shift;
  70.345 -	      continue;
  70.346 -	    }
  70.347 -	  /* Scan for matches in right half.  The last byte has
  70.348 -	     already been matched, by virtue of the shift table.  */
  70.349 -	  i = MAX (suffix, memory);
  70.350 -	  while (i < needle_len - 1 && (CANON_ELEMENT (needle[i])
  70.351 -					== CANON_ELEMENT (haystack[i + j])))
  70.352 -	    ++i;
  70.353 -	  if (needle_len - 1 <= i)
  70.354 -	    {
  70.355 -	      /* Scan for matches in left half.  */
  70.356 -	      i = suffix - 1;
  70.357 -	      while (memory < i + 1 && (CANON_ELEMENT (needle[i])
  70.358 -					== CANON_ELEMENT (haystack[i + j])))
  70.359 -		--i;
  70.360 -	      if (i + 1 < memory + 1)
  70.361 -		return (RETURN_TYPE) (haystack + j);
  70.362 -	      /* No match, so remember how many repetitions of period
  70.363 -		 on the right half were scanned.  */
  70.364 -	      j += period;
  70.365 -	      memory = needle_len - period;
  70.366 -	    }
  70.367 -	  else
  70.368 -	    {
  70.369 -	      j += i - suffix + 1;
  70.370 -	      memory = 0;
  70.371 -	    }
  70.372 -	}
  70.373 -    }
  70.374 -  else
  70.375 -    {
  70.376 -      /* The two halves of needle are distinct; no extra memory is
  70.377 -	 required, and any mismatch results in a maximal shift.  */
  70.378 -      size_t shift;
  70.379 -      period = MAX (suffix, needle_len - suffix) + 1;
  70.380 -      j = 0;
  70.381 -      while (AVAILABLE (haystack, haystack_len, j, needle_len))
  70.382 -	{
  70.383 -	  /* Check the last byte first; if it does not match, then
  70.384 -	     shift to the next possible match location.  */
  70.385 -	  shift = shift_table[CANON_ELEMENT (haystack[j + needle_len - 1])];
  70.386 -	  if (0 < shift)
  70.387 -	    {
  70.388 -	      j += shift;
  70.389 -	      continue;
  70.390 -	    }
  70.391 -	  /* Scan for matches in right half.  The last byte has
  70.392 -	     already been matched, by virtue of the shift table.  */
  70.393 -	  i = suffix;
  70.394 -	  while (i < needle_len - 1 && (CANON_ELEMENT (needle[i])
  70.395 -					== CANON_ELEMENT (haystack[i + j])))
  70.396 -	    ++i;
  70.397 -	  if (needle_len - 1 <= i)
  70.398 -	    {
  70.399 -	      /* Scan for matches in left half.  */
  70.400 -	      i = suffix - 1;
  70.401 -	      while (i != SIZE_MAX && (CANON_ELEMENT (needle[i])
  70.402 -				       == CANON_ELEMENT (haystack[i + j])))
  70.403 -		--i;
  70.404 -	      if (i == SIZE_MAX)
  70.405 -		return (RETURN_TYPE) (haystack + j);
  70.406 -	      j += period;
  70.407 -	    }
  70.408 -	  else
  70.409 -	    j += i - suffix + 1;
  70.410 -	}
  70.411 -    }
  70.412 -  return NULL;
  70.413 -}
  70.414 -
  70.415 -#undef AVAILABLE
  70.416 -#undef CANON_ELEMENT
  70.417 -#undef CMP_FUNC
  70.418 -#undef MAX
  70.419 -#undef RETURN_TYPE
    71.1 --- a/libc/string/strcasecmp.c	Sat Dec 07 00:44:56 2019 +0100
    71.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    71.3 @@ -1,51 +0,0 @@
    71.4 -/*
    71.5 -FUNCTION
    71.6 -	<<strcasecmp>>---case-insensitive character string compare
    71.7 -	
    71.8 -INDEX
    71.9 -	strcasecmp
   71.10 -
   71.11 -SYNOPSIS
   71.12 -	#include <strings.h>
   71.13 -	int strcasecmp(const char *<[a]>, const char *<[b]>);
   71.14 -
   71.15 -DESCRIPTION
   71.16 -	<<strcasecmp>> compares the string at <[a]> to
   71.17 -	the string at <[b]> in a case-insensitive manner.
   71.18 -
   71.19 -RETURNS 
   71.20 -
   71.21 -	If <<*<[a]>>> sorts lexicographically after <<*<[b]>>> (after
   71.22 -	both are converted to lowercase), <<strcasecmp>> returns a
   71.23 -	number greater than zero.  If the two strings match,
   71.24 -	<<strcasecmp>> returns zero.  If <<*<[a]>>> sorts
   71.25 -	lexicographically before <<*<[b]>>>, <<strcasecmp>> returns a
   71.26 -	number less than zero.
   71.27 -
   71.28 -PORTABILITY
   71.29 -<<strcasecmp>> is in the Berkeley Software Distribution.
   71.30 -
   71.31 -<<strcasecmp>> requires no supporting OS subroutines. It uses
   71.32 -tolower() from elsewhere in this library.
   71.33 -
   71.34 -QUICKREF
   71.35 -	strcasecmp
   71.36 -*/
   71.37 -
   71.38 -#include <strings.h>
   71.39 -#include <ctype.h>
   71.40 -
   71.41 -int
   71.42 -strcasecmp (const char *s1,
   71.43 -	const char *s2)
   71.44 -{
   71.45 -  int d = 0;
   71.46 -  for ( ; ; )
   71.47 -    {
   71.48 -      const int c1 = tolower(*s1++);
   71.49 -      const int c2 = tolower(*s2++);
   71.50 -      if (((d = c1 - c2) != 0) || (c2 == '\0'))
   71.51 -        break;
   71.52 -    }
   71.53 -  return d;
   71.54 -}
    72.1 --- a/libc/string/strcasecmp_l.c	Sat Dec 07 00:44:56 2019 +0100
    72.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    72.3 @@ -1,54 +0,0 @@
    72.4 -/*
    72.5 -FUNCTION
    72.6 -	<<strcasecmp_l>>---case-insensitive character string compare
    72.7 -	
    72.8 -INDEX
    72.9 -	strcasecmp_l
   72.10 -
   72.11 -SYNOPSIS
   72.12 -	#include <strings.h>
   72.13 -	int strcasecmp_l(const char *<[a]>, const char *<[b]>,
   72.14 -			 locale_t <[locale]>);
   72.15 -
   72.16 -DESCRIPTION
   72.17 -	<<strcasecmp_l>> compares the string at <[a]> to
   72.18 -	the string at <[b]> in a case-insensitive manner.
   72.19 -
   72.20 -	if <[locale]> is LC_GLOBAL_LOCALE or not a valid locale object, the
   72.21 -	behaviour is undefined.
   72.22 -
   72.23 -RETURNS 
   72.24 -
   72.25 -	If <<*<[a]>>> sorts lexicographically after <<*<[b]>>> (after
   72.26 -	both are converted to lowercase), <<strcasecmp_l>> returns a
   72.27 -	number greater than zero.  If the two strings match,
   72.28 -	<<strcasecmp_l>> returns zero.  If <<*<[a]>>> sorts
   72.29 -	lexicographically before <<*<[b]>>>, <<strcasecmp_l>> returns a
   72.30 -	number less than zero.
   72.31 -
   72.32 -PORTABILITY
   72.33 -<<strcasecmp_l>> is POSIX-1.2008.
   72.34 -
   72.35 -<<strcasecmp_l>> requires no supporting OS subroutines. It uses
   72.36 -tolower_l() from elsewhere in this library.
   72.37 -
   72.38 -QUICKREF
   72.39 -	strcasecmp_l
   72.40 -*/
   72.41 -
   72.42 -#include <strings.h>
   72.43 -#include <ctype.h>
   72.44 -
   72.45 -int
   72.46 -strcasecmp_l (const char *s1, const char *s2, struct __locale_t *locale)
   72.47 -{
   72.48 -  int d = 0;
   72.49 -  for ( ; ; )
   72.50 -    {
   72.51 -      const int c1 = tolower_l (*s1++, locale);
   72.52 -      const int c2 = tolower_l (*s2++, locale);
   72.53 -      if (((d = c1 - c2) != 0) || (c2 == '\0'))
   72.54 -        break;
   72.55 -    }
   72.56 -  return d;
   72.57 -}
    73.1 --- a/libc/string/strcasestr.c	Sat Dec 07 00:44:56 2019 +0100
    73.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    73.3 @@ -1,146 +0,0 @@
    73.4 -/*
    73.5 -FUNCTION
    73.6 -	<<strcasestr>>---case-insensitive character string search
    73.7 -
    73.8 -INDEX
    73.9 -	strcasestr
   73.10 -
   73.11 -SYNOPSIS
   73.12 -	#include <string.h>
   73.13 -	char *strcasestr(const char *<[s]>, const char *<[find]>);
   73.14 -
   73.15 -DESCRIPTION
   73.16 -	<<strcasestr>> searchs the string <[s]> for
   73.17 -	the first occurrence of the sequence <[find]>.  <<strcasestr>>
   73.18 -	is identical to <<strstr>> except the search is
   73.19 -	case-insensitive.
   73.20 -
   73.21 -RETURNS
   73.22 -
   73.23 -	A pointer to the first case-insensitive occurrence of the sequence
   73.24 -	<[find]> or <<NULL>> if no match was found.
   73.25 -
   73.26 -PORTABILITY
   73.27 -<<strcasestr>> is in the Berkeley Software Distribution.
   73.28 -
   73.29 -<<strcasestr>> requires no supporting OS subroutines. It uses
   73.30 -tolower() from elsewhere in this library.
   73.31 -
   73.32 -QUICKREF
   73.33 -	strcasestr
   73.34 -*/
   73.35 -
   73.36 -/*-
   73.37 - * Copyright (c) 1990, 1993
   73.38 - *	The Regents of the University of California.  All rights reserved.
   73.39 - *
   73.40 - * The quadratic code is derived from software contributed to Berkeley by
   73.41 - * Chris Torek.
   73.42 - *
   73.43 - * Redistribution and use in source and binary forms, with or without
   73.44 - * modification, are permitted provided that the following conditions
   73.45 - * are met:
   73.46 - * 1. Redistributions of source code must retain the above copyright
   73.47 - *    notice, this list of conditions and the following disclaimer.
   73.48 - * 2. Redistributions in binary form must reproduce the above copyright
   73.49 - *    notice, this list of conditions and the following disclaimer in the
   73.50 - *    documentation and/or other materials provided with the distribution.
   73.51 - * 4. Neither the name of the University nor the names of its contributors
   73.52 - *    may be used to endorse or promote products derived from this software
   73.53 - *    without specific prior written permission.
   73.54 - *
   73.55 - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   73.56 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   73.57 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   73.58 - * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   73.59 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   73.60 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   73.61 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   73.62 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   73.63 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   73.64 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   73.65 - * SUCH DAMAGE.
   73.66 - */
   73.67 -/* Linear algorithm Copyright (C) 2008 Eric Blake
   73.68 - * Permission to use, copy, modify, and distribute the linear portion of
   73.69 - * software is freely granted, provided that this notice is preserved.
   73.70 - */
   73.71 -
   73.72 -#include <sys/cdefs.h>
   73.73 -
   73.74 -#include <ctype.h>
   73.75 -#include <string.h>
   73.76 -#include <strings.h>
   73.77 -
   73.78 -#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__)
   73.79 -# define RETURN_TYPE char *
   73.80 -# define AVAILABLE(h, h_l, j, n_l)			\
   73.81 -  (!memchr ((h) + (h_l), '\0', (j) + (n_l) - (h_l))	\
   73.82 -   && ((h_l) = (j) + (n_l)))
   73.83 -# define CANON_ELEMENT(c) tolower (c)
   73.84 -#if __GNUC_PREREQ (4, 2)
   73.85 -/* strncasecmp uses signed char, CMP_FUNC is expected to use unsigned char. */
   73.86 -#pragma GCC diagnostic ignored "-Wpointer-sign"
   73.87 -#endif
   73.88 -# define CMP_FUNC strncasecmp
   73.89 -# include "str-two-way.h"
   73.90 -#endif
   73.91 -
   73.92 -/*
   73.93 - * Find the first occurrence of find in s, ignore case.
   73.94 - */
   73.95 -char *
   73.96 -strcasestr (const char *s,
   73.97 -	const char *find)
   73.98 -{
   73.99 -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
  73.100 -
  73.101 -  /* Less code size, but quadratic performance in the worst case.  */
  73.102 -	char c, sc;
  73.103 -	size_t len;
  73.104 -
  73.105 -	if ((c = *find++) != 0) {
  73.106 -		c = tolower((unsigned char)c);
  73.107 -		len = strlen(find);
  73.108 -		do {
  73.109 -			do {
  73.110 -				if ((sc = *s++) == 0)
  73.111 -					return (NULL);
  73.112 -			} while ((char)tolower((unsigned char)sc) != c);
  73.113 -		} while (strncasecmp(s, find, len) != 0);
  73.114 -		s--;
  73.115 -	}
  73.116 -	return ((char *)s);
  73.117 -
  73.118 -#else /* compilation for speed */
  73.119 -
  73.120 -  /* Larger code size, but guaranteed linear performance.  */
  73.121 -  const char *haystack = s;
  73.122 -  const char *needle = find;
  73.123 -  size_t needle_len; /* Length of NEEDLE.  */
  73.124 -  size_t haystack_len; /* Known minimum length of HAYSTACK.  */
  73.125 -  int ok = 1; /* True if NEEDLE is prefix of HAYSTACK.  */
  73.126 -
  73.127 -  /* Determine length of NEEDLE, and in the process, make sure
  73.128 -     HAYSTACK is at least as long (no point processing all of a long
  73.129 -     NEEDLE if HAYSTACK is too short).  */
  73.130 -  while (*haystack && *needle)
  73.131 -    ok &= (tolower ((unsigned char) *haystack++)
  73.132 -	   == tolower ((unsigned char) *needle++));
  73.133 -  if (*needle)
  73.134 -    return NULL;
  73.135 -  if (ok)
  73.136 -    return (char *) s;
  73.137 -  needle_len = needle - find;
  73.138 -  haystack = s + 1;
  73.139 -  haystack_len = needle_len - 1;
  73.140 -
  73.141 -  /* Perform the search.  */
  73.142 -  if (needle_len < LONG_NEEDLE_THRESHOLD)
  73.143 -    return two_way_short_needle ((const unsigned char *) haystack,
  73.144 -				 haystack_len,
  73.145 -				 (const unsigned char *) find, needle_len);
  73.146 -  return two_way_long_needle ((const unsigned char *) haystack, haystack_len,
  73.147 -			      (const unsigned char *) find, needle_len);
  73.148 -#endif /* compilation for speed */
  73.149 -}
    74.1 --- a/libc/string/strcat.c	Sat Dec 07 00:44:56 2019 +0100
    74.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    74.3 @@ -1,97 +0,0 @@
    74.4 -/*
    74.5 -FUNCTION
    74.6 -	<<strcat>>---concatenate strings
    74.7 -
    74.8 -INDEX
    74.9 -	strcat
   74.10 -
   74.11 -SYNOPSIS
   74.12 -	#include <string.h>
   74.13 -	char *strcat(char *restrict <[dst]>, const char *restrict <[src]>);
   74.14 -
   74.15 -DESCRIPTION
   74.16 -	<<strcat>> appends a copy of the string pointed to by <[src]>
   74.17 -	(including the terminating null character) to the end of the
   74.18 -	string pointed to by <[dst]>.  The initial character of
   74.19 -	<[src]> overwrites the null character at the end of <[dst]>.
   74.20 -
   74.21 -RETURNS
   74.22 -	This function returns the initial value of <[dst]>
   74.23 -
   74.24 -PORTABILITY
   74.25 -<<strcat>> is ANSI C.
   74.26 -
   74.27 -<<strcat>> requires no supporting OS subroutines.
   74.28 -
   74.29 -QUICKREF
   74.30 -	strcat ansi pure
   74.31 -*/
   74.32 -
   74.33 -#include <string.h>
   74.34 -#include <limits.h>
   74.35 -
   74.36 -/* Nonzero if X is aligned on a "long" boundary.  */
   74.37 -#define ALIGNED(X) \
   74.38 -  (((long)X & (sizeof (long) - 1)) == 0)
   74.39 -
   74.40 -#if LONG_MAX == 2147483647L
   74.41 -#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
   74.42 -#else
   74.43 -#if LONG_MAX == 9223372036854775807L
   74.44 -/* Nonzero if X (a long int) contains a NULL byte. */
   74.45 -#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
   74.46 -#else
   74.47 -#error long int is not a 32bit or 64bit type.
   74.48 -#endif
   74.49 -#endif
   74.50 -
   74.51 -#ifndef DETECTNULL
   74.52 -#error long int is not a 32bit or 64bit byte
   74.53 -#endif
   74.54 -
   74.55 -
   74.56 -/*SUPPRESS 560*/
   74.57 -/*SUPPRESS 530*/
   74.58 -
   74.59 -char *
   74.60 -strcat (char *__restrict s1,
   74.61 -	const char *__restrict s2)
   74.62 -{
   74.63 -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
   74.64 -  char *s = s1;
   74.65 -
   74.66 -  while (*s1)
   74.67 -    s1++;
   74.68 -
   74.69 -  while (*s1++ = *s2++)
   74.70 -    ;
   74.71 -  return s;
   74.72 -#else
   74.73 -  char *s = s1;
   74.74 -
   74.75 -
   74.76 -  /* Skip over the data in s1 as quickly as possible.  */
   74.77 -  if (ALIGNED (s1))
   74.78 -    {
   74.79 -      unsigned long *aligned_s1 = (unsigned long *)s1;
   74.80 -      while (!DETECTNULL (*aligned_s1))
   74.81 -	aligned_s1++;
   74.82 -
   74.83 -      s1 = (char *)aligned_s1;
   74.84 -    }
   74.85 -
   74.86 -  while (*s1)
   74.87 -    s1++;
   74.88 -
   74.89 -  /* s1 now points to the its trailing null character, we can
   74.90 -     just use strcpy to do the work for us now.
   74.91 -
   74.92 -     ?!? We might want to just include strcpy here.
   74.93 -     Also, this will cause many more unaligned string copies because
   74.94 -     s1 is much less likely to be aligned.  I don't know if its worth
   74.95 -     tweaking strcpy to handle this better.  */
   74.96 -  strcpy (s1, s2);
   74.97 -	
   74.98 -  return s;
   74.99 -#endif /* not PREFER_SIZE_OVER_SPEED */
  74.100 -}
    75.1 --- a/libc/string/strchr.c	Sat Dec 07 00:44:56 2019 +0100
    75.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    75.3 @@ -1,116 +0,0 @@
    75.4 -/*
    75.5 -FUNCTION
    75.6 -	<<strchr>>---search for character in string
    75.7 -
    75.8 -INDEX
    75.9 -	strchr
   75.10 -
   75.11 -SYNOPSIS
   75.12 -	#include <string.h>
   75.13 -	char * strchr(const char *<[string]>, int <[c]>);
   75.14 -
   75.15 -DESCRIPTION
   75.16 -	This function finds the first occurence of <[c]> (converted to
   75.17 -	a char) in the string pointed to by <[string]> (including the
   75.18 -	terminating null character).
   75.19 -
   75.20 -RETURNS
   75.21 -	Returns a pointer to the located character, or a null pointer
   75.22 -	if <[c]> does not occur in <[string]>.
   75.23 -
   75.24 -PORTABILITY
   75.25 -<<strchr>> is ANSI C.
   75.26 -
   75.27 -<<strchr>> requires no supporting OS subroutines.
   75.28 -
   75.29 -QUICKREF
   75.30 -	strchr ansi pure
   75.31 -*/
   75.32 -
   75.33 -#include <string.h>
   75.34 -#include <limits.h>
   75.35 -
   75.36 -/* Nonzero if X is not aligned on a "long" boundary.  */
   75.37 -#define UNALIGNED(X) ((long)X & (sizeof (long) - 1))
   75.38 -
   75.39 -/* How many bytes are loaded each iteration of the word copy loop.  */
   75.40 -#define LBLOCKSIZE (sizeof (long))
   75.41 -
   75.42 -#if LONG_MAX == 2147483647L
   75.43 -#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
   75.44 -#else
   75.45 -#if LONG_MAX == 9223372036854775807L
   75.46 -/* Nonzero if X (a long int) contains a NULL byte. */
   75.47 -#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
   75.48 -#else
   75.49 -#error long int is not a 32bit or 64bit type.
   75.50 -#endif
   75.51 -#endif
   75.52 -
   75.53 -/* DETECTCHAR returns nonzero if (long)X contains the byte used
   75.54 -   to fill (long)MASK. */
   75.55 -#define DETECTCHAR(X,MASK) (DETECTNULL(X ^ MASK))
   75.56 -
   75.57 -char *
   75.58 -strchr (const char *s1,
   75.59 -	int i)
   75.60 -{
   75.61 -  const unsigned char *s = (const unsigned char *)s1;
   75.62 -  unsigned char c = i;
   75.63 -
   75.64 -#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__)
   75.65 -  unsigned long mask,j;
   75.66 -  unsigned long *aligned_addr;
   75.67 -
   75.68 -  /* Special case for finding 0.  */
   75.69 -  if (!c)
   75.70 -    {
   75.71 -      while (UNALIGNED (s))
   75.72 -        {
   75.73 -          if (!*s)
   75.74 -            return (char *) s;
   75.75 -          s++;
   75.76 -        }
   75.77 -      /* Operate a word at a time.  */
   75.78 -      aligned_addr = (unsigned long *) s;
   75.79 -      while (!DETECTNULL (*aligned_addr))
   75.80 -        aligned_addr++;
   75.81 -      /* Found the end of string.  */
   75.82 -      s = (const unsigned char *) aligned_addr;
   75.83 -      while (*s)
   75.84 -        s++;
   75.85 -      return (char *) s;
   75.86 -    }
   75.87 -
   75.88 -  /* All other bytes.  Align the pointer, then search a long at a time.  */
   75.89 -  while (UNALIGNED (s))
   75.90 -    {
   75.91 -      if (!*s)
   75.92 -        return NULL;
   75.93 -      if (*s == c)
   75.94 -        return (char *) s;
   75.95 -      s++;
   75.96 -    }
   75.97 -
   75.98 -  mask = c;
   75.99 -  for (j = 8; j < LBLOCKSIZE * 8; j <<= 1)
  75.100 -    mask = (mask << j) | mask;
  75.101 -
  75.102 -  aligned_addr = (unsigned long *) s;
  75.103 -  while (!DETECTNULL (*aligned_addr) && !DETECTCHAR (*aligned_addr, mask))
  75.104 -    aligned_addr++;
  75.105 -
  75.106 -  /* The block of bytes currently pointed to by aligned_addr
  75.107 -     contains either a null or the target char, or both.  We
  75.108 -     catch it using the bytewise search.  */
  75.109 -
  75.110 -  s = (unsigned char *) aligned_addr;
  75.111 -
  75.112 -#endif /* not PREFER_SIZE_OVER_SPEED */
  75.113 -
  75.114 -  while (*s && *s != c)
  75.115 -    s++;
  75.116 -  if (*s == c)
  75.117 -    return (char *)s;
  75.118 -  return NULL;
  75.119 -}
    76.1 --- a/libc/string/strchrnul.c	Sat Dec 07 00:44:56 2019 +0100
    76.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    76.3 @@ -1,40 +0,0 @@
    76.4 -/*
    76.5 -FUNCTION
    76.6 -	<<strchrnul>>---search for character in string
    76.7 -
    76.8 -INDEX
    76.9 -	strchrnul
   76.10 -
   76.11 -SYNOPSIS
   76.12 -	#include <string.h>
   76.13 -	char * strchrnul(const char *<[string]>, int <[c]>);
   76.14 -
   76.15 -DESCRIPTION
   76.16 -	This function finds the first occurence of <[c]> (converted to
   76.17 -	a char) in the string pointed to by <[string]> (including the
   76.18 -	terminating null character).
   76.19 -
   76.20 -RETURNS
   76.21 -	Returns a pointer to the located character, or a pointer
   76.22 -	to the concluding null byte if <[c]> does not occur in <[string]>.
   76.23 -
   76.24 -PORTABILITY
   76.25 -<<strchrnul>> is a GNU extension.
   76.26 -
   76.27 -<<strchrnul>> requires no supporting OS subroutines.  It uses
   76.28 -strchr() and strlen() from elsewhere in this library.
   76.29 -
   76.30 -QUICKREF
   76.31 -	strchrnul
   76.32 -*/
   76.33 -
   76.34 -#include <string.h>
   76.35 -
   76.36 -char *
   76.37 -strchrnul (const char *s1,
   76.38 -	int i)
   76.39 -{
   76.40 -  char *s = strchr(s1, i);
   76.41 -
   76.42 -  return s ? s : (char *)s1 + strlen(s1);
   76.43 -}
    77.1 --- a/libc/string/strcmp.c	Sat Dec 07 00:44:56 2019 +0100
    77.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    77.3 @@ -1,99 +0,0 @@
    77.4 -/*
    77.5 -FUNCTION
    77.6 -	<<strcmp>>---character string compare
    77.7 -	
    77.8 -INDEX
    77.9 -	strcmp
   77.10 -
   77.11 -SYNOPSIS
   77.12 -	#include <string.h>
   77.13 -	int strcmp(const char *<[a]>, const char *<[b]>);
   77.14 -
   77.15 -DESCRIPTION
   77.16 -	<<strcmp>> compares the string at <[a]> to
   77.17 -	the string at <[b]>.
   77.18 -
   77.19 -RETURNS
   77.20 -	If <<*<[a]>>> sorts lexicographically after <<*<[b]>>>,
   77.21 -	<<strcmp>> returns a number greater than zero.  If the two
   77.22 -	strings match, <<strcmp>> returns zero.  If <<*<[a]>>>
   77.23 -	sorts lexicographically before <<*<[b]>>>, <<strcmp>> returns a
   77.24 -	number less than zero.
   77.25 -
   77.26 -PORTABILITY
   77.27 -<<strcmp>> is ANSI C.
   77.28 -
   77.29 -<<strcmp>> requires no supporting OS subroutines.
   77.30 -
   77.31 -QUICKREF
   77.32 -	strcmp ansi pure
   77.33 -*/
   77.34 -
   77.35 -#include <string.h>
   77.36 -#include <limits.h>
   77.37 -
   77.38 -/* Nonzero if either X or Y is not aligned on a "long" boundary.  */
   77.39 -#define UNALIGNED(X, Y) \
   77.40 -  (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
   77.41 -
   77.42 -/* DETECTNULL returns nonzero if (long)X contains a NULL byte. */
   77.43 -#if LONG_MAX == 2147483647L
   77.44 -#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
   77.45 -#else
   77.46 -#if LONG_MAX == 9223372036854775807L
   77.47 -#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
   77.48 -#else
   77.49 -#error long int is not a 32bit or 64bit type.
   77.50 -#endif
   77.51 -#endif
   77.52 -
   77.53 -#ifndef DETECTNULL
   77.54 -#error long int is not a 32bit or 64bit byte
   77.55 -#endif
   77.56 -
   77.57 -int
   77.58 -strcmp (const char *s1,
   77.59 -	const char *s2)
   77.60 -{ 
   77.61 -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
   77.62 -  while (*s1 != '\0' && *s1 == *s2)
   77.63 -    {
   77.64 -      s1++;
   77.65 -      s2++;
   77.66 -    }
   77.67 -
   77.68 -  return (*(unsigned char *) s1) - (*(unsigned char *) s2);
   77.69 -#else
   77.70 -  unsigned long *a1;
   77.71 -  unsigned long *a2;
   77.72 -
   77.73 -  /* If s1 or s2 are unaligned, then compare bytes. */
   77.74 -  if (!UNALIGNED (s1, s2))
   77.75 -    {  
   77.76 -      /* If s1 and s2 are word-aligned, compare them a word at a time. */
   77.77 -      a1 = (unsigned long*)s1;
   77.78 -      a2 = (unsigned long*)s2;
   77.79 -      while (*a1 == *a2)
   77.80 -        {
   77.81 -          /* To get here, *a1 == *a2, thus if we find a null in *a1,
   77.82 -	     then the strings must be equal, so return zero.  */
   77.83 -          if (DETECTNULL (*a1))
   77.84 -	    return 0;
   77.85 -
   77.86 -          a1++;
   77.87 -          a2++;
   77.88 -        }
   77.89 -
   77.90 -      /* A difference was detected in last few bytes of s1, so search bytewise */
   77.91 -      s1 = (char*)a1;
   77.92 -      s2 = (char*)a2;
   77.93 -    }
   77.94 -
   77.95 -  while (*s1 != '\0' && *s1 == *s2)
   77.96 -    {
   77.97 -      s1++;
   77.98 -      s2++;
   77.99 -    }
  77.100 -  return (*(unsigned char *) s1) - (*(unsigned char *) s2);
  77.101 -#endif /* not PREFER_SIZE_OVER_SPEED */
  77.102 -}
    78.1 --- a/libc/string/strcoll.c	Sat Dec 07 00:44:56 2019 +0100
    78.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    78.3 @@ -1,44 +0,0 @@
    78.4 -/*
    78.5 -FUNCTION
    78.6 -	<<strcoll>>---locale-specific character string compare
    78.7 -	
    78.8 -INDEX
    78.9 -	strcoll
   78.10 -
   78.11 -SYNOPSIS
   78.12 -	#include <string.h>
   78.13 -	int strcoll(const char *<[stra]>, const char * <[strb]>);
   78.14 -
   78.15 -DESCRIPTION
   78.16 -	<<strcoll>> compares the string pointed to by <[stra]> to
   78.17 -	the string pointed to by <[strb]>, using an interpretation
   78.18 -	appropriate to the current <<LC_COLLATE>> state.
   78.19 -
   78.20 -	(NOT Cygwin:) The current implementation of <<strcoll>> simply
   78.21 -	uses <<strcmp>> and does not support any language-specific sorting.
   78.22 -
   78.23 -RETURNS
   78.24 -	If the first string is greater than the second string,
   78.25 -	<<strcoll>> returns a number greater than zero.  If the two
   78.26 -	strings are equivalent, <<strcoll>> returns zero.  If the first
   78.27 -	string is less than the second string, <<strcoll>> returns a
   78.28 -	number less than zero.
   78.29 -
   78.30 -PORTABILITY
   78.31 -<<strcoll>> is ANSI C.
   78.32 -
   78.33 -<<strcoll>> requires no supporting OS subroutines.
   78.34 -
   78.35 -QUICKREF
   78.36 -	strcoll ansi pure
   78.37 -*/
   78.38 -
   78.39 -#include <string.h>
   78.40 -
   78.41 -int
   78.42 -strcoll (const char *a,
   78.43 -	const char *b)
   78.44 -
   78.45 -{
   78.46 -  return strcmp (a, b);
   78.47 -}
    79.1 --- a/libc/string/strcoll_l.c	Sat Dec 07 00:44:56 2019 +0100
    79.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    79.3 @@ -1,46 +0,0 @@
    79.4 -/*
    79.5 -FUNCTION
    79.6 -	<<strcoll_l>>---locale-specific character string compare
    79.7 -	
    79.8 -INDEX
    79.9 -	strcoll_l
   79.10 -
   79.11 -SYNOPSIS
   79.12 -	#include <string.h>
   79.13 -	int strcoll_l(const char *<[stra]>, const char * <[strb]>,
   79.14 -		      locale_t <[locale]>);
   79.15 -
   79.16 -DESCRIPTION
   79.17 -	<<strcoll_l>> compares the string pointed to by <[stra]> to
   79.18 -	the string pointed to by <[strb]>, using an interpretation
   79.19 -	appropriate to the current <<LC_COLLATE>> state.
   79.20 -
   79.21 -	(NOT Cygwin:) The current implementation of <<strcoll_l>> simply
   79.22 -	uses <<strcmp>> and does not support any language-specific sorting.
   79.23 -
   79.24 -	If <[locale]> is LC_GLOBAL_LOCALE or not a valid locale object, the
   79.25 -	behaviour is undefined.
   79.26 -
   79.27 -RETURNS
   79.28 -	If the first string is greater than the second string,
   79.29 -	<<strcoll_l>> returns a number greater than zero.  If the two
   79.30 -	strings are equivalent, <<strcoll_l>> returns zero.  If the first
   79.31 -	string is less than the second string, <<strcoll_l>> returns a
   79.32 -	number less than zero.
   79.33 -
   79.34 -PORTABILITY
   79.35 -<<strcoll_l>> is POSIX-1.2008.
   79.36 -
   79.37 -<<strcoll_l>> requires no supporting OS subroutines.
   79.38 -
   79.39 -QUICKREF
   79.40 -	strcoll_l ansi pure
   79.41 -*/
   79.42 -
   79.43 -#include <string.h>
   79.44 -
   79.45 -int
   79.46 -strcoll_l (const char *a, const char *b, struct __locale_t *locale)
   79.47 -{
   79.48 -  return strcmp (a, b);
   79.49 -}
    80.1 --- a/libc/string/strcpy.c	Sat Dec 07 00:44:56 2019 +0100
    80.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    80.3 @@ -1,92 +0,0 @@
    80.4 -/*
    80.5 -FUNCTION
    80.6 -	<<strcpy>>---copy string
    80.7 -
    80.8 -INDEX
    80.9 -	strcpy
   80.10 -
   80.11 -SYNOPSIS
   80.12 -	#include <string.h>
   80.13 -	char *strcpy(char *<[dst]>, const char *<[src]>);
   80.14 -
   80.15 -DESCRIPTION
   80.16 -	<<strcpy>> copies the string pointed to by <[src]>
   80.17 -	(including the terminating null character) to the array
   80.18 -	pointed to by <[dst]>.
   80.19 -
   80.20 -RETURNS
   80.21 -	This function returns the initial value of <[dst]>.
   80.22 -
   80.23 -PORTABILITY
   80.24 -<<strcpy>> is ANSI C.
   80.25 -
   80.26 -<<strcpy>> requires no supporting OS subroutines.
   80.27 -
   80.28 -QUICKREF
   80.29 -	strcpy ansi pure
   80.30 -*/
   80.31 -
   80.32 -#include <string.h>
   80.33 -#include <limits.h>
   80.34 -
   80.35 -/*SUPPRESS 560*/
   80.36 -/*SUPPRESS 530*/
   80.37 -
   80.38 -/* Nonzero if either X or Y is not aligned on a "long" boundary.  */
   80.39 -#define UNALIGNED(X, Y) \
   80.40 -  (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
   80.41 -
   80.42 -#if LONG_MAX == 2147483647L
   80.43 -#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
   80.44 -#else
   80.45 -#if LONG_MAX == 9223372036854775807L
   80.46 -/* Nonzero if X (a long int) contains a NULL byte. */
   80.47 -#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
   80.48 -#else
   80.49 -#error long int is not a 32bit or 64bit type.
   80.50 -#endif
   80.51 -#endif
   80.52 -
   80.53 -#ifndef DETECTNULL
   80.54 -#error long int is not a 32bit or 64bit byte
   80.55 -#endif
   80.56 -
   80.57 -char*
   80.58 -strcpy (char *dst0,
   80.59 -	const char *src0)
   80.60 -{
   80.61 -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
   80.62 -  char *s = dst0;
   80.63 -
   80.64 -  while (*dst0++ = *src0++)
   80.65 -    ;
   80.66 -
   80.67 -  return s;
   80.68 -#else
   80.69 -  char *dst = dst0;
   80.70 -  const char *src = src0;
   80.71 -  long *aligned_dst;
   80.72 -  const long *aligned_src;
   80.73 -
   80.74 -  /* If SRC or DEST is unaligned, then copy bytes.  */
   80.75 -  if (!UNALIGNED (src, dst))
   80.76 -    {
   80.77 -      aligned_dst = (long*)dst;
   80.78 -      aligned_src = (long*)src;
   80.79 -
   80.80 -      /* SRC and DEST are both "long int" aligned, try to do "long int"
   80.81 -         sized copies.  */
   80.82 -      while (!DETECTNULL(*aligned_src))
   80.83 -        {
   80.84 -          *aligned_dst++ = *aligned_src++;
   80.85 -        }
   80.86 -
   80.87 -      dst = (char*)aligned_dst;
   80.88 -      src = (char*)aligned_src;
   80.89 -    }
   80.90 -
   80.91 -  while ((*dst++ = *src++))
   80.92 -    ;
   80.93 -  return dst0;
   80.94 -#endif /* not PREFER_SIZE_OVER_SPEED */
   80.95 -}
    81.1 --- a/libc/string/strcspn.c	Sat Dec 07 00:44:56 2019 +0100
    81.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    81.3 @@ -1,48 +0,0 @@
    81.4 -/*
    81.5 -FUNCTION
    81.6 -	<<strcspn>>---count characters not in string
    81.7 -
    81.8 -INDEX
    81.9 -	strcspn
   81.10 -
   81.11 -SYNOPSIS
   81.12 -	size_t strcspn(const char *<[s1]>, const char *<[s2]>);
   81.13 -
   81.14 -DESCRIPTION
   81.15 -	This function computes the length of the initial part of
   81.16 -	the string pointed to by <[s1]> which consists entirely of
   81.17 -	characters <[NOT]> from the string pointed to by <[s2]>
   81.18 -	(excluding the terminating null character).
   81.19 -
   81.20 -RETURNS
   81.21 -	<<strcspn>> returns the length of the substring found.
   81.22 -
   81.23 -PORTABILITY
   81.24 -<<strcspn>> is ANSI C.
   81.25 -
   81.26 -<<strcspn>> requires no supporting OS subroutines.
   81.27 - */
   81.28 -
   81.29 -#include <string.h>
   81.30 -
   81.31 -size_t
   81.32 -strcspn (const char *s1,
   81.33 -	const char *s2)
   81.34 -{
   81.35 -  const char *s = s1;
   81.36 -  const char *c;
   81.37 -
   81.38 -  while (*s1)
   81.39 -    {
   81.40 -      for (c = s2; *c; c++)
   81.41 -	{
   81.42 -	  if (*s1 == *c)
   81.43 -	    break;
   81.44 -	}
   81.45 -      if (*c)
   81.46 -	break;
   81.47 -      s1++;
   81.48 -    }
   81.49 -
   81.50 -  return s1 - s;
   81.51 -}
    82.1 --- a/libc/string/strdup.c	Sat Dec 07 00:44:56 2019 +0100
    82.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    82.3 @@ -1,13 +0,0 @@
    82.4 -#ifndef _REENT_ONLY
    82.5 -
    82.6 -#include <reent.h>
    82.7 -#include <stdlib.h>
    82.8 -#include <string.h>
    82.9 -
   82.10 -char *
   82.11 -strdup (const char *str)
   82.12 -{
   82.13 -  return _strdup_r (_REENT, str);
   82.14 -}
   82.15 -
   82.16 -#endif /* !_REENT_ONLY */
    83.1 --- a/libc/string/strdup_r.c	Sat Dec 07 00:44:56 2019 +0100
    83.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    83.3 @@ -1,16 +0,0 @@
    83.4 -#include <reent.h>
    83.5 -#include <stdlib.h>
    83.6 -#include <string.h>
    83.7 -
    83.8 -char *
    83.9 -_strdup_r (struct _reent *reent_ptr,
   83.10 -        const char   *str)
   83.11 -{
   83.12 -  size_t len = strlen (str) + 1;
   83.13 -  char *copy = _malloc_r (reent_ptr, len);
   83.14 -  if (copy)
   83.15 -    {
   83.16 -      memcpy (copy, str, len);
   83.17 -    }
   83.18 -  return copy;
   83.19 -}
    84.1 --- a/libc/string/strerror.c	Sat Dec 07 00:44:56 2019 +0100
    84.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    84.3 @@ -1,905 +0,0 @@
    84.4 -/***
    84.5 -**** CAUTION!!! KEEP DOC CONSISTENT---if you change text of a message
    84.6 -****            here, change two places:
    84.7 -****            1) the leading doc section (alphabetized by macro)
    84.8 -****            2) the real text inside switch(errnum)
    84.9 -***/
   84.10 -
   84.11 -/*
   84.12 -FUNCTION
   84.13 -	<<strerror>>, <<strerror_l>>---convert error number to string
   84.14 -
   84.15 -INDEX
   84.16 -	strerror
   84.17 -
   84.18 -INDEX
   84.19 -	strerror_l
   84.20 -
   84.21 -SYNOPSIS
   84.22 -	#include <string.h>
   84.23 -	char *strerror(int <[errnum]>);
   84.24 -	char *strerror_l(int <[errnum]>, locale_t <[locale]>);
   84.25 -	char *_strerror_r(struct _reent <[ptr]>, int <[errnum]>,
   84.26 -			  int <[internal]>, int *<[error]>);
   84.27 -
   84.28 -DESCRIPTION
   84.29 -<<strerror>> converts the error number <[errnum]> into a
   84.30 -string.  The value of <[errnum]> is usually a copy of <<errno>>.
   84.31 -If <<errnum>> is not a known error number, the result points to an
   84.32 -empty string.
   84.33 -
   84.34 -<<strerror_l>> is like <<strerror>> but creates a string in a format
   84.35 -as expected in locale <[locale]>.  If <[locale]> is LC_GLOBAL_LOCALE or
   84.36 -not a valid locale object, the behaviour is undefined.
   84.37 -
   84.38 -This implementation of <<strerror>> prints out the following strings
   84.39 -for each of the values defined in `<<errno.h>>':
   84.40 -
   84.41 -o+
   84.42 -o 0
   84.43 -Success
   84.44 -
   84.45 -o E2BIG
   84.46 -Arg list too long
   84.47 -
   84.48 -o EACCES
   84.49 -Permission denied
   84.50 -
   84.51 -o EADDRINUSE
   84.52 -Address already in use
   84.53 -
   84.54 -o EADDRNOTAVAIL
   84.55 -Address not available
   84.56 -
   84.57 -o EADV
   84.58 -Advertise error
   84.59 -
   84.60 -o EAFNOSUPPORT
   84.61 -Address family not supported by protocol family
   84.62 -
   84.63 -o EAGAIN
   84.64 -No more processes
   84.65 -
   84.66 -o EALREADY
   84.67 -Socket already connected
   84.68 -
   84.69 -o EBADF
   84.70 -Bad file number
   84.71 -
   84.72 -o EBADMSG
   84.73 -Bad message
   84.74 -
   84.75 -o EBUSY
   84.76 -Device or resource busy
   84.77 -
   84.78 -o ECANCELED
   84.79 -Operation canceled
   84.80 -
   84.81 -o ECHILD
   84.82 -No children
   84.83 -
   84.84 -o ECOMM
   84.85 -Communication error
   84.86 -
   84.87 -o ECONNABORTED
   84.88 -Software caused connection abort
   84.89 -
   84.90 -o ECONNREFUSED
   84.91 -Connection refused
   84.92 -
   84.93 -o ECONNRESET
   84.94 -Connection reset by peer
   84.95 -
   84.96 -o EDEADLK
   84.97 -Deadlock
   84.98 -
   84.99 -o EDESTADDRREQ
  84.100 -Destination address required
  84.101 -
  84.102 -o EEXIST
  84.103 -File exists
  84.104 -
  84.105 -o EDOM
  84.106 -Mathematics argument out of domain of function
  84.107 -
  84.108 -o EFAULT
  84.109 -Bad address
  84.110 -
  84.111 -o EFBIG
  84.112 -File too large
  84.113 -
  84.114 -o EHOSTDOWN
  84.115 -Host is down
  84.116 -
  84.117 -o EHOSTUNREACH
  84.118 -Host is unreachable
  84.119 -
  84.120 -o EIDRM
  84.121 -Identifier removed
  84.122 -
  84.123 -o EILSEQ
  84.124 -Illegal byte sequence
  84.125 -
  84.126 -o EINPROGRESS
  84.127 -Connection already in progress
  84.128 -
  84.129 -o EINTR
  84.130 -Interrupted system call
  84.131 -
  84.132 -o EINVAL
  84.133 -Invalid argument
  84.134 -
  84.135 -o EIO
  84.136 -I/O error
  84.137 -
  84.138 -o EISCONN
  84.139 -Socket is already connected
  84.140 -
  84.141 -o EISDIR
  84.142 -Is a directory
  84.143 -
  84.144 -o ELIBACC
  84.145 -Cannot access a needed shared library
  84.146 -
  84.147 -o ELIBBAD
  84.148 -Accessing a corrupted shared library
  84.149 -
  84.150 -o ELIBEXEC
  84.151 -Cannot exec a shared library directly
  84.152 -
  84.153 -o ELIBMAX
  84.154 -Attempting to link in more shared libraries than system limit
  84.155 -
  84.156 -o ELIBSCN
  84.157 -<<.lib>> section in a.out corrupted
  84.158 -
  84.159 -o EMFILE
  84.160 -File descriptor value too large
  84.161 -
  84.162 -o EMLINK
  84.163 -Too many links
  84.164 -
  84.165 -o EMSGSIZE
  84.166 -Message too long
  84.167 -
  84.168 -o EMULTIHOP
  84.169 -Multihop attempted
  84.170 -
  84.171 -o ENAMETOOLONG
  84.172 -File or path name too long
  84.173 -
  84.174 -o ENETDOWN
  84.175 -Network interface is not configured
  84.176 -
  84.177 -o ENETRESET
  84.178 -Connection aborted by network
  84.179 -
  84.180 -o ENETUNREACH
  84.181 -Network is unreachable
  84.182 -
  84.183 -o ENFILE
  84.184 -Too many open files in system
  84.185 -
  84.186 -o ENOBUFS
  84.187 -No buffer space available
  84.188 -
  84.189 -o ENODATA
  84.190 -No data
  84.191 -
  84.192 -o ENODEV
  84.193 -No such device
  84.194 -
  84.195 -o ENOENT
  84.196 -No such file or directory
  84.197 -
  84.198 -o ENOEXEC
  84.199 -Exec format error
  84.200 -
  84.201 -o ENOLCK
  84.202 -No lock
  84.203 -
  84.204 -o ENOLINK
  84.205 -Virtual circuit is gone
  84.206 -
  84.207 -o ENOMEM
  84.208 -Not enough space
  84.209 -
  84.210 -o ENOMSG
  84.211 -No message of desired type
  84.212 -
  84.213 -o ENONET
  84.214 -Machine is not on the network
  84.215 -
  84.216 -o ENOPKG
  84.217 -No package
  84.218 -
  84.219 -o ENOPROTOOPT
  84.220 -Protocol not available
  84.221 -
  84.222 -o ENOSPC
  84.223 -No space left on device
  84.224 -
  84.225 -o ENOSR
  84.226 -No stream resources
  84.227 -
  84.228 -o ENOSTR
  84.229 -Not a stream
  84.230 -
  84.231 -o ENOSYS
  84.232 -Function not implemented
  84.233 -
  84.234 -o ENOTBLK
  84.235 -Block device required
  84.236 -
  84.237 -o ENOTCONN
  84.238 -Socket is not connected
  84.239 -
  84.240 -o ENOTDIR
  84.241 -Not a directory
  84.242 -
  84.243 -o ENOTEMPTY
  84.244 -Directory not empty
  84.245 -
  84.246 -o ENOTRECOVERABLE
  84.247 -State not recoverable
  84.248 -
  84.249 -o ENOTSOCK
  84.250 -Socket operation on non-socket
  84.251 -
  84.252 -o ENOTSUP
  84.253 -Not supported
  84.254 -
  84.255 -o ENOTTY
  84.256 -Not a character device
  84.257 -
  84.258 -o ENXIO
  84.259 -No such device or address
  84.260 -
  84.261 -o EOPNOTSUPP
  84.262 -Operation not supported on socket
  84.263 -
  84.264 -o EOVERFLOW
  84.265 -Value too large for defined data type
  84.266 -
  84.267 -o EOWNERDEAD
  84.268 -Previous owner died
  84.269 -
  84.270 -o EPERM
  84.271 -Not owner
  84.272 -
  84.273 -o EPIPE
  84.274 -Broken pipe
  84.275 -
  84.276 -o EPROTO
  84.277 -Protocol error
  84.278 -
  84.279 -o EPROTOTYPE
  84.280 -Protocol wrong type for socket
  84.281 -
  84.282 -o EPROTONOSUPPORT
  84.283 -Unknown protocol
  84.284 -
  84.285 -o ERANGE
  84.286 -Result too large
  84.287 -
  84.288 -o EREMOTE
  84.289 -Resource is remote
  84.290 -
  84.291 -o EROFS
  84.292 -Read-only file system
  84.293 -
  84.294 -o ESHUTDOWN
  84.295 -Can't send after socket shutdown
  84.296 -
  84.297 -o ESOCKTNOSUPPORT
  84.298 -Socket type not supported
  84.299 -
  84.300 -o ESPIPE
  84.301 -Illegal seek
  84.302 -
  84.303 -o ESRCH
  84.304 -No such process
  84.305 -
  84.306 -o ESRMNT
  84.307 -Srmount error
  84.308 -
  84.309 -o ESTRPIPE
  84.310 -Strings pipe error
  84.311 -
  84.312 -o ETIME
  84.313 -Stream ioctl timeout
  84.314 -
  84.315 -o ETIMEDOUT
  84.316 -Connection timed out
  84.317 -
  84.318 -o ETXTBSY
  84.319 -Text file busy
  84.320 -
  84.321 -o EWOULDBLOCK
  84.322 -Operation would block (usually same as EAGAIN)
  84.323 -
  84.324 -o EXDEV
  84.325 -Cross-device link
  84.326 -
  84.327 -o-
  84.328 -
  84.329 -<<_strerror_r>> is a reentrant version of the above.
  84.330 -
  84.331 -RETURNS
  84.332 -This function returns a pointer to a string.  Your application must
  84.333 -not modify that string.
  84.334 -
  84.335 -PORTABILITY
  84.336 -ANSI C requires <<strerror>>, but does not specify the strings used
  84.337 -for each error number.
  84.338 -
  84.339 -<<strerror_l>> is POSIX-1.2008.
  84.340 -
  84.341 -Although this implementation of <<strerror>> is reentrant (depending
  84.342 -on <<_user_strerror>>), ANSI C declares that subsequent calls to
  84.343 -<<strerror>> may overwrite the result string; therefore portable
  84.344 -code cannot depend on the reentrancy of this subroutine.
  84.345 -
  84.346 -Although this implementation of <<strerror>> guarantees a non-null
  84.347 -result with a NUL-terminator, some implementations return <<NULL>>
  84.348 -on failure.  Although POSIX allows <<strerror>> to set <<errno>>
  84.349 -to EINVAL on failure, this implementation does not do so (unless
  84.350 -you provide <<_user_strerror>>).
  84.351 -
  84.352 -POSIX recommends that unknown <[errnum]> result in a message
  84.353 -including that value, however it is not a requirement and this
  84.354 -implementation does not provide that information (unless you
  84.355 -provide <<_user_strerror>>).
  84.356 -
  84.357 -This implementation of <<strerror>> provides for user-defined
  84.358 -extensibility.  <<errno.h>> defines <[__ELASTERROR]>, which can be
  84.359 -used as a base for user-defined error values.  If the user supplies a
  84.360 -routine named <<_user_strerror>>, and <[errnum]> passed to
  84.361 -<<strerror>> does not match any of the supported values,
  84.362 -<<_user_strerror>> is called with three arguments.  The first is of
  84.363 -type <[int]>, and is the <[errnum]> value unknown to <<strerror>>.
  84.364 -The second is of type <[int]>, and matches the <[internal]> argument
  84.365 -of <<_strerror_r>>; this should be zero if called from <<strerror>>
  84.366 -and non-zero if called from any other function; <<_user_strerror>> can
  84.367 -use this information to satisfy the POSIX rule that no other
  84.368 -standardized function can overwrite a static buffer reused by
  84.369 -<<strerror>>.  The third is of type <[int *]>, and matches the
  84.370 -<[error]> argument of <<_strerror_r>>; if a non-zero value is stored
  84.371 -into that location (usually <[EINVAL]>), then <<strerror>> will set
  84.372 -<<errno>> to that value, and the XPG variant of <<strerror_r>> will
  84.373 -return that value instead of zero or <[ERANGE]>.  <<_user_strerror>>
  84.374 -returns a <[char *]> value; returning <[NULL]> implies that the user
  84.375 -function did not choose to handle <[errnum]>.  The default
  84.376 -<<_user_strerror>> returns <[NULL]> for all input values.  Note that
  84.377 -<<_user_sterror>> must be thread-safe, and only denote errors via the
  84.378 -third argument rather than modifying <<errno>>, if <<strerror>> and
  84.379 -<<strerror_r>> are are to comply with POSIX.
  84.380 -
  84.381 -<<strerror>> requires no supporting OS subroutines.
  84.382 -
  84.383 -QUICKREF
  84.384 -	strerror ansi pure
  84.385 -*/
  84.386 -
  84.387 -#include <errno.h>
  84.388 -#include <string.h>
  84.389 -
  84.390 -char *
  84.391 -_strerror_r (struct _reent *ptr,
  84.392 -	int errnum,
  84.393 -	int internal,
  84.394 -	int *errptr)
  84.395 -{
  84.396 -  char *error;
  84.397 -  extern char *_user_strerror (int, int, int *);
  84.398 -
  84.399 -  switch (errnum)
  84.400 -    {
  84.401 -    case 0:
  84.402 -      error = "Success";
  84.403 -      break;
  84.404 -/* go32 defines EPERM as EACCES */
  84.405 -#if defined (EPERM) && (!defined (EACCES) || (EPERM != EACCES))
  84.406 -    case EPERM:
  84.407 -      error = "Not owner";
  84.408 -      break;
  84.409 -#endif
  84.410 -#ifdef ENOENT
  84.411 -    case ENOENT:
  84.412 -      error = "No such file or directory";
  84.413 -      break;
  84.414 -#endif
  84.415 -#ifdef ESRCH
  84.416 -    case ESRCH:
  84.417 -      error = "No such process";
  84.418 -      break;
  84.419 -#endif
  84.420 -#ifdef EINTR
  84.421 -    case EINTR:
  84.422 -      error = "Interrupted system call";
  84.423 -      break;
  84.424 -#endif
  84.425 -#ifdef EIO
  84.426 -    case EIO:
  84.427 -      error = "I/O error";
  84.428 -      break;
  84.429 -#endif
  84.430 -/* go32 defines ENXIO as ENODEV */
  84.431 -#if defined (ENXIO) && (!defined (ENODEV) || (ENXIO != ENODEV))
  84.432 -    case ENXIO:
  84.433 -      error = "No such device or address";
  84.434 -      break;
  84.435 -#endif
  84.436 -#ifdef E2BIG
  84.437 -    case E2BIG:
  84.438 -      error = "Arg list too long";
  84.439 -      break;
  84.440 -#endif
  84.441 -#ifdef ENOEXEC
  84.442 -    case ENOEXEC:
  84.443 -      error = "Exec format error";
  84.444 -      break;
  84.445 -#endif
  84.446 -#ifdef EALREADY
  84.447 -    case EALREADY:
  84.448 -      error = "Socket already connected";
  84.449 -      break;
  84.450 -#endif
  84.451 -#ifdef EBADF
  84.452 -    case EBADF:
  84.453 -      error = "Bad file number";
  84.454 -      break;
  84.455 -#endif
  84.456 -#ifdef ECHILD
  84.457 -    case ECHILD:
  84.458 -      error = "No children";
  84.459 -      break;
  84.460 -#endif
  84.461 -#ifdef EDESTADDRREQ
  84.462 -    case EDESTADDRREQ:
  84.463 -      error = "Destination address required";
  84.464 -      break;
  84.465 -#endif
  84.466 -#ifdef EAGAIN
  84.467 -    case EAGAIN:
  84.468 -      error = "No more processes";
  84.469 -      break;
  84.470 -#endif
  84.471 -#ifdef ENOMEM
  84.472 -    case ENOMEM:
  84.473 -      error = "Not enough space";
  84.474 -      break;
  84.475 -#endif
  84.476 -#ifdef EACCES
  84.477 -    case EACCES:
  84.478 -      error = "Permission denied";
  84.479 -      break;
  84.480 -#endif
  84.481 -#ifdef EFAULT
  84.482 -    case EFAULT:
  84.483 -      error = "Bad address";
  84.484 -      break;
  84.485 -#endif
  84.486 -#ifdef ENOTBLK
  84.487 -    case ENOTBLK:
  84.488 -      error = "Block device required";
  84.489 -      break;
  84.490 -#endif
  84.491 -#ifdef EBUSY
  84.492 -    case EBUSY:
  84.493 -      error = "Device or resource busy";
  84.494 -      break;
  84.495 -#endif
  84.496 -#ifdef EEXIST
  84.497 -    case EEXIST:
  84.498 -      error = "File exists";
  84.499 -      break;
  84.500 -#endif
  84.501 -#ifdef EXDEV
  84.502 -    case EXDEV:
  84.503 -      error = "Cross-device link";
  84.504 -      break;
  84.505 -#endif
  84.506 -#ifdef ENODEV
  84.507 -    case ENODEV:
  84.508 -      error = "No such device";
  84.509 -      break;
  84.510 -#endif
  84.511 -#ifdef ENOTDIR
  84.512 -    case ENOTDIR:
  84.513 -      error = "Not a directory";
  84.514 -      break;
  84.515 -#endif
  84.516 -#ifdef EHOSTDOWN
  84.517 -    case EHOSTDOWN:
  84.518 -      error = "Host is down";
  84.519 -      break;
  84.520 -#endif
  84.521 -#ifdef EINPROGRESS
  84.522 -    case EINPROGRESS:
  84.523 -      error = "Connection already in progress";
  84.524 -      break;
  84.525 -#endif
  84.526 -#ifdef EISDIR
  84.527 -    case EISDIR:
  84.528 -      error = "Is a directory";
  84.529 -      break;
  84.530 -#endif
  84.531 -#ifdef EINVAL
  84.532 -    case EINVAL:
  84.533 -      error = "Invalid argument";
  84.534 -      break;
  84.535 -#endif
  84.536 -#ifdef ENETDOWN
  84.537 -    case ENETDOWN:
  84.538 -      error = "Network interface is not configured";
  84.539 -      break;
  84.540 -#endif
  84.541 -#ifdef ENETRESET
  84.542 -    case ENETRESET:
  84.543 -      error = "Connection aborted by network";
  84.544 -      break;
  84.545 -#endif
  84.546 -#ifdef ENFILE
  84.547 -    case ENFILE:
  84.548 -      error = "Too many open files in system";
  84.549 -      break;
  84.550 -#endif
  84.551 -#ifdef EMFILE
  84.552 -    case EMFILE:
  84.553 -      error = "File descriptor value too large";
  84.554 -      break;
  84.555 -#endif
  84.556 -#ifdef ENOTTY
  84.557 -    case ENOTTY:
  84.558 -      error = "Not a character device";
  84.559 -      break;
  84.560 -#endif
  84.561 -#ifdef ETXTBSY
  84.562 -    case ETXTBSY:
  84.563 -      error = "Text file busy";
  84.564 -      break;
  84.565 -#endif
  84.566 -#ifdef EFBIG
  84.567 -    case EFBIG:
  84.568 -      error = "File too large";
  84.569 -      break;
  84.570 -#endif
  84.571 -#ifdef EHOSTUNREACH
  84.572 -    case EHOSTUNREACH:
  84.573 -      error = "Host is unreachable";
  84.574 -      break;
  84.575 -#endif
  84.576 -#ifdef ENOSPC
  84.577 -    case ENOSPC:
  84.578 -      error = "No space left on device";
  84.579 -      break;
  84.580 -#endif
  84.581 -#ifdef ENOTSUP
  84.582 -    case ENOTSUP:
  84.583 -      error = "Not supported";
  84.584 -      break;
  84.585 -#endif
  84.586 -#ifdef ESPIPE
  84.587 -    case ESPIPE:
  84.588 -      error = "Illegal seek";
  84.589 -      break;
  84.590 -#endif
  84.591 -#ifdef EROFS
  84.592 -    case EROFS:
  84.593 -      error = "Read-only file system";
  84.594 -      break;
  84.595 -#endif
  84.596 -#ifdef EMLINK
  84.597 -    case EMLINK:
  84.598 -      error = "Too many links";
  84.599 -      break;
  84.600 -#endif
  84.601 -#ifdef EPIPE
  84.602 -    case EPIPE:
  84.603 -      error = "Broken pipe";
  84.604 -      break;
  84.605 -#endif
  84.606 -#ifdef EDOM
  84.607 -    case EDOM:
  84.608 -      error = "Mathematics argument out of domain of function";
  84.609 -      break;
  84.610 -#endif
  84.611 -#ifdef ERANGE
  84.612 -    case ERANGE:
  84.613 -      error = "Result too large";
  84.614 -      break;
  84.615 -#endif
  84.616 -#ifdef ENOMSG
  84.617 -    case ENOMSG:
  84.618 -      error = "No message of desired type";
  84.619 -      break;
  84.620 -#endif
  84.621 -#ifdef EIDRM
  84.622 -    case EIDRM:
  84.623 -      error = "Identifier removed";
  84.624 -      break;
  84.625 -#endif
  84.626 -#ifdef EILSEQ
  84.627 -    case EILSEQ:
  84.628 -      error = "Illegal byte sequence";
  84.629 -      break;
  84.630 -#endif
  84.631 -#ifdef EDEADLK
  84.632 -    case EDEADLK:
  84.633 -      error = "Deadlock";
  84.634 -      break;
  84.635 -#endif
  84.636 -#ifdef ENETUNREACH
  84.637 -    case  ENETUNREACH:
  84.638 -      error = "Network is unreachable";
  84.639 -      break;
  84.640 -#endif
  84.641 -#ifdef ENOLCK
  84.642 -    case ENOLCK:
  84.643 -      error = "No lock";
  84.644 -      break;
  84.645 -#endif
  84.646 -#ifdef ENOSTR
  84.647 -    case ENOSTR:
  84.648 -      error = "Not a stream";
  84.649 -      break;
  84.650 -#endif
  84.651 -#ifdef ETIME
  84.652 -    case ETIME:
  84.653 -      error = "Stream ioctl timeout";
  84.654 -      break;
  84.655 -#endif
  84.656 -#ifdef ENOSR
  84.657 -    case ENOSR:
  84.658 -      error = "No stream resources";
  84.659 -      break;
  84.660 -#endif
  84.661 -#ifdef ENONET
  84.662 -    case ENONET:
  84.663 -      error = "Machine is not on the network";
  84.664 -      break;
  84.665 -#endif
  84.666 -#ifdef ENOPKG
  84.667 -    case ENOPKG:
  84.668 -      error = "No package";
  84.669 -      break;
  84.670 -#endif
  84.671 -#ifdef EREMOTE
  84.672 -    case EREMOTE:
  84.673 -      error = "Resource is remote";
  84.674 -      break;
  84.675 -#endif
  84.676 -#ifdef ENOLINK
  84.677 -    case ENOLINK:
  84.678 -      error = "Virtual circuit is gone";
  84.679 -      break;
  84.680 -#endif
  84.681 -#ifdef EADV
  84.682 -    case EADV:
  84.683 -      error = "Advertise error";
  84.684 -      break;
  84.685 -#endif
  84.686 -#ifdef ESRMNT
  84.687 -    case ESRMNT:
  84.688 -      error = "Srmount error";
  84.689 -      break;
  84.690 -#endif
  84.691 -#ifdef ECOMM
  84.692 -    case ECOMM:
  84.693 -      error = "Communication error";
  84.694 -      break;
  84.695 -#endif
  84.696 -#ifdef EPROTO
  84.697 -    case EPROTO:
  84.698 -      error = "Protocol error";
  84.699 -      break;
  84.700 -#endif
  84.701 -#ifdef EPROTONOSUPPORT
  84.702 -    case EPROTONOSUPPORT:
  84.703 -      error = "Unknown protocol";
  84.704 -      break;
  84.705 -#endif
  84.706 -#ifdef EMULTIHOP
  84.707 -    case EMULTIHOP:
  84.708 -      error = "Multihop attempted";
  84.709 -      break;
  84.710 -#endif
  84.711 -#ifdef EBADMSG
  84.712 -    case EBADMSG:
  84.713 -      error = "Bad message";
  84.714 -      break;
  84.715 -#endif
  84.716 -#ifdef ELIBACC
  84.717 -    case ELIBACC:
  84.718 -      error = "Cannot access a needed shared library";
  84.719 -      break;
  84.720 -#endif
  84.721 -#ifdef ELIBBAD
  84.722 -    case ELIBBAD:
  84.723 -      error = "Accessing a corrupted shared library";
  84.724 -      break;
  84.725 -#endif
  84.726 -#ifdef ELIBSCN
  84.727 -    case ELIBSCN:
  84.728 -      error = ".lib section in a.out corrupted";
  84.729 -      break;
  84.730 -#endif
  84.731 -#ifdef ELIBMAX
  84.732 -    case ELIBMAX:
  84.733 -      error = "Attempting to link in more shared libraries than system limit";
  84.734 -      break;
  84.735 -#endif
  84.736 -#ifdef ELIBEXEC
  84.737 -    case ELIBEXEC:
  84.738 -      error = "Cannot exec a shared library directly";
  84.739 -      break;
  84.740 -#endif
  84.741 -#ifdef ENOSYS
  84.742 -    case ENOSYS:
  84.743 -      error = "Function not implemented";
  84.744 -      break;
  84.745 -#endif
  84.746 -#ifdef ENMFILE
  84.747 -    case ENMFILE:
  84.748 -      error = "No more files";
  84.749 -      break;
  84.750 -#endif
  84.751 -#ifdef ENOTEMPTY
  84.752 -    case ENOTEMPTY:
  84.753 -      error = "Directory not empty";
  84.754 -      break;
  84.755 -#endif
  84.756 -#ifdef ENAMETOOLONG
  84.757 -    case ENAMETOOLONG:
  84.758 -      error = "File or path name too long";
  84.759 -      break;
  84.760 -#endif
  84.761 -#ifdef ELOOP
  84.762 -    case ELOOP:
  84.763 -      error = "Too many symbolic links";
  84.764 -      break;
  84.765 -#endif
  84.766 -#ifdef ENOBUFS
  84.767 -    case ENOBUFS:
  84.768 -      error = "No buffer space available";
  84.769 -      break;
  84.770 -#endif
  84.771 -#ifdef ENODATA
  84.772 -    case ENODATA:
  84.773 -      error = "No data";
  84.774 -      break;
  84.775 -#endif
  84.776 -#ifdef EAFNOSUPPORT
  84.777 -    case EAFNOSUPPORT:
  84.778 -      error = "Address family not supported by protocol family";
  84.779 -      break;
  84.780 -#endif
  84.781 -#ifdef EPROTOTYPE
  84.782 -    case EPROTOTYPE:
  84.783 -      error = "Protocol wrong type for socket";
  84.784 -      break;
  84.785 -#endif
  84.786 -#ifdef ENOTSOCK
  84.787 -    case ENOTSOCK:
  84.788 -      error = "Socket operation on non-socket";
  84.789 -      break;
  84.790 -#endif
  84.791 -#ifdef ENOPROTOOPT
  84.792 -    case ENOPROTOOPT:
  84.793 -      error = "Protocol not available";
  84.794 -      break;
  84.795 -#endif
  84.796 -#ifdef ESHUTDOWN
  84.797 -    case ESHUTDOWN:
  84.798 -      error = "Can't send after socket shutdown";
  84.799 -      break;
  84.800 -#endif
  84.801 -#ifdef ECONNREFUSED
  84.802 -    case ECONNREFUSED:
  84.803 -      error = "Connection refused";
  84.804 -      break;
  84.805 -#endif
  84.806 -#ifdef ECONNRESET
  84.807 -    case ECONNRESET:
  84.808 -      error = "Connection reset by peer";
  84.809 -      break;
  84.810 -#endif
  84.811 -#ifdef EADDRINUSE
  84.812 -    case EADDRINUSE:
  84.813 -      error = "Address already in use";
  84.814 -      break;
  84.815 -#endif
  84.816 -#ifdef EADDRNOTAVAIL
  84.817 -    case EADDRNOTAVAIL:
  84.818 -      error = "Address not available";
  84.819 -      break;
  84.820 -#endif
  84.821 -#ifdef ECONNABORTED
  84.822 -    case ECONNABORTED:
  84.823 -      error = "Software caused connection abort";
  84.824 -      break;
  84.825 -#endif
  84.826 -#if (defined(EWOULDBLOCK) && (!defined (EAGAIN) || (EWOULDBLOCK != EAGAIN)))
  84.827 -    case EWOULDBLOCK:
  84.828 -        error = "Operation would block";
  84.829 -        break;
  84.830 -#endif
  84.831 -#ifdef ENOTCONN
  84.832 -    case ENOTCONN:
  84.833 -        error = "Socket is not connected";
  84.834 -        break;
  84.835 -#endif
  84.836 -#ifdef ESOCKTNOSUPPORT
  84.837 -    case ESOCKTNOSUPPORT:
  84.838 -        error = "Socket type not supported";
  84.839 -        break;
  84.840 -#endif
  84.841 -#ifdef EISCONN
  84.842 -    case EISCONN:
  84.843 -        error = "Socket is already connected";
  84.844 -        break;
  84.845 -#endif
  84.846 -#ifdef ECANCELED
  84.847 -    case ECANCELED:
  84.848 -        error = "Operation canceled";
  84.849 -        break;
  84.850 -#endif
  84.851 -#ifdef ENOTRECOVERABLE
  84.852 -    case ENOTRECOVERABLE:
  84.853 -        error = "State not recoverable";
  84.854 -        break;
  84.855 -#endif
  84.856 -#ifdef EOWNERDEAD
  84.857 -    case EOWNERDEAD:
  84.858 -        error = "Previous owner died";
  84.859 -        break;
  84.860 -#endif
  84.861 -#ifdef ESTRPIPE
  84.862 -    case ESTRPIPE:
  84.863 -	error = "Streams pipe error";
  84.864 -	break;
  84.865 -#endif
  84.866 -#if defined(EOPNOTSUPP) && (!defined(ENOTSUP) || (ENOTSUP != EOPNOTSUPP))
  84.867 -    case EOPNOTSUPP:
  84.868 -        error = "Operation not supported on socket";
  84.869 -        break;
  84.870 -#endif
  84.871 -#ifdef EOVERFLOW
  84.872 -    case EOVERFLOW:
  84.873 -      error = "Value too large for defined data type";
  84.874 -      break;
  84.875 -#endif
  84.876 -#ifdef EMSGSIZE
  84.877 -    case EMSGSIZE:
  84.878 -        error = "Message too long";
  84.879 -        break;
  84.880 -#endif
  84.881 -#ifdef ETIMEDOUT
  84.882 -    case ETIMEDOUT:
  84.883 -        error = "Connection timed out";
  84.884 -        break;
  84.885 -#endif
  84.886 -    default:
  84.887 -      if (!errptr)
  84.888 -        errptr = &ptr->_errno;
  84.889 -      if ((error = _user_strerror (errnum, internal, errptr)) == 0)
  84.890 -        error = "";
  84.891 -      break;
  84.892 -    }
  84.893 -
  84.894 -  return error;
  84.895 -}
  84.896 -
  84.897 -char *
  84.898 -strerror (int errnum)
  84.899 -{
  84.900 -  return _strerror_r (_REENT, errnum, 0, NULL);
  84.901 -}
  84.902 -
  84.903 -char *
  84.904 -strerror_l (int errnum, locale_t locale)
  84.905 -{
  84.906 -  /* We don't support per-locale error messages. */
  84.907 -  return _strerror_r (_REENT, errnum, 0, NULL);
  84.908 -}
    85.1 --- a/libc/string/strerror_r.c	Sat Dec 07 00:44:56 2019 +0100
    85.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    85.3 @@ -1,77 +0,0 @@
    85.4 -/* GNU variant of strerror_r. */
    85.5 -/*
    85.6 -FUNCTION
    85.7 -	<<strerror_r>>---convert error number to string and copy to buffer
    85.8 -
    85.9 -INDEX
   85.10 -	strerror_r
   85.11 -
   85.12 -SYNOPSIS
   85.13 -	#include <string.h>
   85.14 -	#ifdef _GNU_SOURCE
   85.15 -	char *strerror_r(int <[errnum]>, char *<[buffer]>, size_t <[n]>);
   85.16 -	#else
   85.17 -	int strerror_r(int <[errnum]>, char *<[buffer]>, size_t <[n]>);
   85.18 -	#endif
   85.19 -
   85.20 -DESCRIPTION
   85.21 -<<strerror_r>> converts the error number <[errnum]> into a
   85.22 -string and copies the result into the supplied <[buffer]> for
   85.23 -a length up to <[n]>, including the NUL terminator. The value of
   85.24 -<[errnum]> is usually a copy of <<errno>>.  If <<errnum>> is not a known
   85.25 -error number, the result is the empty string.
   85.26 -
   85.27 -See <<strerror>> for how strings are mapped to <<errnum>>.
   85.28 -
   85.29 -RETURNS
   85.30 -There are two variants: the GNU version always returns a NUL-terminated
   85.31 -string, which is <[buffer]> if all went well, but which is another
   85.32 -pointer if <[n]> was too small (leaving <[buffer]> untouched).  If the
   85.33 -return is not <[buffer]>, your application must not modify that string.
   85.34 -The POSIX version returns 0 on success, <[EINVAL]> if <<errnum>> was not
   85.35 -recognized, and <[ERANGE]> if <[n]> was too small.  The variant chosen
   85.36 -depends on macros that you define before inclusion of <<string.h>>.
   85.37 -
   85.38 -PORTABILITY
   85.39 -<<strerror_r>> with a <[char *]> result is a GNU extension.
   85.40 -<<strerror_r>> with an <[int]> result is required by POSIX 2001.
   85.41 -This function is compliant only if <<_user_strerror>> is not provided,
   85.42 -or if it is thread-safe and uses separate storage according to whether
   85.43 -the second argument of that function is non-zero.  For more details
   85.44 -on <<_user_strerror>>, see the <<strerror>> documentation.
   85.45 -
   85.46 -POSIX states that the contents of <[buf]> are unspecified on error,
   85.47 -although this implementation guarantees a NUL-terminated string for
   85.48 -all except <[n]> of 0.
   85.49 -
   85.50 -POSIX recommends that unknown <[errnum]> result in a message including
   85.51 -that value, however it is not a requirement and this implementation
   85.52 -provides only an empty string (unless you provide <<_user_strerror>>).
   85.53 -POSIX also recommends that unknown <[errnum]> fail with EINVAL even
   85.54 -when providing such a message, however it is not a requirement and
   85.55 -this implementation will return success if <<_user_strerror>> provided
   85.56 -a non-empty alternate string without assigning into its third argument.
   85.57 -
   85.58 -<<strerror_r>> requires no supporting OS subroutines.
   85.59 -
   85.60 -*/
   85.61 -
   85.62 -#undef __STRICT_ANSI__
   85.63 -#define _GNU_SOURCE
   85.64 -#include <errno.h>
   85.65 -#include <string.h>
   85.66 -#undef strerror_r
   85.67 -
   85.68 -/* For backwards-compatible linking, this must be the GNU signature;
   85.69 -   see xpg_strerror_r.c for the POSIX version.  */
   85.70 -char *
   85.71 -strerror_r (int errnum,
   85.72 -	char *buffer,
   85.73 -	size_t n)
   85.74 -{
   85.75 -  char *error = _strerror_r (_REENT, errnum, 1, NULL);
   85.76 -
   85.77 -  if (strlen (error) >= n)
   85.78 -    return error;
   85.79 -  return strcpy (buffer, error);
   85.80 -}
    86.1 --- a/libc/string/strings.tex	Sat Dec 07 00:44:56 2019 +0100
    86.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    86.3 @@ -1,205 +0,0 @@
    86.4 -@node Strings
    86.5 -@chapter Strings and Memory (@file{string.h})
    86.6 -
    86.7 -This chapter describes string-handling functions and functions for
    86.8 -managing areas of memory.  The corresponding declarations are in
    86.9 -@file{string.h}.
   86.10 -
   86.11 -@menu
   86.12 -* bcmp::        Compare two memory areas
   86.13 -* bcopy::       Copy memory regions
   86.14 -* bzero::       Initialize memory to zero
   86.15 -* index::       Search for character in string
   86.16 -* memccpy::     Copy memory regions up to end-token
   86.17 -* memchr::      Find character in memory
   86.18 -* memcmp::      Compare two memory areas
   86.19 -* memcpy::      Copy memory regions
   86.20 -* memmem::      Find memory segment
   86.21 -* memmove::     Move possibly overlapping memory
   86.22 -* mempcpy::	Copy memory regions and locate end
   86.23 -* memrchr::     Reverse search for character in memory
   86.24 -* memset::      Set an area of memory
   86.25 -* rawmemchr::   Find character in memory
   86.26 -* rindex::      Reverse search for character in string
   86.27 -* stpcpy::      Copy string returning a pointer to its end
   86.28 -* stpncpy::     Counted copy string returning a pointer to its end
   86.29 -* strcasecmp::	Compare strings ignoring case
   86.30 -* strcasestr::	Find string segment ignoring case
   86.31 -* strcat::      Concatenate strings
   86.32 -* strchr::      Search for character in string
   86.33 -* strchrnul::   Search for character in string
   86.34 -* strcmp::      Character string compare
   86.35 -* strcoll::     Locale-specific character string compare
   86.36 -* strcpy::      Copy string
   86.37 -* strcspn::     Count chars not in string
   86.38 -* strerror::    Convert error number to string (strerror, strerror_l)
   86.39 -* strerror_r::  Convert error number to string
   86.40 -* strlen::      Character string length
   86.41 -* strlwr::	Convert string to lowercase
   86.42 -* strncasecmp::	Compare strings ignoring case
   86.43 -* strncat::     Concatenate strings
   86.44 -* strncmp::     Character string compare
   86.45 -* strncpy::     Counted copy string
   86.46 -* strnstr::     Find string segment
   86.47 -* strnlen::     Character string length
   86.48 -* strpbrk::     Find chars in string
   86.49 -* strrchr::     Reverse search for character in string
   86.50 -* strsignal::	Return signal message string
   86.51 -* strspn::      Find initial match
   86.52 -* strstr::      Find string segment
   86.53 -* strtok::      Get next token from a string
   86.54 -* strupr::	Convert string to upper case
   86.55 -* strverscmp::  Compare version strings
   86.56 -* strxfrm::     Transform string
   86.57 -* swab::        Swap adjacent bytes
   86.58 -* wcscasecmp::  Compare wide character strings ignoring case
   86.59 -* wcsdup::      Wide character string duplicate
   86.60 -* wcsncasecmp:: Compare wide character strings ignoring case
   86.61 -@end menu
   86.62 -
   86.63 -@page
   86.64 -@include string/bcmp.def
   86.65 -
   86.66 -@page
   86.67 -@include string/bcopy.def
   86.68 -
   86.69 -@page
   86.70 -@include string/bzero.def
   86.71 -
   86.72 -@page
   86.73 -@include string/index.def
   86.74 -
   86.75 -@page
   86.76 -@include string/memccpy.def
   86.77 -
   86.78 -@page
   86.79 -@include string/memchr.def
   86.80 -
   86.81 -@page
   86.82 -@include string/memcmp.def
   86.83 -
   86.84 -@page
   86.85 -@include string/memcpy.def
   86.86 -
   86.87 -@page
   86.88 -@include string/memmem.def
   86.89 -
   86.90 -@page
   86.91 -@include string/memmove.def
   86.92 -
   86.93 -@page
   86.94 -@include string/mempcpy.def
   86.95 -
   86.96 -@page
   86.97 -@include string/memrchr.def
   86.98 -
   86.99 -@page
  86.100 -@include string/memset.def
  86.101 -
  86.102 -@page
  86.103 -@include string/rawmemchr.def
  86.104 -
  86.105 -@page
  86.106 -@include string/rindex.def
  86.107 -
  86.108 -@page
  86.109 -@include string/stpcpy.def
  86.110 -
  86.111 -@page
  86.112 -@include string/stpncpy.def
  86.113 -
  86.114 -@page
  86.115 -@include string/strcasecmp.def
  86.116 -
  86.117 -@page
  86.118 -@include string/strcasestr.def
  86.119 -
  86.120 -@page
  86.121 -@include string/strcat.def
  86.122 -
  86.123 -@page
  86.124 -@include string/strchr.def
  86.125 -
  86.126 -@page
  86.127 -@include string/strchrnul.def
  86.128 -
  86.129 -@page
  86.130 -@include string/strcmp.def
  86.131 -
  86.132 -@page
  86.133 -@include string/strcoll.def
  86.134 -
  86.135 -@page
  86.136 -@include string/strcpy.def
  86.137 -
  86.138 -@page
  86.139 -@include string/strcspn.def
  86.140 -
  86.141 -@page
  86.142 -@include string/strerror.def
  86.143 -
  86.144 -@page
  86.145 -@include string/strerror_r.def
  86.146 -
  86.147 -@page
  86.148 -@include string/strlen.def
  86.149 -
  86.150 -@page
  86.151 -@include string/strlwr.def
  86.152 -
  86.153 -@page
  86.154 -@include string/strncasecmp.def
  86.155 -
  86.156 -@page
  86.157 -@include string/strncat.def
  86.158 -
  86.159 -@page
  86.160 -@include string/strncmp.def
  86.161 -
  86.162 -@page
  86.163 -@include string/strncpy.def
  86.164 -
  86.165 -@page
  86.166 -@include string/strnstr.def
  86.167 -
  86.168 -@page
  86.169 -@include string/strnlen.def
  86.170 -
  86.171 -@page
  86.172 -@include string/strpbrk.def
  86.173 -
  86.174 -@page
  86.175 -@include string/strrchr.def
  86.176 -
  86.177 -@page
  86.178 -@include string/strsignal.def
  86.179 -
  86.180 -@page
  86.181 -@include string/strspn.def
  86.182 -
  86.183 -@page
  86.184 -@include string/strstr.def
  86.185 -
  86.186 -@page
  86.187 -@include string/strtok.def
  86.188 -
  86.189 -@page
  86.190 -@include string/strupr.def
  86.191 -
  86.192 -@page
  86.193 -@include string/strverscmp.def
  86.194 -
  86.195 -@page
  86.196 -@include string/strxfrm.def
  86.197 -
  86.198 -@page
  86.199 -@include string/swab.def
  86.200 -
  86.201 -@page
  86.202 -@include string/wcscasecmp.def
  86.203 -
  86.204 -@page
  86.205 -@include string/wcsdup.def
  86.206 -
  86.207 -@page
  86.208 -@include string/wcsncasecmp.def
    87.1 --- a/libc/string/strlcat.c	Sat Dec 07 00:44:56 2019 +0100
    87.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    87.3 @@ -1,73 +0,0 @@
    87.4 -/*      $OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp $        */
    87.5 -
    87.6 -/*
    87.7 - * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
    87.8 - * All rights reserved.
    87.9 - *
   87.10 - * Redistribution and use in source and binary forms, with or without
   87.11 - * modification, are permitted provided that the following conditions
   87.12 - * are met:
   87.13 - * 1. Redistributions of source code must retain the above copyright
   87.14 - *    notice, this list of conditions and the following disclaimer.
   87.15 - * 2. Redistributions in binary form must reproduce the above copyright
   87.16 - *    notice, this list of conditions and the following disclaimer in the
   87.17 - *    documentation and/or other materials provided with the distribution.
   87.18 - * 3. The name of the author may not be used to endorse or promote products
   87.19 - *    derived from this software without specific prior written permission.
   87.20 - *
   87.21 - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
   87.22 - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
   87.23 - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
   87.24 - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
   87.25 - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
   87.26 - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
   87.27 - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
   87.28 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
   87.29 - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
   87.30 - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   87.31 - */
   87.32 -
   87.33 -#if defined(LIBC_SCCS) && !defined(lint)
   87.34 -static char *rcsid = "$OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp $";
   87.35 -#endif /* LIBC_SCCS and not lint */
   87.36 -
   87.37 -#include <sys/types.h>
   87.38 -#include <string.h>
   87.39 -
   87.40 -/*
   87.41 - * Appends src to string dst of size siz (unlike strncat, siz is the
   87.42 - * full size of dst, not space left).  At most siz-1 characters
   87.43 - * will be copied.  Always NUL terminates (unless siz <= strlen(dst)).
   87.44 - * Returns strlen(src) + MIN(siz, strlen(initial dst)).
   87.45 - * If retval >= siz, truncation occurred.
   87.46 - */
   87.47 -size_t
   87.48 -strlcat (char *dst,
   87.49 -	const char *src,
   87.50 -	size_t siz)
   87.51 -{
   87.52 -        register char *d = dst;
   87.53 -        register const char *s = src;
   87.54 -        register size_t n = siz;
   87.55 -        size_t dlen;
   87.56 -
   87.57 -        /* Find the end of dst and adjust bytes left but don't go past end */
   87.58 -        while (n-- != 0 && *d != '\0')
   87.59 -                d++;
   87.60 -        dlen = d - dst;
   87.61 -        n = siz - dlen;
   87.62 -
   87.63 -        if (n == 0)
   87.64 -                return(dlen + strlen(s));
   87.65 -        while (*s != '\0') {
   87.66 -                if (n != 1) {
   87.67 -                        *d++ = *s;
   87.68 -                        n--;
   87.69 -                }
   87.70 -                s++;
   87.71 -        }
   87.72 -        *d = '\0';
   87.73 -
   87.74 -        return(dlen + (s - src));        /* count does not include NUL */
   87.75 -}
   87.76 -
    88.1 --- a/libc/string/strlcpy.c	Sat Dec 07 00:44:56 2019 +0100
    88.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    88.3 @@ -1,69 +0,0 @@
    88.4 -/*      $OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp $        */
    88.5 -
    88.6 -/*
    88.7 - * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
    88.8 - * All rights reserved.
    88.9 - *
   88.10 - * Redistribution and use in source and binary forms, with or without
   88.11 - * modification, are permitted provided that the following conditions
   88.12 - * are met:
   88.13 - * 1. Redistributions of source code must retain the above copyright
   88.14 - *    notice, this list of conditions and the following disclaimer.
   88.15 - * 2. Redistributions in binary form must reproduce the above copyright
   88.16 - *    notice, this list of conditions and the following disclaimer in the
   88.17 - *    documentation and/or other materials provided with the distribution.
   88.18 - * 3. The name of the author may not be used to endorse or promote products
   88.19 - *    derived from this software without specific prior written permission.
   88.20 - *
   88.21 - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
   88.22 - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
   88.23 - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
   88.24 - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
   88.25 - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
   88.26 - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
   88.27 - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
   88.28 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
   88.29 - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
   88.30 - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   88.31 - */
   88.32 -
   88.33 -#if defined(LIBC_SCCS) && !defined(lint)
   88.34 -static char *rcsid = "$OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp $";
   88.35 -#endif /* LIBC_SCCS and not lint */
   88.36 -
   88.37 -#include <sys/types.h>
   88.38 -#include <string.h>
   88.39 -
   88.40 -/*
   88.41 - * Copy src to string dst of size siz.  At most siz-1 characters
   88.42 - * will be copied.  Always NUL terminates (unless siz == 0).
   88.43 - * Returns strlen(src); if retval >= siz, truncation occurred.
   88.44 - */
   88.45 -size_t
   88.46 -strlcpy (char *dst,
   88.47 -	const char *src,
   88.48 -	size_t siz)
   88.49 -{
   88.50 -        register char *d = dst;
   88.51 -        register const char *s = src;
   88.52 -        register size_t n = siz;
   88.53 -
   88.54 -        /* Copy as many bytes as will fit */
   88.55 -        if (n != 0 && --n != 0) {
   88.56 -                do {
   88.57 -                        if ((*d++ = *s++) == 0)
   88.58 -                                break;
   88.59 -                } while (--n != 0);
   88.60 -        }
   88.61 -
   88.62 -        /* Not enough room in dst, add NUL and traverse rest of src */
   88.63 -        if (n == 0) {
   88.64 -                if (siz != 0)
   88.65 -                        *d = '\0';                /* NUL-terminate dst */
   88.66 -                while (*s++)
   88.67 -                        ;
   88.68 -        }
   88.69 -
   88.70 -        return(s - src - 1);        /* count does not include NUL */
   88.71 -}
   88.72 -
    89.1 --- a/libc/string/strlen.c	Sat Dec 07 00:44:56 2019 +0100
    89.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    89.3 @@ -1,82 +0,0 @@
    89.4 -/*
    89.5 -FUNCTION
    89.6 -	<<strlen>>---character string length
    89.7 -
    89.8 -INDEX
    89.9 -	strlen
   89.10 -
   89.11 -SYNOPSIS
   89.12 -	#include <string.h>
   89.13 -	size_t strlen(const char *<[str]>);
   89.14 -
   89.15 -DESCRIPTION
   89.16 -	The <<strlen>> function works out the length of the string
   89.17 -	starting at <<*<[str]>>> by counting chararacters until it
   89.18 -	reaches a <<NULL>> character.
   89.19 -
   89.20 -RETURNS
   89.21 -	<<strlen>> returns the character count.
   89.22 -
   89.23 -PORTABILITY
   89.24 -<<strlen>> is ANSI C.
   89.25 -
   89.26 -<<strlen>> requires no supporting OS subroutines.
   89.27 -
   89.28 -QUICKREF
   89.29 -	strlen ansi pure
   89.30 -*/
   89.31 -
   89.32 -#include <_ansi.h>
   89.33 -#include <string.h>
   89.34 -#include <limits.h>
   89.35 -
   89.36 -#define LBLOCKSIZE   (sizeof (long))
   89.37 -#define UNALIGNED(X) ((long)X & (LBLOCKSIZE - 1))
   89.38 -
   89.39 -#if LONG_MAX == 2147483647L
   89.40 -#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
   89.41 -#else
   89.42 -#if LONG_MAX == 9223372036854775807L
   89.43 -/* Nonzero if X (a long int) contains a NULL byte. */
   89.44 -#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
   89.45 -#else
   89.46 -#error long int is not a 32bit or 64bit type.
   89.47 -#endif
   89.48 -#endif
   89.49 -
   89.50 -#ifndef DETECTNULL
   89.51 -#error long int is not a 32bit or 64bit byte
   89.52 -#endif
   89.53 -
   89.54 -size_t
   89.55 -strlen (const char *str)
   89.56 -{
   89.57 -  const char *start = str;
   89.58 -
   89.59 -#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__)
   89.60 -  unsigned long *aligned_addr;
   89.61 -
   89.62 -  /* Align the pointer, so we can search a word at a time.  */
   89.63 -  while (UNALIGNED (str))
   89.64 -    {
   89.65 -      if (!*str)
   89.66 -	return str - start;
   89.67 -      str++;
   89.68 -    }
   89.69 -
   89.70 -  /* If the string is word-aligned, we can check for the presence of
   89.71 -     a null in each word-sized block.  */
   89.72 -  aligned_addr = (unsigned long *)str;
   89.73 -  while (!DETECTNULL (*aligned_addr))
   89.74 -    aligned_addr++;
   89.75 -
   89.76 -  /* Once a null is detected, we check each byte in that block for a
   89.77 -     precise position of the null.  */
   89.78 -  str = (char *) aligned_addr;
   89.79 -
   89.80 -#endif /* not PREFER_SIZE_OVER_SPEED */
   89.81 -
   89.82 -  while (*str)
   89.83 -    str++;
   89.84 -  return str - start;
   89.85 -}
    90.1 --- a/libc/string/strlwr.c	Sat Dec 07 00:44:56 2019 +0100
    90.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    90.3 @@ -1,40 +0,0 @@
    90.4 -/*
    90.5 -FUNCTION
    90.6 -	<<strlwr>>---force string to lowercase
    90.7 -	
    90.8 -INDEX
    90.9 -	strlwr
   90.10 -
   90.11 -SYNOPSIS
   90.12 -	#include <string.h>
   90.13 -	char *strlwr(char *<[a]>);
   90.14 -
   90.15 -DESCRIPTION
   90.16 -	<<strlwr>> converts each character in the string at <[a]> to
   90.17 -	lowercase.
   90.18 -
   90.19 -RETURNS
   90.20 -	<<strlwr>> returns its argument, <[a]>.
   90.21 -
   90.22 -PORTABILITY
   90.23 -<<strlwr>> is not widely portable.
   90.24 -
   90.25 -<<strlwr>> requires no supporting OS subroutines.
   90.26 -
   90.27 -QUICKREF
   90.28 -	strlwr
   90.29 -*/
   90.30 -
   90.31 -#include <string.h>
   90.32 -#include <ctype.h>
   90.33 -
   90.34 -char *
   90.35 -strlwr (char *s)
   90.36 -{
   90.37 -  unsigned char *ucs = (unsigned char *) s;
   90.38 -  for ( ; *ucs != '\0'; ucs++)
   90.39 -    {
   90.40 -      *ucs = tolower(*ucs);
   90.41 -    }
   90.42 -  return s;
   90.43 -}
    91.1 --- a/libc/string/strncasecmp.c	Sat Dec 07 00:44:56 2019 +0100
    91.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    91.3 @@ -1,53 +0,0 @@
    91.4 -/*
    91.5 -FUNCTION
    91.6 -	<<strncasecmp>>---case-insensitive character string compare
    91.7 -	
    91.8 -INDEX
    91.9 -	strncasecmp
   91.10 -
   91.11 -SYNOPSIS
   91.12 -	#include <strings.h>
   91.13 -	int strncasecmp(const char *<[a]>, const char * <[b]>, size_t <[length]>);
   91.14 -
   91.15 -DESCRIPTION
   91.16 -	<<strncasecmp>> compares up to <[length]> characters
   91.17 -	from the string at <[a]> to the string at <[b]> in a 
   91.18 -	case-insensitive manner.
   91.19 -
   91.20 -RETURNS
   91.21 -
   91.22 -	If <<*<[a]>>> sorts lexicographically after <<*<[b]>>> (after
   91.23 -	both are converted to lowercase), <<strncasecmp>> returns a
   91.24 -	number greater than zero.  If the two strings are equivalent,
   91.25 -	<<strncasecmp>> returns zero.  If <<*<[a]>>> sorts
   91.26 -	lexicographically before <<*<[b]>>>, <<strncasecmp>> returns a
   91.27 -	number less than zero.
   91.28 -
   91.29 -PORTABILITY
   91.30 -<<strncasecmp>> is in the Berkeley Software Distribution.
   91.31 -
   91.32 -<<strncasecmp>> requires no supporting OS subroutines. It uses
   91.33 -tolower() from elsewhere in this library.
   91.34 -
   91.35 -QUICKREF
   91.36 -	strncasecmp
   91.37 -*/
   91.38 -
   91.39 -#include <strings.h>
   91.40 -#include <ctype.h>
   91.41 -
   91.42 -int 
   91.43 -strncasecmp (const char *s1,
   91.44 -	const char *s2,
   91.45 -	size_t n)
   91.46 -{
   91.47 -  int d = 0;
   91.48 -  for ( ; n != 0; n--)
   91.49 -    {
   91.50 -      const int c1 = tolower(*s1++);
   91.51 -      const int c2 = tolower(*s2++);
   91.52 -      if (((d = c1 - c2) != 0) || (c2 == '\0'))
   91.53 -        break;
   91.54 -    }
   91.55 -  return d;
   91.56 -}
    92.1 --- a/libc/string/strncasecmp_l.c	Sat Dec 07 00:44:56 2019 +0100
    92.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    92.3 @@ -1,56 +0,0 @@
    92.4 -/*
    92.5 -FUNCTION
    92.6 -	<<strncasecmp_l>>---case-insensitive character string compare
    92.7 -	
    92.8 -INDEX
    92.9 -	strncasecmp_l
   92.10 -
   92.11 -SYNOPSIS
   92.12 -	#include <strings.h>
   92.13 -	int strncasecmp_l(const char *<[a]>, const char * <[b]>,
   92.14 -			  size_t <[length]>, locale_t <[locale]>);
   92.15 -
   92.16 -DESCRIPTION
   92.17 -	<<strncasecmp_l>> compares up to <[length]> characters
   92.18 -	from the string at <[a]> to the string at <[b]> in a 
   92.19 -	case-insensitive manner.
   92.20 -
   92.21 -	if <[locale]> is LC_GLOBAL_LOCALE or not a valid locale object, the
   92.22 -	behaviour is undefined.
   92.23 -
   92.24 -RETURNS
   92.25 -
   92.26 -	If <<*<[a]>>> sorts lexicographically after <<*<[b]>>> (after
   92.27 -	both are converted to lowercase), <<strncasecmp_l>> returns a
   92.28 -	number greater than zero.  If the two strings are equivalent,
   92.29 -	<<strncasecmp_l>> returns zero.  If <<*<[a]>>> sorts
   92.30 -	lexicographically before <<*<[b]>>>, <<strncasecmp_l>> returns a
   92.31 -	number less than zero.
   92.32 -
   92.33 -PORTABILITY
   92.34 -<<strncasecmp_l>> is POSIX-1.2008.
   92.35 -
   92.36 -<<strncasecmp_l>> requires no supporting OS subroutines. It uses
   92.37 -tolower_l() from elsewhere in this library.
   92.38 -
   92.39 -QUICKREF
   92.40 -	strncasecmp_l
   92.41 -*/
   92.42 -
   92.43 -#include <strings.h>
   92.44 -#include <ctype.h>
   92.45 -
   92.46 -int 
   92.47 -strncasecmp_l (const char *s1, const char *s2, size_t n,
   92.48 -	       struct __locale_t *locale)
   92.49 -{
   92.50 -  int d = 0;
   92.51 -  for ( ; n != 0; n--)
   92.52 -    {
   92.53 -      const int c1 = tolower_l (*s1++, locale);
   92.54 -      const int c2 = tolower_l (*s2++, locale);
   92.55 -      if (((d = c1 - c2) != 0) || (c2 == '\0'))
   92.56 -        break;
   92.57 -    }
   92.58 -  return d;
   92.59 -}
    93.1 --- a/libc/string/strncat.c	Sat Dec 07 00:44:56 2019 +0100
    93.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    93.3 @@ -1,107 +0,0 @@
    93.4 -/*
    93.5 -FUNCTION
    93.6 -	<<strncat>>---concatenate strings
    93.7 -
    93.8 -INDEX
    93.9 -	strncat
   93.10 -
   93.11 -SYNOPSIS
   93.12 -	#include <string.h>
   93.13 -	char *strncat(char *restrict <[dst]>, const char *restrict <[src]>,
   93.14 -                      size_t <[length]>);
   93.15 -
   93.16 -DESCRIPTION
   93.17 -	<<strncat>> appends not more than <[length]> characters from
   93.18 -	the string pointed to by <[src]> (including the	terminating
   93.19 -	null character) to the end of the string pointed to by
   93.20 -	<[dst]>.  The initial character of <[src]> overwrites the null
   93.21 -	character at the end of <[dst]>.  A terminating null character
   93.22 -	is always appended to the result
   93.23 -
   93.24 -WARNINGS
   93.25 -	Note that a null is always appended, so that if the copy is
   93.26 -	limited by the <[length]> argument, the number of characters
   93.27 -	appended to <[dst]> is <<n + 1>>.
   93.28 -
   93.29 -RETURNS
   93.30 -	This function returns the initial value of <[dst]>
   93.31 -
   93.32 -PORTABILITY
   93.33 -<<strncat>> is ANSI C.
   93.34 -
   93.35 -<<strncat>> requires no supporting OS subroutines.
   93.36 -
   93.37 -QUICKREF
   93.38 -	strncat ansi pure
   93.39 -*/
   93.40 -
   93.41 -#include <string.h>
   93.42 -#include <limits.h>
   93.43 -
   93.44 -/* Nonzero if X is aligned on a "long" boundary.  */
   93.45 -#define ALIGNED(X) \
   93.46 -  (((long)X & (sizeof (long) - 1)) == 0)
   93.47 -
   93.48 -#if LONG_MAX == 2147483647L
   93.49 -#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
   93.50 -#else
   93.51 -#if LONG_MAX == 9223372036854775807L
   93.52 -/* Nonzero if X (a long int) contains a NULL byte. */
   93.53 -#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
   93.54 -#else
   93.55 -#error long int is not a 32bit or 64bit type.
   93.56 -#endif
   93.57 -#endif
   93.58 -
   93.59 -#ifndef DETECTNULL
   93.60 -#error long int is not a 32bit or 64bit byte
   93.61 -#endif
   93.62 -
   93.63 -char *
   93.64 -strncat (char *__restrict s1,
   93.65 -	const char *__restrict s2,
   93.66 -	size_t n)
   93.67 -{
   93.68 -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
   93.69 -  char *s = s1;
   93.70 -
   93.71 -  while (*s1)
   93.72 -    s1++;
   93.73 -  while (n-- != 0 && (*s1++ = *s2++))
   93.74 -    {
   93.75 -      if (n == 0)
   93.76 -	*s1 = '\0';
   93.77 -    }
   93.78 -
   93.79 -  return s;
   93.80 -#else
   93.81 -  char *s = s1;
   93.82 -
   93.83 -  /* Skip over the data in s1 as quickly as possible.  */
   93.84 -  if (ALIGNED (s1))
   93.85 -    {
   93.86 -      unsigned long *aligned_s1 = (unsigned long *)s1;
   93.87 -      while (!DETECTNULL (*aligned_s1))
   93.88 -	aligned_s1++;
   93.89 -
   93.90 -      s1 = (char *)aligned_s1;
   93.91 -    }
   93.92 -
   93.93 -  while (*s1)
   93.94 -    s1++;
   93.95 -
   93.96 -  /* s1 now points to the its trailing null character, now copy
   93.97 -     up to N bytes from S2 into S1 stopping if a NULL is encountered
   93.98 -     in S2.
   93.99 -
  93.100 -     It is not safe to use strncpy here since it copies EXACTLY N
  93.101 -     characters, NULL padding if necessary.  */
  93.102 -  while (n-- != 0 && (*s1++ = *s2++))
  93.103 -    {
  93.104 -      if (n == 0)
  93.105 -	*s1 = '\0';
  93.106 -    }
  93.107 -	
  93.108 -  return s;
  93.109 -#endif /* not PREFER_SIZE_OVER_SPEED */
  93.110 -}
    94.1 --- a/libc/string/strncmp.c	Sat Dec 07 00:44:56 2019 +0100
    94.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    94.3 @@ -1,114 +0,0 @@
    94.4 -/*
    94.5 -FUNCTION
    94.6 -	<<strncmp>>---character string compare
    94.7 -	
    94.8 -INDEX
    94.9 -	strncmp
   94.10 -
   94.11 -SYNOPSIS
   94.12 -	#include <string.h>
   94.13 -	int strncmp(const char *<[a]>, const char * <[b]>, size_t <[length]>);
   94.14 -
   94.15 -DESCRIPTION
   94.16 -	<<strncmp>> compares up to <[length]> characters
   94.17 -	from the string at <[a]> to the string at <[b]>.
   94.18 -
   94.19 -RETURNS
   94.20 -	If <<*<[a]>>> sorts lexicographically after <<*<[b]>>>,
   94.21 -	<<strncmp>> returns a number greater than zero.  If the two
   94.22 -	strings are equivalent, <<strncmp>> returns zero.  If <<*<[a]>>>
   94.23 -	sorts lexicographically before <<*<[b]>>>, <<strncmp>> returns a
   94.24 -	number less than zero.
   94.25 -
   94.26 -PORTABILITY
   94.27 -<<strncmp>> is ANSI C.
   94.28 -
   94.29 -<<strncmp>> requires no supporting OS subroutines.
   94.30 -
   94.31 -QUICKREF
   94.32 -	strncmp ansi pure
   94.33 -*/
   94.34 -
   94.35 -#include <string.h>
   94.36 -#include <limits.h>
   94.37 -
   94.38 -/* Nonzero if either X or Y is not aligned on a "long" boundary.  */
   94.39 -#define UNALIGNED(X, Y) \
   94.40 -  (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
   94.41 -
   94.42 -/* DETECTNULL returns nonzero if (long)X contains a NULL byte. */
   94.43 -#if LONG_MAX == 2147483647L
   94.44 -#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
   94.45 -#else
   94.46 -#if LONG_MAX == 9223372036854775807L
   94.47 -#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
   94.48 -#else
   94.49 -#error long int is not a 32bit or 64bit type.
   94.50 -#endif
   94.51 -#endif
   94.52 -
   94.53 -#ifndef DETECTNULL
   94.54 -#error long int is not a 32bit or 64bit byte
   94.55 -#endif
   94.56 -
   94.57 -int 
   94.58 -strncmp (const char *s1,
   94.59 -	const char *s2,
   94.60 -	size_t n)
   94.61 -{
   94.62 -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
   94.63 -  if (n == 0)
   94.64 -    return 0;
   94.65 -
   94.66 -  while (n-- != 0 && *s1 == *s2)
   94.67 -    {
   94.68 -      if (n == 0 || *s1 == '\0')
   94.69 -	break;
   94.70 -      s1++;
   94.71 -      s2++;
   94.72 -    }
   94.73 -
   94.74 -  return (*(unsigned char *) s1) - (*(unsigned char *) s2);
   94.75 -#else
   94.76 -  unsigned long *a1;
   94.77 -  unsigned long *a2;
   94.78 -
   94.79 -  if (n == 0)
   94.80 -    return 0;
   94.81 -
   94.82 -  /* If s1 or s2 are unaligned, then compare bytes. */
   94.83 -  if (!UNALIGNED (s1, s2))
   94.84 -    {
   94.85 -      /* If s1 and s2 are word-aligned, compare them a word at a time. */
   94.86 -      a1 = (unsigned long*)s1;
   94.87 -      a2 = (unsigned long*)s2;
   94.88 -      while (n >= sizeof (long) && *a1 == *a2)
   94.89 -        {
   94.90 -          n -= sizeof (long);
   94.91 -
   94.92 -          /* If we've run out of bytes or hit a null, return zero
   94.93 -	     since we already know *a1 == *a2.  */
   94.94 -          if (n == 0 || DETECTNULL (*a1))
   94.95 -	    return 0;
   94.96 -
   94.97 -          a1++;
   94.98 -          a2++;
   94.99 -        }
  94.100 -
  94.101 -      /* A difference was detected in last few bytes of s1, so search bytewise */
  94.102 -      s1 = (char*)a1;
  94.103 -      s2 = (char*)a2;
  94.104 -    }
  94.105 -
  94.106 -  while (n-- > 0 && *s1 == *s2)
  94.107 -    {
  94.108 -      /* If we've run out of bytes or hit a null, return zero
  94.109 -	 since we already know *s1 == *s2.  */
  94.110 -      if (n == 0 || *s1 == '\0')
  94.111 -	return 0;
  94.112 -      s1++;
  94.113 -      s2++;
  94.114 -    }
  94.115 -  return (*(unsigned char *) s1) - (*(unsigned char *) s2);
  94.116 -#endif /* not PREFER_SIZE_OVER_SPEED */
  94.117 -}
    95.1 --- a/libc/string/strncpy.c	Sat Dec 07 00:44:56 2019 +0100
    95.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    95.3 @@ -1,118 +0,0 @@
    95.4 -/*
    95.5 -FUNCTION
    95.6 -	<<strncpy>>---counted copy string
    95.7 -
    95.8 -INDEX
    95.9 -	strncpy
   95.10 -
   95.11 -SYNOPSIS
   95.12 -	#include <string.h>
   95.13 -	char *strncpy(char *restrict <[dst]>, const char *restrict <[src]>,
   95.14 -                      size_t <[length]>);
   95.15 -
   95.16 -DESCRIPTION
   95.17 -	<<strncpy>> copies not more than <[length]> characters from the
   95.18 -	the string pointed to by <[src]> (including the terminating
   95.19 -	null character) to the array pointed to by <[dst]>.  If the
   95.20 -	string pointed to by <[src]> is shorter than <[length]>
   95.21 -	characters, null characters are appended to the destination
   95.22 -	array until a total of <[length]> characters have been
   95.23 -	written.
   95.24 -
   95.25 -RETURNS
   95.26 -	This function returns the initial value of <[dst]>.
   95.27 -
   95.28 -PORTABILITY
   95.29 -<<strncpy>> is ANSI C.
   95.30 -
   95.31 -<<strncpy>> requires no supporting OS subroutines.
   95.32 -
   95.33 -QUICKREF
   95.34 -	strncpy ansi pure
   95.35 -*/
   95.36 -
   95.37 -#include <string.h>
   95.38 -#include <limits.h>
   95.39 -
   95.40 -/*SUPPRESS 560*/
   95.41 -/*SUPPRESS 530*/
   95.42 -
   95.43 -/* Nonzero if either X or Y is not aligned on a "long" boundary.  */
   95.44 -#define UNALIGNED(X, Y) \
   95.45 -  (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
   95.46 -
   95.47 -#if LONG_MAX == 2147483647L
   95.48 -#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
   95.49 -#else
   95.50 -#if LONG_MAX == 9223372036854775807L
   95.51 -/* Nonzero if X (a long int) contains a NULL byte. */
   95.52 -#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
   95.53 -#else
   95.54 -#error long int is not a 32bit or 64bit type.
   95.55 -#endif
   95.56 -#endif
   95.57 -
   95.58 -#ifndef DETECTNULL
   95.59 -#error long int is not a 32bit or 64bit byte
   95.60 -#endif
   95.61 -
   95.62 -#define TOO_SMALL(LEN) ((LEN) < sizeof (long))
   95.63 -
   95.64 -char *
   95.65 -strncpy (char *__restrict dst0,
   95.66 -	const char *__restrict src0,
   95.67 -	size_t count)
   95.68 -{
   95.69 -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
   95.70 -  char *dscan;
   95.71 -  const char *sscan;
   95.72 -
   95.73 -  dscan = dst0;
   95.74 -  sscan = src0;
   95.75 -  while (count > 0)
   95.76 -    {
   95.77 -      --count;
   95.78 -      if ((*dscan++ = *sscan++) == '\0')
   95.79 -	break;
   95.80 -    }
   95.81 -  while (count-- > 0)
   95.82 -    *dscan++ = '\0';
   95.83 -
   95.84 -  return dst0;
   95.85 -#else
   95.86 -  char *dst = dst0;
   95.87 -  const char *src = src0;
   95.88 -  long *aligned_dst;
   95.89 -  const long *aligned_src;
   95.90 -
   95.91 -  /* If SRC and DEST is aligned and count large enough, then copy words.  */
   95.92 -  if (!UNALIGNED (src, dst) && !TOO_SMALL (count))
   95.93 -    {
   95.94 -      aligned_dst = (long*)dst;
   95.95 -      aligned_src = (long*)src;
   95.96 -
   95.97 -      /* SRC and DEST are both "long int" aligned, try to do "long int"
   95.98 -	 sized copies.  */
   95.99 -      while (count >= sizeof (long int) && !DETECTNULL(*aligned_src))
  95.100 -	{
  95.101 -	  count -= sizeof (long int);
  95.102 -	  *aligned_dst++ = *aligned_src++;
  95.103 -	}
  95.104 -
  95.105 -      dst = (char*)aligned_dst;
  95.106 -      src = (char*)aligned_src;
  95.107 -    }
  95.108 -
  95.109 -  while (count > 0)
  95.110 -    {
  95.111 -      --count;
  95.112 -      if ((*dst++ = *src++) == '\0')
  95.113 -	break;
  95.114 -    }
  95.115 -
  95.116 -  while (count-- > 0)
  95.117 -    *dst++ = '\0';
  95.118 -
  95.119 -  return dst0;
  95.120 -#endif /* not PREFER_SIZE_OVER_SPEED */
  95.121 -}
    96.1 --- a/libc/string/strndup.c	Sat Dec 07 00:44:56 2019 +0100
    96.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    96.3 @@ -1,15 +0,0 @@
    96.4 -#ifndef _REENT_ONLY
    96.5 -
    96.6 -#include <_ansi.h>
    96.7 -#include <reent.h>
    96.8 -#include <stdlib.h>
    96.9 -#include <string.h>
   96.10 -
   96.11 -char *
   96.12 -strndup (const char *str,
   96.13 -	size_t n)
   96.14 -{
   96.15 -  return _strndup_r (_REENT, str, n);
   96.16 -}
   96.17 -
   96.18 -#endif /* !_REENT_ONLY */
    97.1 --- a/libc/string/strndup_r.c	Sat Dec 07 00:44:56 2019 +0100
    97.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    97.3 @@ -1,26 +0,0 @@
    97.4 -#include <reent.h>
    97.5 -#include <stdlib.h>
    97.6 -#include <string.h>
    97.7 -
    97.8 -char *
    97.9 -_strndup_r (struct _reent *reent_ptr,
   97.10 -        const char   *str,
   97.11 -        size_t n)
   97.12 -{
   97.13 -  const char *ptr = str;
   97.14 -  size_t len;
   97.15 -  char *copy;
   97.16 -
   97.17 -  while (n-- > 0 && *ptr)
   97.18 -    ptr++;
   97.19 -
   97.20 -  len = ptr - str;
   97.21 -
   97.22 -  copy = _malloc_r (reent_ptr, len + 1);
   97.23 -  if (copy)
   97.24 -    {
   97.25 -      memcpy (copy, str, len);
   97.26 -      copy[len] = '\0';
   97.27 -    }
   97.28 -  return copy;
   97.29 -}
    98.1 --- a/libc/string/strnlen.c	Sat Dec 07 00:44:56 2019 +0100
    98.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    98.3 @@ -1,42 +0,0 @@
    98.4 -/* 
    98.5 -FUNCTION
    98.6 -	<<strnlen>>---character string length
    98.7 -	
    98.8 -INDEX
    98.9 -	strnlen
   98.10 -
   98.11 -SYNOPSIS
   98.12 -	#include <string.h>
   98.13 -	size_t strnlen(const char *<[str]>, size_t <[n]>);
   98.14 -
   98.15 -DESCRIPTION
   98.16 -	The <<strnlen>> function works out the length of the string
   98.17 -	starting at <<*<[str]>>> by counting chararacters until it
   98.18 -	reaches a NUL character or the maximum: <[n]> number of
   98.19 -        characters have been inspected.
   98.20 -
   98.21 -RETURNS
   98.22 -	<<strnlen>> returns the character count or <[n]>.
   98.23 -
   98.24 -PORTABILITY
   98.25 -<<strnlen>> is a GNU extension.
   98.26 -
   98.27 -<<strnlen>> requires no supporting OS subroutines.
   98.28 -
   98.29 -*/
   98.30 -
   98.31 -#undef __STRICT_ANSI__
   98.32 -#include <_ansi.h>
   98.33 -#include <string.h>
   98.34 -
   98.35 -size_t
   98.36 -strnlen (const char *str,
   98.37 -	size_t n)
   98.38 -{
   98.39 -  const char *start = str;
   98.40 -
   98.41 -  while (n-- > 0 && *str)
   98.42 -    str++;
   98.43 -
   98.44 -  return str - start;
   98.45 -}
    99.1 --- a/libc/string/strnstr.c	Sat Dec 07 00:44:56 2019 +0100
    99.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    99.3 @@ -1,51 +0,0 @@
    99.4 -/*
    99.5 -FUNCTION
    99.6 -	<<strnstr>>---find string segment
    99.7 -
    99.8 -INDEX
    99.9 -	strnstr
   99.10 -
   99.11 -SYNOPSIS
   99.12 -	#include <string.h>
   99.13 -	size_t strnstr(const char *<[s1]>, const char *<[s2]>, size_t <[n]>);
   99.14 -
   99.15 -DESCRIPTION
   99.16 -	Locates the first occurrence in the string pointed to by <[s1]> of
   99.17 -	the sequence of limited to the <[n]> characters in the string
   99.18 -        pointed to by <[s2]>
   99.19 -
   99.20 -RETURNS
   99.21 -	Returns a pointer to the located string segment, or a null
   99.22 -	pointer if the string <[s2]> is not found. If <[s2]> points to
   99.23 -	a string with zero length, <[s1]> is returned.
   99.24 -
   99.25 -
   99.26 -PORTABILITY
   99.27 -<<strnstr>> is a BSD extension.
   99.28 -
   99.29 -<<strnstr>> requires no supporting OS subroutines.
   99.30 -
   99.31 -QUICKREF
   99.32 -	strnstr pure
   99.33 -
   99.34 -*/
   99.35 -
   99.36 -#define	_GNU_SOURCE
   99.37 -#include <string.h>
   99.38 -
   99.39 -/*
   99.40 - * Find the first occurrence of find in s, where the search is limited to the
   99.41 - * first slen characters of s.
   99.42 - */
   99.43 -char *
   99.44 -strnstr(const char *haystack, const char *needle, size_t haystack_len)
   99.45 -{
   99.46 -  size_t needle_len = strnlen(needle, haystack_len);
   99.47 -
   99.48 -  if (needle_len < haystack_len || !needle[needle_len]) {
   99.49 -    char *x = memmem(haystack, haystack_len, needle, needle_len);
   99.50 -    if (x && !memchr(haystack, 0, x - haystack))
   99.51 -      return x;
   99.52 -  }
   99.53 -  return NULL;
   99.54 -}
   100.1 --- a/libc/string/strpbrk.c	Sat Dec 07 00:44:56 2019 +0100
   100.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   100.3 @@ -1,51 +0,0 @@
   100.4 -/*
   100.5 -FUNCTION
   100.6 -	<<strpbrk>>---find characters in string
   100.7 -
   100.8 -INDEX
   100.9 -	strpbrk
  100.10 -
  100.11 -SYNOPSIS
  100.12 -	#include <string.h>
  100.13 -	char *strpbrk(const char *<[s1]>, const char *<[s2]>);
  100.14 -
  100.15 -DESCRIPTION
  100.16 -	This function locates the first occurence in the string
  100.17 -	pointed to by <[s1]> of any character in string pointed to by
  100.18 -	<[s2]> (excluding the terminating null character).
  100.19 -
  100.20 -RETURNS
  100.21 -	<<strpbrk>> returns a pointer to the character found in <[s1]>, or a
  100.22 -	null pointer if no character from <[s2]> occurs in <[s1]>.
  100.23 -
  100.24 -PORTABILITY
  100.25 -<<strpbrk>> requires no supporting OS subroutines.
  100.26 -*/
  100.27 -
  100.28 -#include <string.h>
  100.29 -
  100.30 -char *
  100.31 -strpbrk (const char *s1,
  100.32 -	const char *s2)
  100.33 -{
  100.34 -  const char *c = s2;
  100.35 -  if (!*s1)
  100.36 -    return (char *) NULL;
  100.37 -
  100.38 -  while (*s1)
  100.39 -    {
  100.40 -      for (c = s2; *c; c++)
  100.41 -	{
  100.42 -	  if (*s1 == *c)
  100.43 -	    break;
  100.44 -	}
  100.45 -      if (*c)
  100.46 -	break;
  100.47 -      s1++;
  100.48 -    }
  100.49 -
  100.50 -  if (*c == '\0')
  100.51 -    s1 = NULL;
  100.52 -
  100.53 -  return (char *) s1;
  100.54 -}
   101.1 --- a/libc/string/strrchr.c	Sat Dec 07 00:44:56 2019 +0100
   101.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   101.3 @@ -1,52 +0,0 @@
   101.4 -/*
   101.5 -FUNCTION
   101.6 -	<<strrchr>>---reverse search for character in string
   101.7 -
   101.8 -INDEX
   101.9 -	strrchr
  101.10 -
  101.11 -SYNOPSIS
  101.12 -	#include <string.h>
  101.13 -	char * strrchr(const char *<[string]>, int <[c]>);
  101.14 -
  101.15 -DESCRIPTION
  101.16 -	This function finds the last occurence of <[c]> (converted to
  101.17 -	a char) in the string pointed to by <[string]> (including the
  101.18 -	terminating null character).
  101.19 -
  101.20 -RETURNS
  101.21 -	Returns a pointer to the located character, or a null pointer
  101.22 -	if <[c]> does not occur in <[string]>.
  101.23 -
  101.24 -PORTABILITY
  101.25 -<<strrchr>> is ANSI C.
  101.26 -
  101.27 -<<strrchr>> requires no supporting OS subroutines.
  101.28 -
  101.29 -QUICKREF
  101.30 -	strrchr ansi pure
  101.31 -*/
  101.32 -
  101.33 -#include <string.h>
  101.34 -
  101.35 -char *
  101.36 -strrchr (const char *s,
  101.37 -	int i)
  101.38 -{
  101.39 -  const char *last = NULL;
  101.40 -
  101.41 -  if (i)
  101.42 -    {
  101.43 -      while ((s=strchr(s, i)))
  101.44 -	{
  101.45 -	  last = s;
  101.46 -	  s++;
  101.47 -	}
  101.48 -    }
  101.49 -  else
  101.50 -    {
  101.51 -      last = strchr(s, i);
  101.52 -    }
  101.53 -		  
  101.54 -  return (char *) last;
  101.55 -}
   102.1 --- a/libc/string/strsep.c	Sat Dec 07 00:44:56 2019 +0100
   102.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   102.3 @@ -1,18 +0,0 @@
   102.4 -/* BSD strsep function */
   102.5 -
   102.6 -/* Copyright 2002, Red Hat Inc. */
   102.7 -
   102.8 -/* undef STRICT_ANSI so that strsep prototype will be defined */
   102.9 -#undef  __STRICT_ANSI__
  102.10 -#include <string.h>
  102.11 -#include <_ansi.h>
  102.12 -#include <reent.h>
  102.13 -
  102.14 -extern char *__strtok_r (char *, const char *, char **, int);
  102.15 -
  102.16 -char *
  102.17 -strsep (register char **source_ptr,
  102.18 -	register const char *delim)
  102.19 -{
  102.20 -	return __strtok_r (*source_ptr, delim, source_ptr, 0);
  102.21 -}
   103.1 --- a/libc/string/strsignal.c	Sat Dec 07 00:44:56 2019 +0100
   103.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   103.3 @@ -1,249 +0,0 @@
   103.4 -/*
   103.5 -FUNCTION
   103.6 -	<<strsignal>>---convert signal number to string
   103.7 -
   103.8 -INDEX
   103.9 -	strsignal
  103.10 -
  103.11 -SYNOPSIS
  103.12 -	#include <string.h>
  103.13 -	char *strsignal(int <[signal]>);
  103.14 -
  103.15 -DESCRIPTION
  103.16 -<<strsignal>> converts the signal number <[signal]> into a
  103.17 -string.  If <[signal]> is not a known signal number, the result
  103.18 -will be of the form "Unknown signal NN" where NN is the <[signal]>
  103.19 -is a decimal number.
  103.20 -
  103.21 -RETURNS
  103.22 -This function returns a pointer to a string.  Your application must
  103.23 -not modify that string.
  103.24 -
  103.25 -PORTABILITY
  103.26 -POSIX.1-2008 C requires <<strsignal>>, but does not specify the strings used
  103.27 -for each signal number.
  103.28 -
  103.29 -<<strsignal>> requires no supporting OS subroutines.
  103.30 -
  103.31 -QUICKREF
  103.32 -	strsignal pure
  103.33 -*/
  103.34 -
  103.35 -/*
  103.36 - *  Written by Joel Sherrill <joel.sherrill@OARcorp.com>.
  103.37 - *
  103.38 - *  COPYRIGHT (c) 2010, 2017.
  103.39 - *  On-Line Applications Research Corporation (OAR).
  103.40 - *
  103.41 - *  Permission to use, copy, modify, and distribute this software for any
  103.42 - *  purpose without fee is hereby granted, provided that this entire notice
  103.43 - *  is included in all copies of any software which is or includes a copy
  103.44 - *  or modification of this software.
  103.45 - *
  103.46 - *  THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
  103.47 - *  WARRANTY.  IN PARTICULAR,  THE AUTHOR MAKES NO REPRESENTATION
  103.48 - *  OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS
  103.49 - *  SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
  103.50 - */
  103.51 -
  103.52 -#include <string.h>
  103.53 -#include <signal.h>
  103.54 -#include <stdio.h>
  103.55 -#include <stdlib.h>
  103.56 -#include <reent.h>
  103.57 -
  103.58 -char *
  103.59 -strsignal (int signal)
  103.60 -{
  103.61 -  char *buffer;
  103.62 -  struct _reent *ptr;
  103.63 -
  103.64 -  ptr = _REENT;
  103.65 -
  103.66 -  _REENT_CHECK_SIGNAL_BUF(ptr);
  103.67 -  buffer = _REENT_SIGNAL_BUF(ptr);
  103.68 -
  103.69 -#if defined(SIGRTMIN) && defined(SIGRTMAX)
  103.70 -  if ((signal >= SIGRTMIN) && (signal <= SIGRTMAX)) {
  103.71 -    siprintf (buffer, "Real-time signal %d", signal - SIGRTMIN);
  103.72 -    return buffer;
  103.73 -  }
  103.74 -#endif
  103.75 -
  103.76 -  switch (signal) {
  103.77 -#ifdef SIGHUP
  103.78 -    case SIGHUP:
  103.79 -      buffer = "Hangup";
  103.80 -      break;
  103.81 -#endif
  103.82 -#ifdef SIGINT
  103.83 -    case SIGINT:
  103.84 -      buffer = "Interrupt";
  103.85 -      break;
  103.86 -#endif
  103.87 -#ifdef SIGQUIT
  103.88 -    case SIGQUIT:
  103.89 -      buffer = "Quit";
  103.90 -      break;
  103.91 -#endif
  103.92 -#ifdef SIGILL
  103.93 -    case SIGILL:
  103.94 -      buffer = "Illegal instruction";
  103.95 -      break;
  103.96 -#endif
  103.97 -#ifdef SIGTRAP
  103.98 -    case SIGTRAP:
  103.99 -      buffer = "Trace/breakpoint trap";
 103.100 -      break;
 103.101 -#endif
 103.102 -#ifdef SIGIOT
 103.103 -  #if  defined(SIGABRT) && (SIGIOT != SIGABRT)
 103.104 -    case SIGABRT:
 103.105 -  #endif
 103.106 -    case SIGIOT:
 103.107 -      buffer = "IOT trap";
 103.108 -      break;
 103.109 -#endif
 103.110 -#ifdef SIGEMT
 103.111 -    case SIGEMT:
 103.112 -      buffer = "EMT trap";
 103.113 -      break;
 103.114 -#endif
 103.115 -#ifdef SIGFPE
 103.116 -    case SIGFPE:
 103.117 -      buffer = "Floating point exception";
 103.118 -      break;
 103.119 -#endif
 103.120 -#ifdef SIGKILL
 103.121 -    case SIGKILL:
 103.122 -      buffer = "Killed";
 103.123 -      break;
 103.124 -#endif
 103.125 -#ifdef SIGBUS
 103.126 -    case SIGBUS:
 103.127 -      buffer = "Bus error";
 103.128 -      break;
 103.129 -#endif
 103.130 -#ifdef SIGSEGV
 103.131 -    case SIGSEGV:
 103.132 -      buffer = "Segmentation fault";
 103.133 -      break;
 103.134 -#endif
 103.135 -#ifdef SIGSYS
 103.136 -    case SIGSYS:
 103.137 -      buffer = "Bad system call";
 103.138 -      break;
 103.139 -#endif
 103.140 -#ifdef SIGPIPE
 103.141 -    case SIGPIPE:
 103.142 -      buffer = "Broken pipe";
 103.143 -      break;
 103.144 -#endif
 103.145 -#ifdef SIGALRM
 103.146 -    case SIGALRM:
 103.147 -      buffer = "Alarm clock";
 103.148 -      break;
 103.149 -#endif
 103.150 -#ifdef SIGTERM
 103.151 -    case SIGTERM:
 103.152 -      buffer = "Terminated";
 103.153 -      break;
 103.154 -#endif
 103.155 -#ifdef SIGURG
 103.156 -    case SIGURG:
 103.157 -      buffer = "Urgent I/O condition";
 103.158 -      break;
 103.159 -#endif
 103.160 -#ifdef SIGSTOP
 103.161 -    case SIGSTOP:
 103.162 -      buffer = "Stopped (signal)";
 103.163 -      break;
 103.164 -#endif
 103.165 -#ifdef SIGTSTP
 103.166 -    case SIGTSTP:
 103.167 -      buffer = "Stopped";
 103.168 -      break;
 103.169 -#endif
 103.170 -#ifdef SIGCONT
 103.171 -    case SIGCONT:
 103.172 -      buffer = "Continued";
 103.173 -      break;
 103.174 -#endif
 103.175 -#ifdef SIGCHLD
 103.176 -  #if  defined(SIGCLD) && (SIGCHLD != SIGCLD)
 103.177 -    case SIGCLD:
 103.178 -  #endif
 103.179 -    case SIGCHLD:
 103.180 -      buffer = "Child exited";
 103.181 -      break;
 103.182 -#endif
 103.183 -#ifdef SIGTTIN
 103.184 -    case SIGTTIN:
 103.185 -      buffer = "Stopped (tty input)";
 103.186 -      break;
 103.187 -#endif
 103.188 -#ifdef SIGTTOUT
 103.189 -    case SIGTTOUT:
 103.190 -      buffer = "Stopped (tty output)";
 103.191 -      break;
 103.192 -#endif
 103.193 -#ifdef SIGIO
 103.194 -  #if  defined(SIGPOLL) && (SIGIO != SIGPOLL)
 103.195 -    case SIGPOLL:
 103.196 -  #endif
 103.197 -    case SIGIO:
 103.198 -      buffer = "I/O possible";
 103.199 -      break;
 103.200 -#endif
 103.201 -#ifdef SIGWINCH
 103.202 -    case SIGWINCH:
 103.203 -      buffer = "Window changed";
 103.204 -      break;
 103.205 -#endif
 103.206 -#ifdef SIGUSR1
 103.207 -    case SIGUSR1:
 103.208 -      buffer = "User defined signal 1";
 103.209 -      break;
 103.210 -#endif
 103.211 -#ifdef SIGUSR2
 103.212 -    case SIGUSR2:
 103.213 -      buffer = "User defined signal 2";
 103.214 -      break;
 103.215 -#endif
 103.216 -#ifdef SIGPWR
 103.217 -    case SIGPWR:
 103.218 -      buffer = "Power Failure";
 103.219 -      break;
 103.220 -#endif
 103.221 -#ifdef SIGXCPU
 103.222 -    case SIGXCPU:
 103.223 -      buffer = "CPU time limit exceeded";
 103.224 -      break;
 103.225 -#endif
 103.226 -#ifdef SIGXFSZ
 103.227 -    case SIGXFSZ:
 103.228 -      buffer = "File size limit exceeded";
 103.229 -      break;
 103.230 -#endif
 103.231 -#ifdef SIGVTALRM 
 103.232 -    case SIGVTALRM :
 103.233 -      buffer = "Virtual timer expired";
 103.234 -      break;
 103.235 -#endif
 103.236 -#ifdef SIGPROF
 103.237 -    case SIGPROF:
 103.238 -      buffer = "Profiling timer expired";
 103.239 -      break;
 103.240 -#endif
 103.241 -#if defined(SIGLOST) && SIGLOST != SIGPWR
 103.242 -    case SIGLOST:
 103.243 -      buffer = "Resource lost";
 103.244 -      break;
 103.245 -#endif
 103.246 -    default:
 103.247 -      siprintf (buffer, "Unknown signal %d", signal);
 103.248 -      break;
 103.249 -  }
 103.250 -
 103.251 -  return buffer;
 103.252 -}
   104.1 --- a/libc/string/strspn.c	Sat Dec 07 00:44:56 2019 +0100
   104.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   104.3 @@ -1,52 +0,0 @@
   104.4 -/*
   104.5 -FUNCTION
   104.6 -	<<strspn>>---find initial match
   104.7 -
   104.8 -INDEX
   104.9 -	strspn
  104.10 -
  104.11 -SYNOPSIS
  104.12 -	#include <string.h>
  104.13 -	size_t strspn(const char *<[s1]>, const char *<[s2]>);
  104.14 -
  104.15 -DESCRIPTION
  104.16 -	This function computes the length of the initial segment of
  104.17 -	the string pointed to by <[s1]> which consists entirely of
  104.18 -	characters from the string pointed to by <[s2]> (excluding the
  104.19 -	terminating null character).
  104.20 -
  104.21 -RETURNS
  104.22 -	<<strspn>> returns the length of the segment found.
  104.23 -
  104.24 -PORTABILITY
  104.25 -<<strspn>> is ANSI C.
  104.26 -
  104.27 -<<strspn>> requires no supporting OS subroutines.
  104.28 -
  104.29 -QUICKREF
  104.30 -	strspn ansi pure
  104.31 -*/
  104.32 -
  104.33 -#include <string.h>
  104.34 -
  104.35 -size_t
  104.36 -strspn (const char *s1,
  104.37 -	const char *s2)
  104.38 -{
  104.39 -  const char *s = s1;
  104.40 -  const char *c;
  104.41 -
  104.42 -  while (*s1)
  104.43 -    {
  104.44 -      for (c = s2; *c; c++)
  104.45 -	{
  104.46 -	  if (*s1 == *c)
  104.47 -	    break;
  104.48 -	}
  104.49 -      if (*c == '\0')
  104.50 -	break;
  104.51 -      s1++;
  104.52 -    }
  104.53 -
  104.54 -  return s1 - s;
  104.55 -}
   105.1 --- a/libc/string/strstr.c	Sat Dec 07 00:44:56 2019 +0100
   105.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   105.3 @@ -1,204 +0,0 @@
   105.4 -/* Optimized strstr function.
   105.5 -   Copyright (c) 2018 Arm Ltd.  All rights reserved.
   105.6 -
   105.7 -   SPDX-License-Identifier: BSD-3-Clause
   105.8 -
   105.9 -   Redistribution and use in source and binary forms, with or without
  105.10 -   modification, are permitted provided that the following conditions
  105.11 -   are met:
  105.12 -   1. Redistributions of source code must retain the above copyright
  105.13 -      notice, this list of conditions and the following disclaimer.
  105.14 -   2. Redistributions in binary form must reproduce the above copyright
  105.15 -      notice, this list of conditions and the following disclaimer in the
  105.16 -      documentation and/or other materials provided with the distribution.
  105.17 -   3. The name of the company may not be used to endorse or promote
  105.18 -      products derived from this software without specific prior written
  105.19 -      permission.
  105.20 -
  105.21 -   THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED
  105.22 -   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  105.23 -   MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  105.24 -   IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  105.25 -   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
  105.26 -   TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  105.27 -   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  105.28 -   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  105.29 -   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  105.30 -   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
  105.31 -
  105.32 -/*
  105.33 -FUNCTION
  105.34 -	<<strstr>>---find string segment
  105.35 -
  105.36 -INDEX
  105.37 -	strstr
  105.38 -
  105.39 -SYNOPSIS
  105.40 -	#include <string.h>
  105.41 -	char *strstr(const char *<[s1]>, const char *<[s2]>);
  105.42 -
  105.43 -DESCRIPTION
  105.44 -	Locates the first occurrence in the string pointed to by <[s1]> of
  105.45 -	the sequence of characters in the string pointed to by <[s2]>
  105.46 -	(excluding the terminating null character).
  105.47 -
  105.48 -RETURNS
  105.49 -	Returns a pointer to the located string segment, or a null
  105.50 -	pointer if the string <[s2]> is not found. If <[s2]> points to
  105.51 -	a string with zero length, <[s1]> is returned.
  105.52 -
  105.53 -PORTABILITY
  105.54 -<<strstr>> is ANSI C.
  105.55 -
  105.56 -<<strstr>> requires no supporting OS subroutines.
  105.57 -
  105.58 -QUICKREF
  105.59 -	strstr ansi pure
  105.60 -*/
  105.61 -
  105.62 -#include <string.h>
  105.63 -#include <limits.h>
  105.64 -
  105.65 -#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__) \
  105.66 -    || CHAR_BIT > 8
  105.67 -
  105.68 -/* Small and efficient strstr implementation.  */
  105.69 -char *
  105.70 -strstr (const char *hs, const char *ne)
  105.71 -{
  105.72 -  size_t i;
  105.73 -  int c = ne[0];
  105.74 -
  105.75 -  if (c == 0)
  105.76 -    return (char*)hs;
  105.77 -
  105.78 -  for ( ; hs[0] != '\0'; hs++)
  105.79 -    {
  105.80 -      if (hs[0] != c)
  105.81 -	continue;
  105.82 -      for (i = 1; ne[i] != 0; i++)
  105.83 -	if (hs[i] != ne[i])
  105.84 -	  break;
  105.85 -      if (ne[i] == '\0')
  105.86 -	return (char*)hs;
  105.87 -    }
  105.88 -
  105.89 -  return NULL;
  105.90 -}
  105.91 -
  105.92 -#else /* compilation for speed */
  105.93 -
  105.94 -# define RETURN_TYPE char *
  105.95 -# define AVAILABLE(h, h_l, j, n_l) (((j) <= (h_l) - (n_l)) \
  105.96 -   || ((h_l) += strnlen ((h) + (h_l), (n_l) | 2048), ((j) <= (h_l) - (n_l))))
  105.97 -
  105.98 -# include "str-two-way.h"
  105.99 -
 105.100 -/* Number of bits used to index shift table.  */
 105.101 -#define SHIFT_TABLE_BITS 6
 105.102 -
 105.103 -static inline char *
 105.104 -strstr2 (const unsigned char *hs, const unsigned char *ne)
 105.105 -{
 105.106 -  uint32_t h1 = (ne[0] << 16) | ne[1];
 105.107 -  uint32_t h2 = 0;
 105.108 -  int c;
 105.109 -  for (c = hs[0]; h1 != h2 && c != 0; c = *++hs)
 105.110 -      h2 = (h2 << 16) | c;
 105.111 -  return h1 == h2 ? (char *)hs - 2 : NULL;
 105.112 -}
 105.113 -
 105.114 -static inline char *
 105.115 -strstr3 (const unsigned char *hs, const unsigned char *ne)
 105.116 -{
 105.117 -  uint32_t h1 = (ne[0] << 24) | (ne[1] << 16) | (ne[2] << 8);
 105.118 -  uint32_t h2 = 0;
 105.119 -  int c;
 105.120 -  for (c = hs[0]; h1 != h2 && c != 0; c = *++hs)
 105.121 -      h2 = (h2 | c) << 8;
 105.122 -  return h1 == h2 ? (char *)hs - 3 : NULL;
 105.123 -}
 105.124 -
 105.125 -static inline char *
 105.126 -strstr4 (const unsigned char *hs, const unsigned char *ne)
 105.127 -{
 105.128 -  uint32_t h1 = (ne[0] << 24) | (ne[1] << 16) | (ne[2] << 8) | ne[3];
 105.129 -  uint32_t h2 = 0;
 105.130 -  int c;
 105.131 -  for (c = hs[0]; c != 0 && h1 != h2; c = *++hs)
 105.132 -    h2 = (h2 << 8) | c;
 105.133 -  return h1 == h2 ? (char *)hs - 4 : NULL;
 105.134 -}
 105.135 -
 105.136 -/* Extremely fast strstr algorithm with guaranteed linear-time performance.
 105.137 -   Small needles up to size 4 use a dedicated linear search.  Longer needles
 105.138 -   up to size 254 use Sunday's Quick-Search algorithm.  Due to its simplicity
 105.139 -   it has the best average performance of string matching algorithms on almost
 105.140 -   all inputs.  It uses a bad-character shift table to skip past mismatches.
 105.141 -   By limiting the needle length to 254, the shift table can be reduced to 8
 105.142 -   bits per entry, lowering preprocessing overhead and minimizing cache effects.
 105.143 -   The limit also implies the worst-case performance is linear.
 105.144 -   Even larger needles are processed by the linear-time Two-Way algorithm.
 105.145 -*/
 105.146 -char *
 105.147 -strstr (const char *haystack, const char *needle)
 105.148 -{
 105.149 -  const unsigned char *hs = (const unsigned char *) haystack;
 105.150 -  const unsigned char *ne = (const unsigned char *) needle;
 105.151 -  int i;
 105.152 -
 105.153 -  /* Handle short needle special cases first.  */
 105.154 -  if (ne[0] == '\0')
 105.155 -    return (char *) hs;
 105.156 -  if (ne[1] == '\0')
 105.157 -    return (char*)strchr (hs, ne[0]);
 105.158 -  if (ne[2] == '\0')
 105.159 -    return strstr2 (hs, ne);
 105.160 -  if (ne[3] == '\0')
 105.161 -    return strstr3 (hs, ne);
 105.162 -  if (ne[4] == '\0')
 105.163 -    return strstr4 (hs, ne);
 105.164 -
 105.165 -  size_t ne_len = strlen (ne);
 105.166 -  size_t hs_len = strnlen (hs, ne_len | 512);
 105.167 -
 105.168 -  /* Ensure haystack length is >= needle length.  */
 105.169 -  if (hs_len < ne_len)
 105.170 -    return NULL;
 105.171 -
 105.172 -  /* Use the Quick-Search algorithm for needle lengths less than 255.  */
 105.173 -  if (__builtin_expect (ne_len < 255, 1))
 105.174 -    {
 105.175 -      uint8_t shift[1 << SHIFT_TABLE_BITS];
 105.176 -      const unsigned char *end = hs + hs_len - ne_len;
 105.177 -
 105.178 -      /* Initialize bad character shift hash table.  */
 105.179 -      memset (shift, ne_len + 1, sizeof (shift));
 105.180 -      for (i = 0; i < ne_len; i++)
 105.181 -	shift[ne[i] % sizeof (shift)] = ne_len - i;
 105.182 -
 105.183 -      do
 105.184 -	{
 105.185 -	  hs--;
 105.186 -
 105.187 -	  /* Search by skipping past bad characters.  */
 105.188 -	  size_t tmp = shift[hs[ne_len] % sizeof (shift)];
 105.189 -	  for (hs += tmp; hs <= end; hs += tmp)
 105.190 -	    {
 105.191 -	      tmp = shift[hs[ne_len] % sizeof (shift)];
 105.192 -	      if (memcmp (hs, ne, ne_len) == 0)
 105.193 -		return (char*) hs;
 105.194 -	    }
 105.195 -	  if (end[ne_len] == 0)
 105.196 -	    return NULL;
 105.197 -	  end += strnlen (end + ne_len, 2048);
 105.198 -	}
 105.199 -      while (hs <= end);
 105.200 -
 105.201 -      return NULL;
 105.202 -    }
 105.203 -
 105.204 -  /* Use Two-Way algorithm for very long needles.  */
 105.205 -  return two_way_long_needle (hs, hs_len, ne, ne_len);
 105.206 -}
 105.207 -#endif /* compilation for speed */
   106.1 --- a/libc/string/strtok.c	Sat Dec 07 00:44:56 2019 +0100
   106.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   106.3 @@ -1,90 +0,0 @@
   106.4 -/*
   106.5 -FUNCTION
   106.6 -	<<strtok>>, <<strtok_r>>, <<strsep>>---get next token from a string
   106.7 -
   106.8 -INDEX
   106.9 -	strtok
  106.10 -
  106.11 -INDEX
  106.12 -	strtok_r
  106.13 -
  106.14 -INDEX
  106.15 -	strsep
  106.16 -
  106.17 -SYNOPSIS
  106.18 -	#include <string.h>
  106.19 -      	char *strtok(char *restrict <[source]>,
  106.20 -                     const char *restrict <[delimiters]>);
  106.21 -      	char *strtok_r(char *restrict <[source]>,
  106.22 -                       const char *restrict <[delimiters]>,
  106.23 -                       char **<[lasts]>);
  106.24 -	char *strsep(char **<[source_ptr]>, const char *<[delimiters]>);
  106.25 -
  106.26 -DESCRIPTION
  106.27 -	The <<strtok>> function is used to isolate sequential tokens in a 
  106.28 -	null-terminated string, <<*<[source]>>>. These tokens are delimited 
  106.29 -	in the string by at least one of the characters in <<*<[delimiters]>>>.
  106.30 -	The first time that <<strtok>> is called, <<*<[source]>>> should be
  106.31 -	specified; subsequent calls, wishing to obtain further tokens from
  106.32 -	the same string, should pass a null pointer instead.  The separator
  106.33 -	string, <<*<[delimiters]>>>, must be supplied each time and may 
  106.34 -	change between calls.
  106.35 -
  106.36 -	The <<strtok>> function returns a pointer to the beginning of each 
  106.37 -	subsequent token in the string, after replacing the separator 
  106.38 -	character itself with a null character.  When no more tokens remain, 
  106.39 -	a null pointer is returned.
  106.40 -
  106.41 -	The <<strtok_r>> function has the same behavior as <<strtok>>, except
  106.42 -	a pointer to placeholder <<*<[lasts]>>> must be supplied by the caller.
  106.43 -
  106.44 -	The <<strsep>> function is similar in behavior to <<strtok>>, except
  106.45 -	a pointer to the string pointer must be supplied <<<[source_ptr]>>> and
  106.46 -	the function does not skip leading delimiters.  When the string starts
  106.47 -	with a delimiter, the delimiter is changed to the null character and
  106.48 -	the empty string is returned.  Like <<strtok_r>> and <<strtok>>, the
  106.49 -	<<*<[source_ptr]>>> is updated to the next character following the
  106.50 -	last delimiter found or NULL if the end of string is reached with
  106.51 -	no more delimiters.
  106.52 -
  106.53 -RETURNS
  106.54 -	<<strtok>>, <<strtok_r>>, and <<strsep>> all return a pointer to the 
  106.55 -	next token, or <<NULL>> if no more tokens can be found.  For
  106.56 -	<<strsep>>, a token may be the empty string.
  106.57 -
  106.58 -NOTES
  106.59 -	<<strtok>> is unsafe for multi-threaded applications.  <<strtok_r>>
  106.60 -	and <<strsep>> are thread-safe and should be used instead.
  106.61 -
  106.62 -PORTABILITY
  106.63 -<<strtok>> is ANSI C.
  106.64 -<<strtok_r>> is POSIX.
  106.65 -<<strsep>> is a BSD extension.
  106.66 -
  106.67 -<<strtok>>, <<strtok_r>>, and <<strsep>> require no supporting OS subroutines.
  106.68 -
  106.69 -QUICKREF
  106.70 -	strtok ansi impure
  106.71 -*/
  106.72 -
  106.73 -/* undef STRICT_ANSI so that strtok_r prototype will be defined */
  106.74 -#undef  __STRICT_ANSI__
  106.75 -#include <string.h>
  106.76 -#include <stdlib.h>
  106.77 -#include <_ansi.h>
  106.78 -#include <reent.h>
  106.79 -
  106.80 -#ifndef _REENT_ONLY
  106.81 -
  106.82 -extern char *__strtok_r (char *, const char *, char **, int);
  106.83 -
  106.84 -char *
  106.85 -strtok (register char *__restrict s,
  106.86 -	register const char *__restrict delim)
  106.87 -{
  106.88 -	struct _reent *reent = _REENT;
  106.89 -
  106.90 -	_REENT_CHECK_MISC(reent);
  106.91 -	return __strtok_r (s, delim, &(_REENT_STRTOK_LAST(reent)), 1);
  106.92 -}
  106.93 -#endif
   107.1 --- a/libc/string/strtok_r.c	Sat Dec 07 00:44:56 2019 +0100
   107.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   107.3 @@ -1,97 +0,0 @@
   107.4 -/*
   107.5 - * Copyright (c) 1988 Regents of the University of California.
   107.6 - * All rights reserved.
   107.7 - *
   107.8 - * Redistribution and use in source and binary forms, with or without
   107.9 - * modification, are permitted provided that the following conditions
  107.10 - * are met:
  107.11 - * 1. Redistributions of source code must retain the above copyright
  107.12 - *    notice, this list of conditions and the following disclaimer.
  107.13 - * 2. Redistributions in binary form must reproduce the above copyright
  107.14 - *    notice, this list of conditions and the following disclaimer in the
  107.15 - *    documentation and/or other materials provided with the distribution.
  107.16 - * 3. Neither the name of the University nor the names of its contributors
  107.17 - *    may be used to endorse or promote products derived from this software
  107.18 - *    without specific prior written permission.
  107.19 - *
  107.20 - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  107.21 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  107.22 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  107.23 - * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  107.24 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  107.25 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  107.26 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  107.27 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  107.28 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  107.29 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  107.30 - * SUCH DAMAGE.
  107.31 - */
  107.32 -
  107.33 -#include <string.h>
  107.34 -
  107.35 -char *
  107.36 -__strtok_r (register char *s,
  107.37 -	register const char *delim,
  107.38 -	char **lasts,
  107.39 -	int skip_leading_delim)
  107.40 -{
  107.41 -	register char *spanp;
  107.42 -	register int c, sc;
  107.43 -	char *tok;
  107.44 -
  107.45 -
  107.46 -	if (s == NULL && (s = *lasts) == NULL)
  107.47 -		return (NULL);
  107.48 -
  107.49 -	/*
  107.50 -	 * Skip (span) leading delimiters (s += strspn(s, delim), sort of).
  107.51 -	 */
  107.52 -cont:
  107.53 -	c = *s++;
  107.54 -	for (spanp = (char *)delim; (sc = *spanp++) != 0;) {
  107.55 -		if (c == sc) {
  107.56 -			if (skip_leading_delim) {
  107.57 -				goto cont;
  107.58 -			}
  107.59 -			else {
  107.60 -				*lasts = s;
  107.61 -				s[-1] = 0;
  107.62 -				return (s - 1);
  107.63 -			}
  107.64 -		}
  107.65 -	}
  107.66 -
  107.67 -	if (c == 0) {		/* no non-delimiter characters */
  107.68 -		*lasts = NULL;
  107.69 -		return (NULL);
  107.70 -	}
  107.71 -	tok = s - 1;
  107.72 -
  107.73 -	/*
  107.74 -	 * Scan token (scan for delimiters: s += strcspn(s, delim), sort of).
  107.75 -	 * Note that delim must have one NUL; we stop if we see that, too.
  107.76 -	 */
  107.77 -	for (;;) {
  107.78 -		c = *s++;
  107.79 -		spanp = (char *)delim;
  107.80 -		do {
  107.81 -			if ((sc = *spanp++) == c) {
  107.82 -				if (c == 0)
  107.83 -					s = NULL;
  107.84 -				else
  107.85 -					s[-1] = 0;
  107.86 -				*lasts = s;
  107.87 -				return (tok);
  107.88 -			}
  107.89 -		} while (sc != 0);
  107.90 -	}
  107.91 -	/* NOTREACHED */
  107.92 -}
  107.93 -
  107.94 -char *
  107.95 -strtok_r (register char *__restrict s,
  107.96 -	register const char *__restrict delim,
  107.97 -	char **__restrict lasts)
  107.98 -{
  107.99 -	return __strtok_r (s, delim, lasts, 1);
 107.100 -}
   108.1 --- a/libc/string/strupr.c	Sat Dec 07 00:44:56 2019 +0100
   108.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   108.3 @@ -1,40 +0,0 @@
   108.4 -/*
   108.5 -FUNCTION
   108.6 -	<<strupr>>---force string to uppercase
   108.7 -	
   108.8 -INDEX
   108.9 -	strupr
  108.10 -
  108.11 -SYNOPSIS
  108.12 -	#include <string.h>
  108.13 -	char *strupr(char *<[a]>);
  108.14 -
  108.15 -DESCRIPTION
  108.16 -	<<strupr>> converts each character in the string at <[a]> to
  108.17 -	uppercase.
  108.18 -
  108.19 -RETURNS
  108.20 -	<<strupr>> returns its argument, <[a]>.
  108.21 -
  108.22 -PORTABILITY
  108.23 -<<strupr>> is not widely portable.
  108.24 -
  108.25 -<<strupr>> requires no supporting OS subroutines.
  108.26 -
  108.27 -QUICKREF
  108.28 -	strupr
  108.29 -*/
  108.30 -
  108.31 -#include <string.h>
  108.32 -#include <ctype.h>
  108.33 -
  108.34 -char *
  108.35 -strupr (char *s)
  108.36 -{
  108.37 -  unsigned char *ucs = (unsigned char *) s;
  108.38 -  for ( ; *ucs != '\0'; ucs++)
  108.39 -    {
  108.40 -      *ucs = toupper(*ucs);
  108.41 -    }
  108.42 -  return s;
  108.43 -}
   109.1 --- a/libc/string/strverscmp.c	Sat Dec 07 00:44:56 2019 +0100
   109.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   109.3 @@ -1,92 +0,0 @@
   109.4 -/*
   109.5 -FUNCTION
   109.6 -	<<strverscmp>>---version string compare
   109.7 -
   109.8 -INDEX
   109.9 -	strverscmp
  109.10 -
  109.11 -SYNOPSIS
  109.12 -	#define _GNU_SOURCE
  109.13 -	#include <string.h>
  109.14 -	int strverscmp(const char *<[a]>, const char *<[b]>);
  109.15 -
  109.16 -DESCRIPTION
  109.17 -	<<strverscmp>> compares the string at <[a]> to
  109.18 -	the string at <[b]> in a version-logical order.
  109.19 -
  109.20 -RETURNS
  109.21 -
  109.22 -	If <<*<[a]>>> version-sorts after <<*<[b]>>>, <<strverscmp>> returns
  109.23 -	a number greater than zero.  If the two strings match, <<strverscmp>>
  109.24 -	returns zero.  If <<*<[a]>>> version-sorts before <<*<[b]>>>,
  109.25 -	<<strverscmp>> returns a number less than zero.
  109.26 -
  109.27 -PORTABILITY
  109.28 -<<strverscmp>> is a GNU extension.
  109.29 -
  109.30 -<<strverscmp>> requires no supporting OS subroutines. It uses
  109.31 -isdigit() from elsewhere in this library.
  109.32 -
  109.33 -QUICKREF
  109.34 -	strverscmp
  109.35 -*/
  109.36 -
  109.37 -/*
  109.38 -From musl src/string/strverscmp.c
  109.39 -
  109.40 -Copyright © 2005-2014 Rich Felker, et al.
  109.41 -
  109.42 -Permission is hereby granted, free of charge, to any person obtaining
  109.43 -a copy of this software and associated documentation files (the
  109.44 -"Software"), to deal in the Software without restriction, including
  109.45 -without limitation the rights to use, copy, modify, merge, publish,
  109.46 -distribute, sublicense, and/or sell copies of the Software, and to
  109.47 -permit persons to whom the Software is furnished to do so, subject to
  109.48 -the following conditions:
  109.49 -
  109.50 -The above copyright notice and this permission notice shall be
  109.51 -included in all copies or substantial portions of the Software.
  109.52 -
  109.53 -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  109.54 -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  109.55 -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  109.56 -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  109.57 -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  109.58 -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  109.59 -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  109.60 -*/
  109.61 -
  109.62 -#define _GNU_SOURCE
  109.63 -#include <ctype.h>
  109.64 -#include <string.h>
  109.65 -
  109.66 -int strverscmp(const char *l0, const char *r0)
  109.67 -{
  109.68 -	const unsigned char *l = (const void *)l0;
  109.69 -	const unsigned char *r = (const void *)r0;
  109.70 -	size_t i, dp, j;
  109.71 -	int z = 1;
  109.72 -
  109.73 -	/* Find maximal matching prefix and track its maximal digit
  109.74 -	 * suffix and whether those digits are all zeros. */
  109.75 -	for (dp=i=0; l[i]==r[i]; i++) {
  109.76 -		int c = l[i];
  109.77 -		if (!c) return 0;
  109.78 -		if (!isdigit(c)) dp=i+1, z=1;
  109.79 -		else if (c!='0') z=0;
  109.80 -	}
  109.81 -
  109.82 -	if (l[dp]!='0' && r[dp]!='0') {
  109.83 -		/* If we're not looking at a digit sequence that began
  109.84 -		 * with a zero, longest digit string is greater. */
  109.85 -		for (j=i; isdigit(l[j]); j++)
  109.86 -			if (!isdigit(r[j])) return 1;
  109.87 -		if (isdigit(r[j])) return -1;
  109.88 -	} else if (z && dp<i && (isdigit(l[i]) || isdigit(r[i]))) {
  109.89 -		/* Otherwise, if common prefix of digit sequence is
  109.90 -		 * all zeros, digits order less than non-digits. */
  109.91 -		return (unsigned char)(l[i]-'0') - (unsigned char)(r[i]-'0');
  109.92 -	}
  109.93 -
  109.94 -	return l[i] - r[i];
  109.95 -}
   110.1 --- a/libc/string/strxfrm.c	Sat Dec 07 00:44:56 2019 +0100
   110.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   110.3 @@ -1,69 +0,0 @@
   110.4 -/*
   110.5 -FUNCTION
   110.6 -	<<strxfrm>>---transform string
   110.7 -
   110.8 -INDEX
   110.9 -	strxfrm
  110.10 -
  110.11 -SYNOPSIS
  110.12 -	#include <string.h>
  110.13 -	size_t strxfrm(char *restrict <[s1]>, const char *restrict <[s2]>,
  110.14 -                       size_t <[n]>);
  110.15 -
  110.16 -DESCRIPTION
  110.17 -	This function transforms the string pointed to by <[s2]> and
  110.18 -	places the resulting string into the array pointed to by
  110.19 -	<[s1]>. The transformation is such that if the <<strcmp>>
  110.20 -	function is applied to the two transformed strings, it returns
  110.21 -	a value greater than, equal to, or less than zero,
  110.22 -	correspoinding to the result of a <<strcoll>> function applied
  110.23 -	to the same two original strings.
  110.24 -
  110.25 -	No more than <[n]> characters are placed into the resulting
  110.26 -	array pointed to by <[s1]>, including the terminating null
  110.27 -	character. If <[n]> is zero, <[s1]> may be a null pointer. If
  110.28 -	copying takes place between objects that overlap, the behavior
  110.29 -	is undefined.
  110.30 -
  110.31 -	(NOT Cygwin:) The current implementation of <<strxfrm>> simply copies
  110.32 -	the input and does not support any language-specific transformations.
  110.33 -
  110.34 -RETURNS
  110.35 -	The <<strxfrm>> function returns the length of the transformed string
  110.36 -	(not including the terminating null character). If the value returned
  110.37 -	is <[n]> or more, the contents of the array pointed to by
  110.38 -	<[s1]> are indeterminate.
  110.39 -
  110.40 -PORTABILITY
  110.41 -<<strxfrm>> is ANSI C.
  110.42 -
  110.43 -<<strxfrm>> requires no supporting OS subroutines.
  110.44 -
  110.45 -QUICKREF
  110.46 -	strxfrm ansi pure
  110.47 -*/
  110.48 -
  110.49 -#include <string.h>
  110.50 -
  110.51 -size_t
  110.52 -strxfrm (char *__restrict s1,
  110.53 -	const char *__restrict s2,
  110.54 -	size_t n)
  110.55 -{
  110.56 -  size_t res;
  110.57 -  res = 0;
  110.58 -  while (n-- > 0)
  110.59 -    {
  110.60 -      if ((*s1++ = *s2++) != '\0')
  110.61 -        ++res;
  110.62 -      else
  110.63 -        return res;
  110.64 -    }
  110.65 -  while (*s2)
  110.66 -    {
  110.67 -      ++s2;
  110.68 -      ++res;
  110.69 -    }
  110.70 -
  110.71 -  return res;
  110.72 -}
   111.1 --- a/libc/string/strxfrm_l.c	Sat Dec 07 00:44:56 2019 +0100
   111.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   111.3 @@ -1,71 +0,0 @@
   111.4 -/*
   111.5 -FUNCTION
   111.6 -	<<strxfrm_l>>---transform string
   111.7 -
   111.8 -INDEX
   111.9 -	strxfrm_l
  111.10 -
  111.11 -SYNOPSIS
  111.12 -	#include <string.h>
  111.13 -	size_t strxfrm_l(char *restrict <[s1]>, const char *restrict <[s2]>,
  111.14 -                       size_t <[n]>, locale_t <[locale]>);
  111.15 -
  111.16 -DESCRIPTION
  111.17 -	This function transforms the string pointed to by <[s2]> and
  111.18 -	places the resulting string into the array pointed to by
  111.19 -	<[s1]>. The transformation is such that if the <<strcmp>>
  111.20 -	function is applied to the two transformed strings, it returns
  111.21 -	a value greater than, equal to, or less than zero,
  111.22 -	correspoinding to the result of a <<strcoll>> function applied
  111.23 -	to the same two original strings.
  111.24 -
  111.25 -	No more than <[n]> characters are placed into the resulting
  111.26 -	array pointed to by <[s1]>, including the terminating null
  111.27 -	character. If <[n]> is zero, <[s1]> may be a null pointer. If
  111.28 -	copying takes place between objects that overlap, the behavior
  111.29 -	is undefined.
  111.30 -
  111.31 -	(NOT Cygwin:) The current implementation of <<strxfrm_l>> simply copies
  111.32 -	the input and does not support any language-specific transformations.
  111.33 -
  111.34 -	If <[locale]> is LC_GLOBAL_LOCALE or not a valid locale object, the
  111.35 -	behaviour is undefined.
  111.36 -
  111.37 -RETURNS
  111.38 -	The <<strxfrm_l>> function returns the length of the transformed string
  111.39 -	(not including the terminating null character). If the value returned
  111.40 -	is <[n]> or more, the contents of the array pointed to by
  111.41 -	<[s1]> are indeterminate.
  111.42 -
  111.43 -PORTABILITY
  111.44 -<<strxfrm_l>> is POSIX-1.2008.
  111.45 -
  111.46 -<<strxfrm_l>> requires no supporting OS subroutines.
  111.47 -
  111.48 -QUICKREF
  111.49 -	strxfrm_l ansi pure
  111.50 -*/
  111.51 -
  111.52 -#include <string.h>
  111.53 -
  111.54 -size_t
  111.55 -strxfrm_l (char *__restrict s1, const char *__restrict s2, size_t n,
  111.56 -	   struct __locale_t *locale)
  111.57 -{
  111.58 -  size_t res;
  111.59 -  res = 0;
  111.60 -  while (n-- > 0)
  111.61 -    {
  111.62 -      if ((*s1++ = *s2++) != '\0')
  111.63 -        ++res;
  111.64 -      else
  111.65 -        return res;
  111.66 -    }
  111.67 -  while (*s2)
  111.68 -    {
  111.69 -      ++s2;
  111.70 -      ++res;
  111.71 -    }
  111.72 -
  111.73 -  return res;
  111.74 -}
   112.1 --- a/libc/string/swab.c	Sat Dec 07 00:44:56 2019 +0100
   112.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   112.3 @@ -1,37 +0,0 @@
   112.4 -/*
   112.5 -FUNCTION
   112.6 -	<<swab>>---swap adjacent bytes
   112.7 -
   112.8 -SYNOPSIS
   112.9 -	#include <unistd.h>
  112.10 -	void swab(const void *<[in]>, void *<[out]>, ssize_t <[n]>);
  112.11 -
  112.12 -DESCRIPTION
  112.13 -	This function copies <[n]> bytes from the memory region
  112.14 -	pointed to by <[in]> to the memory region pointed to by
  112.15 -	<[out]>, exchanging adjacent even and odd bytes.
  112.16 -
  112.17 -PORTABILITY
  112.18 -<<swab>> requires no supporting OS subroutines.
  112.19 -*/
  112.20 -
  112.21 -#include <unistd.h>
  112.22 -
  112.23 -void
  112.24 -swab (const void *b1,
  112.25 -	void *b2,
  112.26 -	ssize_t length)
  112.27 -{
  112.28 -  const char *from = b1;
  112.29 -  char *to = b2;
  112.30 -  ssize_t ptr;
  112.31 -  for (ptr = 1; ptr < length; ptr += 2)
  112.32 -    {
  112.33 -      char p = from[ptr];
  112.34 -      char q = from[ptr-1];
  112.35 -      to[ptr-1] = p;
  112.36 -      to[ptr  ] = q;
  112.37 -    }
  112.38 -  if (ptr == length) /* I.e., if length is odd, */
  112.39 -    to[ptr-1] = 0;   /* then pad with a NUL. */
  112.40 -}
   113.1 --- a/libc/string/timingsafe_bcmp.c	Sat Dec 07 00:44:56 2019 +0100
   113.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   113.3 @@ -1,29 +0,0 @@
   113.4 -/*	$OpenBSD: timingsafe_bcmp.c,v 1.2 2014/06/10 04:17:37 deraadt Exp $	*/
   113.5 -/*
   113.6 - * Copyright (c) 2010 Damien Miller.  All rights reserved.
   113.7 - *
   113.8 - * Permission to use, copy, modify, and distribute this software for any
   113.9 - * purpose with or without fee is hereby granted, provided that the above
  113.10 - * copyright notice and this permission notice appear in all copies.
  113.11 - *
  113.12 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  113.13 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  113.14 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  113.15 - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  113.16 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  113.17 - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  113.18 - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  113.19 - */
  113.20 -
  113.21 -#include <string.h>
  113.22 -
  113.23 -int
  113.24 -timingsafe_bcmp(const void *b1, const void *b2, size_t n)
  113.25 -{
  113.26 -	const unsigned char *p1 = b1, *p2 = b2;
  113.27 -	int ret = 0;
  113.28 -
  113.29 -	for (; n > 0; n--)
  113.30 -		ret |= *p1++ ^ *p2++;
  113.31 -	return (ret != 0);
  113.32 -}
   114.1 --- a/libc/string/timingsafe_memcmp.c	Sat Dec 07 00:44:56 2019 +0100
   114.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   114.3 @@ -1,46 +0,0 @@
   114.4 -/*	$OpenBSD: timingsafe_memcmp.c,v 1.1 2014/06/13 02:12:17 matthew Exp $	*/
   114.5 -/*
   114.6 - * Copyright (c) 2014 Google Inc.
   114.7 - *
   114.8 - * Permission to use, copy, modify, and distribute this software for any
   114.9 - * purpose with or without fee is hereby granted, provided that the above
  114.10 - * copyright notice and this permission notice appear in all copies.
  114.11 - *
  114.12 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  114.13 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  114.14 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  114.15 - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  114.16 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  114.17 - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  114.18 - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  114.19 - */
  114.20 -
  114.21 -#include <limits.h>
  114.22 -#include <string.h>
  114.23 -
  114.24 -int
  114.25 -timingsafe_memcmp(const void *b1, const void *b2, size_t len)
  114.26 -{
  114.27 -        const unsigned char *p1 = b1, *p2 = b2;
  114.28 -        size_t i;
  114.29 -        int res = 0, done = 0;
  114.30 -
  114.31 -        for (i = 0; i < len; i++) {
  114.32 -                /* lt is -1 if p1[i] < p2[i]; else 0. */
  114.33 -                int lt = (p1[i] - p2[i]) >> CHAR_BIT;
  114.34 -
  114.35 -                /* gt is -1 if p1[i] > p2[i]; else 0. */
  114.36 -                int gt = (p2[i] - p1[i]) >> CHAR_BIT;
  114.37 -
  114.38 -                /* cmp is 1 if p1[i] > p2[i]; -1 if p1[i] < p2[i]; else 0. */
  114.39 -                int cmp = lt - gt;
  114.40 -
  114.41 -                /* set res = cmp if !done. */
  114.42 -                res |= cmp & ~done;
  114.43 -
  114.44 -                /* set done if p1[i] != p2[i]. */
  114.45 -                done |= lt | gt;
  114.46 -        }
  114.47 -
  114.48 -        return (res);
  114.49 -}
   115.1 --- a/libc/string/u_strerr.c	Sat Dec 07 00:44:56 2019 +0100
   115.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   115.3 @@ -1,14 +0,0 @@
   115.4 -#include <_ansi.h>
   115.5 -
   115.6 -char *
   115.7 -_user_strerror (int errnum,
   115.8 -       int internal,
   115.9 -       int *errptr)
  115.10 -{
  115.11 -  /* prevent warning about unused parameters */
  115.12 -  (void) errnum;
  115.13 -  (void) internal;
  115.14 -  (void) errptr;
  115.15 -
  115.16 -  return 0;
  115.17 -}
   116.1 --- a/libc/string/uniset	Sat Dec 07 00:44:56 2019 +0100
   116.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   116.3 @@ -1,696 +0,0 @@
   116.4 -#!/usr/bin/perl
   116.5 -# Uniset -- Unicode subset manager -- Markus Kuhn
   116.6 -# http://www.cl.cam.ac.uk/~mgk25/download/uniset.tar.gz
   116.7 -
   116.8 -require 5.008;
   116.9 -use open ':utf8';
  116.10 -use FindBin qw($RealBin);  # to find directory where this file is located
  116.11 -
  116.12 -binmode(STDOUT, ":utf8");
  116.13 -binmode(STDIN, ":utf8");
  116.14 -
  116.15 -my (%name, %invname, %category, %comment);
  116.16 -
  116.17 -print <<End if $#ARGV < 0;
  116.18 -Uniset -- Unicode subset manager -- Markus Kuhn
  116.19 -
  116.20 -Uniset merges and subtracts Unicode subsets. It can output and
  116.21 -analyse the resulting character set in various formats.
  116.22 -
  116.23 -Uniset understand the following command-line arguments:
  116.24 -
  116.25 -Commands to define a set of characters:
  116.26 -
  116.27 -  + filename   add the character set described in the file to the set
  116.28 -  - filename   remove the character set described in the file from the set
  116.29 -  +: filename  add the characters in the UTF-8 file to the set
  116.30 -  -: filename  remove the characters in the UTF-8 file from the set
  116.31 -  +xxxx..yyyy  add the range to the set (xxxx and yyyy are hex numbers)
  116.32 -  -xxxx..yyyy  remove the range from the set (xxxx and yyyy are hex numbers)
  116.33 -  +cat=Xx      add all Unicode characters with category code Xx
  116.34 -  -cat=Xx      remove all Unicode characters with category code Xx
  116.35 -  -cat!=Xx     remove all Unicode characters without category code Xx
  116.36 -  clean        remove any elements that do not appear in the Unicode database
  116.37 -  unknown      remove any elements that do appear in the Unicode database
  116.38 -
  116.39 -Command to output descriptions of the constructed set of characters:
  116.40 -
  116.41 -  table        write a full table with one line per character
  116.42 -  compact      output the set in compact MES format
  116.43 -  c            output the set as C interval array
  116.44 -  nr           output the number of characters
  116.45 -  sources      output a table that shows the number of characters contributed
  116.46 -               by the various combinations of input sets added with +.
  116.47 -  utf8-list    output a list of all characters encoded in UTF-8
  116.48 -
  116.49 -Commands to tailor the following output commands:
  116.50 -
  116.51 -  html         write HTML tables instead of plain text
  116.52 -  ucs          add the unicode character itself to the table (UTF-8 in
  116.53 -               plain table, numeric character reference in HTML)
  116.54 -
  116.55 -Formats of character set input files read by the + and - command:
  116.56 -
  116.57 -Empty lines, white space at the start and end of the line and any
  116.58 -comment text following a \# are ignored. The following formats are
  116.59 -recognized
  116.60 -
  116.61 -xx yyyy             xx is the hex code in an 8-bit character set and yyyy
  116.62 -                    is the corresponding Unicode value. Both can optionally
  116.63 -                    be prefixed by 0x. This is the format used in the
  116.64 -                    files on <ftp://ftp.unicode.org/Public/MAPPINGS/>.
  116.65 -
  116.66 -yyyy                yyyy (optionally prefixed with 0x) is a Unicode character
  116.67 -                    belonging to the specified subset.
  116.68 -
  116.69 -yyyy-yyyy           a range of Unicode characters belonging to
  116.70 -yyyy..yyyy          the specified subset.
  116.71 -
  116.72 -xx yy yy yy-yy yy   xx denotes a row (high-byte) and the yy specify
  116.73 -                    corresponding low bytes or with a hyphen also ranges of
  116.74 -                    low bytes in the Unicode values that belong to this
  116.75 -                    subset. This is also the format that is generated by
  116.76 -                    the compact command.
  116.77 -End
  116.78 -exit 1 if $#ARGV < 0;
  116.79 -
  116.80 -
  116.81 -# Subroutine to identify whether the ISO 10646/Unicode character code
  116.82 -# ucs belongs into the East Asian Wide (W) or East Asian FullWidth
  116.83 -# (F) category as defined in Unicode Technical Report #11.
  116.84 -
  116.85 -sub iswide ($) {
  116.86 -    my $ucs = shift(@_);
  116.87 -
  116.88 -    return ($ucs >= 0x1100 &&
  116.89 -	    ($ucs <= 0x115f ||                     # Hangul Jamo
  116.90 -	     $ucs == 0x2329 || $ucs == 0x232a ||
  116.91 -	     ($ucs >= 0x2e80 && $ucs <= 0xa4cf &&
  116.92 -	      $ucs != 0x303f) ||                   # CJK .. Yi
  116.93 -	     ($ucs >= 0xac00 && $ucs <= 0xd7a3) || # Hangul Syllables
  116.94 -	     ($ucs >= 0xf900 && $ucs <= 0xfaff) || # CJK Comp. Ideographs
  116.95 -	     ($ucs >= 0xfe30 && $ucs <= 0xfe6f) || # CJK Comp. Forms
  116.96 -	     ($ucs >= 0xff00 && $ucs <= 0xff60) || # Fullwidth Forms
  116.97 -	     ($ucs >= 0xffe0 && $ucs <= 0xffe6) ||
  116.98 -	     ($ucs >= 0x20000 && $ucs <= 0x2fffd) ||
  116.99 -	     ($ucs >= 0x30000 && $ucs <= 0x3fffd)));
 116.100 -}
 116.101 -
 116.102 -# Return the Unicode name that belongs to a given character code
 116.103 -
 116.104 -# Jamo short names, see Unicode 3.0, table 4-4, page 86
 116.105 -
 116.106 -my @lname = ('G', 'GG', 'N', 'D', 'DD', 'R', 'M', 'B', 'BB', 'S', 'SS', '',
 116.107 -	     'J', 'JJ', 'C', 'K', 'T', 'P', 'H'); # 1100..1112
 116.108 -my @vname = ('A', 'AE', 'YA', 'YAE', 'EO', 'E', 'YEO', 'YE', 'O',
 116.109 -	     'WA', 'WAE', 'OE', 'YO', 'U', 'WEO', 'WE', 'WI', 'YU',
 116.110 -	     'EU', 'YI', 'I'); # 1161..1175
 116.111 -my @tname = ('G', 'GG', 'GS', 'N', 'NJ', 'NH', 'D', 'L', 'LG', 'LM',
 116.112 -	     'LB', 'LS', 'LT', 'LP', 'LH', 'M', 'B', 'BS', 'S', 'SS',
 116.113 -	     'NG', 'J', 'C', 'K', 'T', 'P', 'H'); # 11a8..11c2
 116.114 -
 116.115 -sub name {
 116.116 -    my $ucs = shift(@_);
 116.117 -
 116.118 -    # The intervals used here reflect Unicode Version 3.2
 116.119 -    if (($ucs >=  0x3400 && $ucs <=  0x4db5) ||
 116.120 -	($ucs >=  0x4e00 && $ucs <=  0x9fa5) ||
 116.121 -	($ucs >= 0x20000 && $ucs <= 0x2a6d6)) {
 116.122 -	return "CJK UNIFIED IDEOGRAPH-" . sprintf("%04X", $ucs);
 116.123 -    }
 116.124 -
 116.125 -    if ($ucs >= 0xac00 && $ucs <= 0xd7a3) {
 116.126 -	my $s = $ucs - 0xac00;
 116.127 -	my $l = 0x1100 + int($s / (21 * 28));
 116.128 -	my $v = 0x1161 + int(($s % (21 * 28)) / 28);
 116.129 -	my $t = 0x11a7 + $s % 28;
 116.130 -	return "HANGUL SYLLABLE " .
 116.131 -	    ($lname[int($s / (21 * 28))] .
 116.132 -	     $vname[int(($s % (21 * 28)) / 28)] .
 116.133 -	     $tname[$s % 28 - 1]);
 116.134 -    }
 116.135 -
 116.136 -    return $name{$ucs};
 116.137 -}
 116.138 -
 116.139 -sub is_unicode {
 116.140 -    my $ucs = shift(@_);
 116.141 -
 116.142 -    # The intervals used here reflect Unicode Version 3.2
 116.143 -    if (($ucs >=  0x3400 && $ucs <=  0x4db5) ||
 116.144 -	($ucs >=  0x4e00 && $ucs <=  0x9fa5) ||
 116.145 -	($ucs >=  0xac00 && $ucs <=  0xd7a3) ||
 116.146 -	($ucs >= 0x20000 && $ucs <= 0x2a6d6)) {
 116.147 -	return 1;
 116.148 -    }
 116.149 -
 116.150 -    return exists $name{$ucs};
 116.151 -}
 116.152 -
 116.153 -my @search_path;
 116.154 -push @search_path, "$ENV{HOME}/local/share/uniset"
 116.155 -    if -d "$ENV{HOME}/local/share/uniset";
 116.156 -push @search_path, "/usr/share/uniset" if -d "/usr/share/uniset";
 116.157 -push @search_path, $RealBin unless $RealBin =~ m|^/usr/bin|;
 116.158 -
 116.159 -sub search_open {
 116.160 -    my ($mode, $fn) = @_;
 116.161 -    my $file;
 116.162 -    return $file if open($file, $mode, $fn);
 116.163 -    return undef if $fn =~ m|/|;
 116.164 -    for my $path (@search_path) {
 116.165 -	return $file if open($file, $mode, "$path/$fn");
 116.166 -    }
 116.167 -    return undef;
 116.168 -}
 116.169 -
 116.170 -my $html = 0;
 116.171 -my $image = 0;
 116.172 -my $adducs = 0;
 116.173 -my $unicodedata = "UnicodeData.txt";
 116.174 -my $blockdata = "Blocks.txt";
 116.175 -
 116.176 -# read list of all Unicode names
 116.177 -my $data = search_open('<', $unicodedata);
 116.178 -unless ($data) {
 116.179 -    die ("Can't open Unicode database '$unicodedata':\n$!\n\n" .
 116.180 -	 "Please make sure that you have downloaded the file\n" .
 116.181 -	 "http://www.unicode.org/Public/UNIDATA/UnicodeData.txt\n");
 116.182 -}
 116.183 -while (<$data>) {
 116.184 -    if (/^([0-9,A-F]{4,8});([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*)$/) {
 116.185 -	next if $2 ne '<control>' && substr($2, 0, 1) eq '<';
 116.186 -	$ucs = hex($1);
 116.187 -        $name{$ucs} = $2;
 116.188 -	$invname{$2} = $ucs;
 116.189 -	$category{$ucs} = $3;
 116.190 -        $comment{$ucs} = $12;
 116.191 -    } else {
 116.192 -        die("Syntax error in line '$_' in file '$unicodedata'");
 116.193 -    }
 116.194 -}
 116.195 -close($data);
 116.196 -
 116.197 -# read list of all Unicode blocks
 116.198 -$data = search_open('<', $blockdata);
 116.199 -unless ($data) {
 116.200 -    die ("Can't open Unicode blockname list '$blockdata':\n$!\n\n" .
 116.201 -	 "Please make sure that you have downloaded the file\n" .
 116.202 -	 "http://www.unicode.org/Public/UNIDATA/Blocks.txt\n");
 116.203 -}
 116.204 -my $blocks = 0;
 116.205 -my (@blockstart, @blockend, @blockname);
 116.206 -while (<$data>) {
 116.207 -    if (/^\s*([0-9,A-F]{4,8})\s*\.\.\s*([0-9,A-F]{4,8})\s*;\s*(.*)$/) {
 116.208 -        $blockstart[$blocks] = hex($1);
 116.209 -	$blockend  [$blocks] = hex($2);
 116.210 -        $blockname [$blocks] = $3;
 116.211 -	$blocks++;
 116.212 -    } elsif (/^\s*\#/ || /^\s*$/) {
 116.213 -	# ignore comments and empty lines
 116.214 -    } else {
 116.215 -        die("Syntax error in line '$_' in file '$blockdata'");
 116.216 -    }
 116.217 -}
 116.218 -close($data);
 116.219 -if ($blockend[$blocks-1] < 0x110000) {
 116.220 -    $blockstart[$blocks] = 0x110000;
 116.221 -    $blockend  [$blocks] = 0x7FFFFFFF;
 116.222 -    $blockname [$blocks] = "Beyond Plane 16";
 116.223 -    $blocks++;
 116.224 -}
 116.225 -
 116.226 -# process command line arguments
 116.227 -while ($_ = shift(@ARGV)) {
 116.228 -    if (/^html$/) {
 116.229 -	$html = 1;
 116.230 -    } elsif (/^ucs$/) {
 116.231 -	$adducs = 1;
 116.232 -    } elsif (/^img$/) {
 116.233 -	$html = 1;
 116.234 -	$image = 1;
 116.235 -    } elsif (/^template$/) {
 116.236 -	$template = shift(@ARGV);
 116.237 -	open(TEMPLATE, $template) || die("Can't open template file '$template': '$!'");
 116.238 -	while (<TEMPLATE>) {
 116.239 -	    if (/^\#\s*include\s+\"([^\"]*)\"\s*$/) {
 116.240 -		open(INCLUDE, $1) || die("Can't open template include file '$1': '$!'");
 116.241 -		while (<INCLUDE>) {
 116.242 -		    print $_;
 116.243 -		}
 116.244 -		close(INCLUDE);
 116.245 -	    } elsif (/^\#\s*quote\s+\"([^\"]*)\"\s*$/) {
 116.246 -		open(INCLUDE, $1) || die("Can't open template include file '$1': '$!'");
 116.247 -		while (<INCLUDE>) {
 116.248 -		    s/&/&amp;/g;
 116.249 -		    s/</&lt;/g;
 116.250 -		    print $_;
 116.251 -		}
 116.252 -		close(INCLUDE);
 116.253 -	    } else {
 116.254 -		print $_;
 116.255 -	    }
 116.256 -	}
 116.257 -	close(TEMPLATE);
 116.258 -    } elsif (/^\+cat=(.+)$/) {
 116.259 -	# add characters with given category
 116.260 -	$cat = $1;
 116.261 -	for $i (keys(%category)) {
 116.262 -	    $used{$i} = "[${cat}]" if $category{$i} eq $cat;
 116.263 -	}
 116.264 -    } elsif (/^\-cat=(.+)$/) {
 116.265 -	# remove characters with given category
 116.266 -	$cat = $1;
 116.267 -	for $i (keys(%category)) {
 116.268 -	    delete $used{$i} if $category{$i} eq $cat;
 116.269 -	}
 116.270 -    } elsif (/^\-cat!=(.+)$/) {
 116.271 -	# remove characters without given category
 116.272 -	$cat = $1;
 116.273 -	for $i (keys(%category)) {
 116.274 -	    delete $used{$i} unless $category{$i} eq $cat;
 116.275 -	}
 116.276 -    } elsif (/^([+-]):(.*)/) {
 116.277 -	$remove = $1 eq "-";
 116.278 -	$setfile = $2;
 116.279 -	$setfile = shift(@ARGV) if $setfile eq "";
 116.280 -	push(@SETS, $setfile);
 116.281 -	open(SET, $setfile) || die("Can't open set file '$setfile': '$!'");
 116.282 -	$setname = $setfile;
 116.283 -	while (<SET>) {
 116.284 -	    while ($_) {
 116.285 -		$i = ord($_);
 116.286 -		$used{$i} .= "[${setname}]" unless $remove;
 116.287 -		delete $used{$i} if $remove;
 116.288 -		$_ = substr($_, 1);
 116.289 -	    }
 116.290 -	}
 116.291 -	close SET;
 116.292 -    } elsif (/^([+-])(.*)/) {
 116.293 -	$remove = $1 eq "-";
 116.294 -	$setfile = $2;
 116.295 -	$setfile = "$setfile..$setfile" if $setfile =~ /^([0-9A-Fa-f]{4,8})$/;
 116.296 -	if ($setfile =~ /^([0-9A-Fa-f]{4,8})(-|\.\.)([0-9A-Fa-f]{4,8})$/) {
 116.297 -	    # handle intervall specification on command line
 116.298 -	    $first = hex($1);
 116.299 -	    $last = hex($3);
 116.300 -	    for ($i = $first; $i <= $last; $i++) {
 116.301 -		$used{$i} .= "[ARG]" unless $remove;
 116.302 -		delete $used{$i} if $remove;
 116.303 -	    }
 116.304 -	    next;
 116.305 -	}
 116.306 -	$setfile = shift(@ARGV) if $setfile eq "";
 116.307 -	push(@SETS, $setfile);
 116.308 -	my $setf = search_open('<', $setfile);
 116.309 -	die("Can't open set file '$setfile': '$!'") unless $setf;
 116.310 -	$cedf = ($setfile =~ /cedf/); # detect Kosta Kosti's trans CEDF format by path name
 116.311 -	$setname = $setfile;
 116.312 -	$setname =~ s/([^.\[\]]*)\..*/$1/;
 116.313 -	while (<$setf>) {
 116.314 -	    if (/^<code_set_name>/) {
 116.315 -		# handle ISO 15897 (POSIX registry) charset mapping format
 116.316 -		undef $comment_char;
 116.317 -		undef $escape_char;
 116.318 -		while (<$setf>) {
 116.319 -		    if ($comment_char && /^$comment_char/) {
 116.320 -			# remove comments
 116.321 -			$_ = $`;
 116.322 -		    }
 116.323 -		    next if (/^\032?\s*$/);                                             # skip empty lines
 116.324 -		    if (/^<comment_char> (\S)$/) {
 116.325 -			$comment_char = $1;
 116.326 -		    } elsif (/^<escape_char> (\S)$/) {
 116.327 -			$escape_char = $1;
 116.328 -		    } elsif (/^(END )?CHARMAP$/) {
 116.329 -			#ignore
 116.330 -		    } elsif (/^<.*>\s*\/x([0-9A-F]{2})\s*<U([0-9A-F]{4,8})>/) {
 116.331 -			$used{hex($2)} .= "[${setname}{$1}]" unless $remove;
 116.332 -			delete $used{hex($2)} if $remove;
 116.333 -		    } else {
 116.334 -			die("Syntax error in line $. in file '$setfile':\n'$_'\n");
 116.335 -		    }
 116.336 -		}
 116.337 -		next;
 116.338 -	    } elsif (/^STARTFONT /) {
 116.339 -		# handle X11 BDF file
 116.340 -		while (<$setf>) {
 116.341 -		    if (/^ENCODING\s+([0-9]+)/) {
 116.342 -			$used{$1} .= "[${setname}]" unless $remove;
 116.343 -			delete $used{$1} if $remove;
 116.344 -		    }
 116.345 -		}
 116.346 -		next;
 116.347 -	    }
 116.348 -	    tr/a-z/A-Z/;           # make input uppercase
 116.349 -	    if ($cedf) {
 116.350 -		if ($. > 4) {
 116.351 -		    if (/^([0-9A-F]{2})\t.?\t(.*)$/) {
 116.352 -			# handle Kosta Kosti's trans CEDF format
 116.353 -			next if (hex($1) < 32 || (hex($1) > 0x7e && hex($1) < 0xa0));
 116.354 -			$ucs = $invname{$2};
 116.355 -			die "unknown ISO 10646 name '$2' in '$setfile' line $..\n" if ! $ucs;
 116.356 -			$used{$ucs} .= "[${setname}{$1}]" unless $remove;
 116.357 -			delete $used{$ucs} if $remove;
 116.358 -		    } else {
 116.359 -			die("Syntax error in line $. in CEDF file '$setfile':\n'$_'\n");
 116.360 -		    }
 116.361 -		}
 116.362 -		next;
 116.363 -	    }
 116.364 -	    if (/^\s*(0X|U\+|U-)?([0-9A-F]{2})\s+\#\s*UNDEFINED\s*$/) {
 116.365 -		# ignore ftp.unicode.org mapping file lines with #UNDEFINED
 116.366 -		next;
 116.367 -	    }
 116.368 -	    s/^([^\#]*)\#.*$/$1/;  # remove comments
 116.369 -	    next if (/^\032?\s*$/);     # skip empty lines
 116.370 -	    if (/^\s*(0X)?([0-9A-F-]{2})\s+(0X|U\+|U-)?([0-9A-F]{4,8})\s*$/) {
 116.371 -		# handle entry from a ftp.unicode.org mapping file
 116.372 -		$used{hex($4)} .= "[${setname}{$2}]" unless $remove;
 116.373 -		delete $used{hex($4)} if $remove;
 116.374 -	    } elsif (/^\s*(0X|U\+|U-)?([0-9A-F]{4,8})(\s*-\s*|\s*\.\.\s*|\s+)(0X|U\+|U-)?([0-9A-F]{4,8})\s*$/) {
 116.375 -		# handle interval specification
 116.376 -		$first = hex($2);
 116.377 -		$last = hex($5);
 116.378 -		for ($i = $first; $i <= $last; $i++) {
 116.379 -		    $used{$i} .= "[${setname}]" unless $remove;
 116.380 -		    delete $used{$i} if $remove;
 116.381 -		}
 116.382 -	    } elsif (/^\s*([0-9A-F]{2,6})(\s+[0-9A-F]{2},?|\s+[0-9A-F]{2}-[0-9A-F]{2},?)+/) {
 116.383 -		# handle lines from P10 MES draft
 116.384 -		$row = $1;
 116.385 -		$cols = $_;
 116.386 -		$cols =~ s/^\s*([0-9A-F]{2,6})\s*(.*)\s*$/$2/;
 116.387 -		$cols =~ tr/,//d;
 116.388 -		@cols = split(/\s+/, $cols);
 116.389 -		for (@cols) {
 116.390 -		    if (/^(..)$/) {
 116.391 -			$first = hex("$row$1");
 116.392 -			$last  = $first;
 116.393 -		    } elsif (/^(..)-(..)$/) {
 116.394 -			$first = hex("$row$1");
 116.395 -			$last  = hex("$row$2");
 116.396 -		    } else {
 116.397 -			die ("this should never happen '$_'");
 116.398 -		    }
 116.399 -		    for ($i = $first; $i <= $last; $i++) {
 116.400 -			$used{$i} .= "[${setname}]" unless $remove;
 116.401 -			delete $used{$i} if $remove;
 116.402 -		    }
 116.403 -		}
 116.404 -	    } elsif (/^\s*(0X|U\+|U-)?([0-9A-F]{4,8})\s*/) {
 116.405 -		# handle single character
 116.406 -		$used{hex($2)} .= "[${setname}]" unless $remove;
 116.407 -		delete $used{hex($2)} if $remove;
 116.408 -	    } else {
 116.409 -		die("Syntax error in line $. in file '$setfile':\n'$_'\n") unless /^\s*(\#.*)?$/;
 116.410 -	    }
 116.411 -	}
 116.412 -	close $setf;
 116.413 -    } elsif (/^loadimages$/ || /^loadbigimages$/) {
 116.414 -	if (/^loadimages$/) {
 116.415 -	    $prefix = "Small.Glyphs";
 116.416 -	} else {
 116.417 -	    $prefix = "Glyphs";
 116.418 -	}
 116.419 -	$total = 0;
 116.420 -	for $i (keys(%used)) {
 116.421 -	    next if ($name{$i} eq "<control>");
 116.422 -	    $total++;
 116.423 -	}
 116.424 -	$count = 0;
 116.425 -	$| = 1;
 116.426 -	for $i (sort({$a <=> $b} keys(%used))) {
 116.427 -	    next if ($name{$i} eq "<control>");
 116.428 -	    $count++;
 116.429 -	    $j = sprintf("%04X", $i);
 116.430 -	    $j =~ /(..)(..)/;
 116.431 -	    $gif = "http://charts.unicode.org/Unicode.charts/$prefix/$1/U$j.gif";
 116.432 -	    print("\r$count/$total: $gif");
 116.433 -	    system("mkdir -p $prefix/$1; cd $prefix/$1; webcopy -u -s $gif &");
 116.434 -	    select(undef, undef, undef, 0.2);
 116.435 -	}
 116.436 -	print("\n");
 116.437 -	exit 0;
 116.438 -    } elsif (/^giftable/) {
 116.439 -	# form a table of glyphs (requires pbmtools installed)
 116.440 -	$count = 0;
 116.441 -	for $i (keys(%used)) {
 116.442 -	    $count++ unless $name{$i} eq "<control>";
 116.443 -	}
 116.444 -	$width = int(sqrt($count/sqrt(2)) + 0.5);
 116.445 -	$width = $1 if /^giftable([0-9]+)$/;
 116.446 -	system("rm -f tmp-*.pnm table.pnm~ table.pnm");
 116.447 -	$col = 0;
 116.448 -	$row = 0;
 116.449 -	for $i (sort({$a <=> $b} keys(%used))) {
 116.450 -	    next if ($name{$i} eq "<control>");
 116.451 -	    $j = sprintf("%04X", $i);
 116.452 -	    $j =~ /(..)(..)/;
 116.453 -	    $gif = "Small.Glyphs/$1/U$j.gif";
 116.454 -	    $pnm = sprintf("tmp-%02x.pnm", $col);
 116.455 -	    $fallback = "Small.Glyphs/FF/UFFFD.gif";
 116.456 -	    system("giftopnm $gif >$pnm || { rm $pnm ; giftopnm $fallback >$pnm ; }");
 116.457 -	    if (++$col == $width) {
 116.458 -		system("pnmcat -lr tmp-*.pnm | cat >tmp-row.pnm");
 116.459 -		if ($row == 0) {
 116.460 -		    system("mv tmp-row.pnm table.pnm");
 116.461 -		} else {
 116.462 -		    system("mv table.pnm table.pnm~; pnmcat -tb table.pnm~ tmp-row.pnm >table.pnm");
 116.463 -		}
 116.464 -		$row++;
 116.465 -		$col = 0;
 116.466 -		system("rm -f tmp-*.pnm table.pnm~");
 116.467 -	    }
 116.468 -	}
 116.469 -	if ($col > 0) {
 116.470 -	    system("pnmcat -lr tmp-*.pnm | cat >tmp-row.pnm");
 116.471 -	    if ($row == 0) {
 116.472 -		system("mv tmp-row.pnm table.pnm");
 116.473 -	    } else {
 116.474 -		system("mv table.pnm table.pnm~; pnmcat -tb -jleft -black table.pnm~ tmp-row.pnm >table.pnm");
 116.475 -	    }
 116.476 -	}
 116.477 -	system("rm -f table.gif ; ppmtogif table.pnm > table.gif");
 116.478 -	system("rm -f tmp-*.pnm table.pnm~ table.pnm");
 116.479 -    } elsif (/^table$/) {
 116.480 -	# go through all used names to print full table
 116.481 -	print "<TABLE border=2>\n" if $html;
 116.482 -	for $i (sort({$a <=> $b} keys(%used))) {
 116.483 -	    next if ($name{$i} eq "<control>");
 116.484 -	    if ($html) {
 116.485 -		$sources = $used{$i};
 116.486 -		$sources =~ s/\]\[/, /g;
 116.487 -		$sources =~ s/^\[//g;
 116.488 -		$sources =~ s/\]$//g;
 116.489 -		$sources =~ s/\{(..)\}/<SUB>$1<\/SUB>/g;
 116.490 -		$j = sprintf("%04X", $i);
 116.491 -		$j =~ /(..)(..)/;
 116.492 -		$gif = "Small.Glyphs/$1/U$j.gif";
 116.493 -		print "<TR>";
 116.494 -		print "<TD><img width=32 height=32 src=\"$gif\">" if $image;
 116.495 -		printf("<TD>&#%d;", $i) if $adducs;
 116.496 -		print "<TD><SAMP>$j</SAMP><TD><SAMP>" . name($i);
 116.497 -		print " ($comment{$i})" if $comment{$i};
 116.498 -		print "</SAMP><TD><SMALL>$sources</SMALL>\n";
 116.499 -	    } else {
 116.500 -		printf("%04X \# ", $i);
 116.501 -		print pack("U", $i) . " " if $adducs;
 116.502 -		print name($i) ."\n";
 116.503 -	    }
 116.504 -	}
 116.505 -	print "</TABLE>\n" if $html;
 116.506 -    } elsif (/^imgblock$/) {
 116.507 -	$width = 16;
 116.508 -	$width = $1 if /giftable([0-9]+)/;
 116.509 -	$col = 0;
 116.510 -	$subline = "";
 116.511 -	print "\n<P><TABLE cellspacing=0 cellpadding=0>";
 116.512 -	for $i (sort({$a <=> $b} keys(%used))) {
 116.513 -	    print "<TR>" if $col == 0;
 116.514 -	    $j = sprintf("%04X", $i);
 116.515 -	    $j =~ /(..)(..)/;
 116.516 -	    $gif = "Small.Glyphs/$1/U$j.gif";
 116.517 -	    $alt = name($i);
 116.518 -	    print "<TD><img width=32 height=32 src=\"$gif\" alt=\"$alt\">";
 116.519 -	    $subline .= "<TD><SMALL><SAMP>$j</SAMP></SMALL>";
 116.520 -	    if (++$col == $width) {
 116.521 -		print "<TR align=center>$subline";
 116.522 -		$col = 0;
 116.523 -		$subline = "";
 116.524 -	    }
 116.525 -	}
 116.526 -	print "<TR align=center>$subline" if ($col > 0);
 116.527 -	print "</TABLE>\n";
 116.528 -    } elsif (/^sources$/) {
 116.529 -	# count how many characters are attributed to the various source set combinations
 116.530 -	print "<P>Number of occurences of source character set combinations:\n<TABLE border=2>" if $html;
 116.531 -	for $i (keys(%used)) {
 116.532 -	    next if ($name{$i} eq "<control>");
 116.533 -	    $sources = $used{$i};
 116.534 -	    $sources =~ s/\]\[/, /g;
 116.535 -	    $sources =~ s/^\[//g;
 116.536 -	    $sources =~ s/\]$//g;
 116.537 -	    $sources =~ s/\{(..)\}//g;
 116.538 -	    $contribs{$sources} += 1;
 116.539 -	}
 116.540 -	for $j (keys(%contribs)) {
 116.541 -	    print "<TR><TD>$contribs{$j}<TD>$j\n" if $html;
 116.542 -	}
 116.543 -	print "</TABLE>\n" if $html;
 116.544 -    } elsif (/^compact$/) {
 116.545 -	# print compact table in P10 MES format
 116.546 -	print "<P>Compact representation of this character set:\n<TABLE border=2>" if $html;
 116.547 -	print "<TR><TD><B>Rows</B><TD><B>Positions (Cells)</B>" if $html;
 116.548 -	print "\n# Plane 00\n# Rows\tPositions (Cells)\n" unless $html;
 116.549 -	$current_row = '';
 116.550 -	$start_col = '';
 116.551 -	$last_col = '';
 116.552 -	for $i (sort({$a <=> $b} keys(%used))) {
 116.553 -	    next if ($name{$i} eq "<control>");
 116.554 -	    $row = sprintf("%02X", $i >> 8);
 116.555 -	    $col = sprintf("%02X", $i & 0xff);
 116.556 -	    if ($row ne $current_row) {
 116.557 -		if (($last_col ne '') and ($last_col ne $start_col)) {
 116.558 -		    print "-$last_col";
 116.559 -		    print "</SAMP>" if $html;
 116.560 -		}
 116.561 -		print "<TR><TD><SAMP>$row</SAMP><TD><SAMP>" if $html;
 116.562 -		print "\n  $row\t" unless $html;
 116.563 -		$len = 0;
 116.564 -		$current_row = $row;
 116.565 -		$start_col = '';
 116.566 -	    }
 116.567 -	    if ($start_col eq '') {
 116.568 -		print "$col";
 116.569 -		$len += 2;
 116.570 -		$start_col = $col;
 116.571 -		$last_col = $col;
 116.572 -	    } elsif (hex($col) == hex($last_col) + 1) {
 116.573 -		$last_col = $col;
 116.574 -	    } else {
 116.575 -		if ($last_col ne $start_col) {
 116.576 -		    print "-$last_col";
 116.577 -		    $len += 3;
 116.578 -		}
 116.579 -		if ($len > 60 && !$html) {
 116.580 -		    print "\n  $row\t";
 116.581 -		    $len = 0;
 116.582 -		};
 116.583 -		print " " if $len;
 116.584 -		print "$col";
 116.585 -		$len += 2 + !! $len;
 116.586 -		$start_col = $col;
 116.587 -		$last_col = $col;
 116.588 -	    }
 116.589 -	}
 116.590 -	if (($last_col ne '') and ($last_col ne $start_col)) {
 116.591 -	    print "-$last_col";
 116.592 -	    print "</SAMP>" if $html;
 116.593 -	}
 116.594 -	print "\n" if ($current_row ne '');
 116.595 -	print "</TABLE>\n" if $html;
 116.596 -	print "\n";
 116.597 -    } elsif (/^c$/) {
 116.598 -	# print table as C interval array
 116.599 -	print "{";
 116.600 -	$last_i = '';
 116.601 -	$columns = 3;
 116.602 -	$col = $columns;
 116.603 -	for $i (sort({$a <=> $b} keys(%used))) {
 116.604 -	    next if ($name{$i} eq "<control>");
 116.605 -	    if ($last_i eq '') {
 116.606 -		if (++$col > $columns) { $col = 1; print "\n "; }
 116.607 -		printf(" { 0x%04X, ", $i);
 116.608 -		$last_i = $i;
 116.609 -	    } elsif ($i == $last_i + 1) {
 116.610 -		$last_i = $i;
 116.611 -	    } else {
 116.612 -		printf("0x%04X },", $last_i);
 116.613 -		if (++$col > $columns) { $col = 1; print "\n "; }
 116.614 -		printf(" { 0x%04X, ", $i);
 116.615 -		$last_i = $i;
 116.616 -	    }
 116.617 -	}
 116.618 -	if ($last_i ne '') {
 116.619 -	    printf("0x%04X }", $last_i);
 116.620 -	}
 116.621 -	print "\n};\n";
 116.622 -    } elsif (/^utf8-list$/) {
 116.623 -	$col = 0;
 116.624 -	$block = 0;
 116.625 -	$last = -1;
 116.626 -	for $i (sort({$a <=> $b} keys(%used))) {
 116.627 -	    next if ($name{$i} eq "<control>");
 116.628 -	    while ($blockend[$block] < $i && $block < $blocks - 1) {
 116.629 -		$block++;
 116.630 -	    }
 116.631 -	    if ($last <= $blockend[$block-1] &&
 116.632 -		$i < $blockstart[$block]) {
 116.633 -		print "\n" if ($col);
 116.634 -		printf "\nFree block (U+%04X-U+%04X):\n\n",
 116.635 -		    $blockend[$block-1] + 1, $blockstart[$block] - 1;
 116.636 -		$col = 0;
 116.637 -	    }
 116.638 -	    if ($last < $blockstart[$block] && $i >= $blockstart[$block]) {
 116.639 -		print "\n" if ($col);
 116.640 -		printf "\n$blockname[$block] (U+%04X-U+%04X):\n\n",
 116.641 -		$blockstart[$block], $blockend[$block];
 116.642 -		$col = 0;
 116.643 -	    }
 116.644 -	    if ($category{$i} eq 'Mn') {
 116.645 -		# prefix non-spacing character with U+25CC DOTTED CIRCLE
 116.646 -		print "\x{25CC}";
 116.647 -	    } elsif ($category{$i} eq 'Me') {
 116.648 -		# prefix enclosing non-spacing character with space
 116.649 -		print " ";
 116.650 -	    }
 116.651 -	    print pack("U", $i);
 116.652 -	    $col += 1 + iswide($i);
 116.653 -	    if ($col >= 64) {
 116.654 -		print "\n";
 116.655 -		$col = 0;
 116.656 -	    }
 116.657 -	    $last = $i;
 116.658 -	}
 116.659 -	print "\n" if ($col);
 116.660 -    } elsif (/^collections$/) {
 116.661 -	$block = 0;
 116.662 -	$last = -1;
 116.663 -	for $i (sort({$a <=> $b} keys(%used))) {
 116.664 -	    next if ($name{$i} eq "<control>");
 116.665 -	    while ($blockend[$block] < $i && $block < $blocks - 1) {
 116.666 -		$block++;
 116.667 -	    }
 116.668 -	    if ($last < $blockstart[$block] && $i >= $blockstart[$block]) {
 116.669 -		print $blockname[$block],
 116.670 -		  " " x (40 - length($blockname[$block]));
 116.671 -		printf "%04X-%04X\n",
 116.672 -		  $blockstart[$block], $blockend[$block];
 116.673 -	    }
 116.674 -	    $last = $i;
 116.675 -	}
 116.676 -    } elsif (/^nr$/) {
 116.677 -	print "<P>" if $html;
 116.678 -	print "# " unless $html;
 116.679 -	print "Number of characters in above table: ";
 116.680 -	$count = 0;
 116.681 -	for $i (keys(%used)) {
 116.682 -	    $count++ unless $name{$i} eq "<control>";
 116.683 -	}
 116.684 -	print $count;
 116.685 -	print "\n";
 116.686 -    } elsif (/^clean$/) {
 116.687 -	# remove characters from set that are not in $unicodedata
 116.688 -	for $i (keys(%used)) {
 116.689 -	    delete $used{$i} unless is_unicode($i);
 116.690 -	}
 116.691 -    } elsif (/^unknown$/) {
 116.692 -	# remove characters from set that are in $unicodedata
 116.693 -	for $i (keys(%used)) {
 116.694 -	    delete $used{$i} if is_unicode($i);
 116.695 -	}
 116.696 -    } else {
 116.697 -	die("Unknown command line command '$_'");
 116.698 -    };
 116.699 -}
   117.1 --- a/libc/string/wcpcpy.c	Sat Dec 07 00:44:56 2019 +0100
   117.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   117.3 @@ -1,35 +0,0 @@
   117.4 -/*
   117.5 -FUNCTION
   117.6 -	<<wcpcpy>>---copy a wide-character string returning a pointer to its end
   117.7 -
   117.8 -SYNOPSIS
   117.9 -	#include <wchar.h>
  117.10 -	wchar_t *wcpcpy(wchar_t *<[s1]>, const wchar_t *<[s2]>);
  117.11 -
  117.12 -DESCRIPTION
  117.13 -	The <<wcpcpy>> function copies the wide-character string pointed to by
  117.14 -	<[s2]> (including the terminating null wide-character code) into the
  117.15 -	array pointed to by <[s1]>. If copying takes place between objects that
  117.16 -	overlap, the behaviour is undefined. 
  117.17 -
  117.18 -RETURNS
  117.19 -	This function returns a pointer to the end of the destination string,
  117.20 -	thus pointing to the trailing '\0'.
  117.21 -
  117.22 -PORTABILITY
  117.23 -<<wcpcpy>> is a GNU extension.
  117.24 -
  117.25 -No supporting OS subroutines are required.
  117.26 -*/
  117.27 -
  117.28 -#include <_ansi.h>
  117.29 -#include <wchar.h>
  117.30 -
  117.31 -wchar_t *
  117.32 -wcpcpy (wchar_t *__restrict s1,
  117.33 -	const wchar_t *__restrict s2)
  117.34 -{
  117.35 -  while ((*s1++ = *s2++))
  117.36 -    ;
  117.37 -  return --s1;
  117.38 -}
   118.1 --- a/libc/string/wcpncpy.c	Sat Dec 07 00:44:56 2019 +0100
   118.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   118.3 @@ -1,55 +0,0 @@
   118.4 -/*
   118.5 -FUNCTION
   118.6 -	<<wcpncpy>>---copy part of a wide-character string returning a pointer to its end
   118.7 -
   118.8 -SYNOPSIS
   118.9 -	#include <wchar.h>
  118.10 -	wchar_t *wcpncpy(wchar_t *__restrict <[s1]>,
  118.11 -			 const wchar_t *__restrict <[s2]>, size_t <[n]>);
  118.12 -
  118.13 -DESCRIPTION
  118.14 -	The <<wcpncpy>> function copies not more than n wide-character codes
  118.15 -	(wide-character codes that follow a null wide-character code are not
  118.16 -	copied) from the array pointed to by <[s2]> to the array pointed to
  118.17 -	by <[s1]>. If copying takes place between objects that overlap, the
  118.18 -	behaviour is undefined.
  118.19 -
  118.20 -	If the array pointed to by <[s2]> is a wide-character string that is
  118.21 -	shorter than <[n]> wide-character codes, null wide-character codes are
  118.22 -	appended to the copy in the array pointed to by <[s1]>, until <[n]>
  118.23 -	wide-character codes in all are written. 
  118.24 -
  118.25 -RETURNS
  118.26 -	The <<wcpncpy>> function returns <[s1]>; no return value is reserved to
  118.27 -	indicate an error. 
  118.28 -
  118.29 -PORTABILITY
  118.30 -<<wcpncpy>> is ISO/IEC 9899/AMD1:1995 (ISO C).
  118.31 -
  118.32 -No supporting OS subroutines are required.
  118.33 -*/
  118.34 -
  118.35 -#include <_ansi.h>
  118.36 -#include <wchar.h>
  118.37 -
  118.38 -wchar_t *
  118.39 -wcpncpy (wchar_t *__restrict dst,
  118.40 -	const wchar_t *__restrict src,
  118.41 -	size_t count)
  118.42 -{
  118.43 -  wchar_t *ret = NULL;
  118.44 -
  118.45 -  while (count > 0)
  118.46 -    {
  118.47 -      --count;
  118.48 -      if ((*dst++ = *src++) == L'\0')
  118.49 -	{
  118.50 -	  ret = dst - 1;
  118.51 -	  break;
  118.52 -	}
  118.53 -    }
  118.54 -  while (count-- > 0)
  118.55 -    *dst++ = L'\0';
  118.56 -
  118.57 -  return ret ? ret : dst;
  118.58 -}
   119.1 --- a/libc/string/wcscasecmp.c	Sat Dec 07 00:44:56 2019 +0100
   119.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   119.3 @@ -1,51 +0,0 @@
   119.4 -/*
   119.5 -FUNCTION
   119.6 -	<<wcscasecmp>>---case-insensitive wide character string compare
   119.7 -	
   119.8 -INDEX
   119.9 -	wcscasecmp
  119.10 -
  119.11 -SYNOPSIS
  119.12 -	#include <wchar.h>
  119.13 -	int wcscasecmp(const wchar_t *<[a]>, const wchar_t *<[b]>);
  119.14 -
  119.15 -DESCRIPTION
  119.16 -	<<wcscasecmp>> compares the wide character string at <[a]> to
  119.17 -	the wide character string at <[b]> in a case-insensitive manner.
  119.18 -
  119.19 -RETURNS 
  119.20 -
  119.21 -	If <<*<[a]>>> sorts lexicographically after <<*<[b]>>> (after
  119.22 -	both are converted to uppercase), <<wcscasecmp>> returns a
  119.23 -	number greater than zero.  If the two strings match,
  119.24 -	<<wcscasecmp>> returns zero.  If <<*<[a]>>> sorts
  119.25 -	lexicographically before <<*<[b]>>>, <<wcscasecmp>> returns a
  119.26 -	number less than zero.
  119.27 -
  119.28 -PORTABILITY
  119.29 -POSIX-1.2008
  119.30 -
  119.31 -<<wcscasecmp>> requires no supporting OS subroutines. It uses
  119.32 -tolower() from elsewhere in this library.
  119.33 -
  119.34 -QUICKREF
  119.35 -	wcscasecmp 
  119.36 -*/
  119.37 -
  119.38 -#include <wchar.h>
  119.39 -#include <wctype.h>
  119.40 -
  119.41 -int
  119.42 -wcscasecmp (const wchar_t *s1,
  119.43 -	const wchar_t *s2)
  119.44 -{
  119.45 -  int d = 0;
  119.46 -  for ( ; ; )
  119.47 -    {
  119.48 -      const int c1 = towlower (*s1++);
  119.49 -      const int c2 = towlower (*s2++);
  119.50 -      if (((d = c1 - c2) != 0) || (c2 == '\0'))
  119.51 -        break;
  119.52 -    }
  119.53 -  return d;
  119.54 -}
   120.1 --- a/libc/string/wcscasecmp_l.c	Sat Dec 07 00:44:56 2019 +0100
   120.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   120.3 @@ -1,54 +0,0 @@
   120.4 -/*
   120.5 -FUNCTION
   120.6 -	<<wcscasecmp_l>>---case-insensitive wide character string compare
   120.7 -	
   120.8 -INDEX
   120.9 -	wcscasecmp_l
  120.10 -
  120.11 -SYNOPSIS
  120.12 -	#include <wchar.h>
  120.13 -	int wcscasecmp_l(const wchar_t *<[a]>, const wchar_t *<[b]>,
  120.14 -			 locale_t <[locale]>);
  120.15 -
  120.16 -DESCRIPTION
  120.17 -	<<wcscasecmp_l>> compares the wide character string at <[a]> to
  120.18 -	the wide character string at <[b]> in a case-insensitive manner.
  120.19 -
  120.20 -	if <[locale]> is LC_GLOBAL_LOCALE or not a valid locale object,
  120.21 -	the behaviour is undefined.
  120.22 -
  120.23 -RETURNS 
  120.24 -
  120.25 -	If <<*<[a]>>> sorts lexicographically after <<*<[b]>>> (after
  120.26 -	both are converted to uppercase), <<wcscasecmp_l>> returns a
  120.27 -	number greater than zero.  If the two strings match,
  120.28 -	<<wcscasecmp_l>> returns zero.  If <<*<[a]>>> sorts
  120.29 -	lexicographically before <<*<[b]>>>, <<wcscasecmp_l>> returns a
  120.30 -	number less than zero.
  120.31 -
  120.32 -PORTABILITY
  120.33 -<<wcscasecmp_l>> is POSIX-1.2008
  120.34 -
  120.35 -<<wcscasecmp_l>> requires no supporting OS subroutines. It uses
  120.36 -tolower() from elsewhere in this library.
  120.37 -
  120.38 -QUICKREF
  120.39 -	wcscasecmp_l 
  120.40 -*/
  120.41 -
  120.42 -#include <wchar.h>
  120.43 -#include <wctype.h>
  120.44 -
  120.45 -int
  120.46 -wcscasecmp_l (const wchar_t *s1, const wchar_t *s2, struct __locale_t *locale)
  120.47 -{
  120.48 -  int d = 0;
  120.49 -  for ( ; ; )
  120.50 -    {
  120.51 -      const int c1 = towlower_l (*s1++, locale);
  120.52 -      const int c2 = towlower_l (*s2++, locale);
  120.53 -      if (((d = c1 - c2) != 0) || (c2 == '\0'))
  120.54 -        break;
  120.55 -    }
  120.56 -  return d;
  120.57 -}
   121.1 --- a/libc/string/wcscat.c	Sat Dec 07 00:44:56 2019 +0100
   121.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   121.3 @@ -1,80 +0,0 @@
   121.4 -/*
   121.5 -FUNCTION
   121.6 -	<<wcscat>>---concatenate two wide-character strings
   121.7 -INDEX
   121.8 -	wcscat
   121.9 -
  121.10 -SYNOPSIS
  121.11 -	#include <wchar.h>
  121.12 -	wchar_t *wcscat(wchar_t *__restrict <[s1]>,
  121.13 -			const wchar_t *__restrict <[s2]>);
  121.14 -
  121.15 -DESCRIPTION
  121.16 -	The <<wcscat>> function appends a copy of the wide-character string
  121.17 -	pointed to by <[s2]> (including the terminating null wide-character
  121.18 -	code) to the end of the wide-character string pointed to by <[s1]>.
  121.19 -	The initial wide-character code of <[s2]> overwrites the null
  121.20 -	wide-character code at the end of <[s1]>. If copying takes place between
  121.21 -	objects that overlap, the behaviour is undefined. 
  121.22 -
  121.23 -RETURNS
  121.24 -	The <<wcscat>> function returns <[s1]>;
  121.25 -	no return value is reserved to indicate an error. 
  121.26 -
  121.27 -PORTABILITY
  121.28 -<<wcscat>> is ISO/IEC 9899/AMD1:1995 (ISO C).
  121.29 -
  121.30 -No supporting OS subroutines are required.
  121.31 -*/
  121.32 -
  121.33 -/*	$NetBSD: wcscat.c,v 1.1 2000/12/23 23:14:36 itojun Exp $	*/
  121.34 -
  121.35 -/*-
  121.36 - * Copyright (c)1999 Citrus Project,
  121.37 - * All rights reserved.
  121.38 - *
  121.39 - * Redistribution and use in source and binary forms, with or without
  121.40 - * modification, are permitted provided that the following conditions
  121.41 - * are met:
  121.42 - * 1. Redistributions of source code must retain the above copyright
  121.43 - *    notice, this list of conditions and the following disclaimer.
  121.44 - * 2. Redistributions in binary form must reproduce the above copyright
  121.45 - *    notice, this list of conditions and the following disclaimer in the
  121.46 - *    documentation and/or other materials provided with the distribution.
  121.47 - *
  121.48 - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  121.49 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  121.50 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  121.51 - * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  121.52 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  121.53 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  121.54 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  121.55 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  121.56 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  121.57 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  121.58 - * SUCH DAMAGE.
  121.59 - *
  121.60 - *	citrus Id: wcscat.c,v 1.1 1999/12/29 21:47:45 tshiozak Exp
  121.61 - */
  121.62 -
  121.63 -#include <_ansi.h>
  121.64 -#include <wchar.h>
  121.65 -
  121.66 -wchar_t *
  121.67 -wcscat (wchar_t *__restrict s1,
  121.68 -	const wchar_t *__restrict s2)
  121.69 -{
  121.70 -  wchar_t *p;
  121.71 -  wchar_t *q;
  121.72 -  const wchar_t *r;
  121.73 -
  121.74 -  p = s1;
  121.75 -  while (*p)
  121.76 -    p++;
  121.77 -  q = p;
  121.78 -  r = s2;
  121.79 -  while (*r)
  121.80 -    *q++ = *r++;
  121.81 -  *q = '\0';
  121.82 -  return s1;
  121.83 -}
   122.1 --- a/libc/string/wcschr.c	Sat Dec 07 00:44:56 2019 +0100
   122.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   122.3 @@ -1,76 +0,0 @@
   122.4 -/*
   122.5 -FUNCTION
   122.6 -	<<wcschr>>---wide-character string scanning operation
   122.7 -
   122.8 -SYNOPSIS
   122.9 -	#include <wchar.h>
  122.10 -	wchar_t *wcschr(const wchar_t *<[s]>, wchar_t <[c]>);
  122.11 -
  122.12 -DESCRIPTION
  122.13 -	The <<wcschr>> function locates the first occurrence of <[c]> in the
  122.14 -	wide-character string pointed to by <[s]>. The value of <[c]> must be a
  122.15 -	character representable as a type wchar_t and must be a wide-character
  122.16 -	code corresponding to a valid character in the current locale.
  122.17 -	The terminating null wide-character string.
  122.18 -
  122.19 -RETURNS
  122.20 -	Upon completion, <<wcschr>> returns a pointer to the wide-character
  122.21 -	code, or a null pointer if the wide-character code is not found. 
  122.22 -
  122.23 -PORTABILITY
  122.24 -<<wcschr>> is ISO/IEC 9899/AMD1:1995 (ISO C).
  122.25 -
  122.26 -No supporting OS subroutines are required.
  122.27 -*/
  122.28 -
  122.29 -/*	$NetBSD: wcschr.c,v 1.1 2000/12/23 23:14:36 itojun Exp $	*/
  122.30 -
  122.31 -/*-
  122.32 - * Copyright (c)1999 Citrus Project,
  122.33 - * All rights reserved.
  122.34 - *
  122.35 - * Redistribution and use in source and binary forms, with or without
  122.36 - * modification, are permitted provided that the following conditions
  122.37 - * are met:
  122.38 - * 1. Redistributions of source code must retain the above copyright
  122.39 - *    notice, this list of conditions and the following disclaimer.
  122.40 - * 2. Redistributions in binary form must reproduce the above copyright
  122.41 - *    notice, this list of conditions and the following disclaimer in the
  122.42 - *    documentation and/or other materials provided with the distribution.
  122.43 - *
  122.44 - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  122.45 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  122.46 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  122.47 - * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  122.48 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  122.49 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  122.50 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  122.51 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  122.52 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  122.53 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  122.54 - * SUCH DAMAGE.
  122.55 - *
  122.56 - *	citrus Id: wcschr.c,v 1.2 2000/12/21 05:07:25 itojun Exp
  122.57 - */
  122.58 -
  122.59 -#include <_ansi.h>
  122.60 -#include <stddef.h>
  122.61 -#include <wchar.h>
  122.62 -
  122.63 -wchar_t *
  122.64 -wcschr (const wchar_t * s,
  122.65 -	wchar_t c)
  122.66 -{
  122.67 -  const wchar_t *p;
  122.68 -
  122.69 -  p = s;
  122.70 -  do
  122.71 -    {
  122.72 -      if (*p == c)
  122.73 -	{
  122.74 -	  /* LINTED interface specification */
  122.75 -	  return (wchar_t *) p;
  122.76 -	}
  122.77 -    } while (*p++);
  122.78 -  return NULL;
  122.79 -}
   123.1 --- a/libc/string/wcscmp.c	Sat Dec 07 00:44:56 2019 +0100
   123.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   123.3 @@ -1,78 +0,0 @@
   123.4 -/*
   123.5 -FUNCTION
   123.6 -	<<wcscmp>>---compare two wide-character strings
   123.7 -
   123.8 -SYNOPSIS
   123.9 -	#include <wchar.h>
  123.10 -	int wcscmp(const wchar_t *<[s1]>, *<[s2]>);
  123.11 -
  123.12 -DESCRIPTION
  123.13 -	The <<wcscmp>> function compares the wide-character string pointed to
  123.14 -	by <[s1]> to the wide-character string pointed to by <[s2]>.
  123.15 -
  123.16 -	The sign of a non-zero return value is determined by the sign of the
  123.17 -	difference between the values of the first pair of wide-character codes
  123.18 -	that differ in the objects being compared.
  123.19 -
  123.20 -RETURNS
  123.21 -	Upon completion, <<wcscmp>> returns an integer greater than, equal to
  123.22 -	or less than 0, if the wide-character string pointed to by <[s1]> is
  123.23 -	greater than, equal to or less than the wide-character string pointed
  123.24 -	to by <[s2]> respectively. 
  123.25 -
  123.26 -PORTABILITY
  123.27 -<<wcscmp>> is ISO/IEC 9899/AMD1:1995 (ISO C).
  123.28 -
  123.29 -No supporting OS subroutines are required.
  123.30 -*/
  123.31 -
  123.32 -/*	$NetBSD$	*/
  123.33 -
  123.34 -/*-
  123.35 - * Copyright (c) 1990, 1993
  123.36 - *	The Regents of the University of California.  All rights reserved.
  123.37 - *
  123.38 - * This code is derived from software contributed to Berkeley by
  123.39 - * Chris Torek.
  123.40 - *
  123.41 - * Redistribution and use in source and binary forms, with or without
  123.42 - * modification, are permitted provided that the following conditions
  123.43 - * are met:
  123.44 - * 1. Redistributions of source code must retain the above copyright
  123.45 - *    notice, this list of conditions and the following disclaimer.
  123.46 - * 2. Redistributions in binary form must reproduce the above copyright
  123.47 - *    notice, this list of conditions and the following disclaimer in the
  123.48 - *    documentation and/or other materials provided with the distribution.
  123.49 - * 3. Neither the name of the University nor the names of its contributors
  123.50 - *    may be used to endorse or promote products derived from this software
  123.51 - *    without specific prior written permission.
  123.52 - *
  123.53 - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  123.54 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  123.55 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  123.56 - * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  123.57 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  123.58 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  123.59 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  123.60 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  123.61 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  123.62 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  123.63 - * SUCH DAMAGE.
  123.64 - */
  123.65 -
  123.66 -#include <_ansi.h>
  123.67 -#include <wchar.h>
  123.68 -
  123.69 -/*
  123.70 - * Compare strings.
  123.71 - */
  123.72 -int
  123.73 -wcscmp (const wchar_t * s1,
  123.74 -	const wchar_t * s2)
  123.75 -{
  123.76 -
  123.77 -  while (*s1 == *s2++)
  123.78 -    if (*s1++ == 0)
  123.79 -      return (0);
  123.80 -  return (*s1 - *--s2);
  123.81 -}
   124.1 --- a/libc/string/wcscoll.c	Sat Dec 07 00:44:56 2019 +0100
   124.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   124.3 @@ -1,41 +0,0 @@
   124.4 -/*
   124.5 -FUNCTION
   124.6 -	<<wcscoll>>---locale-specific wide-character string compare
   124.7 -	
   124.8 -INDEX
   124.9 -	wcscoll
  124.10 -
  124.11 -SYNOPSIS
  124.12 -	#include <wchar.h>
  124.13 -	int wcscoll(const wchar_t *<[stra]>, const wchar_t * <[strb]>);
  124.14 -
  124.15 -DESCRIPTION
  124.16 -	<<wcscoll>> compares the wide-character string pointed to by
  124.17 -	<[stra]> to the wide-character string pointed to by <[strb]>,
  124.18 -	using an interpretation appropriate to the current <<LC_COLLATE>>
  124.19 -	state.
  124.20 -
  124.21 -	(NOT Cygwin:) The current implementation of <<wcscoll>> simply
  124.22 -	uses <<wcscmp>> and does not support any language-specific sorting.
  124.23 -
  124.24 -RETURNS
  124.25 -	If the first string is greater than the second string,
  124.26 -	<<wcscoll>> returns a number greater than zero.  If the two
  124.27 -	strings are equivalent, <<wcscoll>> returns zero.  If the first
  124.28 -	string is less than the second string, <<wcscoll>> returns a
  124.29 -	number less than zero.
  124.30 -
  124.31 -PORTABILITY
  124.32 -<<wcscoll>> is ISO/IEC 9899/AMD1:1995 (ISO C).
  124.33 -*/
  124.34 -
  124.35 -#include <_ansi.h>
  124.36 -#include <wchar.h>
  124.37 -
  124.38 -int
  124.39 -wcscoll (const wchar_t *a,
  124.40 -	const wchar_t *b)
  124.41 -
  124.42 -{
  124.43 -  return wcscmp (a, b);
  124.44 -}
   125.1 --- a/libc/string/wcscoll_l.c	Sat Dec 07 00:44:56 2019 +0100
   125.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   125.3 @@ -1,43 +0,0 @@
   125.4 -/*
   125.5 -FUNCTION
   125.6 -	<<wcscoll_l>>---locale-specific wide-character string compare
   125.7 -	
   125.8 -INDEX
   125.9 -	wcscoll_l
  125.10 -
  125.11 -SYNOPSIS
  125.12 -	#include <wchar.h>
  125.13 -	int wcscoll_l(const wchar_t *<[stra]>, const wchar_t * <[strb]>,
  125.14 -		      locale_t <[locale]>);
  125.15 -
  125.16 -DESCRIPTION
  125.17 -	<<wcscoll_l>> compares the wide-character string pointed to by
  125.18 -	<[stra]> to the wide-character string pointed to by <[strb]>,
  125.19 -	using an interpretation appropriate to the current <<LC_COLLATE>>
  125.20 -	state.
  125.21 -
  125.22 -	(NOT Cygwin:) The current implementation of <<wcscoll_l>> simply
  125.23 -	uses <<wcscmp>> and does not support any language-specific sorting.
  125.24 -
  125.25 -	If <[locale]> is LC_GLOBAL_LOCALE or not a valid locale object, the
  125.26 -	behaviour is undefined.
  125.27 -
  125.28 -RETURNS
  125.29 -	If the first string is greater than the second string,
  125.30 -	<<wcscoll_l>> returns a number greater than zero.  If the two
  125.31 -	strings are equivalent, <<wcscoll_l>> returns zero.  If the first
  125.32 -	string is less than the second string, <<wcscoll_l>> returns a
  125.33 -	number less than zero.
  125.34 -
  125.35 -PORTABILITY
  125.36 -<<wcscoll_l>> is POSIX-1.2008.
  125.37 -*/
  125.38 -
  125.39 -#include <_ansi.h>
  125.40 -#include <wchar.h>
  125.41 -
  125.42 -int
  125.43 -wcscoll_l (const wchar_t *a, const wchar_t *b, struct __locale_t *locale)
  125.44 -{
  125.45 -  return wcscmp (a, b);
  125.46 -}
   126.1 --- a/libc/string/wcscpy.c	Sat Dec 07 00:44:56 2019 +0100
   126.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   126.3 @@ -1,74 +0,0 @@
   126.4 -/*
   126.5 -FUNCTION
   126.6 -	<<wcscpy>>---copy a wide-character string 
   126.7 -
   126.8 -SYNOPSIS
   126.9 -	#include <wchar.h>
  126.10 -	wchar_t *wcscpy(wchar_t *__restrict <[s1]>,
  126.11 -			const wchar_t *__restrict <[s2]>);
  126.12 -
  126.13 -DESCRIPTION
  126.14 -	The <<wcscpy>> function copies the wide-character string pointed to by
  126.15 -	<[s2]> (including the terminating null wide-character code) into the
  126.16 -	array pointed to by <[s1]>. If copying takes place between objects that
  126.17 -	overlap, the behaviour is undefined. 
  126.18 -
  126.19 -RETURNS
  126.20 -	The <<wcscpy>> function returns <[s1]>; no return value is reserved to
  126.21 -	indicate an error. 
  126.22 -
  126.23 -PORTABILITY
  126.24 -<<wcscpy>> is ISO/IEC 9899/AMD1:1995 (ISO C).
  126.25 -
  126.26 -No supporting OS subroutines are required.
  126.27 -*/
  126.28 -
  126.29 -/*	$NetBSD: wcscpy.c,v 1.1 2000/12/23 23:14:36 itojun Exp $	*/
  126.30 -
  126.31 -/*-
  126.32 - * Copyright (c)1999 Citrus Project,
  126.33 - * All rights reserved.
  126.34 - *
  126.35 - * Redistribution and use in source and binary forms, with or without
  126.36 - * modification, are permitted provided that the following conditions
  126.37 - * are met:
  126.38 - * 1. Redistributions of source code must retain the above copyright
  126.39 - *    notice, this list of conditions and the following disclaimer.
  126.40 - * 2. Redistributions in binary form must reproduce the above copyright
  126.41 - *    notice, this list of conditions and the following disclaimer in the
  126.42 - *    documentation and/or other materials provided with the distribution.
  126.43 - *
  126.44 - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  126.45 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  126.46 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  126.47 - * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  126.48 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  126.49 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  126.50 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  126.51 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  126.52 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  126.53 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  126.54 - * SUCH DAMAGE.
  126.55 - *
  126.56 - *	citrus Id: wcscpy.c,v 1.2 2000/12/21 04:51:09 itojun Exp
  126.57 - */
  126.58 -
  126.59 -#include <_ansi.h>
  126.60 -#include <wchar.h>
  126.61 -
  126.62 -wchar_t *
  126.63 -wcscpy (wchar_t *__restrict s1,
  126.64 -	const wchar_t *__restrict s2)
  126.65 -{
  126.66 -  wchar_t *p;
  126.67 -  const wchar_t *q;
  126.68 -
  126.69 -  *s1 = '\0';
  126.70 -  p = s1;
  126.71 -  q = s2;
  126.72 -  while (*q)
  126.73 -    *p++ = *q++;
  126.74 -  *p = '\0';
  126.75 -
  126.76 -  return s1;
  126.77 -}
   127.1 --- a/libc/string/wcscspn.c	Sat Dec 07 00:44:56 2019 +0100
   127.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   127.3 @@ -1,80 +0,0 @@
   127.4 -/*
   127.5 -FUNCTION
   127.6 -	<<wcscspn>>---get length of a complementary wide substring 
   127.7 -
   127.8 -SYNOPSIS
   127.9 -	#include <wchar.h>
  127.10 -	size_t wcscspn(const wchar_t *<[s]>, wchar_t *<[set]>);
  127.11 -
  127.12 -DESCRIPTION
  127.13 -	The <<wcscspn>> function computes the length of the maximum initial
  127.14 -	segment of the wide-character string pointed to by <[s]> which consists
  127.15 -	entirely of wide-character codes not from the wide-character string
  127.16 -	pointed to by <[set]>. 
  127.17 -
  127.18 -RETURNS
  127.19 -	The <<wcscspn>> function returns the length of the initial substring of
  127.20 -	<[s1]>; no return value is reserved to indicate an error.
  127.21 -
  127.22 -PORTABILITY
  127.23 -<<wcscspn>> is ISO/IEC 9899/AMD1:1995 (ISO C).
  127.24 -
  127.25 -No supporting OS subroutines are required.
  127.26 -*/
  127.27 -
  127.28 -/*	$NetBSD: wcscspn.c,v 1.1 2000/12/23 23:14:36 itojun Exp $	*/
  127.29 -
  127.30 -/*-
  127.31 - * Copyright (c)1999 Citrus Project,
  127.32 - * All rights reserved.
  127.33 - *
  127.34 - * Redistribution and use in source and binary forms, with or without
  127.35 - * modification, are permitted provided that the following conditions
  127.36 - * are met:
  127.37 - * 1. Redistributions of source code must retain the above copyright
  127.38 - *    notice, this list of conditions and the following disclaimer.
  127.39 - * 2. Redistributions in binary form must reproduce the above copyright
  127.40 - *    notice, this list of conditions and the following disclaimer in the
  127.41 - *    documentation and/or other materials provided with the distribution.
  127.42 - *
  127.43 - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  127.44 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  127.45 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  127.46 - * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  127.47 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  127.48 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  127.49 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  127.50 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  127.51 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  127.52 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  127.53 - * SUCH DAMAGE.
  127.54 - *
  127.55 - *	citrus Id: wcscspn.c,v 1.1 1999/12/29 21:47:45 tshiozak Exp
  127.56 - */
  127.57 -
  127.58 -#include <_ansi.h>
  127.59 -#include <wchar.h>
  127.60 -
  127.61 -size_t
  127.62 -wcscspn (const wchar_t * s,
  127.63 -	const wchar_t * set)
  127.64 -{
  127.65 -  const wchar_t *p;
  127.66 -  const wchar_t *q;
  127.67 -
  127.68 -  p = s;
  127.69 -  while (*p)
  127.70 -    {
  127.71 -      q = set;
  127.72 -      while (*q)
  127.73 -	{
  127.74 -	  if (*p == *q)
  127.75 -	    goto done;
  127.76 -	  q++;
  127.77 -	}
  127.78 -      p++;
  127.79 -    }
  127.80 -
  127.81 -done:
  127.82 -  return (p - s);
  127.83 -}
   128.1 --- a/libc/string/wcsdup.c	Sat Dec 07 00:44:56 2019 +0100
   128.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   128.3 @@ -1,56 +0,0 @@
   128.4 -/*
   128.5 -FUNCTION
   128.6 -	<<wcsdup>>---wide character string duplicate
   128.7 -	
   128.8 -INDEX
   128.9 -	wcsdup
  128.10 -INDEX
  128.11 -	_wcsdup_r
  128.12 -
  128.13 -SYNOPSIS
  128.14 -	#include <wchar.h>
  128.15 -	wchar_t *wcsdup(const wchar_t *<[str]>);
  128.16 -
  128.17 -	#include <wchar.h>
  128.18 -	wchar_t *_wcsdup_r(struct _reent *<[ptr]>, const wchar_t *<[str]>);
  128.19 -
  128.20 -DESCRIPTION
  128.21 -	<<wcsdup>> allocates a new wide character string using <<malloc>>,
  128.22 -	and copies the content of the argument <[str]> into the newly
  128.23 -	allocated string, thus making a copy of <[str]>.
  128.24 -
  128.25 -RETURNS 
  128.26 -	<<wcsdup>> returns a pointer to the copy of <[str]> if enough
  128.27 -	memory for the copy was available.  Otherwise it returns NULL
  128.28 -	and errno is set to ENOMEM.
  128.29 -
  128.30 -PORTABILITY
  128.31 -POSIX-1.2008
  128.32 -
  128.33 -QUICKREF
  128.34 -	wcsdup 
  128.35 -*/
  128.36 -
  128.37 -#include <reent.h>
  128.38 -#include <stdlib.h>
  128.39 -#include <wchar.h>
  128.40 -
  128.41 -wchar_t *
  128.42 -_wcsdup_r (struct _reent *p, const wchar_t *str)
  128.43 -{
  128.44 -  size_t len = wcslen (str) + 1;
  128.45 -  wchar_t *copy = _malloc_r (p, len * sizeof (wchar_t));
  128.46 -  if (copy)
  128.47 -    wmemcpy (copy, str, len);
  128.48 -  return copy;
  128.49 -}
  128.50 -
  128.51 -#ifndef _REENT_ONLY
  128.52 -
  128.53 -wchar_t *
  128.54 -wcsdup (const wchar_t *str)
  128.55 -{
  128.56 -  return _wcsdup_r (_REENT, str);
  128.57 -}
  128.58 -
  128.59 -#endif /* !_REENT_ONLY */
   129.1 --- a/libc/string/wcslcat.c	Sat Dec 07 00:44:56 2019 +0100
   129.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   129.3 @@ -1,100 +0,0 @@
   129.4 -/*
   129.5 -FUNCTION
   129.6 -	<<wcslcat>>---concatenate wide-character strings to specified length
   129.7 -
   129.8 -SYNOPSIS
   129.9 -	#include <wchar.h>
  129.10 -	size_t wcslcat(wchar_t *<[dst]>, const wchar_t *<[src]>, size_t <[siz]>);
  129.11 -
  129.12 -DESCRIPTION
  129.13 -	The <<wcslcat>> function appends wide characters from <[src]> to
  129.14 -	end of the <[dst]> wide-character string so that the resultant
  129.15 -	wide-character string is not more than <[siz]> wide characters
  129.16 -	including the terminating null wide-character code.  A terminating
  129.17 -	null wide character is always added unless <[siz]> is 0.  Thus,
  129.18 -	the maximum number of wide characters that can be appended from
  129.19 -	<[src]> is <[siz]> - 1. If copying takes place between objects 
  129.20 -	that overlap, the behaviour is undefined.
  129.21 -
  129.22 -RETURNS
  129.23 -	Wide-character string length of initial <[dst]> plus the
  129.24 -	wide-character string length of <[src]> (does not include
  129.25 -	terminating null wide-characters).  If the return value is
  129.26 -	greater than or equal to <[siz]>, then truncation occurred and
  129.27 -	not all wide characters from <[src]> were appended.
  129.28 -
  129.29 -PORTABILITY
  129.30 -No supporting OS subroutines are required.
  129.31 -*/
  129.32 -
  129.33 -/*	$NetBSD: wcslcat.c,v 1.1 2000/12/23 23:14:36 itojun Exp $	*/
  129.34 -/*	from OpenBSD: strlcat.c,v 1.3 2000/11/24 11:10:02 itojun Exp 	*/
  129.35 -
  129.36 -/*
  129.37 - * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
  129.38 - * All rights reserved.
  129.39 - *
  129.40 - * Redistribution and use in source and binary forms, with or without
  129.41 - * modification, are permitted provided that the following conditions
  129.42 - * are met:
  129.43 - * 1. Redistributions of source code must retain the above copyright
  129.44 - *    notice, this list of conditions and the following disclaimer.
  129.45 - * 2. Redistributions in binary form must reproduce the above copyright
  129.46 - *    notice, this list of conditions and the following disclaimer in the
  129.47 - *    documentation and/or other materials provided with the distribution.
  129.48 - * 3. The name of the author may not be used to endorse or promote products
  129.49 - *    derived from this software without specific prior written permission.
  129.50 - *
  129.51 - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
  129.52 - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  129.53 - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
  129.54 - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  129.55 - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  129.56 - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  129.57 - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  129.58 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  129.59 - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  129.60 - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  129.61 - */
  129.62 -
  129.63 -#include <_ansi.h>
  129.64 -#include <wchar.h>
  129.65 -
  129.66 -/*
  129.67 - * Appends src to string dst of size siz (unlike wcsncat, siz is the
  129.68 - * full size of dst, not space left).  At most siz-1 characters
  129.69 - * will be copied.  Always NUL terminates (unless siz == 0).
  129.70 - * Returns wcslen(initial dst) + wcslen(src); if retval >= siz,
  129.71 - * truncation occurred.
  129.72 - */
  129.73 -size_t
  129.74 -wcslcat (wchar_t * dst,
  129.75 -	const wchar_t * src,
  129.76 -	size_t siz)
  129.77 -{
  129.78 -  wchar_t *d = dst;
  129.79 -  const wchar_t *s = src;
  129.80 -  size_t n = siz;
  129.81 -  size_t dlen;
  129.82 -
  129.83 -  /* Find the end of dst and adjust bytes left but don't go past end */
  129.84 -  while (*d != '\0' && n-- != 0)
  129.85 -    d++;
  129.86 -  dlen = d - dst;
  129.87 -  n = siz - dlen;
  129.88 -
  129.89 -  if (n == 0)
  129.90 -    return (dlen + wcslen (s));
  129.91 -  while (*s != '\0')
  129.92 -    {
  129.93 -      if (n != 1)
  129.94 -	{
  129.95 -	  *d++ = *s;
  129.96 -	  n--;
  129.97 -	}
  129.98 -      s++;
  129.99 -    }
 129.100 -  *d = '\0';
 129.101 -
 129.102 -  return (dlen + (s - src));	/* count does not include NUL */
 129.103 -}
   130.1 --- a/libc/string/wcslcpy.c	Sat Dec 07 00:44:56 2019 +0100
   130.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   130.3 @@ -1,94 +0,0 @@
   130.4 -/*
   130.5 -FUNCTION
   130.6 -	<<wcslcpy>>---copy a wide-character string to specified length
   130.7 -
   130.8 -SYNOPSIS
   130.9 -	#include <wchar.h>
  130.10 -	size_t wcslcpy(wchar_t *<[dst]>, const wchar_t *<[src]>, size_t <[siz]>);
  130.11 -
  130.12 -DESCRIPTION
  130.13 -	<<wcslcpy>> copies wide characters from <[src]> to <[dst]>
  130.14 -	such that up to <[siz]> - 1 characters are copied.  A
  130.15 -	terminating null is appended to the result, unless <[siz]>
  130.16 -	is zero.
  130.17 -
  130.18 -RETURNS
  130.19 -	<<wcslcpy>> returns the number of wide characters in <[src]>,
  130.20 -	not including the terminating null wide character.  If the
  130.21 -	return value is greater than or equal to <[siz]>, then
  130.22 -	not all wide characters were copied from <[src]> and truncation
  130.23 -	occurred.
  130.24 -
  130.25 -PORTABILITY
  130.26 -No supporting OS subroutines are required.
  130.27 -*/
  130.28 -
  130.29 -/*	$NetBSD: wcslcpy.c,v 1.1 2000/12/23 23:14:36 itojun Exp $	*/
  130.30 -/*	from OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp 	*/
  130.31 -
  130.32 -/*
  130.33 - * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
  130.34 - * All rights reserved.
  130.35 - *
  130.36 - * Redistribution and use in source and binary forms, with or without
  130.37 - * modification, are permitted provided that the following conditions
  130.38 - * are met:
  130.39 - * 1. Redistributions of source code must retain the above copyright
  130.40 - *    notice, this list of conditions and the following disclaimer.
  130.41 - * 2. Redistributions in binary form must reproduce the above copyright
  130.42 - *    notice, this list of conditions and the following disclaimer in the
  130.43 - *    documentation and/or other materials provided with the distribution.
  130.44 - * 3. The name of the author may not be used to endorse or promote products
  130.45 - *    derived from this software without specific prior written permission.
  130.46 - *
  130.47 - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
  130.48 - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  130.49 - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
  130.50 - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  130.51 - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  130.52 - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  130.53 - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  130.54 - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  130.55 - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  130.56 - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  130.57 - */
  130.58 -
  130.59 -#include <_ansi.h>
  130.60 -#include <wchar.h>
  130.61 -
  130.62 -/*
  130.63 - * Copy src to string dst of size siz.  At most siz-1 characters
  130.64 - * will be copied.  Always NUL terminates (unless siz == 0).
  130.65 - * Returns wcslen(src); if retval >= siz, truncation occurred.
  130.66 - */
  130.67 -size_t
  130.68 -wcslcpy (wchar_t * dst,
  130.69 -	const wchar_t * src,
  130.70 -	size_t siz)
  130.71 -{
  130.72 -  wchar_t *d = dst;
  130.73 -  const wchar_t *s = src;
  130.74 -  size_t n = siz;
  130.75 -
  130.76 -  /* Copy as many bytes as will fit */
  130.77 -  if (n != 0 && --n != 0)
  130.78 -    {
  130.79 -      do
  130.80 -	{
  130.81 -	  if ((*d++ = *s++) == 0)
  130.82 -	    break;
  130.83 -	}
  130.84 -      while (--n != 0);
  130.85 -    }
  130.86 -
  130.87 -  /* Not enough room in dst, add NUL and traverse rest of src */
  130.88 -  if (n == 0)
  130.89 -    {
  130.90 -      if (siz != 0)
  130.91 -	*d = '\0';		/* NUL-terminate dst */
  130.92 -      while (*s++)
  130.93 -	;
  130.94 -    }
  130.95 -
  130.96 -  return (s - src - 1);		/* count does not include NUL */
  130.97 -}
   131.1 --- a/libc/string/wcslen.c	Sat Dec 07 00:44:56 2019 +0100
   131.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   131.3 @@ -1,67 +0,0 @@
   131.4 -/*
   131.5 -FUNCTION
   131.6 -	<<wcslen>>---get wide-character string length 
   131.7 -
   131.8 -SYNOPSIS
   131.9 -	#include <wchar.h>
  131.10 -	size_t wcslen(const wchar_t *<[s]>);
  131.11 -
  131.12 -DESCRIPTION
  131.13 -	The <<wcslen>> function computes the number of wide-character codes
  131.14 -	in the wide-character string to which <[s]> points, not including the
  131.15 -	terminating null wide-character code.
  131.16 -
  131.17 -RETURNS
  131.18 -	The <<wcslen>> function returns the length of <[s]>; no return value is
  131.19 -	reserved to indicate an error.
  131.20 -
  131.21 -PORTABILITY
  131.22 -<<wcslen>> is ISO/IEC 9899/AMD1:1995 (ISO C).
  131.23 -
  131.24 -No supporting OS subroutines are required.
  131.25 -*/
  131.26 -
  131.27 -/*	$NetBSD: wcslen.c,v 1.1 2000/12/23 23:14:36 itojun Exp $	*/
  131.28 -
  131.29 -/*-
  131.30 - * Copyright (c)1999 Citrus Project,
  131.31 - * All rights reserved.
  131.32 - *
  131.33 - * Redistribution and use in source and binary forms, with or without
  131.34 - * modification, are permitted provided that the following conditions
  131.35 - * are met:
  131.36 - * 1. Redistributions of source code must retain the above copyright
  131.37 - *    notice, this list of conditions and the following disclaimer.
  131.38 - * 2. Redistributions in binary form must reproduce the above copyright
  131.39 - *    notice, this list of conditions and the following disclaimer in the
  131.40 - *    documentation and/or other materials provided with the distribution.
  131.41 - *
  131.42 - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  131.43 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  131.44 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  131.45 - * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  131.46 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  131.47 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  131.48 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  131.49 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  131.50 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  131.51 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  131.52 - * SUCH DAMAGE.
  131.53 - *
  131.54 - *	citrus Id: wcslen.c,v 1.1 1999/12/29 21:47:45 tshiozak Exp
  131.55 - */
  131.56 -
  131.57 -#include <_ansi.h>
  131.58 -#include <wchar.h>
  131.59 -
  131.60 -size_t
  131.61 -wcslen (const wchar_t * s)
  131.62 -{
  131.63 -  const wchar_t *p;
  131.64 -
  131.65 -  p = s;
  131.66 -  while (*p)
  131.67 -    p++;
  131.68 -
  131.69 -  return p - s;
  131.70 -}
   132.1 --- a/libc/string/wcsncasecmp.c	Sat Dec 07 00:44:56 2019 +0100
   132.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   132.3 @@ -1,53 +0,0 @@
   132.4 -/*
   132.5 -FUNCTION
   132.6 -	<<wcsncasecmp>>---case-insensitive wide character string compare
   132.7 -	
   132.8 -INDEX
   132.9 -	wcsncasecmp
  132.10 -
  132.11 -SYNOPSIS
  132.12 -	#include <wchar.h>
  132.13 -	int wcsncasecmp(const wchar_t *<[a]>, const wchar_t * <[b]>, size_t <[length]>);
  132.14 -
  132.15 -DESCRIPTION
  132.16 -	<<wcsncasecmp>> compares up to <[length]> wide characters
  132.17 -	from the string at <[a]> to the string at <[b]> in a 
  132.18 -	case-insensitive manner.
  132.19 -
  132.20 -RETURNS
  132.21 -
  132.22 -	If <<*<[a]>>> sorts lexicographically after <<*<[b]>>> (after
  132.23 -	both are converted to uppercase), <<wcsncasecmp>> returns a
  132.24 -	number greater than zero.  If the two strings are equivalent,
  132.25 -	<<wcsncasecmp>> returns zero.  If <<*<[a]>>> sorts
  132.26 -	lexicographically before <<*<[b]>>>, <<wcsncasecmp>> returns a
  132.27 -	number less than zero.
  132.28 -
  132.29 -PORTABILITY
  132.30 -POSIX-1.2008
  132.31 -
  132.32 -<<wcsncasecmp>> requires no supporting OS subroutines. It uses
  132.33 -tolower() from elsewhere in this library.
  132.34 -
  132.35 -QUICKREF
  132.36 -	wcsncasecmp
  132.37 -*/
  132.38 -
  132.39 -#include <wchar.h>
  132.40 -#include <wctype.h>
  132.41 -
  132.42 -int 
  132.43 -wcsncasecmp (const wchar_t *s1,
  132.44 -	const wchar_t *s2,
  132.45 -	size_t n)
  132.46 -{
  132.47 -  int d = 0;
  132.48 -  for ( ; n != 0; n--)
  132.49 -    {
  132.50 -      const int c1 = towlower (*s1++);
  132.51 -      const int c2 = towlower (*s2++);
  132.52 -      if (((d = c1 - c2) != 0) || (c2 == '\0'))
  132.53 -        break;
  132.54 -    }
  132.55 -  return d;
  132.56 -}
   133.1 --- a/libc/string/wcsncasecmp_l.c	Sat Dec 07 00:44:56 2019 +0100
   133.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   133.3 @@ -1,56 +0,0 @@
   133.4 -/*
   133.5 -FUNCTION
   133.6 -	<<wcsncasecmp_l>>---case-insensitive wide character string compare
   133.7 -	
   133.8 -INDEX
   133.9 -	wcsncasecmp_l
  133.10 -
  133.11 -SYNOPSIS
  133.12 -	#include <wchar.h>
  133.13 -	int wcsncasecmp_l(const wchar_t *<[a]>, const wchar_t * <[b]>,
  133.14 -			  size_t <[length]>, locale_t <[locale]>);
  133.15 -
  133.16 -DESCRIPTION
  133.17 -	<<wcsncasecmp_l>> compares up to <[length]> wide characters
  133.18 -	from the string at <[a]> to the string at <[b]> in a 
  133.19 -	case-insensitive manner.
  133.20 -
  133.21 -	if <[locale]> is LC_GLOBAL_LOCALE or not a valid locale object, the
  133.22 -	behaviour is undefined.
  133.23 -
  133.24 -RETURNS
  133.25 -
  133.26 -	If <<*<[a]>>> sorts lexicographically after <<*<[b]>>> (after
  133.27 -	both are converted to uppercase), <<wcsncasecmp_l>> returns a
  133.28 -	number greater than zero.  If the two strings are equivalent,
  133.29 -	<<wcsncasecmp_l>> returns zero.  If <<*<[a]>>> sorts
  133.30 -	lexicographically before <<*<[b]>>>, <<wcsncasecmp_l>> returns a
  133.31 -	number less than zero.
  133.32 -
  133.33 -PORTABILITY
  133.34 -POSIX-1.2008
  133.35 -
  133.36 -<<wcsncasecmp_l>> requires no supporting OS subroutines. It uses
  133.37 -tolower() from elsewhere in this library.
  133.38 -
  133.39 -QUICKREF
  133.40 -	wcsncasecmp_l
  133.41 -*/
  133.42 -
  133.43 -#include <wchar.h>
  133.44 -#include <wctype.h>
  133.45 -
  133.46 -int 
  133.47 -wcsncasecmp_l (const wchar_t *s1, const wchar_t *s2, size_t n,
  133.48 -	       struct __locale_t *locale)
  133.49 -{
  133.50 -  int d = 0;
  133.51 -  for ( ; n != 0; n--)
  133.52 -    {
  133.53 -      const int c1 = towlower_l (*s1++, locale);
  133.54 -      const int c2 = towlower_l (*s2++, locale);
  133.55 -      if (((d = c1 - c2) != 0) || (c2 == '\0'))
  133.56 -        break;
  133.57 -    }
  133.58 -  return d;
  133.59 -}
   134.1 --- a/libc/string/wcsncat.c	Sat Dec 07 00:44:56 2019 +0100
   134.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   134.3 @@ -1,85 +0,0 @@
   134.4 -/*
   134.5 -FUNCTION
   134.6 -	<<wcsncat>>---concatenate part of two wide-character strings 
   134.7 -
   134.8 -SYNOPSIS
   134.9 -	#include <wchar.h>
  134.10 -	wchar_t *wcsncat(wchar_t *__restrict <[s1]>,
  134.11 -			const wchar_t *__restrict <[s2]>, size_t <[n]>);
  134.12 -
  134.13 -DESCRIPTION
  134.14 -	The <<wcsncat>> function appends not more than <[n]> wide-character
  134.15 -	codes (a null wide-character code and wide-character codes that follow
  134.16 -	it are not appended) from the array pointed to by <[s2]> to the end of
  134.17 -	the wide-character string pointed to by <[s1]>. The initial
  134.18 -	wide-character code of <[s2]> overwrites the null wide-character code
  134.19 -	at the end of <[s1]>.
  134.20 -	A terminating null wide-character code is always appended to the result.
  134.21 -	If copying takes place between objects that overlap, the behaviour is
  134.22 -	undefined.
  134.23 -
  134.24 -RETURNS
  134.25 -	The <<wcsncat>> function returns <[s1]>; no return value is reserved to
  134.26 -	indicate an error.
  134.27 -
  134.28 -PORTABILITY
  134.29 -<<wcsncat>> is ISO/IEC 9899/AMD1:1995 (ISO C).
  134.30 -
  134.31 -No supporting OS subroutines are required.
  134.32 -*/
  134.33 -
  134.34 -/*	$NetBSD: wcsncat.c,v 1.1 2000/12/23 23:14:36 itojun Exp $	*/
  134.35 -
  134.36 -/*-
  134.37 - * Copyright (c)1999 Citrus Project,
  134.38 - * All rights reserved.
  134.39 - *
  134.40 - * Redistribution and use in source and binary forms, with or without
  134.41 - * modification, are permitted provided that the following conditions
  134.42 - * are met:
  134.43 - * 1. Redistributions of source code must retain the above copyright
  134.44 - *    notice, this list of conditions and the following disclaimer.
  134.45 - * 2. Redistributions in binary form must reproduce the above copyright
  134.46 - *    notice, this list of conditions and the following disclaimer in the
  134.47 - *    documentation and/or other materials provided with the distribution.
  134.48 - *
  134.49 - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  134.50 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  134.51 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  134.52 - * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  134.53 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  134.54 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  134.55 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  134.56 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  134.57 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  134.58 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  134.59 - * SUCH DAMAGE.
  134.60 - *
  134.61 - *	citrus Id: wcsncat.c,v 1.1 1999/12/29 21:47:45 tshiozak Exp
  134.62 - */
  134.63 -
  134.64 -#include <_ansi.h>
  134.65 -#include <wchar.h>
  134.66 -
  134.67 -wchar_t *
  134.68 -wcsncat (wchar_t *__restrict s1,
  134.69 -	const wchar_t *__restrict s2,
  134.70 -	size_t n)
  134.71 -{
  134.72 -  wchar_t *p;
  134.73 -  wchar_t *q;
  134.74 -  const wchar_t *r;
  134.75 -
  134.76 -  p = s1;
  134.77 -  while (*p)
  134.78 -    p++;
  134.79 -  q = p;
  134.80 -  r = s2;
  134.81 -  while (*r && n)
  134.82 -    {
  134.83 -      *q++ = *r++;
  134.84 -      n--;
  134.85 -    }
  134.86 -  *q = '\0';
  134.87 -  return s1;
  134.88 -}
   135.1 --- a/libc/string/wcsncmp.c	Sat Dec 07 00:44:56 2019 +0100
   135.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   135.3 @@ -1,84 +0,0 @@
   135.4 -/*
   135.5 -FUNCTION
   135.6 -	<<wcsncmp>>---compare part of two wide-character strings 
   135.7 -
   135.8 -SYNOPSIS
   135.9 -	#include <wchar.h>
  135.10 -	int wcsncmp(const wchar_t *<[s1]>, const wchar_t *<[s2]>, size_t <[n]>);
  135.11 -
  135.12 -DESCRIPTION
  135.13 -	The <<wcsncmp>> function compares not more than <[n]> wide-character
  135.14 -	codes (wide-character codes that follow a null wide-character code are
  135.15 -	not compared) from the array pointed to by <[s1]> to the array pointed
  135.16 -	to by <[s2]>.
  135.17 -
  135.18 -	The sign of a non-zero return value is determined by the sign of the
  135.19 -	difference between the values of the first pair of wide-character codes
  135.20 -	that differ in the objects being compared. 
  135.21 -
  135.22 -RETURNS
  135.23 -	Upon successful completion, <<wcsncmp>> returns an integer greater than,
  135.24 -	equal to or less than 0, if the possibly null-terminated array pointed
  135.25 -	to by <[s1]> is greater than, equal to or less than the possibly
  135.26 -	null-terminated array pointed to by <[s2]> respectively. 
  135.27 -
  135.28 -PORTABILITY
  135.29 -<<wcsncmp>> is ISO/IEC 9899/AMD1:1995 (ISO C).
  135.30 -
  135.31 -No supporting OS subroutines are required.
  135.32 -*/
  135.33 -
  135.34 -/*	$NetBSD$	*/
  135.35 -
  135.36 -/*
  135.37 - * Copyright (c) 1989, 1993
  135.38 - *	The Regents of the University of California.  All rights reserved.
  135.39 - *
  135.40 - * Redistribution and use in source and binary forms, with or without
  135.41 - * modification, are permitted provided that the following conditions
  135.42 - * are met:
  135.43 - * 1. Redistributions of source code must retain the above copyright
  135.44 - *    notice, this list of conditions and the following disclaimer.
  135.45 - * 2. Redistributions in binary form must reproduce the above copyright
  135.46 - *    notice, this list of conditions and the following disclaimer in the
  135.47 - *    documentation and/or other materials provided with the distribution.
  135.48 - * 3. Neither the name of the University nor the names of its contributors
  135.49 - *    may be used to endorse or promote products derived from this software
  135.50 - *    without specific prior written permission.
  135.51 - *
  135.52 - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  135.53 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  135.54 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  135.55 - * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  135.56 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  135.57 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  135.58 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  135.59 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  135.60 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  135.61 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  135.62 - * SUCH DAMAGE.
  135.63 - */
  135.64 -
  135.65 -#include <_ansi.h>
  135.66 -#include <wchar.h>
  135.67 -
  135.68 -int
  135.69 -wcsncmp (const wchar_t * s1,
  135.70 -	const wchar_t * s2,
  135.71 -	size_t n)
  135.72 -{
  135.73 -
  135.74 -  if (n == 0)
  135.75 -    return (0);
  135.76 -  do
  135.77 -    {
  135.78 -      if (*s1 != *s2++)
  135.79 -	{
  135.80 -	  return (*s1 - *--s2);
  135.81 -	}
  135.82 -      if (*s1++ == 0)
  135.83 -	break;
  135.84 -    }
  135.85 -  while (--n != 0);
  135.86 -  return (0);
  135.87 -}
   136.1 --- a/libc/string/wcsncpy.c	Sat Dec 07 00:44:56 2019 +0100
   136.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   136.3 @@ -1,52 +0,0 @@
   136.4 -/*
   136.5 -FUNCTION
   136.6 -	<<wcsncpy>>---copy part of a wide-character string 
   136.7 -
   136.8 -SYNOPSIS
   136.9 -	#include <wchar.h>
  136.10 -	wchar_t *wcsncpy(wchar_t *__restrict <[s1]>,
  136.11 -			const wchar_t *__restrict <[s2]>, size_t <[n]>);
  136.12 -
  136.13 -DESCRIPTION
  136.14 -	The <<wcsncpy>> function copies not more than <[n]> wide-character codes
  136.15 -	(wide-character codes that follow a null wide-character code are not
  136.16 -	copied) from the array pointed to by <[s2]> to the array pointed to
  136.17 -	by <[s1]>. If copying takes place between objects that overlap, the
  136.18 -	behaviour is undefined.  Note that if <[s1]> contains more than <[n]>
  136.19 -	wide characters before its terminating null, the result is not
  136.20 -	null-terminated.
  136.21 -
  136.22 -	If the array pointed to by <[s2]> is a wide-character string that is
  136.23 -	shorter than <[n]> wide-character codes, null wide-character codes are
  136.24 -	appended to the copy in the array pointed to by <[s1]>, until <[n]>
  136.25 -	wide-character codes in all are written. 
  136.26 -
  136.27 -RETURNS
  136.28 -	The <<wcsncpy>> function returns <[s1]>; no return value is reserved to
  136.29 -	indicate an error. 
  136.30 -
  136.31 -PORTABILITY
  136.32 -ISO/IEC 9899; POSIX.1.
  136.33 -
  136.34 -No supporting OS subroutines are required.
  136.35 -*/
  136.36 -
  136.37 -#include <_ansi.h>
  136.38 -#include <wchar.h>
  136.39 -
  136.40 -wchar_t *
  136.41 -wcsncpy (wchar_t *__restrict s1,
  136.42 -	const wchar_t *__restrict s2,
  136.43 -	size_t n)
  136.44 -{
  136.45 -  wchar_t *dscan=s1;
  136.46 -
  136.47 -  while(n > 0)
  136.48 -    {
  136.49 -      --n;
  136.50 -      if((*dscan++ = *s2++) == L'\0')  break;
  136.51 -    }
  136.52 -  while(n-- > 0)  *dscan++ = L'\0';
  136.53 -
  136.54 -  return s1;
  136.55 -}
   137.1 --- a/libc/string/wcsnlen.c	Sat Dec 07 00:44:56 2019 +0100
   137.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   137.3 @@ -1,68 +0,0 @@
   137.4 -/* 
   137.5 -FUNCTION
   137.6 -        <<wcsnlen>>---get fixed-size wide-character string length
   137.7 -    
   137.8 -INDEX
   137.9 -        wcsnlen
  137.10 -
  137.11 -SYNOPSIS
  137.12 -        #include <wchar.h>
  137.13 -        size_t wcsnlen(const wchar_t *<[s]>, size_t <[maxlen]>);
  137.14 -
  137.15 -DESCRIPTION
  137.16 -        The <<wcsnlen>> function computes the number of wide-character codes
  137.17 -        in the wide-character string pointed to by <[s]> not including the
  137.18 -        terminating L'\0' wide character but at most <[maxlen]> wide
  137.19 -        characters.
  137.20 -
  137.21 -RETURNS
  137.22 -        <<wcsnlen>> returns the length of <[s]> if it is less then <[maxlen]>,
  137.23 -        or <[maxlen]> if there is no L'\0' wide character in first <[maxlen]>
  137.24 -        characters.
  137.25 -
  137.26 -PORTABILITY
  137.27 -<<wcsnlen>> is a GNU extension.
  137.28 -
  137.29 -<<wcsnlen>> requires no supporting OS subroutines.
  137.30 -*/
  137.31 -
  137.32 -/*
  137.33 - * Copyright (c) 2003, Artem B. Bityuckiy (dedekind@mail.ru).
  137.34 - *
  137.35 - * Redistribution and use in source and binary forms, with or without
  137.36 - * modification, are permitted provided that the above copyright notice,
  137.37 - * this condition statement, and the following disclaimer are retained
  137.38 - * in any redistributions of the source code.
  137.39 - *
  137.40 - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  137.41 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  137.42 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  137.43 - * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  137.44 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  137.45 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  137.46 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  137.47 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  137.48 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  137.49 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  137.50 - * SUCH DAMAGE.
  137.51 - */
  137.52 -
  137.53 -#include <_ansi.h>
  137.54 -#include <sys/types.h>
  137.55 -#include <wchar.h>
  137.56 -
  137.57 -size_t
  137.58 -wcsnlen (const wchar_t *s,
  137.59 -                 size_t maxlen)
  137.60 -{
  137.61 -  const wchar_t *p;
  137.62 -
  137.63 -  p = s;
  137.64 -  while (*p && maxlen-- > 0)
  137.65 -    p++;
  137.66 -
  137.67 -  return (size_t)(p - s);
  137.68 -}
  137.69 -
  137.70 -
  137.71 -
   138.1 --- a/libc/string/wcspbrk.c	Sat Dec 07 00:44:56 2019 +0100
   138.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   138.3 @@ -1,82 +0,0 @@
   138.4 -/*
   138.5 -FUNCTION
   138.6 -	<<wcspbrk>>----scan wide-character string for a wide-character code
   138.7 -
   138.8 -SYNOPSIS
   138.9 -	#include <wchar.h>
  138.10 -	wchar_t *wcspbrk(const wchar_t *<[s]>, const wchar_t *<[set]>);
  138.11 -
  138.12 -DESCRIPTION
  138.13 -	The <<wcspbrk>> function locates the first occurrence in the
  138.14 -	wide-character string pointed to by <[s]> of any wide-character code
  138.15 -	from the wide-character string pointed to by <[set]>. 
  138.16 -
  138.17 -RETURNS
  138.18 -	Upon successful completion, <<wcspbrk>> returns a pointer to the
  138.19 -	wide-character code or a null pointer if no wide-character code from
  138.20 -	<[set]> occurs in <[s]>.
  138.21 -
  138.22 -PORTABILITY
  138.23 -<<wcspbrk>> is ISO/IEC 9899/AMD1:1995 (ISO C).
  138.24 -
  138.25 -No supporting OS subroutines are required.
  138.26 -*/
  138.27 -
  138.28 -/*	$NetBSD: wcspbrk.c,v 1.1 2000/12/23 23:14:37 itojun Exp $	*/
  138.29 -
  138.30 -/*-
  138.31 - * Copyright (c)1999 Citrus Project,
  138.32 - * All rights reserved.
  138.33 - *
  138.34 - * Redistribution and use in source and binary forms, with or without
  138.35 - * modification, are permitted provided that the following conditions
  138.36 - * are met:
  138.37 - * 1. Redistributions of source code must retain the above copyright
  138.38 - *    notice, this list of conditions and the following disclaimer.
  138.39 - * 2. Redistributions in binary form must reproduce the above copyright
  138.40 - *    notice, this list of conditions and the following disclaimer in the
  138.41 - *    documentation and/or other materials provided with the distribution.
  138.42 - *
  138.43 - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  138.44 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  138.45 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  138.46 - * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  138.47 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  138.48 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  138.49 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  138.50 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  138.51 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  138.52 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  138.53 - * SUCH DAMAGE.
  138.54 - *
  138.55 - *	citrus Id: wcspbrk.c,v 1.2 2000/12/21 05:07:25 itojun Exp
  138.56 - */
  138.57 -
  138.58 -#include <_ansi.h>
  138.59 -#include <stddef.h>
  138.60 -#include <wchar.h>
  138.61 -
  138.62 -wchar_t *
  138.63 -wcspbrk (const wchar_t * s,
  138.64 -	const wchar_t * set)
  138.65 -{
  138.66 -  const wchar_t *p;
  138.67 -  const wchar_t *q;
  138.68 -
  138.69 -  p = s;
  138.70 -  while (*p)
  138.71 -    {
  138.72 -      q = set;
  138.73 -      while (*q)
  138.74 -	{
  138.75 -	  if (*p == *q)
  138.76 -	    {
  138.77 -	      /* LINTED interface specification */
  138.78 -	      return (wchar_t *) p;
  138.79 -	    }
  138.80 -	  q++;
  138.81 -	}
  138.82 -      p++;
  138.83 -    }
  138.84 -  return NULL;
  138.85 -}
   139.1 --- a/libc/string/wcsrchr.c	Sat Dec 07 00:44:56 2019 +0100
   139.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   139.3 @@ -1,81 +0,0 @@
   139.4 -/*
   139.5 -FUNCTION
   139.6 -	<<wcsrchr>>---wide-character string scanning operation 
   139.7 -
   139.8 -SYNOPSIS
   139.9 -	#include <wchar.h>
  139.10 -	wchar_t *wcsrchr(const wchar_t *<[s]>, wchar_t <[c]>);
  139.11 -
  139.12 -DESCRIPTION
  139.13 -	The <<wcsrchr>> function locates the last occurrence of <[c]> in the
  139.14 -	wide-character string pointed to by <[s]>. The value of <[c]> must be a
  139.15 -	character representable as a type wchar_t and must be a wide-character
  139.16 -	code corresponding to a valid character in the current locale.
  139.17 -	The terminating null wide-character code is considered to be part of
  139.18 -	the wide-character string. 
  139.19 -
  139.20 -RETURNS
  139.21 -	Upon successful completion, <<wcsrchr>> returns a pointer to the
  139.22 -	wide-character code or a null pointer if <[c]> does not occur in the
  139.23 -	wide-character string.
  139.24 -
  139.25 -PORTABILITY
  139.26 -<<wcsrchr>> is ISO/IEC 9899/AMD1:1995 (ISO C).
  139.27 -
  139.28 -No supporting OS subroutines are required.
  139.29 -*/
  139.30 -
  139.31 -/*	$NetBSD: wcsrchr.c,v 1.1 2000/12/23 23:14:37 itojun Exp $	*/
  139.32 -
  139.33 -/*-
  139.34 - * Copyright (c)1999 Citrus Project,
  139.35 - * All rights reserved.
  139.36 - *
  139.37 - * Redistribution and use in source and binary forms, with or without
  139.38 - * modification, are permitted provided that the following conditions
  139.39 - * are met:
  139.40 - * 1. Redistributions of source code must retain the above copyright
  139.41 - *    notice, this list of conditions and the following disclaimer.
  139.42 - * 2. Redistributions in binary form must reproduce the above copyright
  139.43 - *    notice, this list of conditions and the following disclaimer in the
  139.44 - *    documentation and/or other materials provided with the distribution.
  139.45 - *
  139.46 - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  139.47 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  139.48 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  139.49 - * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  139.50 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  139.51 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  139.52 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  139.53 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  139.54 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  139.55 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  139.56 - * SUCH DAMAGE.
  139.57 - *
  139.58 - *	citrus Id: wcsrchr.c,v 1.2 2000/12/21 05:07:25 itojun Exp
  139.59 - */
  139.60 -
  139.61 -#include <_ansi.h>
  139.62 -#include <stddef.h>
  139.63 -#include <wchar.h>
  139.64 -
  139.65 -wchar_t *
  139.66 -wcsrchr (const wchar_t * s,
  139.67 -	wchar_t c)
  139.68 -{
  139.69 -  const wchar_t *p;
  139.70 -
  139.71 -  p = s;
  139.72 -  while (*p)
  139.73 -    p++;
  139.74 -  while (s <= p)
  139.75 -    {
  139.76 -      if (*p == c)
  139.77 -	{
  139.78 -	  /* LINTED interface specification */
  139.79 -	  return (wchar_t *) p;
  139.80 -	}
  139.81 -      p--;
  139.82 -    }
  139.83 -  return NULL;
  139.84 -}
   140.1 --- a/libc/string/wcsspn.c	Sat Dec 07 00:44:56 2019 +0100
   140.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   140.3 @@ -1,82 +0,0 @@
   140.4 -/*
   140.5 -FUNCTION
   140.6 -	<<wcsspn>>---get length of a wide substring 
   140.7 -
   140.8 -SYNOPSIS
   140.9 -	#include <wchar.h>
  140.10 -	size_t wcsspn(const wchar_t *<[s]>, const wchar_t *<[set]>);
  140.11 -
  140.12 -DESCRIPTION
  140.13 -	The <<wcsspn>> function computes the length of the maximum initial
  140.14 -	segment of the wide-character string pointed to by <[s]> which consists
  140.15 -	entirely of wide-character codes from the wide-character string
  140.16 -	pointed to by <[set]>.
  140.17 -
  140.18 -RETURNS
  140.19 -	The wcsspn() function returns the length <[s1]>; no return value is
  140.20 -	reserved to indicate an error.
  140.21 -
  140.22 -PORTABILITY
  140.23 -<<wcsspn>> is ISO/IEC 9899/AMD1:1995 (ISO C).
  140.24 -
  140.25 -No supporting OS subroutines are required.
  140.26 -*/
  140.27 -
  140.28 -/*	$NetBSD: wcsspn.c,v 1.1 2000/12/23 23:14:37 itojun Exp $	*/
  140.29 -
  140.30 -/*-
  140.31 - * Copyright (c)1999 Citrus Project,
  140.32 - * All rights reserved.
  140.33 - *
  140.34 - * Redistribution and use in source and binary forms, with or without
  140.35 - * modification, are permitted provided that the following conditions
  140.36 - * are met:
  140.37 - * 1. Redistributions of source code must retain the above copyright
  140.38 - *    notice, this list of conditions and the following disclaimer.
  140.39 - * 2. Redistributions in binary form must reproduce the above copyright
  140.40 - *    notice, this list of conditions and the following disclaimer in the
  140.41 - *    documentation and/or other materials provided with the distribution.
  140.42 - *
  140.43 - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  140.44 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  140.45 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  140.46 - * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  140.47 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  140.48 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  140.49 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  140.50 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  140.51 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  140.52 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  140.53 - * SUCH DAMAGE.
  140.54 - *
  140.55 - *	citrus Id: wcsspn.c,v 1.1 1999/12/29 21:47:45 tshiozak Exp
  140.56 - */
  140.57 -
  140.58 -#include <_ansi.h>
  140.59 -#include <wchar.h>
  140.60 -
  140.61 -size_t
  140.62 -wcsspn (const wchar_t * s,
  140.63 -	const wchar_t * set)
  140.64 -{
  140.65 -  const wchar_t *p;
  140.66 -  const wchar_t *q;
  140.67 -
  140.68 -  p = s;
  140.69 -  while (*p)
  140.70 -    {
  140.71 -      q = set;
  140.72 -      while (*q)
  140.73 -	{
  140.74 -	  if (*p == *q)
  140.75 -	    break;
  140.76 -	  q++;
  140.77 -	}
  140.78 -      if (!*q)
  140.79 -	goto done;
  140.80 -      p++;
  140.81 -    }
  140.82 -
  140.83 -done:
  140.84 -  return (p - s);
  140.85 -}
   141.1 --- a/libc/string/wcsstr.c	Sat Dec 07 00:44:56 2019 +0100
   141.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   141.3 @@ -1,100 +0,0 @@
   141.4 -/*
   141.5 -FUNCTION
   141.6 -	<<wcsstr>>---find a wide-character substring 
   141.7 -
   141.8 -SYNOPSIS
   141.9 -	#include <wchar.h>
  141.10 -	wchar_t *wcsstr(const wchar_t *__restrict <[big]>,
  141.11 -			const wchar_t *__restrict <[little]>);
  141.12 -
  141.13 -DESCRIPTION
  141.14 -	The <<wcsstr>> function locates the first occurrence in the
  141.15 -	wide-character string pointed to by <[big]> of the sequence of
  141.16 -	wide characters (excluding the terminating null wide character) in the
  141.17 -	wide-character string pointed to by <[little]>.
  141.18 -
  141.19 -RETURNS
  141.20 -	On successful completion, <<wcsstr>> returns a pointer to the located
  141.21 -	wide-character string, or a null pointer if the wide-character string
  141.22 -	is not found.
  141.23 -
  141.24 -	If <[little]> points to a wide-character string with zero length,
  141.25 -	the function returns <[big]>.
  141.26 -
  141.27 -PORTABILITY
  141.28 -<<wcsstr>> is ISO/IEC 9899/AMD1:1995 (ISO C).
  141.29 -
  141.30 -*/
  141.31 -
  141.32 -/*	$NetBSD: wcsstr.c,v 1.1 2000/12/23 23:14:37 itojun Exp $	*/
  141.33 -
  141.34 -/*-
  141.35 - * Copyright (c)1999 Citrus Project,
  141.36 - * All rights reserved.
  141.37 - *
  141.38 - * Redistribution and use in source and binary forms, with or without
  141.39 - * modification, are permitted provided that the following conditions
  141.40 - * are met:
  141.41 - * 1. Redistributions of source code must retain the above copyright
  141.42 - *    notice, this list of conditions and the following disclaimer.
  141.43 - * 2. Redistributions in binary form must reproduce the above copyright
  141.44 - *    notice, this list of conditions and the following disclaimer in the
  141.45 - *    documentation and/or other materials provided with the distribution.
  141.46 - *
  141.47 - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  141.48 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  141.49 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  141.50 - * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  141.51 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  141.52 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  141.53 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  141.54 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  141.55 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  141.56 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  141.57 - * SUCH DAMAGE.
  141.58 - *
  141.59 - *	citrus Id: wcsstr.c,v 1.2 2000/12/21 05:07:25 itojun Exp
  141.60 - */
  141.61 -
  141.62 -#include <_ansi.h>
  141.63 -#include <stddef.h>
  141.64 -#include <wchar.h>
  141.65 -
  141.66 -wchar_t *
  141.67 -wcsstr (const wchar_t *__restrict big,
  141.68 -	const wchar_t *__restrict little)
  141.69 -{
  141.70 -  const wchar_t *p;
  141.71 -  const wchar_t *q;
  141.72 -  const wchar_t *r;
  141.73 -
  141.74 -  if (!*little)
  141.75 -    {
  141.76 -      /* LINTED interface specification */
  141.77 -      return (wchar_t *) big;
  141.78 -    }
  141.79 -  if (wcslen (big) < wcslen (little))
  141.80 -    return NULL;
  141.81 -
  141.82 -  p = big;
  141.83 -  q = little;
  141.84 -  while (*p)
  141.85 -    {
  141.86 -      q = little;
  141.87 -      r = p;
  141.88 -      while (*q)
  141.89 -	{
  141.90 -	  if (*r != *q)
  141.91 -	    break;
  141.92 -	  q++;
  141.93 -	  r++;
  141.94 -	}
  141.95 -      if (!*q)
  141.96 -	{
  141.97 -	  /* LINTED interface specification */
  141.98 -	  return (wchar_t *) p;
  141.99 -	}
 141.100 -      p++;
 141.101 -    }
 141.102 -  return NULL;
 141.103 -}
   142.1 --- a/libc/string/wcstok.c	Sat Dec 07 00:44:56 2019 +0100
   142.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   142.3 @@ -1,174 +0,0 @@
   142.4 -/*
   142.5 -FUNCTION
   142.6 -	<<wcstok>>---get next token from a string
   142.7 -
   142.8 -INDEX
   142.9 -	wcstok
  142.10 -
  142.11 -
  142.12 -SYNOPSIS
  142.13 -	#include <wchar.h>
  142.14 -      	wchar_t *wcstok(wchar_t *__restrict <[source]>,
  142.15 -      			const wchar_t *__restrict <[delimiters]>,
  142.16 -			wchar_t **__restrict <[lasts]>);
  142.17 -
  142.18 -DESCRIPTION
  142.19 -	The <<wcstok>> function is the wide-character equivalent of the
  142.20 -	<<strtok_r>> function (which in turn is the same as the <<strtok>>
  142.21 -	function with an added argument to make it thread-safe).
  142.22 -
  142.23 -	The <<wcstok>> function is used to isolate (one at a time)
  142.24 -	sequential tokens in a null-terminated wide-character string,
  142.25 -	<<*<[source]>>>.  A token is defined as a substring not containing
  142.26 -	any wide-characters from <<*<[delimiters]>>>.
  142.27 -
  142.28 -	The first time that <<wcstok>> is called, <<*<[source]>>> should
  142.29 -	be specified with the wide-character string to be searched, and
  142.30 -	<<*<[lasts]>>>--but not <<lasts>>, which must be non-NULL--may be
  142.31 -	random; subsequent calls, wishing to obtain further tokens from
  142.32 -	the same string, should pass a null pointer for <<*<[source]>>>
  142.33 -	instead but must supply <<*<[lasts]>>> unchanged from the last
  142.34 -	call.  The separator wide-character string, <<*<[delimiters]>>>,
  142.35 -	must be supplied each time and may change between calls.
  142.36 -	A pointer to placeholder <<*<[lasts]>>> must be supplied by
  142.37 -	the caller, and is set each time as needed to save the state
  142.38 -	by <<wcstok>>.	Every call to <<wcstok>> with <<*<[source]>>>
  142.39 -	== <<NULL>> must pass the value of <<*<[lasts]>>> as last set
  142.40 -	by <<wcstok>>.
  142.41 -
  142.42 -	The <<wcstok>> function returns a pointer to the beginning of each 
  142.43 -	subsequent token in the string, after replacing the separator 
  142.44 -	wide-character itself with a null wide-character.  When no more tokens
  142.45 -	remain, a null pointer is returned.
  142.46 -
  142.47 -RETURNS
  142.48 -	<<wcstok>> returns a pointer to the first wide character of a token, or
  142.49 -	<<NULL>> if there is no token.
  142.50 -
  142.51 -NOTES
  142.52 -	<<wcstok>> is thread-safe (unlike <<strtok>>, but like <<strtok_r>>).
  142.53 -	<<wcstok>> writes into the string being searched.
  142.54 -
  142.55 -PORTABILITY
  142.56 -<<wcstok>> is C99 and POSIX.1-2001.
  142.57 -
  142.58 -<<wcstok>> requires no supporting OS subroutines.
  142.59 -
  142.60 -QUICKREF
  142.61 -	strtok ansi pure
  142.62 -*/
  142.63 -/* wcstok for Newlib created by adapting strtok_r, 2008.  */
  142.64 -/*
  142.65 - * Copyright (c) 1988 Regents of the University of California.
  142.66 - * All rights reserved.
  142.67 - *
  142.68 - * Redistribution and use in source and binary forms, with or without
  142.69 - * modification, are permitted provided that the following conditions
  142.70 - * are met:
  142.71 - * 1. Redistributions of source code must retain the above copyright
  142.72 - *    notice, this list of conditions and the following disclaimer.
  142.73 - * 2. Redistributions in binary form must reproduce the above copyright
  142.74 - *    notice, this list of conditions and the following disclaimer in the
  142.75 - *    documentation and/or other materials provided with the distribution.
  142.76 - * 3. Neither the name of the University nor the names of its contributors
  142.77 - *    may be used to endorse or promote products derived from this software
  142.78 - *    without specific prior written permission.
  142.79 - *
  142.80 - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  142.81 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  142.82 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  142.83 - * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  142.84 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  142.85 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  142.86 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  142.87 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  142.88 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  142.89 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  142.90 - * SUCH DAMAGE.
  142.91 - */
  142.92 -
  142.93 -#include <wchar.h>
  142.94 -
  142.95 -wchar_t *
  142.96 -wcstok (register wchar_t *__restrict s,
  142.97 -	register const wchar_t *__restrict delim,
  142.98 -	wchar_t **__restrict lasts)
  142.99 -{
 142.100 -	register const wchar_t *spanp;
 142.101 -	register int c, sc;
 142.102 -	wchar_t *tok;
 142.103 -
 142.104 -
 142.105 -	if (s == NULL && (s = *lasts) == NULL)
 142.106 -		return (NULL);
 142.107 -
 142.108 -	/*
 142.109 -	 * Skip (span) leading delimiters (s += wcsspn(s, delim), sort of).
 142.110 -	 */
 142.111 -cont:
 142.112 -	c = *s++;
 142.113 -	for (spanp = delim; (sc = *spanp++) != L'\0';) {
 142.114 -		if (c == sc)  goto cont;
 142.115 -	}
 142.116 -
 142.117 -	if (c == L'\0') {		/* no non-delimiter characters */
 142.118 -		*lasts = NULL;
 142.119 -		return (NULL);
 142.120 -	}
 142.121 -	tok = s - 1;
 142.122 -
 142.123 -	/*
 142.124 -	 * Scan token (scan for delimiters: s += wcscspn(s, delim), sort of).
 142.125 -	 * Note that delim must have one NUL; we stop if we see that, too.
 142.126 -	 */
 142.127 -	for (;;) {
 142.128 -		c = *s++;
 142.129 -		spanp = delim;
 142.130 -		do {
 142.131 -			if ((sc = *spanp++) == c) {
 142.132 -				if (c == L'\0')
 142.133 -					s = NULL;
 142.134 -				else
 142.135 -					s[-1] = L'\0';
 142.136 -				*lasts = s;
 142.137 -				return (tok);
 142.138 -			}
 142.139 -		} while (sc != L'\0');
 142.140 -	}
 142.141 -	/* NOTREACHED */
 142.142 -}
 142.143 - 
 142.144 -/* The remainder of this file can serve as a regression test.  Compile
 142.145 - *  with -D_REGRESSION_TEST.  */
 142.146 -#if defined(_REGRESSION_TEST)	/* [Test code:  example from C99 standard */
 142.147 -#include <stdio.h>
 142.148 -#include <wchar.h>
 142.149 - 
 142.150 -/* example from C99 standard with minor additions to be a test */
 142.151 -int
 142.152 -main(void)
 142.153 -{
 142.154 -int  errs=0;
 142.155 -static wchar_t str1[] = L"?a???b,,,#c";
 142.156 -static wchar_t str2[] = L"\t \t";
 142.157 -wchar_t *t, *ptr1, *ptr2;
 142.158 - 
 142.159 -t = wcstok(str1, L"?", &ptr1); // t points to the token L"a"
 142.160 -if(wcscmp(t,L"a")) errs++;
 142.161 -t = wcstok(NULL, L",", &ptr1); // t points to the token L"??b"
 142.162 -if(wcscmp(t,L"??b")) errs++;
 142.163 -t = wcstok(str2, L" \t", &ptr2); // t is a null pointer
 142.164 -if(t != NULL) errs++;
 142.165 -t = wcstok(NULL, L"#,", &ptr1); // t points to the token L"c"
 142.166 -if(wcscmp(t,L"c")) errs++;
 142.167 -t = wcstok(NULL, L"?", &ptr1); // t is a null pointer
 142.168 -if(t != NULL) errs++;
 142.169 - 
 142.170 -printf("wcstok() test ");
 142.171 -if(errs)  printf("FAILED %d test cases", errs);
 142.172 -  else    printf("passed");
 142.173 -printf(".\n");
 142.174 - 
 142.175 -return(errs);
 142.176 -}
 142.177 -#endif /* defined(_REGRESSION_TEST) ] */
   143.1 --- a/libc/string/wcstrings.tex	Sat Dec 07 00:44:56 2019 +0100
   143.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   143.3 @@ -1,130 +0,0 @@
   143.4 -@node Wchar strings
   143.5 -@chapter Wide Character Strings (@file{wchar.h})
   143.6 -
   143.7 -This chapter describes wide-character string-handling functions and
   143.8 -managing areas of memory containing wide characters.  The corresponding 
   143.9 -declarations are in @file{wchar.h}.
  143.10 -
  143.11 -@menu
  143.12 -* wmemchr::     Find wide character in memory
  143.13 -* wmemcmp::     Compare two wide-character memory areas
  143.14 -* wmemcpy::     Copy wide-character memory regions
  143.15 -* wmemmove::    Move possibly overlapping wide-character memory
  143.16 -* wmempcpy::    Copy wide-character memory regions and locate end
  143.17 -* wmemset::     Set an area of memory to a specified wide character
  143.18 -* wcscat::      Concatenate wide-character strings
  143.19 -* wcschr::      Search for wide character in string
  143.20 -* wcscmp::      Wide-character string compare
  143.21 -* wcscoll::     Locale-specific wide-character string compare
  143.22 -* wcscpy::      Copy wide-character string
  143.23 -* wcpcpy::      Copy a wide-character string returning a pointer to its end
  143.24 -* wcscspn::     Count wide characters not in string
  143.25 -* wcsftime::    Convert date and time to a formatted wide-character string
  143.26 -* wcslcat::     Concatenate wide-character strings to specified length
  143.27 -* wcslcpy::     Copy wide-character string to specified length
  143.28 -* wcslen::      Wide-character string length
  143.29 -* wcsncat::     Concatenate wide-character strings
  143.30 -* wcsncmp::     Wide-character string compare
  143.31 -* wcsncpy::     Counted copy wide-character string
  143.32 -* wcpncpy::     Copy part of a wide-character string returning a pointer to its end
  143.33 -* wcsnlen::     Wide-character string length with maximum limit
  143.34 -* wcspbrk::     Find wide characters in string
  143.35 -* wcsrchr::     Reverse search for wide character in string
  143.36 -* wcsspn::      Find initial match in wide-character string
  143.37 -* wcsstr::      Find wide-character string segment
  143.38 -* wcstok::      Tokenize wide-character string
  143.39 -* wcswidth::    Number of column positions of a wide-character string
  143.40 -* wcsxfrm::     Locale-specific wide-character string transformation
  143.41 -* wcwidth::     Number of column positions of a wide-character code
  143.42 -@end menu
  143.43 -
  143.44 -@page
  143.45 -@include string/wmemchr.def
  143.46 -
  143.47 -@page
  143.48 -@include string/wmemcmp.def
  143.49 -
  143.50 -@page
  143.51 -@include string/wmemcpy.def
  143.52 -
  143.53 -@page
  143.54 -@include string/wmemmove.def
  143.55 -
  143.56 -@page
  143.57 -@include string/wmempcpy.def
  143.58 -
  143.59 -@page
  143.60 -@include string/wmemset.def
  143.61 -
  143.62 -@page
  143.63 -@include string/wcscat.def
  143.64 -
  143.65 -@page
  143.66 -@include string/wcschr.def
  143.67 -
  143.68 -@page
  143.69 -@include string/wcscmp.def
  143.70 -
  143.71 -@page
  143.72 -@include string/wcscoll.def
  143.73 -
  143.74 -@page
  143.75 -@include string/wcscpy.def
  143.76 -
  143.77 -@page
  143.78 -@include string/wcpcpy.def
  143.79 -
  143.80 -@page
  143.81 -@include string/wcscspn.def
  143.82 -
  143.83 -@page
  143.84 -@include time/wcsftime.def
  143.85 -
  143.86 -@page
  143.87 -@include string/wcslcat.def
  143.88 -
  143.89 -@page
  143.90 -@include string/wcslcpy.def
  143.91 -
  143.92 -@page
  143.93 -@include string/wcslen.def
  143.94 -
  143.95 -@page
  143.96 -@include string/wcsncat.def
  143.97 -
  143.98 -@page
  143.99 -@include string/wcsncmp.def
 143.100 -
 143.101 -@page
 143.102 -@include string/wcsncpy.def
 143.103 -
 143.104 -@page
 143.105 -@include string/wcpncpy.def
 143.106 -
 143.107 -@page
 143.108 -@include string/wcsnlen.def
 143.109 -
 143.110 -@page
 143.111 -@include string/wcspbrk.def
 143.112 -
 143.113 -@page
 143.114 -@include string/wcsrchr.def
 143.115 -
 143.116 -@page
 143.117 -@include string/wcsspn.def
 143.118 -
 143.119 -@page
 143.120 -@include string/wcsstr.def
 143.121 -
 143.122 -@page
 143.123 -@include string/wcstok.def
 143.124 -
 143.125 -@page
 143.126 -@include string/wcswidth.def
 143.127 -
 143.128 -@page
 143.129 -@include string/wcsxfrm.def
 143.130 -
 143.131 -@page
 143.132 -@include string/wcwidth.def
 143.133 -
   144.1 --- a/libc/string/wcswidth.c	Sat Dec 07 00:44:56 2019 +0100
   144.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   144.3 @@ -1,66 +0,0 @@
   144.4 -/*
   144.5 -FUNCTION
   144.6 -	<<wcswidth>>---number of column positions of a wide-character string
   144.7 -	
   144.8 -INDEX
   144.9 -	wcswidth
  144.10 -
  144.11 -SYNOPSIS
  144.12 -	#include <wchar.h>
  144.13 -	int wcswidth(const wchar_t *<[pwcs]>, size_t <[n]>);
  144.14 -
  144.15 -DESCRIPTION
  144.16 -	The <<wcswidth>> function shall determine the number of column
  144.17 -	positions required for <[n]> wide-character codes (or fewer than <[n]>
  144.18 -	wide-character codes if a null wide-character code is encountered
  144.19 -	before <[n]> wide-character codes are exhausted) in the string pointed
  144.20 -	to by <[pwcs]>.
  144.21 -
  144.22 -RETURNS
  144.23 -	The <<wcswidth>> function either shall return 0 (if <[pwcs]> points to a
  144.24 -	null wide-character code), or return the number of column positions
  144.25 -	to be occupied by the wide-character string pointed to by <[pwcs]>, or
  144.26 -	return -1 (if any of the first <[n]> wide-character codes in the
  144.27 -	wide-character string pointed to by <[pwcs]> is not a printable
  144.28 -	wide-character code).
  144.29 -
  144.30 -PORTABILITY
  144.31 -<<wcswidth>> has been introduced in the Single UNIX Specification Volume 2.
  144.32 -<<wcswidth>> has been marked as an extension in the Single UNIX Specification Volume 3.
  144.33 -*/
  144.34 -
  144.35 -#include <_ansi.h>
  144.36 -#include <wchar.h>
  144.37 -#include "local.h"
  144.38 -
  144.39 -int
  144.40 -wcswidth (const wchar_t *pwcs,
  144.41 -	size_t n)
  144.42 -
  144.43 -{
  144.44 -  int w, len = 0;
  144.45 -  if (!pwcs || n == 0)
  144.46 -    return 0;
  144.47 -  do {
  144.48 -    wint_t wi = *pwcs;
  144.49 -
  144.50 -#ifdef _MB_CAPABLE
  144.51 -  wi = _jp2uc (wi);
  144.52 -  /* First half of a surrogate pair? */
  144.53 -  if (sizeof (wchar_t) == 2 && wi >= 0xd800 && wi <= 0xdbff)
  144.54 -    {
  144.55 -      wint_t wi2;
  144.56 -
  144.57 -      /* Extract second half and check for validity. */
  144.58 -      if (--n == 0 || (wi2 = _jp2uc (*++pwcs)) < 0xdc00 || wi2 > 0xdfff)
  144.59 -	return -1;
  144.60 -      /* Compute actual unicode value to use in call to __wcwidth. */
  144.61 -      wi = (((wi & 0x3ff) << 10) | (wi2 & 0x3ff)) + 0x10000;
  144.62 -    }
  144.63 -#endif /* _MB_CAPABLE */
  144.64 -    if ((w = __wcwidth (wi)) < 0)
  144.65 -      return -1;
  144.66 -    len += w;
  144.67 -  } while (*pwcs++ && --n > 0);
  144.68 -  return len;
  144.69 -}
   145.1 --- a/libc/string/wcsxfrm.c	Sat Dec 07 00:44:56 2019 +0100
   145.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   145.3 @@ -1,45 +0,0 @@
   145.4 -/*
   145.5 -FUNCTION
   145.6 -	<<wcsxfrm>>---locale-specific wide-character string transformation
   145.7 -	
   145.8 -INDEX
   145.9 -	wcsxfrm
  145.10 -
  145.11 -SYNOPSIS
  145.12 -	#include <wchar.h>
  145.13 -	int wcsxfrm(wchar_t *__restrict <[stra]>,
  145.14 -		    const wchar_t *__restrict <[strb]>, size_t <[n]>);
  145.15 -
  145.16 -DESCRIPTION
  145.17 -	<<wcsxfrm>> transforms the wide-character string pointed to by
  145.18 -	<[strb]> to the wide-character string pointed to by <[stra]>,
  145.19 -	Comparing two transformed wide strings with <<wcscmp>> should return
  145.20 -	the same result as comparing the original strings with <<wcscoll>>.
  145.21 -	No more than <[n]> wide characters are transformed, including the
  145.22 -	trailing null character.
  145.23 -
  145.24 -	If <[n]> is 0, <[stra]> may be a NULL pointer.
  145.25 -
  145.26 -	(NOT Cygwin:) The current implementation of <<wcsxfrm>> simply uses
  145.27 -	<<wcslcpy>> and does not support any language-specific transformations.
  145.28 -
  145.29 -RETURNS
  145.30 -	<<wcsxfrm>> returns the length of the transformed wide character
  145.31 -	string.  if the return value is greater or equal to <[n]>, the
  145.32 -	content of <[stra]> is undefined.
  145.33 -
  145.34 -PORTABILITY
  145.35 -<<wcsxfrm>> is ISO/IEC 9899/AMD1:1995 (ISO C).
  145.36 -*/
  145.37 -
  145.38 -#include <_ansi.h>
  145.39 -#include <wchar.h>
  145.40 -
  145.41 -size_t
  145.42 -wcsxfrm (wchar_t *__restrict a,
  145.43 -	const wchar_t *__restrict b,
  145.44 -	size_t n)
  145.45 -
  145.46 -{
  145.47 -  return wcslcpy (a, b, n);
  145.48 -}
   146.1 --- a/libc/string/wcsxfrm_l.c	Sat Dec 07 00:44:56 2019 +0100
   146.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   146.3 @@ -1,47 +0,0 @@
   146.4 -/*
   146.5 -FUNCTION
   146.6 -	<<wcsxfrm_l>>---locale-specific wide-character string transformation
   146.7 -	
   146.8 -INDEX
   146.9 -	wcsxfrm_l
  146.10 -
  146.11 -SYNOPSIS
  146.12 -	#include <wchar.h>
  146.13 -	int wcsxfrm_l(wchar_t *__restrict <[stra]>,
  146.14 -		      const wchar_t *__restrict <[strb]>, size_t <[n]>,
  146.15 -		      locale_t <[locale]>);
  146.16 -
  146.17 -DESCRIPTION
  146.18 -	<<wcsxfrm_l>> transforms the wide-character string pointed to by
  146.19 -	<[strb]> to the wide-character string pointed to by <[stra]>,
  146.20 -	Comparing two transformed wide strings with <<wcscmp>> should return
  146.21 -	the same result as comparing the original strings with <<wcscoll>>.
  146.22 -	No more than <[n]> wide characters are transformed, including the
  146.23 -	trailing null character.
  146.24 -
  146.25 -	If <[n]> is 0, <[stra]> may be a NULL pointer.
  146.26 -
  146.27 -	If <[locale]> is LC_GLOBAL_LOCALE or not a valid locale object, the
  146.28 -	behaviour is undefined.
  146.29 -
  146.30 -	(NOT Cygwin:) The current implementation of <<wcsxfrm_l>> simply uses
  146.31 -	<<wcslcpy>> and does not support any language-specific transformations.
  146.32 -
  146.33 -RETURNS
  146.34 -	<<wcsxfrm_l>> returns the length of the transformed wide character
  146.35 -	string.  if the return value is greater or equal to <[n]>, the
  146.36 -	content of <[stra]> is undefined.
  146.37 -
  146.38 -PORTABILITY
  146.39 -<<wcsxfrm_l>> is POSIX-1.2008.
  146.40 -*/
  146.41 -
  146.42 -#include <_ansi.h>
  146.43 -#include <wchar.h>
  146.44 -
  146.45 -size_t
  146.46 -wcsxfrm_l (wchar_t *__restrict a, const wchar_t *__restrict b, size_t n,
  146.47 -	   struct __locale_t *locale)
  146.48 -{
  146.49 -  return wcslcpy (a, b, n);
  146.50 -}
   147.1 --- a/libc/string/wcwidth.c	Sat Dec 07 00:44:56 2019 +0100
   147.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   147.3 @@ -1,245 +0,0 @@
   147.4 -/*
   147.5 -FUNCTION
   147.6 -	<<wcwidth>>---number of column positions of a wide-character code
   147.7 -	
   147.8 -INDEX
   147.9 -	wcwidth
  147.10 -
  147.11 -SYNOPSIS
  147.12 -	#include <wchar.h>
  147.13 -	int wcwidth(const wint_t <[wc]>);
  147.14 -
  147.15 -DESCRIPTION
  147.16 -	The <<wcwidth>> function shall determine the number of column
  147.17 -	positions required for the wide character <[wc]>. The application
  147.18 -	shall ensure that the value of <[wc]> is a character representable
  147.19 -	as a wint_t (combining Unicode surrogate pairs into single 21-bit
  147.20 -	Unicode code points), and is a wide-character code corresponding to a
  147.21 -	valid character in the current locale.
  147.22 -
  147.23 -RETURNS
  147.24 -	The <<wcwidth>> function shall either return 0 (if <[wc]> is a null
  147.25 -	wide-character code), or return the number of column positions to
  147.26 -	be occupied by the wide-character code <[wc]>, or return -1 (if <[wc]>
  147.27 -	does not correspond to a printable wide-character code).
  147.28 -
  147.29 -PORTABILITY
  147.30 -<<wcwidth>> has been introduced in the Single UNIX Specification Volume 2.
  147.31 -<<wcwidth>> has been marked as an extension in the Single UNIX Specification Volume 3.
  147.32 -*/
  147.33 -
  147.34 -/*
  147.35 - * This is an implementation of wcwidth() (defined in
  147.36 - * IEEE Std 1002.1-2001) for Unicode.
  147.37 - *
  147.38 - * http://www.opengroup.org/onlinepubs/007904975/functions/wcwidth.html
  147.39 - *
  147.40 - * In fixed-width output devices, Latin characters all occupy a single
  147.41 - * "cell" position of equal width, whereas ideographic CJK characters
  147.42 - * occupy two such cells. Interoperability between terminal-line
  147.43 - * applications and (teletype-style) character terminals using the
  147.44 - * UTF-8 encoding requires agreement on which character should advance
  147.45 - * the cursor by how many cell positions. No established formal
  147.46 - * standards exist at present on which Unicode character shall occupy
  147.47 - * how many cell positions on character terminals. These routines are
  147.48 - * a first attempt of defining such behavior based on simple rules
  147.49 - * applied to data provided by the Unicode Consortium.
  147.50 - *
  147.51 - * For some graphical characters, the Unicode standard explicitly
  147.52 - * defines a character-cell width via the definition of the East Asian
  147.53 - * FullWidth (F), Wide (W), Half-width (H), and Narrow (Na) classes.
  147.54 - * In all these cases, there is no ambiguity about which width a
  147.55 - * terminal shall use. For characters in the East Asian Ambiguous (A)
  147.56 - * class, the width choice depends purely on a preference of backward
  147.57 - * compatibility with either historic CJK or Western practice.
  147.58 - * Choosing single-width for these characters is easy to justify as
  147.59 - * the appropriate long-term solution, as the CJK practice of
  147.60 - * displaying these characters as double-width comes from historic
  147.61 - * implementation simplicity (8-bit encoded characters were displayed
  147.62 - * single-width and 16-bit ones double-width, even for Greek,
  147.63 - * Cyrillic, etc.) and not any typographic considerations.
  147.64 - *
  147.65 - * Much less clear is the choice of width for the Not East Asian
  147.66 - * (Neutral) class. Existing practice does not dictate a width for any
  147.67 - * of these characters. It would nevertheless make sense
  147.68 - * typographically to allocate two character cells to characters such
  147.69 - * as for instance EM SPACE or VOLUME INTEGRAL, which cannot be
  147.70 - * represented adequately with a single-width glyph. The following
  147.71 - * routines at present merely assign a single-cell width to all
  147.72 - * neutral characters, in the interest of simplicity. This is not
  147.73 - * entirely satisfactory and should be reconsidered before
  147.74 - * establishing a formal standard in this area. At the moment, the
  147.75 - * decision which Not East Asian (Neutral) characters should be
  147.76 - * represented by double-width glyphs cannot yet be answered by
  147.77 - * applying a simple rule from the Unicode database content. Setting
  147.78 - * up a proper standard for the behavior of UTF-8 character terminals
  147.79 - * will require a careful analysis not only of each Unicode character,
  147.80 - * but also of each presentation form, something the author of these
  147.81 - * routines has avoided to do so far.
  147.82 - *
  147.83 - * http://www.unicode.org/unicode/reports/tr11/
  147.84 - *
  147.85 - * Markus Kuhn -- 2007-05-26 (Unicode 5.0)
  147.86 - *
  147.87 - * Permission to use, copy, modify, and distribute this software
  147.88 - * for any purpose and without fee is hereby granted. The author
  147.89 - * disclaims all warranties with regard to this software.
  147.90 - *
  147.91 - * Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
  147.92 - */
  147.93 -
  147.94 -#include <_ansi.h>
  147.95 -#include <wchar.h>
  147.96 -#ifndef _MB_CAPABLE
  147.97 -#include <wctype.h> /* iswprint, iswcntrl */
  147.98 -#endif
  147.99 -#include "local.h"
 147.100 -
 147.101 -#ifdef _MB_CAPABLE
 147.102 -struct interval
 147.103 -{
 147.104 -  int first;
 147.105 -  int last;
 147.106 -};
 147.107 -
 147.108 -/* auxiliary function for binary search in interval table */
 147.109 -static int
 147.110 -bisearch(wint_t ucs, const struct interval *table, int max)
 147.111 -{
 147.112 -  int min = 0;
 147.113 -  int mid;
 147.114 -
 147.115 -  if (ucs < table[0].first || ucs > table[max].last)
 147.116 -    return 0;
 147.117 -  while (max >= min)
 147.118 -    {
 147.119 -      mid = (min + max) / 2;
 147.120 -      if (ucs > table[mid].last)
 147.121 -	min = mid + 1;
 147.122 -      else if (ucs < table[mid].first)
 147.123 -	max = mid - 1;
 147.124 -      else
 147.125 -	return 1;
 147.126 -    }
 147.127 -
 147.128 -  return 0;
 147.129 -}
 147.130 -#endif /* _MB_CAPABLE */
 147.131 -
 147.132 -/* The following function defines the column width of an ISO 10646
 147.133 - * character as follows:
 147.134 - *
 147.135 - *    - The null character (U+0000) has a column width of 0.
 147.136 - *
 147.137 - *    - Other C0/C1 control characters and DEL will lead to a return
 147.138 - *      value of -1.
 147.139 - *
 147.140 - *    - If the current language is recognized as a language usually using
 147.141 - *      CJK fonts, spacing characters in the East Asian Ambiguous (A)
 147.142 - *      category as defined in Unicode Technical Report #11 have a column
 147.143 - *      width of 2.
 147.144 - *
 147.145 - *    - Non-spacing and enclosing combining characters (general
 147.146 - *      category code Mn or Me in the Unicode database) have a
 147.147 - *      column width of 0.
 147.148 - *
 147.149 - *    - SOFT HYPHEN (U+00AD) has a column width of 1.
 147.150 - *
 147.151 - *    - Other format characters (general category code Cf in the Unicode
 147.152 - *      database) and ZERO WIDTH SPACE (U+200B) have a column width of 0.
 147.153 - *
 147.154 - *    - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF)
 147.155 - *      have a column width of 0.
 147.156 - *
 147.157 - *    - Spacing characters in the East Asian Wide (W) or East Asian
 147.158 - *      Full-width (F) category as defined in Unicode Technical
 147.159 - *      Report #11 have a column width of 2.
 147.160 - *
 147.161 - *    - All remaining characters (including all printable
 147.162 - *      ISO 8859-1 and WGL4 characters, Unicode control characters,
 147.163 - *      etc.) have a column width of 1.
 147.164 - *
 147.165 - * This implementation assumes that wint_t characters are encoded
 147.166 - * in ISO 10646.
 147.167 - */
 147.168 -
 147.169 -int
 147.170 -__wcwidth (const wint_t ucs)
 147.171 -{
 147.172 -#ifdef _MB_CAPABLE
 147.173 -  /* sorted list of non-overlapping intervals of East Asian Ambiguous chars */
 147.174 -  static const struct interval ambiguous[] =
 147.175 -#include "ambiguous.t"
 147.176 -
 147.177 -  /* sorted list of non-overlapping intervals of non-spacing characters */
 147.178 -  static const struct interval combining[] =
 147.179 -#include "combining.t"
 147.180 -
 147.181 -  /* sorted list of non-overlapping intervals of wide characters,
 147.182 -     ranges extended to Blocks where possible
 147.183 -   */
 147.184 -  static const struct interval wide[] =
 147.185 -#include "wide.t"
 147.186 -
 147.187 -  /* Test for NUL character */
 147.188 -  if (ucs == 0)
 147.189 -    return 0;
 147.190 -
 147.191 -  /* Test for printable ASCII characters */
 147.192 -  if (ucs >= 0x20 && ucs < 0x7f)
 147.193 -    return 1;
 147.194 -
 147.195 -  /* Test for control characters */
 147.196 -  if (ucs < 0xa0)
 147.197 -    return -1;
 147.198 -
 147.199 -  /* Test for surrogate pair values. */
 147.200 -  if (ucs >= 0xd800 && ucs <= 0xdfff)
 147.201 -    return -1;
 147.202 -
 147.203 -  /* binary search in table of ambiguous characters */
 147.204 -  if (__locale_cjk_lang ()
 147.205 -      && bisearch(ucs, ambiguous,
 147.206 -		  sizeof(ambiguous) / sizeof(struct interval) - 1))
 147.207 -    return 2;
 147.208 -
 147.209 -  /* binary search in table of non-spacing characters */
 147.210 -  if (bisearch(ucs, combining,
 147.211 -	       sizeof(combining) / sizeof(struct interval) - 1))
 147.212 -    return 0;
 147.213 -
 147.214 -  /* if we arrive here, ucs is not a combining or C0/C1 control character */
 147.215 -
 147.216 -  /* binary search in table of wide character codes */
 147.217 -  if (bisearch(ucs, wide,
 147.218 -	       sizeof(wide) / sizeof(struct interval) - 1))
 147.219 -    return 2;
 147.220 -  else
 147.221 -    return 1;
 147.222 -#else /* !_MB_CAPABLE */
 147.223 -  if (iswprint (ucs))
 147.224 -    return 1;
 147.225 -  if (iswcntrl (ucs) || ucs == L'\0')
 147.226 -    return 0;
 147.227 -  return -1;
 147.228 -#endif /* _MB_CAPABLE */
 147.229 -}
 147.230 -
 147.231 -// PAUL: Signature uses wchar_t not wint_t.
 147.232 -#if 0
 147.233 -int
 147.234 -wcwidth (const wint_t wc)
 147.235 -{
 147.236 -  wint_t wi = wc;
 147.237 -#endif
 147.238 -
 147.239 -int
 147.240 -wcwidth (const wchar_t wc)
 147.241 -{
 147.242 -  wint_t wi = (wint_t) wc;
 147.243 -
 147.244 -#ifdef _MB_CAPABLE
 147.245 -  wi = _jp2uc (wi);
 147.246 -#endif /* _MB_CAPABLE */
 147.247 -  return __wcwidth (wi);
 147.248 -}
   148.1 --- a/libc/string/wide.t	Sat Dec 07 00:44:56 2019 +0100
   148.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   148.3 @@ -1,34 +0,0 @@
   148.4 -//# EastAsianWidth-11.0.0.txt
   148.5 -//# Blocks-11.0.0.txt
   148.6 -{
   148.7 -  { 0x1100, 0x115F }, { 0x231A, 0x231B }, { 0x2329, 0x232A },
   148.8 -  { 0x23E9, 0x23EC }, { 0x23F0, 0x23F0 }, { 0x23F3, 0x23F3 },
   148.9 -  { 0x25FD, 0x25FE }, { 0x2614, 0x2615 }, { 0x2648, 0x2653 },
  148.10 -  { 0x267F, 0x267F }, { 0x2693, 0x2693 }, { 0x26A1, 0x26A1 },
  148.11 -  { 0x26AA, 0x26AB }, { 0x26BD, 0x26BE }, { 0x26C4, 0x26C5 },
  148.12 -  { 0x26CE, 0x26CE }, { 0x26D4, 0x26D4 }, { 0x26EA, 0x26EA },
  148.13 -  { 0x26F2, 0x26F3 }, { 0x26F5, 0x26F5 }, { 0x26FA, 0x26FA },
  148.14 -  { 0x26FD, 0x26FD }, { 0x2705, 0x2705 }, { 0x270A, 0x270B },
  148.15 -  { 0x2728, 0x2728 }, { 0x274C, 0x274C }, { 0x274E, 0x274E },
  148.16 -  { 0x2753, 0x2755 }, { 0x2757, 0x2757 }, { 0x2795, 0x2797 },
  148.17 -  { 0x27B0, 0x27B0 }, { 0x27BF, 0x27BF }, { 0x2B1B, 0x2B1C },
  148.18 -  { 0x2B50, 0x2B50 }, { 0x2B55, 0x2B55 }, { 0x2E80, 0x303E },
  148.19 -  { 0x3040, 0x321E }, { 0x3220, 0x3247 }, { 0x3250, 0x32FE },
  148.20 -  { 0x3300, 0x4DBF }, { 0x4E00, 0xA4CF }, { 0xA960, 0xA97F },
  148.21 -  { 0xAC00, 0xD7AF }, { 0xF900, 0xFAFF }, { 0xFE10, 0xFE1F },
  148.22 -  { 0xFE30, 0xFE6F }, { 0xFF01, 0xFF60 }, { 0xFFE0, 0xFFE6 },
  148.23 -  { 0x16FE0, 0x18AFF }, { 0x1B000, 0x1B12F }, { 0x1B170, 0x1B2FF },
  148.24 -  { 0x1F004, 0x1F004 }, { 0x1F0CF, 0x1F0CF }, { 0x1F18E, 0x1F18E },
  148.25 -  { 0x1F191, 0x1F19A }, { 0x1F200, 0x1F320 }, { 0x1F32D, 0x1F335 },
  148.26 -  { 0x1F337, 0x1F37C }, { 0x1F37E, 0x1F393 }, { 0x1F3A0, 0x1F3CA },
  148.27 -  { 0x1F3CF, 0x1F3D3 }, { 0x1F3E0, 0x1F3F0 }, { 0x1F3F4, 0x1F3F4 },
  148.28 -  { 0x1F3F8, 0x1F43E }, { 0x1F440, 0x1F440 }, { 0x1F442, 0x1F4FC },
  148.29 -  { 0x1F4FF, 0x1F53D }, { 0x1F54B, 0x1F54E }, { 0x1F550, 0x1F567 },
  148.30 -  { 0x1F57A, 0x1F57A }, { 0x1F595, 0x1F596 }, { 0x1F5A4, 0x1F5A4 },
  148.31 -  { 0x1F5FB, 0x1F64F }, { 0x1F680, 0x1F6C5 }, { 0x1F6CC, 0x1F6CC },
  148.32 -  { 0x1F6D0, 0x1F6D2 }, { 0x1F6EB, 0x1F6EC }, { 0x1F6F4, 0x1F6F9 },
  148.33 -  { 0x1F910, 0x1F93E }, { 0x1F940, 0x1F970 }, { 0x1F973, 0x1F976 },
  148.34 -  { 0x1F97A, 0x1F97A }, { 0x1F97C, 0x1F9A2 }, { 0x1F9B0, 0x1F9B9 },
  148.35 -  { 0x1F9C0, 0x1F9C2 }, { 0x1F9D0, 0x1F9FF }, { 0x20000, 0x2FFFD },
  148.36 -  { 0x30000, 0x3FFFD }
  148.37 -};
   149.1 --- a/libc/string/wmemchr.c	Sat Dec 07 00:44:56 2019 +0100
   149.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   149.3 @@ -1,82 +0,0 @@
   149.4 -/*
   149.5 -FUNCTION
   149.6 -	<<wmemchr>>---find a wide character in memory
   149.7 - 
   149.8 -
   149.9 -SYNOPSIS
  149.10 -	#include <wchar.h>
  149.11 -	wchar_t	*wmemchr(const wchar_t *<[s]>, wchar_t <[c]>, size_t <[n]>);
  149.12 -
  149.13 -DESCRIPTION
  149.14 -	The <<wmemchr>> function locates the first occurrence of <[c]> in the
  149.15 -	initial <[n]> wide characters of the object pointed to be <[s]>. This
  149.16 -	function is not affected by locale and all wchar_t values are treated
  149.17 -	identically.  The null wide character and wchar_t values not
  149.18 -	corresponding to valid characters are not treated specially.
  149.19 -
  149.20 -	If <[n]> is zero, <[s]> must be a valid pointer and the function
  149.21 -	behaves as if no valid occurrence of <[c]> is found. 
  149.22 -
  149.23 -RETURNS
  149.24 -	The <<wmemchr>> function returns a pointer to the located
  149.25 -	wide character, or a null pointer if the wide character does not occur
  149.26 -	in the object. 
  149.27 -
  149.28 -PORTABILITY
  149.29 -<<wmemchr>> is ISO/IEC 9899/AMD1:1995 (ISO C).
  149.30 -
  149.31 -No supporting OS subroutines are required.
  149.32 -*/
  149.33 -
  149.34 -/*	$NetBSD: wmemchr.c,v 1.1 2000/12/23 23:14:37 itojun Exp $	*/
  149.35 -
  149.36 -/*-
  149.37 - * Copyright (c)1999 Citrus Project,
  149.38 - * All rights reserved.
  149.39 - *
  149.40 - * Redistribution and use in source and binary forms, with or without
  149.41 - * modification, are permitted provided that the following conditions
  149.42 - * are met:
  149.43 - * 1. Redistributions of source code must retain the above copyright
  149.44 - *    notice, this list of conditions and the following disclaimer.
  149.45 - * 2. Redistributions in binary form must reproduce the above copyright
  149.46 - *    notice, this list of conditions and the following disclaimer in the
  149.47 - *    documentation and/or other materials provided with the distribution.
  149.48 - *
  149.49 - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  149.50 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  149.51 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  149.52 - * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  149.53 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  149.54 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  149.55 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  149.56 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  149.57 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  149.58 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  149.59 - * SUCH DAMAGE.
  149.60 - *
  149.61 - *	citrus Id: wmemchr.c,v 1.2 2000/12/20 14:08:31 itojun Exp
  149.62 - */
  149.63 -
  149.64 -
  149.65 -#include <_ansi.h>
  149.66 -#include <wchar.h>
  149.67 -
  149.68 -wchar_t *
  149.69 -wmemchr (const wchar_t * s,
  149.70 -	wchar_t c,
  149.71 -	size_t n)
  149.72 -{
  149.73 -  size_t i;
  149.74 -
  149.75 -  for (i = 0; i < n; i++)
  149.76 -    {
  149.77 -      if (*s == c)
  149.78 -	{
  149.79 -	  /* LINTED const castaway */
  149.80 -	  return (wchar_t *) s;
  149.81 -	}
  149.82 -      s++;
  149.83 -    }
  149.84 -  return NULL;
  149.85 -}
   150.1 --- a/libc/string/wmemcmp.c	Sat Dec 07 00:44:56 2019 +0100
   150.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   150.3 @@ -1,82 +0,0 @@
   150.4 -/*
   150.5 -FUNCTION
   150.6 -	<<wmemcmp>>---compare wide characters in memory 
   150.7 -
   150.8 -SYNOPSIS
   150.9 -	#include <wchar.h>
  150.10 -	int wmemcmp(const wchar_t *<[s1]>, const wchar_t *<[s2]>, size_t <[n]>);
  150.11 -
  150.12 -DESCRIPTION
  150.13 -	The <<wmemcmp>> function compares the first <[n]> wide characters of the
  150.14 -	object pointed to by <[s1]> to the first <[n]> wide characters of the
  150.15 -	object pointed to by <[s2]>. This function is not affected by locale
  150.16 -	and all wchar_t values are treated identically. The null wide character
  150.17 -	and wchar_t values not corresponding to valid characters are not treated
  150.18 -	specially.
  150.19 -
  150.20 -	If <[n]> is zero, <[s1]> and <[s2]> must be a valid pointers and the
  150.21 -	function behaves as if the two objects compare equal. 
  150.22 -
  150.23 -RETURNS
  150.24 -	The <<wmemcmp>> function returns an integer greater than, equal to,
  150.25 -	or less than zero, accordingly as the object pointed to by <[s1]> is
  150.26 -	greater than, equal to, or less than the object pointed to by <[s2]>.
  150.27 -
  150.28 -PORTABILITY
  150.29 -<<wmemcmp>> is ISO/IEC 9899/AMD1:1995 (ISO C).
  150.30 -
  150.31 -No supporting OS subroutines are required.
  150.32 -*/
  150.33 -
  150.34 -/*	$NetBSD: wmemcmp.c,v 1.1 2000/12/23 23:14:37 itojun Exp $	*/
  150.35 -
  150.36 -/*-
  150.37 - * Copyright (c)1999 Citrus Project,
  150.38 - * All rights reserved.
  150.39 - *
  150.40 - * Redistribution and use in source and binary forms, with or without
  150.41 - * modification, are permitted provided that the following conditions
  150.42 - * are met:
  150.43 - * 1. Redistributions of source code must retain the above copyright
  150.44 - *    notice, this list of conditions and the following disclaimer.
  150.45 - * 2. Redistributions in binary form must reproduce the above copyright
  150.46 - *    notice, this list of conditions and the following disclaimer in the
  150.47 - *    documentation and/or other materials provided with the distribution.
  150.48 - *
  150.49 - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  150.50 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  150.51 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  150.52 - * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  150.53 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  150.54 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  150.55 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  150.56 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  150.57 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  150.58 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  150.59 - * SUCH DAMAGE.
  150.60 - *
  150.61 - *	citrus Id: wmemcmp.c,v 1.2 2000/12/20 14:08:31 itojun Exp
  150.62 - */
  150.63 -
  150.64 -#include <_ansi.h>
  150.65 -#include <wchar.h>
  150.66 -
  150.67 -int
  150.68 -wmemcmp (const wchar_t * s1,
  150.69 -	const wchar_t * s2,
  150.70 -	size_t n)
  150.71 -{
  150.72 -  size_t i;
  150.73 -
  150.74 -  for (i = 0; i < n; i++)
  150.75 -    {
  150.76 -      if (*s1 != *s2)
  150.77 -	{
  150.78 -	  /* wchar might be unsigned */
  150.79 -	  return *s1 > *s2 ? 1 : -1;
  150.80 -	}
  150.81 -      s1++;
  150.82 -      s2++;
  150.83 -    }
  150.84 -  return 0;
  150.85 -}
   151.1 --- a/libc/string/wmemcpy.c	Sat Dec 07 00:44:56 2019 +0100
   151.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   151.3 @@ -1,70 +0,0 @@
   151.4 -/*
   151.5 -FUNCTION
   151.6 -	<<wmemcpy>>---copy wide characters in memory 
   151.7 -
   151.8 -SYNOPSIS
   151.9 -	#include <wchar.h>
  151.10 -	wchar_t *wmemcpy(wchar_t *__restrict <[d]>,
  151.11 -			 const wchar_t *__restrict <[s]>, size_t <[n]>);
  151.12 -
  151.13 -DESCRIPTION
  151.14 -	The <<wmemcpy>> function copies <[n]> wide characters from the object
  151.15 -	pointed to by <[s]> to the object pointed to be <[d]>. This function
  151.16 -	is not affected by locale and all wchar_t values are treated
  151.17 -	identically.  The null wide character and wchar_t values not
  151.18 -	corresponding to valid characters are not treated specially.
  151.19 -
  151.20 -	If <[n]> is zero, <[d]> and <[s]> must be a valid pointers, and the
  151.21 -	function copies zero wide characters. 
  151.22 -
  151.23 -RETURNS
  151.24 -	The <<wmemcpy>> function returns the value of <[d]>.
  151.25 -
  151.26 -PORTABILITY
  151.27 -<<wmemcpy>> is ISO/IEC 9899/AMD1:1995 (ISO C).
  151.28 -
  151.29 -No supporting OS subroutines are required.
  151.30 -*/
  151.31 -
  151.32 -/*	$NetBSD: wmemcpy.c,v 1.1 2000/12/23 23:14:37 itojun Exp $	*/
  151.33 -
  151.34 -/*-
  151.35 - * Copyright (c)1999 Citrus Project,
  151.36 - * All rights reserved.
  151.37 - *
  151.38 - * Redistribution and use in source and binary forms, with or without
  151.39 - * modification, are permitted provided that the following conditions
  151.40 - * are met:
  151.41 - * 1. Redistributions of source code must retain the above copyright
  151.42 - *    notice, this list of conditions and the following disclaimer.
  151.43 - * 2. Redistributions in binary form must reproduce the above copyright
  151.44 - *    notice, this list of conditions and the following disclaimer in the
  151.45 - *    documentation and/or other materials provided with the distribution.
  151.46 - *
  151.47 - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  151.48 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  151.49 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  151.50 - * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  151.51 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  151.52 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  151.53 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  151.54 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  151.55 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  151.56 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  151.57 - * SUCH DAMAGE.
  151.58 - *
  151.59 - *	citrus Id: wmemcpy.c,v 1.2 2000/12/20 14:08:31 itojun Exp
  151.60 - */
  151.61 -
  151.62 -#include <_ansi.h>
  151.63 -#include <string.h>
  151.64 -#include <wchar.h>
  151.65 -
  151.66 -wchar_t *
  151.67 -wmemcpy (wchar_t *__restrict d,
  151.68 -	const wchar_t *__restrict s,
  151.69 -	size_t n)
  151.70 -{
  151.71 -
  151.72 -  return (wchar_t *) memcpy (d, s, n * sizeof (wchar_t));
  151.73 -}
   152.1 --- a/libc/string/wmemmove.c	Sat Dec 07 00:44:56 2019 +0100
   152.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   152.3 @@ -1,75 +0,0 @@
   152.4 -/*
   152.5 -FUNCTION
   152.6 -	<<wmemmove>>---copy wide characters in memory with overlapping areas 
   152.7 -
   152.8 -SYNOPSIS
   152.9 -	#include <wchar.h>
  152.10 -	wchar_t *wmemmove(wchar_t *<[d]>, const wchar_t *<[s]>, size_t <[n]>);
  152.11 -
  152.12 -DESCRIPTION
  152.13 -	The <<wmemmove>> function copies <[n]> wide characters from the object
  152.14 -	pointed to by <[s]> to the object pointed to by <[d]>. Copying takes
  152.15 -	place as if the <[n]> wide characters from the object pointed to by
  152.16 -	<[s]> are first copied into a temporary array of <[n]> wide characters
  152.17 -	that does not overlap the objects pointed to by <[d]> or <[s]>, and then
  152.18 -	the <[n]> wide characters from the temporary array are copied into the
  152.19 -	object pointed to by <[d]>.
  152.20 -
  152.21 -	This function is not affected by locale and all wchar_t values are
  152.22 -	treated identically. The null wide character and wchar_t values not
  152.23 -	corresponding to valid characters are not treated specially.
  152.24 -
  152.25 -	If <[n]> is zero, <[d]> and <[s]> must be a valid pointers, and the
  152.26 -	function copies zero wide characters. 
  152.27 -
  152.28 -RETURNS
  152.29 -	The <<wmemmove>> function returns the value of <[d]>.
  152.30 -
  152.31 -PORTABILITY
  152.32 -<<wmemmove>> is ISO/IEC 9899/AMD1:1995 (ISO C).
  152.33 -
  152.34 -No supporting OS subroutines are required.
  152.35 -*/
  152.36 -
  152.37 -/*	$NetBSD: wmemmove.c,v 1.1 2000/12/23 23:14:37 itojun Exp $	*/
  152.38 -
  152.39 -/*-
  152.40 - * Copyright (c)1999 Citrus Project,
  152.41 - * All rights reserved.
  152.42 - *
  152.43 - * Redistribution and use in source and binary forms, with or without
  152.44 - * modification, are permitted provided that the following conditions
  152.45 - * are met:
  152.46 - * 1. Redistributions of source code must retain the above copyright
  152.47 - *    notice, this list of conditions and the following disclaimer.
  152.48 - * 2. Redistributions in binary form must reproduce the above copyright
  152.49 - *    notice, this list of conditions and the following disclaimer in the
  152.50 - *    documentation and/or other materials provided with the distribution.
  152.51 - *
  152.52 - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  152.53 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  152.54 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  152.55 - * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  152.56 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  152.57 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  152.58 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  152.59 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  152.60 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  152.61 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  152.62 - * SUCH DAMAGE.
  152.63 - *
  152.64 - *	citrus Id: wmemmove.c,v 1.2 2000/12/20 14:08:31 itojun Exp
  152.65 - */
  152.66 -
  152.67 -#include <_ansi.h>
  152.68 -#include <string.h>
  152.69 -#include <wchar.h>
  152.70 -
  152.71 -wchar_t *
  152.72 -wmemmove (wchar_t * d,
  152.73 -	const wchar_t * s,
  152.74 -	size_t n)
  152.75 -{
  152.76 -
  152.77 -  return (wchar_t *) memmove (d, s, n * sizeof (wchar_t));
  152.78 -}
   153.1 --- a/libc/string/wmempcpy.c	Sat Dec 07 00:44:56 2019 +0100
   153.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   153.3 @@ -1,42 +0,0 @@
   153.4 -/*
   153.5 -FUNCTION
   153.6 -	<<wmempcpy>>---copy wide characters in memory and return end pointer
   153.7 -
   153.8 -SYNOPSIS
   153.9 -	#define _GNU_SOURCE
  153.10 -	#include <wchar.h>
  153.11 -	wchar_t *wmempcpy(wchar_t *<[d]>,
  153.12 -			 const wchar_t *<[s]>, size_t <[n]>);
  153.13 -
  153.14 -DESCRIPTION
  153.15 -	The <<wmemcpy>> function copies <[n]> wide characters from the object
  153.16 -	pointed to by <[s]> to the object pointed to be <[d]>. This function
  153.17 -	is not affected by locale and all wchar_t values are treated
  153.18 -	identically.  The null wide character and wchar_t values not
  153.19 -	corresponding to valid characters are not treated specially.
  153.20 -
  153.21 -	If <[n]> is zero, <[d]> and <[s]> must be a valid pointers, and the
  153.22 -	function copies zero wide characters.
  153.23 -
  153.24 -RETURNS
  153.25 -	<<wmempcpy>> returns a pointer to the wide character following the
  153.26 -	last wide character copied to the <[out]> region.
  153.27 -
  153.28 -PORTABILITY
  153.29 -<<wmempcpy>> is a GNU extension.
  153.30 -
  153.31 -No supporting OS subroutines are required.
  153.32 -*/
  153.33 -
  153.34 -#define _GNU_SOURCE
  153.35 -#include <_ansi.h>
  153.36 -#include <string.h>
  153.37 -#include <wchar.h>
  153.38 -
  153.39 -wchar_t *
  153.40 -wmempcpy (wchar_t *__restrict d,
  153.41 -	const wchar_t *__restrict s,
  153.42 -	size_t n)
  153.43 -{
  153.44 -  return (wchar_t *) mempcpy (d, s, n * sizeof (wchar_t));
  153.45 -}
   154.1 --- a/libc/string/wmemset.c	Sat Dec 07 00:44:56 2019 +0100
   154.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   154.3 @@ -1,75 +0,0 @@
   154.4 -/*
   154.5 -FUNCTION
   154.6 -       <<wmemset>>---set wide characters in memory 
   154.7 -
   154.8 -SYNOPSIS
   154.9 -       #include <wchar.h>
  154.10 -       wchar_t *wmemset(wchar_t *<[s]>, wchar_t <[c]>, size_t <[n]>);
  154.11 -
  154.12 -DESCRIPTION
  154.13 -       The <<wmemset>> function copies the value of <[c]> into each of the
  154.14 -       first <[n]> wide characters of the object pointed to by <[s]>.  This
  154.15 -       function is not affected by locale and all wchar_t values are treated
  154.16 -       identically.  The null wide character and wchar_t values not
  154.17 -       corresponding to valid characters are not treated specially.
  154.18 -
  154.19 -       If <[n]> is zero, <[s]> must be a valid pointer and the function
  154.20 -       copies zero wide characters.
  154.21 -
  154.22 -RETURNS
  154.23 -       The <<wmemset>> function returns the value of <[s]>.
  154.24 -
  154.25 -PORTABILITY
  154.26 -<<wmemset>> is ISO/IEC 9899/AMD1:1995 (ISO C).
  154.27 -
  154.28 -No supporting OS subroutines are required.
  154.29 -*/
  154.30 -
  154.31 -/*     $NetBSD: wmemset.c,v 1.1 2000/12/23 23:14:37 itojun Exp $       */
  154.32 -
  154.33 -/*-
  154.34 - * Copyright (c)1999 Citrus Project,
  154.35 - * All rights reserved.
  154.36 - *
  154.37 - * Redistribution and use in source and binary forms, with or without
  154.38 - * modification, are permitted provided that the following conditions
  154.39 - * are met:
  154.40 - * 1. Redistributions of source code must retain the above copyright
  154.41 - *    notice, this list of conditions and the following disclaimer.
  154.42 - * 2. Redistributions in binary form must reproduce the above copyright
  154.43 - *    notice, this list of conditions and the following disclaimer in the
  154.44 - *    documentation and/or other materials provided with the distribution.
  154.45 - *
  154.46 - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  154.47 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  154.48 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  154.49 - * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  154.50 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  154.51 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  154.52 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  154.53 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  154.54 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  154.55 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  154.56 - * SUCH DAMAGE.
  154.57 - *
  154.58 - *	citrus Id: wmemset.c,v 1.2 2000/12/20 14:08:31 itojun Exp
  154.59 - */
  154.60 -
  154.61 -#include <_ansi.h>
  154.62 -#include <wchar.h>
  154.63 -
  154.64 -wchar_t	*
  154.65 -wmemset (wchar_t *s,
  154.66 -	wchar_t c,
  154.67 -	size_t n)
  154.68 -{
  154.69 -	size_t i;
  154.70 -	wchar_t *p;
  154.71 -
  154.72 -	p = (wchar_t *)s;
  154.73 -	for (i = 0; i < n; i++) {
  154.74 -		*p = c;
  154.75 -		p++;
  154.76 -	}
  154.77 -	return s;
  154.78 -}
   155.1 --- a/libc/string/xpg_strerror_r.c	Sat Dec 07 00:44:56 2019 +0100
   155.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   155.3 @@ -1,25 +0,0 @@
   155.4 -/* POSIX variant of strerror_r. */
   155.5 -#undef __STRICT_ANSI__
   155.6 -#include <errno.h>
   155.7 -#include <string.h>
   155.8 -
   155.9 -int
  155.10 -__xpg_strerror_r (int errnum,
  155.11 -	char *buffer,
  155.12 -	size_t n)
  155.13 -{
  155.14 -  char *error;
  155.15 -  int result = 0;
  155.16 -
  155.17 -  if (!n)
  155.18 -    return ERANGE;
  155.19 -  error = _strerror_r (_REENT, errnum, 1, &result);
  155.20 -  if (strlen (error) >= n)
  155.21 -    {
  155.22 -      memcpy (buffer, error, n - 1);
  155.23 -      buffer[n - 1] = '\0';
  155.24 -      return ERANGE;
  155.25 -    }
  155.26 -  strcpy (buffer, error);
  155.27 -  return (result || *error) ? result : EINVAL;
  155.28 -}