URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
Compare Revisions
- This comparison shows the changes necessary to convert path
/openrisc/tags/gnu-src/newlib-1.18.0/newlib-1.18.0-or32-1.0rc2/newlib/libc/string
- from Rev 207 to Rev 520
- ↔ Reverse comparison
Rev 207 → Rev 520
/strndup.c
0,0 → 1,16
#ifndef _REENT_ONLY |
|
#include <_ansi.h> |
#include <reent.h> |
#include <stdlib.h> |
#include <string.h> |
|
char * |
_DEFUN (strndup, (str, n), |
_CONST char *str _AND |
size_t n) |
{ |
return _strndup_r (_REENT, str, n); |
} |
|
#endif /* !_REENT_ONLY */ |
strndup.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wcslcat.c
===================================================================
--- wcslcat.c (nonexistent)
+++ wcslcat.c (revision 520)
@@ -0,0 +1,108 @@
+/*
+FUNCTION
+ <>---concatenate wide-character strings to specified length
+
+ANSI_SYNOPSIS
+ #include
+ size_t wcslcat(wchar_t *<[dst]>, const wchar_t *<[src]>, size_t <[siz]>);
+
+TRAD_SYNOPSIS
+ #include
+ size_t wcslcat(<[dst]>, <[src]>, <[siz]>
+ wchar_t *<[dst]>;
+ const wchar_t *<[src]>;
+ size_t <[siz]>;
+
+DESCRIPTION
+ The <> function appends wide characters from <[src]> to
+ end of the <[dst]> wide-character string so that the resultant
+ wide-character string is not more than <[siz]> wide characters
+ including the terminating null wide-character code. A terminating
+ null wide character is always added unless <[siz]> is 0. Thus,
+ the maximum number of wide characters that can be appended from
+ <[src]> is <[siz]> - 1. If copying takes place between objects
+ that overlap, the behaviour is undefined.
+
+RETURNS
+ Wide-character string length of initial <[dst]> plus the
+ wide-character string length of <[src]> (does not include
+ terminating null wide-characters). If the return value is
+ greater than or equal to <[siz]>, then truncation occurred and
+ not all wide characters from <[src]> were appended.
+
+PORTABILITY
+No supporting OS subroutines are required.
+*/
+
+/* $NetBSD: wcslcat.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */
+/* from OpenBSD: strlcat.c,v 1.3 2000/11/24 11:10:02 itojun Exp */
+
+/*
+ * Copyright (c) 1998 Todd C. Miller
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <_ansi.h>
+#include
+
+/*
+ * Appends src to string dst of size siz (unlike wcsncat, siz is the
+ * full size of dst, not space left). At most siz-1 characters
+ * will be copied. Always NUL terminates (unless siz == 0).
+ * Returns wcslen(initial dst) + wcslen(src); if retval >= siz,
+ * truncation occurred.
+ */
+size_t
+_DEFUN (wcslcat, (dst, src, siz),
+ wchar_t * dst _AND
+ _CONST wchar_t * src _AND
+ size_t siz)
+{
+ wchar_t *d = dst;
+ _CONST wchar_t *s = src;
+ size_t n = siz;
+ size_t dlen;
+
+ /* Find the end of dst and adjust bytes left but don't go past end */
+ while (*d != '\0' && n-- != 0)
+ d++;
+ dlen = d - dst;
+ n = siz - dlen;
+
+ if (n == 0)
+ return (dlen + wcslen (s));
+ while (*s != '\0')
+ {
+ if (n != 1)
+ {
+ *d++ = *s;
+ n--;
+ }
+ s++;
+ }
+ *d = '\0';
+
+ return (dlen + (s - src)); /* count does not include NUL */
+}
wcslcat.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: Makefile.in
===================================================================
--- Makefile.in (nonexistent)
+++ Makefile.in (revision 520)
@@ -0,0 +1,1152 @@
+# Makefile.in generated by automake 1.11 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+DIST_COMMON = $(srcdir)/../../Makefile.shared $(srcdir)/Makefile.in \
+ $(srcdir)/Makefile.am
+subdir = string
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \
+ $(top_srcdir)/../../ltoptions.m4 \
+ $(top_srcdir)/../../ltsugar.m4 \
+ $(top_srcdir)/../../ltversion.m4 \
+ $(top_srcdir)/../../lt~obsolete.m4 \
+ $(top_srcdir)/../acinclude.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+ARFLAGS = cru
+lib_a_AR = $(AR) $(ARFLAGS)
+lib_a_LIBADD =
+am__objects_1 = lib_a-bcopy.$(OBJEXT) lib_a-bzero.$(OBJEXT) \
+ lib_a-index.$(OBJEXT) lib_a-memchr.$(OBJEXT) \
+ lib_a-memcmp.$(OBJEXT) lib_a-memcpy.$(OBJEXT) \
+ lib_a-memmove.$(OBJEXT) lib_a-memset.$(OBJEXT) \
+ lib_a-rindex.$(OBJEXT) lib_a-strcasecmp.$(OBJEXT) \
+ lib_a-strcat.$(OBJEXT) lib_a-strchr.$(OBJEXT) \
+ lib_a-strcmp.$(OBJEXT) lib_a-strcoll.$(OBJEXT) \
+ lib_a-strcpy.$(OBJEXT) lib_a-strcspn.$(OBJEXT) \
+ lib_a-strdup.$(OBJEXT) lib_a-strdup_r.$(OBJEXT) \
+ lib_a-strerror.$(OBJEXT) lib_a-strerror_r.$(OBJEXT) \
+ lib_a-strlcat.$(OBJEXT) lib_a-strlcpy.$(OBJEXT) \
+ lib_a-strlen.$(OBJEXT) lib_a-strlwr.$(OBJEXT) \
+ lib_a-strncasecmp.$(OBJEXT) lib_a-strncat.$(OBJEXT) \
+ lib_a-strncmp.$(OBJEXT) lib_a-strncpy.$(OBJEXT) \
+ lib_a-strnlen.$(OBJEXT) lib_a-strpbrk.$(OBJEXT) \
+ lib_a-strrchr.$(OBJEXT) lib_a-strsep.$(OBJEXT) \
+ lib_a-strspn.$(OBJEXT) lib_a-strtok.$(OBJEXT) \
+ lib_a-strtok_r.$(OBJEXT) lib_a-strupr.$(OBJEXT) \
+ lib_a-strxfrm.$(OBJEXT) lib_a-strstr.$(OBJEXT) \
+ lib_a-swab.$(OBJEXT) lib_a-u_strerr.$(OBJEXT) \
+ lib_a-wcscat.$(OBJEXT) lib_a-wcschr.$(OBJEXT) \
+ lib_a-wcscmp.$(OBJEXT) lib_a-wcscoll.$(OBJEXT) \
+ lib_a-wcscpy.$(OBJEXT) lib_a-wcscspn.$(OBJEXT) \
+ lib_a-wcslcat.$(OBJEXT) lib_a-wcslcpy.$(OBJEXT) \
+ lib_a-wcslen.$(OBJEXT) lib_a-wcsncat.$(OBJEXT) \
+ lib_a-wcsncmp.$(OBJEXT) lib_a-wcsncpy.$(OBJEXT) \
+ lib_a-wcsnlen.$(OBJEXT) lib_a-wcspbrk.$(OBJEXT) \
+ lib_a-wcsrchr.$(OBJEXT) lib_a-wcsspn.$(OBJEXT) \
+ lib_a-wcsstr.$(OBJEXT) lib_a-wcstok.$(OBJEXT) \
+ lib_a-wcswidth.$(OBJEXT) lib_a-wcsxfrm.$(OBJEXT) \
+ lib_a-wcwidth.$(OBJEXT) lib_a-wmemchr.$(OBJEXT) \
+ lib_a-wmemcmp.$(OBJEXT) lib_a-wmemcpy.$(OBJEXT) \
+ lib_a-wmemmove.$(OBJEXT) lib_a-wmemset.$(OBJEXT)
+@ELIX_LEVEL_1_FALSE@am__objects_2 = lib_a-bcmp.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@ lib_a-memccpy.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@ lib_a-mempcpy.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@ lib_a-stpcpy.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@ lib_a-stpncpy.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@ lib_a-strndup.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@ lib_a-strcasestr.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@ lib_a-strndup_r.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@ lib_a-wcpcpy.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@ lib_a-wcpncpy.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@ lib_a-wcsdup.$(OBJEXT)
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@am__objects_3 = lib_a-memmem.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-wcscasecmp.$(OBJEXT) \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-wcsncasecmp.$(OBJEXT)
+@USE_LIBTOOL_FALSE@am_lib_a_OBJECTS = $(am__objects_1) \
+@USE_LIBTOOL_FALSE@ $(am__objects_2) $(am__objects_3)
+lib_a_OBJECTS = $(am_lib_a_OBJECTS)
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libstring_la_LIBADD =
+am__objects_4 = bcopy.lo bzero.lo index.lo memchr.lo memcmp.lo \
+ memcpy.lo memmove.lo memset.lo rindex.lo strcasecmp.lo \
+ strcat.lo strchr.lo strcmp.lo strcoll.lo strcpy.lo strcspn.lo \
+ strdup.lo strdup_r.lo strerror.lo strerror_r.lo strlcat.lo \
+ strlcpy.lo strlen.lo strlwr.lo strncasecmp.lo strncat.lo \
+ strncmp.lo strncpy.lo strnlen.lo strpbrk.lo strrchr.lo \
+ strsep.lo strspn.lo strtok.lo strtok_r.lo strupr.lo strxfrm.lo \
+ strstr.lo swab.lo u_strerr.lo wcscat.lo wcschr.lo wcscmp.lo \
+ wcscoll.lo wcscpy.lo wcscspn.lo wcslcat.lo wcslcpy.lo \
+ wcslen.lo wcsncat.lo wcsncmp.lo wcsncpy.lo wcsnlen.lo \
+ wcspbrk.lo wcsrchr.lo wcsspn.lo wcsstr.lo wcstok.lo \
+ wcswidth.lo wcsxfrm.lo wcwidth.lo wmemchr.lo wmemcmp.lo \
+ wmemcpy.lo wmemmove.lo wmemset.lo
+@ELIX_LEVEL_1_FALSE@am__objects_5 = bcmp.lo memccpy.lo mempcpy.lo \
+@ELIX_LEVEL_1_FALSE@ stpcpy.lo stpncpy.lo strndup.lo \
+@ELIX_LEVEL_1_FALSE@ strcasestr.lo strndup_r.lo wcpcpy.lo \
+@ELIX_LEVEL_1_FALSE@ wcpncpy.lo wcsdup.lo
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@am__objects_6 = memmem.lo \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ wcscasecmp.lo \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ wcsncasecmp.lo
+@USE_LIBTOOL_TRUE@am_libstring_la_OBJECTS = $(am__objects_4) \
+@USE_LIBTOOL_TRUE@ $(am__objects_5) $(am__objects_6)
+libstring_la_OBJECTS = $(am_libstring_la_OBJECTS)
+libstring_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(libstring_la_LDFLAGS) $(LDFLAGS) -o $@
+@USE_LIBTOOL_TRUE@am_libstring_la_rpath =
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp =
+am__depfiles_maybe =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(lib_a_SOURCES) $(libstring_la_SOURCES)
+DATA = $(noinst_DATA)
+ETAGS = etags
+CTAGS = ctags
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CRT0 = @CRT0@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBC_EXTRA_DEF = @LIBC_EXTRA_DEF@
+LIBC_EXTRA_LIB = @LIBC_EXTRA_LIB@
+LIBC_MACHINE_LIB = @LIBC_MACHINE_LIB@
+LIBC_POSIX_LIB = @LIBC_POSIX_LIB@
+LIBC_SIGNAL_DEF = @LIBC_SIGNAL_DEF@
+LIBC_SIGNAL_LIB = @LIBC_SIGNAL_LIB@
+LIBC_STDIO64_DEF = @LIBC_STDIO64_DEF@
+LIBC_STDIO64_LIB = @LIBC_STDIO64_LIB@
+LIBC_STDIO_DEF = @LIBC_STDIO_DEF@
+LIBC_STDIO_LIB = @LIBC_STDIO_LIB@
+LIBC_SYSCALL_LIB = @LIBC_SYSCALL_LIB@
+LIBC_SYS_LIB = @LIBC_SYS_LIB@
+LIBC_UNIX_LIB = @LIBC_UNIX_LIB@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NEWLIB_CFLAGS = @NEWLIB_CFLAGS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+READELF = @READELF@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+aext = @aext@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+extra_dir = @extra_dir@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+libm_machine_dir = @libm_machine_dir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lpfx = @lpfx@
+lt_ECHO = @lt_ECHO@
+machine_dir = @machine_dir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+newlib_basedir = @newlib_basedir@
+oext = @oext@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+subdirs = @subdirs@
+sys_dir = @sys_dir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AUTOMAKE_OPTIONS = cygnus
+INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
+GENERAL_SOURCES = \
+ bcopy.c \
+ bzero.c \
+ index.c \
+ memchr.c \
+ memcmp.c \
+ memcpy.c \
+ memmove.c \
+ memset.c \
+ rindex.c \
+ strcasecmp.c \
+ strcat.c \
+ strchr.c \
+ strcmp.c \
+ strcoll.c \
+ strcpy.c \
+ strcspn.c \
+ strdup.c \
+ strdup_r.c \
+ strerror.c \
+ strerror_r.c \
+ strlcat.c \
+ strlcpy.c \
+ strlen.c \
+ strlwr.c \
+ strncasecmp.c \
+ strncat.c \
+ strncmp.c \
+ strncpy.c \
+ strnlen.c \
+ strpbrk.c \
+ strrchr.c \
+ strsep.c \
+ strspn.c \
+ strtok.c \
+ strtok_r.c \
+ strupr.c \
+ strxfrm.c \
+ strstr.c \
+ swab.c \
+ u_strerr.c \
+ wcscat.c \
+ wcschr.c \
+ wcscmp.c \
+ wcscoll.c \
+ wcscpy.c \
+ wcscspn.c \
+ wcslcat.c \
+ wcslcpy.c \
+ wcslen.c \
+ wcsncat.c \
+ wcsncmp.c \
+ wcsncpy.c \
+ wcsnlen.c \
+ wcspbrk.c \
+ wcsrchr.c \
+ wcsspn.c \
+ wcsstr.c \
+ wcstok.c \
+ wcswidth.c \
+ wcsxfrm.c \
+ wcwidth.c \
+ wmemchr.c \
+ wmemcmp.c \
+ wmemcpy.c \
+ wmemmove.c \
+ wmemset.c
+
+@ELIX_LEVEL_1_FALSE@ELIX_2_SOURCES = \
+@ELIX_LEVEL_1_FALSE@ bcmp.c \
+@ELIX_LEVEL_1_FALSE@ memccpy.c \
+@ELIX_LEVEL_1_FALSE@ mempcpy.c \
+@ELIX_LEVEL_1_FALSE@ stpcpy.c \
+@ELIX_LEVEL_1_FALSE@ stpncpy.c \
+@ELIX_LEVEL_1_FALSE@ strndup.c \
+@ELIX_LEVEL_1_FALSE@ strcasestr.c \
+@ELIX_LEVEL_1_FALSE@ strndup_r.c \
+@ELIX_LEVEL_1_FALSE@ wcpcpy.c \
+@ELIX_LEVEL_1_FALSE@ wcpncpy.c \
+@ELIX_LEVEL_1_FALSE@ wcsdup.c
+
+@ELIX_LEVEL_1_TRUE@ELIX_2_SOURCES =
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ELIX_4_SOURCES = \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ memmem.c \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ wcscasecmp.c \
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ wcsncasecmp.c
+
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_TRUE@ELIX_4_SOURCES =
+@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@ELIX_4_SOURCES =
+@ELIX_LEVEL_1_TRUE@ELIX_4_SOURCES =
+libstring_la_LDFLAGS = -Xcompiler -nostdlib
+@USE_LIBTOOL_TRUE@noinst_LTLIBRARIES = libstring.la
+@USE_LIBTOOL_TRUE@libstring_la_SOURCES = $(GENERAL_SOURCES) $(ELIX_2_SOURCES) $(ELIX_4_SOURCES)
+@USE_LIBTOOL_FALSE@noinst_DATA =
+@USE_LIBTOOL_TRUE@noinst_DATA = objectlist.awk.in
+@USE_LIBTOOL_FALSE@noinst_LIBRARIES = lib.a
+@USE_LIBTOOL_FALSE@lib_a_SOURCES = $(GENERAL_SOURCES) $(ELIX_2_SOURCES) $(ELIX_4_SOURCES)
+@USE_LIBTOOL_FALSE@lib_a_CFLAGS = $(AM_CFLAGS)
+CHEWOUT_FILES = \
+bcmp.def memcpy.def strcmp.def strncat.def strstr.def \
+bcopy.def memmove.def strcoll.def strncmp.def strtok.def \
+bzero.def memset.def strcpy.def strncpy.def strxfrm.def \
+index.def rindex.def strcspn.def strpbrk.def swab.def \
+memchr.def strcat.def strerror.def strerror_r.def strrchr.def \
+memcmp.def strchr.def strlen.def strnlen.def strspn.def \
+strcasecmp.def strncasecmp.def strcasestr.def strlwr.def strupr.def \
+memccpy.def mempcpy.def stpcpy.def stpncpy.def \
+wcscasecmp.def wcscat.def wcschr.def wcscmp.def wcscoll.def \
+wcscpy.def wcscspn.def wcpcpy.def wcpncpy.def wcsdup.def \
+wcslcat.def wcslcpy.def wcslen.def wcsncasecmp.def wcsncat.def \
+wcsncmp.def wcsncpy.def wcsnlen.def wcspbrk.def \
+wcsrchr.def wcsspn.def wcsstr.def wcstok.def \
+wcswidth.def wcsxfrm.def wcwidth.def wmemchr.def \
+wmemcmp.def wmemcpy.def wmemmove.def wmemset.def \
+memmem.def
+
+SUFFIXES = .def
+CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str
+TARGETDOC = ../tmp.texi
+CLEANFILES = $(CHEWOUT_FILES) *.ref
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .def .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus string/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --cygnus string/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES)
+ -rm -f lib.a
+ $(lib_a_AR) lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD)
+ $(RANLIB) lib.a
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libstring.la: $(libstring_la_OBJECTS) $(libstring_la_DEPENDENCIES)
+ $(libstring_la_LINK) $(am_libstring_la_rpath) $(libstring_la_OBJECTS) $(libstring_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+.c.o:
+ $(COMPILE) -c $<
+
+.c.obj:
+ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ $(LTCOMPILE) -c -o $@ $<
+
+lib_a-bcopy.o: bcopy.c
+ $(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
+
+lib_a-bcopy.obj: bcopy.c
+ $(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`
+
+lib_a-bzero.o: bzero.c
+ $(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
+
+lib_a-bzero.obj: bzero.c
+ $(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`
+
+lib_a-index.o: index.c
+ $(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
+
+lib_a-index.obj: index.c
+ $(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`
+
+lib_a-memchr.o: memchr.c
+ $(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
+
+lib_a-memchr.obj: memchr.c
+ $(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`
+
+lib_a-memcmp.o: memcmp.c
+ $(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
+
+lib_a-memcmp.obj: memcmp.c
+ $(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`
+
+lib_a-memcpy.o: memcpy.c
+ $(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
+
+lib_a-memcpy.obj: memcpy.c
+ $(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`
+
+lib_a-memmove.o: memmove.c
+ $(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
+
+lib_a-memmove.obj: memmove.c
+ $(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`
+
+lib_a-memset.o: memset.c
+ $(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
+
+lib_a-memset.obj: memset.c
+ $(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`
+
+lib_a-rindex.o: rindex.c
+ $(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
+
+lib_a-rindex.obj: rindex.c
+ $(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`
+
+lib_a-strcasecmp.o: strcasecmp.c
+ $(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
+
+lib_a-strcasecmp.obj: strcasecmp.c
+ $(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`
+
+lib_a-strcat.o: strcat.c
+ $(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
+
+lib_a-strcat.obj: strcat.c
+ $(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`
+
+lib_a-strchr.o: strchr.c
+ $(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
+
+lib_a-strchr.obj: strchr.c
+ $(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`
+
+lib_a-strcmp.o: strcmp.c
+ $(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
+
+lib_a-strcmp.obj: strcmp.c
+ $(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`
+
+lib_a-strcoll.o: strcoll.c
+ $(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
+
+lib_a-strcoll.obj: strcoll.c
+ $(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`
+
+lib_a-strcpy.o: strcpy.c
+ $(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
+
+lib_a-strcpy.obj: strcpy.c
+ $(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`
+
+lib_a-strcspn.o: strcspn.c
+ $(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
+
+lib_a-strcspn.obj: strcspn.c
+ $(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`
+
+lib_a-strdup.o: strdup.c
+ $(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
+
+lib_a-strdup.obj: strdup.c
+ $(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`
+
+lib_a-strdup_r.o: strdup_r.c
+ $(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
+
+lib_a-strdup_r.obj: strdup_r.c
+ $(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`
+
+lib_a-strerror.o: strerror.c
+ $(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
+
+lib_a-strerror.obj: strerror.c
+ $(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`
+
+lib_a-strerror_r.o: strerror_r.c
+ $(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
+
+lib_a-strerror_r.obj: strerror_r.c
+ $(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`
+
+lib_a-strlcat.o: strlcat.c
+ $(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
+
+lib_a-strlcat.obj: strlcat.c
+ $(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`
+
+lib_a-strlcpy.o: strlcpy.c
+ $(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
+
+lib_a-strlcpy.obj: strlcpy.c
+ $(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`
+
+lib_a-strlen.o: strlen.c
+ $(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
+
+lib_a-strlen.obj: strlen.c
+ $(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`
+
+lib_a-strlwr.o: strlwr.c
+ $(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
+
+lib_a-strlwr.obj: strlwr.c
+ $(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`
+
+lib_a-strncasecmp.o: strncasecmp.c
+ $(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
+
+lib_a-strncasecmp.obj: strncasecmp.c
+ $(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`
+
+lib_a-strncat.o: strncat.c
+ $(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
+
+lib_a-strncat.obj: strncat.c
+ $(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`
+
+lib_a-strncmp.o: strncmp.c
+ $(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
+
+lib_a-strncmp.obj: strncmp.c
+ $(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`
+
+lib_a-strncpy.o: strncpy.c
+ $(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
+
+lib_a-strncpy.obj: strncpy.c
+ $(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`
+
+lib_a-strnlen.o: strnlen.c
+ $(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
+
+lib_a-strnlen.obj: strnlen.c
+ $(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`
+
+lib_a-strpbrk.o: strpbrk.c
+ $(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
+
+lib_a-strpbrk.obj: strpbrk.c
+ $(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`
+
+lib_a-strrchr.o: strrchr.c
+ $(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
+
+lib_a-strrchr.obj: strrchr.c
+ $(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`
+
+lib_a-strsep.o: strsep.c
+ $(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
+
+lib_a-strsep.obj: strsep.c
+ $(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`
+
+lib_a-strspn.o: strspn.c
+ $(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
+
+lib_a-strspn.obj: strspn.c
+ $(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`
+
+lib_a-strtok.o: strtok.c
+ $(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
+
+lib_a-strtok.obj: strtok.c
+ $(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`
+
+lib_a-strtok_r.o: strtok_r.c
+ $(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
+
+lib_a-strtok_r.obj: strtok_r.c
+ $(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`
+
+lib_a-strupr.o: strupr.c
+ $(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
+
+lib_a-strupr.obj: strupr.c
+ $(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`
+
+lib_a-strxfrm.o: strxfrm.c
+ $(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
+
+lib_a-strxfrm.obj: strxfrm.c
+ $(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`
+
+lib_a-strstr.o: strstr.c
+ $(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
+
+lib_a-strstr.obj: strstr.c
+ $(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`
+
+lib_a-swab.o: swab.c
+ $(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
+
+lib_a-swab.obj: swab.c
+ $(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`
+
+lib_a-u_strerr.o: u_strerr.c
+ $(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
+
+lib_a-u_strerr.obj: u_strerr.c
+ $(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`
+
+lib_a-wcscat.o: wcscat.c
+ $(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
+
+lib_a-wcscat.obj: wcscat.c
+ $(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`
+
+lib_a-wcschr.o: wcschr.c
+ $(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
+
+lib_a-wcschr.obj: wcschr.c
+ $(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`
+
+lib_a-wcscmp.o: wcscmp.c
+ $(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
+
+lib_a-wcscmp.obj: wcscmp.c
+ $(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`
+
+lib_a-wcscoll.o: wcscoll.c
+ $(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
+
+lib_a-wcscoll.obj: wcscoll.c
+ $(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`
+
+lib_a-wcscpy.o: wcscpy.c
+ $(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
+
+lib_a-wcscpy.obj: wcscpy.c
+ $(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`
+
+lib_a-wcscspn.o: wcscspn.c
+ $(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
+
+lib_a-wcscspn.obj: wcscspn.c
+ $(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`
+
+lib_a-wcslcat.o: wcslcat.c
+ $(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
+
+lib_a-wcslcat.obj: wcslcat.c
+ $(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`
+
+lib_a-wcslcpy.o: wcslcpy.c
+ $(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
+
+lib_a-wcslcpy.obj: wcslcpy.c
+ $(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`
+
+lib_a-wcslen.o: wcslen.c
+ $(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
+
+lib_a-wcslen.obj: wcslen.c
+ $(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`
+
+lib_a-wcsncat.o: wcsncat.c
+ $(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
+
+lib_a-wcsncat.obj: wcsncat.c
+ $(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`
+
+lib_a-wcsncmp.o: wcsncmp.c
+ $(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
+
+lib_a-wcsncmp.obj: wcsncmp.c
+ $(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`
+
+lib_a-wcsncpy.o: wcsncpy.c
+ $(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
+
+lib_a-wcsncpy.obj: wcsncpy.c
+ $(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`
+
+lib_a-wcsnlen.o: wcsnlen.c
+ $(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
+
+lib_a-wcsnlen.obj: wcsnlen.c
+ $(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`
+
+lib_a-wcspbrk.o: wcspbrk.c
+ $(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
+
+lib_a-wcspbrk.obj: wcspbrk.c
+ $(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`
+
+lib_a-wcsrchr.o: wcsrchr.c
+ $(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
+
+lib_a-wcsrchr.obj: wcsrchr.c
+ $(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`
+
+lib_a-wcsspn.o: wcsspn.c
+ $(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
+
+lib_a-wcsspn.obj: wcsspn.c
+ $(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`
+
+lib_a-wcsstr.o: wcsstr.c
+ $(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
+
+lib_a-wcsstr.obj: wcsstr.c
+ $(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`
+
+lib_a-wcstok.o: wcstok.c
+ $(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
+
+lib_a-wcstok.obj: wcstok.c
+ $(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`
+
+lib_a-wcswidth.o: wcswidth.c
+ $(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
+
+lib_a-wcswidth.obj: wcswidth.c
+ $(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`
+
+lib_a-wcsxfrm.o: wcsxfrm.c
+ $(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
+
+lib_a-wcsxfrm.obj: wcsxfrm.c
+ $(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`
+
+lib_a-wcwidth.o: wcwidth.c
+ $(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
+
+lib_a-wcwidth.obj: wcwidth.c
+ $(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`
+
+lib_a-wmemchr.o: wmemchr.c
+ $(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
+
+lib_a-wmemchr.obj: wmemchr.c
+ $(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`
+
+lib_a-wmemcmp.o: wmemcmp.c
+ $(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
+
+lib_a-wmemcmp.obj: wmemcmp.c
+ $(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`
+
+lib_a-wmemcpy.o: wmemcpy.c
+ $(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
+
+lib_a-wmemcpy.obj: wmemcpy.c
+ $(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`
+
+lib_a-wmemmove.o: wmemmove.c
+ $(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
+
+lib_a-wmemmove.obj: wmemmove.c
+ $(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`
+
+lib_a-wmemset.o: wmemset.c
+ $(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
+
+lib_a-wmemset.obj: wmemset.c
+ $(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`
+
+lib_a-bcmp.o: bcmp.c
+ $(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
+
+lib_a-bcmp.obj: bcmp.c
+ $(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`
+
+lib_a-memccpy.o: memccpy.c
+ $(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
+
+lib_a-memccpy.obj: memccpy.c
+ $(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`
+
+lib_a-mempcpy.o: mempcpy.c
+ $(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
+
+lib_a-mempcpy.obj: mempcpy.c
+ $(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`
+
+lib_a-stpcpy.o: stpcpy.c
+ $(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
+
+lib_a-stpcpy.obj: stpcpy.c
+ $(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`
+
+lib_a-stpncpy.o: stpncpy.c
+ $(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
+
+lib_a-stpncpy.obj: stpncpy.c
+ $(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`
+
+lib_a-strndup.o: strndup.c
+ $(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
+
+lib_a-strndup.obj: strndup.c
+ $(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`
+
+lib_a-strcasestr.o: strcasestr.c
+ $(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
+
+lib_a-strcasestr.obj: strcasestr.c
+ $(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`
+
+lib_a-strndup_r.o: strndup_r.c
+ $(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
+
+lib_a-strndup_r.obj: strndup_r.c
+ $(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`
+
+lib_a-wcpcpy.o: wcpcpy.c
+ $(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
+
+lib_a-wcpcpy.obj: wcpcpy.c
+ $(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`
+
+lib_a-wcpncpy.o: wcpncpy.c
+ $(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
+
+lib_a-wcpncpy.obj: wcpncpy.c
+ $(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`
+
+lib_a-wcsdup.o: wcsdup.c
+ $(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
+
+lib_a-wcsdup.obj: wcsdup.c
+ $(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`
+
+lib_a-memmem.o: memmem.c
+ $(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
+
+lib_a-memmem.obj: memmem.c
+ $(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`
+
+lib_a-wcscasecmp.o: wcscasecmp.c
+ $(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
+
+lib_a-wcscasecmp.obj: wcscasecmp.c
+ $(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`
+
+lib_a-wcsncasecmp.o: wcsncasecmp.c
+ $(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
+
+lib_a-wcsncasecmp.obj: wcsncasecmp.c
+ $(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`
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+check-am:
+check: check-am
+all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(DATA)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
+ clean-noinstLTLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLIBRARIES clean-noinstLTLIBRARIES \
+ ctags distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags dvi dvi-am html html-am info \
+ info-am install install-am install-data install-data-am \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+ uninstall-am
+
+objectlist.awk.in: $(noinst_LTLIBRARIES)
+ -rm -f objectlist.awk.in
+ for i in `ls *.lo` ; \
+ do \
+ echo $$i `pwd`/$$i >> objectlist.awk.in ; \
+ done
+
+.c.def:
+ $(CHEW) < $< > $*.def 2> $*.ref
+ touch stmp-def
+
+doc: $(CHEWOUT_FILES)
+ cat $(srcdir)/strings.tex >> $(TARGETDOC)
+ cat $(srcdir)/wcstrings.tex >> $(TARGETDOC)
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: wmemchr.c
===================================================================
--- wmemchr.c (nonexistent)
+++ wmemchr.c (revision 520)
@@ -0,0 +1,89 @@
+/*
+FUNCTION
+ <>---find a wide character in memory
+
+
+ANSI_SYNOPSIS
+ #include
+ wchar_t *wmemchr(const wchar_t *<[s]>, wchar_t <[c]>, size_t <[n]>);
+
+TRAD_SYNOPSIS
+ wchar_t *wmemchr(<[s]>, <[c]>, <[n]>
+ const wchar_t *<[s]>;
+ wchar_t <[c]>;
+ size_t <[n]>;
+
+DESCRIPTION
+ The <> function locates the first occurrence of <[c]> in the
+ initial <[n]> wide characters of the object pointed to be <[s]>. This
+ function is not affected by locale and all wchar_t values are treated
+ identically. The null wide character and wchar_t values not
+ corresponding to valid characters are not treated specially.
+
+ If <[n]> is zero, <[s]> must be a valid pointer and the function
+ behaves as if no valid occurrence of <[c]> is found.
+
+RETURNS
+ The <> function returns a pointer to the located
+ wide character, or a null pointer if the wide character does not occur
+ in the object.
+
+PORTABILITY
+<> is ISO/IEC 9899/AMD1:1995 (ISO C).
+
+No supporting OS subroutines are required.
+*/
+
+/* $NetBSD: wmemchr.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */
+
+/*-
+ * Copyright (c)1999 Citrus Project,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * citrus Id: wmemchr.c,v 1.2 2000/12/20 14:08:31 itojun Exp
+ */
+
+
+#include <_ansi.h>
+#include
+
+wchar_t *
+_DEFUN (wmemchr, (s, c, n),
+ _CONST wchar_t * s _AND
+ wchar_t c _AND
+ size_t n)
+{
+ size_t i;
+
+ for (i = 0; i < n; i++)
+ {
+ if (*s == c)
+ {
+ /* LINTED const castaway */
+ return (wchar_t *) s;
+ }
+ s++;
+ }
+ return NULL;
+}
wmemchr.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strcasecmp.c
===================================================================
--- strcasecmp.c (nonexistent)
+++ strcasecmp.c (revision 520)
@@ -0,0 +1,60 @@
+/*
+FUNCTION
+ <>---case-insensitive character string compare
+
+INDEX
+ strcasecmp
+
+ANSI_SYNOPSIS
+ #include
+ int strcasecmp(const char *<[a]>, const char *<[b]>);
+
+TRAD_SYNOPSIS
+ #include
+ int strcasecmp(<[a]>, <[b]>)
+ char *<[a]>;
+ char *<[b]>;
+
+DESCRIPTION
+ <> compares the string at <[a]> to
+ the string at <[b]> in a case-insensitive manner.
+
+RETURNS
+
+ If <<*<[a]>>> sorts lexicographically after <<*<[b]>>> (after
+ both are converted to lowercase), <> returns a
+ number greater than zero. If the two strings match,
+ <> returns zero. If <<*<[a]>>> sorts
+ lexicographically before <<*<[b]>>>, <> returns a
+ number less than zero.
+
+PORTABILITY
+<> is in the Berkeley Software Distribution.
+
+<> requires no supporting OS subroutines. It uses
+tolower() from elsewhere in this library.
+
+QUICKREF
+ strcasecmp
+*/
+
+#include
+#include
+
+int
+_DEFUN (strcasecmp, (s1, s2),
+ _CONST char *s1 _AND
+ _CONST char *s2)
+{
+ _CONST unsigned char *ucs1 = (_CONST unsigned char *) s1;
+ _CONST unsigned char *ucs2 = (_CONST unsigned char *) s2;
+ int d = 0;
+ for ( ; ; )
+ {
+ _CONST int c1 = tolower(*ucs1++);
+ _CONST int c2 = tolower(*ucs2++);
+ if (((d = c1 - c2) != 0) || (c2 == '\0'))
+ break;
+ }
+ return d;
+}
strcasecmp.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memmove.c
===================================================================
--- memmove.c (nonexistent)
+++ memmove.c (revision 520)
@@ -0,0 +1,143 @@
+/*
+FUNCTION
+ <>---move possibly overlapping memory
+
+INDEX
+ memmove
+
+ANSI_SYNOPSIS
+ #include
+ void *memmove(void *<[dst]>, const void *<[src]>, size_t <[length]>);
+
+TRAD_SYNOPSIS
+ #include
+ void *memmove(<[dst]>, <[src]>, <[length]>)
+ void *<[dst]>;
+ void *<[src]>;
+ size_t <[length]>;
+
+DESCRIPTION
+ This function moves <[length]> characters from the block of
+ memory starting at <<*<[src]>>> to the memory starting at
+ <<*<[dst]>>>. <> reproduces the characters correctly
+ at <<*<[dst]>>> even if the two areas overlap.
+
+
+RETURNS
+ The function returns <[dst]> as passed.
+
+PORTABILITY
+<> is ANSI C.
+
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ memmove ansi pure
+*/
+
+#include
+#include <_ansi.h>
+#include
+#include
+
+/* Nonzero if either X or Y is not aligned on a "long" boundary. */
+#define UNALIGNED(X, Y) \
+ (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
+
+/* How many bytes are copied each iteration of the 4X unrolled loop. */
+#define BIGBLOCKSIZE (sizeof (long) << 2)
+
+/* How many bytes are copied each iteration of the word copy loop. */
+#define LITTLEBLOCKSIZE (sizeof (long))
+
+/* Threshhold for punting to the byte copier. */
+#define TOO_SMALL(LEN) ((LEN) < BIGBLOCKSIZE)
+
+/*SUPPRESS 20*/
+_PTR
+_DEFUN (memmove, (dst_void, src_void, length),
+ _PTR dst_void _AND
+ _CONST _PTR src_void _AND
+ size_t length)
+{
+#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
+ char *dst = dst_void;
+ _CONST char *src = src_void;
+
+ if (src < dst && dst < src + length)
+ {
+ /* Have to copy backwards */
+ src += length;
+ dst += length;
+ while (length--)
+ {
+ *--dst = *--src;
+ }
+ }
+ else
+ {
+ while (length--)
+ {
+ *dst++ = *src++;
+ }
+ }
+
+ return dst_void;
+#else
+ char *dst = dst_void;
+ _CONST char *src = src_void;
+ long *aligned_dst;
+ _CONST long *aligned_src;
+ int len = length;
+
+ if (src < dst && dst < src + len)
+ {
+ /* Destructive overlap...have to copy backwards */
+ src += len;
+ dst += len;
+ while (len--)
+ {
+ *--dst = *--src;
+ }
+ }
+ else
+ {
+ /* Use optimizing algorithm for a non-destructive copy to closely
+ match memcpy. If the size is small or either SRC or DST is unaligned,
+ then punt into the byte copy loop. This should be rare. */
+ if (!TOO_SMALL(len) && !UNALIGNED (src, dst))
+ {
+ aligned_dst = (long*)dst;
+ aligned_src = (long*)src;
+
+ /* Copy 4X long words at a time if possible. */
+ while (len >= BIGBLOCKSIZE)
+ {
+ *aligned_dst++ = *aligned_src++;
+ *aligned_dst++ = *aligned_src++;
+ *aligned_dst++ = *aligned_src++;
+ *aligned_dst++ = *aligned_src++;
+ len -= BIGBLOCKSIZE;
+ }
+
+ /* Copy one long word at a time if possible. */
+ while (len >= LITTLEBLOCKSIZE)
+ {
+ *aligned_dst++ = *aligned_src++;
+ len -= LITTLEBLOCKSIZE;
+ }
+
+ /* Pick up any residual with a byte copier. */
+ dst = (char*)aligned_dst;
+ src = (char*)aligned_src;
+ }
+
+ while (len--)
+ {
+ *dst++ = *src++;
+ }
+ }
+
+ return dst_void;
+#endif /* not PREFER_SIZE_OVER_SPEED */
+}
memmove.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: u_strerr.c
===================================================================
--- u_strerr.c (nonexistent)
+++ u_strerr.c (revision 520)
@@ -0,0 +1,8 @@
+#include <_ansi.h>
+
+char *
+_DEFUN(_user_strerror, (errnum),
+ int errnum)
+{
+ return 0;
+}
u_strerr.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wcpcpy.c
===================================================================
--- wcpcpy.c (nonexistent)
+++ wcpcpy.c (revision 520)
@@ -0,0 +1,41 @@
+/*
+FUNCTION
+ <>---copy a wide-character string returning a pointer to its end
+
+ANSI_SYNOPSIS
+ #include
+ wchar_t *wcpcpy(wchar_t *<[s1]>, const wchar_t *,<[s2]>);
+
+TRAD_SYNOPSIS
+ wchar_t *wcpcpy(<[s1]>, <[s2]>
+ wchar_t *<[s1]>;
+ const wchar_t *<[s2]>;
+
+DESCRIPTION
+ The <> function copies the wide-character string pointed to by
+ <[s2]> (including the terminating null wide-character code) into the
+ array pointed to by <[s1]>. If copying takes place between objects that
+ overlap, the behaviour is undefined.
+
+RETURNS
+ This function returns a pointer to the end of the destination string,
+ thus pointing to the trailing '\0'.
+
+PORTABILITY
+<> is a GNU extension.
+
+No supporting OS subroutines are required.
+*/
+
+#include <_ansi.h>
+#include
+
+wchar_t *
+_DEFUN (wcpcpy, (s1, s2),
+ wchar_t * s1 _AND
+ _CONST wchar_t * s2)
+{
+ while ((*s1++ = *s2++))
+ ;
+ return --s1;
+}
wcpcpy.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wcsdup.c
===================================================================
--- wcsdup.c (nonexistent)
+++ wcsdup.c (revision 520)
@@ -0,0 +1,62 @@
+/*
+FUNCTION
+ <>---wide character string duplicate
+
+INDEX
+ wcsdup
+INDEX
+ _wcsdup_r
+
+ANSI_SYNOPSIS
+ #include
+ wchar_t *wcsdup(const wchar_t *<[str]>);
+
+ #include
+ wchar_t *_wcsdup_r(struct _reent *<[ptr]>, const wchar_t *<[str]>);
+
+TRAD_SYNOPSIS
+ #include
+ wchar_t *wcsdup(<[ptr]>, <[str]>)
+ struct _reent *<[ptr]>;
+ wchar_t *<[str]>;
+
+DESCRIPTION
+ <> allocates a new wide character string using <>,
+ and copies the content of the argument <[str]> into the newly
+ allocated string, thus making a copy of <[str]>.
+
+RETURNS
+ <> returns a pointer to the copy of <[str]> if enough
+ memory for the copy was available. Otherwise it returns NULL
+ and errno is set to ENOMEM.
+
+PORTABILITY
+POSIX-1.2008
+
+QUICKREF
+ wcsdup
+*/
+
+#include
+#include
+#include
+
+wchar_t *
+_wcsdup_r (struct _reent *p, const wchar_t *str)
+{
+ size_t len = wcslen (str) + 1;
+ wchar_t *copy = _malloc_r (p, len * sizeof (wchar_t));
+ if (copy)
+ wmemcpy (copy, str, len);
+ return copy;
+}
+
+#ifndef _REENT_ONLY
+
+wchar_t *
+wcsdup (const wchar_t *str)
+{
+ return _wcsdup_r (_REENT, str);
+}
+
+#endif /* !_REENT_ONLY */
wcsdup.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wcscoll.c
===================================================================
--- wcscoll.c (nonexistent)
+++ wcscoll.c (revision 520)
@@ -0,0 +1,48 @@
+/*
+FUNCTION
+ <>---locale-specific wide-character string compare
+
+INDEX
+ wcscoll
+
+ANSI_SYNOPSIS
+ #include
+ int wcscoll(const wchar_t *<[stra]>, const wchar_t * <[strb]>);
+
+TRAD_SYNOPSIS
+ #include
+ int wcscoll(<[stra]>, <[strb]>)
+ wchar_t *<[stra]>;
+ wchar_t *<[strb]>;
+
+DESCRIPTION
+ <> compares the wide-character string pointed to by
+ <[stra]> to the wide-character string pointed to by <[strb]>,
+ using an interpretation appropriate to the current <>
+ state.
+
+ The current implementation of <> simply uses <>
+ and does not support any language-specific sorting.
+
+RETURNS
+ If the first string is greater than the second string,
+ <> returns a number greater than zero. If the two
+ strings are equivalent, <> returns zero. If the first
+ string is less than the second string, <> returns a
+ number less than zero.
+
+PORTABILITY
+<> is ISO/IEC 9899/AMD1:1995 (ISO C).
+*/
+
+#include <_ansi.h>
+#include
+
+int
+_DEFUN (wcscoll, (a, b),
+ _CONST wchar_t *a _AND
+ _CONST wchar_t *b)
+
+{
+ return wcscmp (a, b);
+}
wcscoll.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wcstok.c
===================================================================
--- wcstok.c (nonexistent)
+++ wcstok.c (revision 520)
@@ -0,0 +1,181 @@
+/*
+FUNCTION
+ <>---get next token from a string
+
+INDEX
+ wcstok
+
+
+ANSI_SYNOPSIS
+ #include
+ wchar_t *wcstok(wchar_t *<[source]>, const wchar_t *<[delimiters]>,
+ wchar_t **<[lasts]>)
+
+TRAD_SYNOPSIS
+ #include
+ wchar_t *wcstok(<[source]>, <[delimiters]>, <[lasts]>)
+ wchar_t *<[source]>;
+ wchar_t *<[delimiters]>;
+ wchar_t **<[lasts]>;
+
+DESCRIPTION
+ The <> function is the wide-character equivalent of the
+ <> function (which in turn is the same as the <>
+ function with an added argument to make it thread-safe).
+
+ The <> function is used to isolate (one at a time)
+ sequential tokens in a null-terminated wide-character string,
+ <<*<[source]>>>. A token is defined as a substring not containing
+ any wide-characters from <<*<[delimiters]>>>.
+
+ The first time that <> is called, <<*<[source]>>> should
+ be specified with the wide-character string to be searched, and
+ <<*<[lasts]>>>--but not <>, which must be non-NULL--may be
+ random; subsequent calls, wishing to obtain further tokens from
+ the same string, should pass a null pointer for <<*<[source]>>>
+ instead but must supply <<*<[lasts]>>> unchanged from the last
+ call. The separator wide-character string, <<*<[delimiters]>>>,
+ must be supplied each time and may change between calls.
+ A pointer to placeholder <<*<[lasts]>>> must be supplied by
+ the caller, and is set each time as needed to save the state
+ by <>. Every call to <> with <<*<[source]>>>
+ == <> must pass the value of <<*<[lasts]>>> as last set
+ by <>.
+
+ The <> function returns a pointer to the beginning of each
+ subsequent token in the string, after replacing the separator
+ wide-character itself with a null wide-character. When no more tokens
+ remain, a null pointer is returned.
+
+RETURNS
+ <> returns a pointer to the first wide character of a token, or
+ <> if there is no token.
+
+NOTES
+ <> is thread-safe (unlike <>, but like <>).
+ <> writes into the string being searched.
+
+PORTABILITY
+<> is C99 and POSIX.1-2001.
+
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ strtok ansi pure
+*/
+/* wcstok for Newlib created by adapting strtok_r, 2008. */
+/*
+ * Copyright (c) 1988 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include
+
+wchar_t *
+_DEFUN (wcstok, (s, delim, lasts),
+ register wchar_t *s _AND
+ register const wchar_t *delim _AND
+ wchar_t **lasts)
+{
+ register const wchar_t *spanp;
+ register int c, sc;
+ wchar_t *tok;
+
+
+ if (s == NULL && (s = *lasts) == NULL)
+ return (NULL);
+
+ /*
+ * Skip (span) leading delimiters (s += wcsspn(s, delim), sort of).
+ */
+cont:
+ c = *s++;
+ for (spanp = delim; (sc = *spanp++) != L'\0';) {
+ if (c == sc) goto cont;
+ }
+
+ if (c == L'\0') { /* no non-delimiter characters */
+ *lasts = NULL;
+ return (NULL);
+ }
+ tok = s - 1;
+
+ /*
+ * Scan token (scan for delimiters: s += wcscspn(s, delim), sort of).
+ * Note that delim must have one NUL; we stop if we see that, too.
+ */
+ for (;;) {
+ c = *s++;
+ spanp = delim;
+ do {
+ if ((sc = *spanp++) == c) {
+ if (c == L'\0')
+ s = NULL;
+ else
+ s[-1] = L'\0';
+ *lasts = s;
+ return (tok);
+ }
+ } while (sc != L'\0');
+ }
+ /* NOTREACHED */
+}
+
+/* The remainder of this file can serve as a regression test. Compile
+ * with -D_REGRESSION_TEST. */
+#if defined(_REGRESSION_TEST) /* [Test code: example from C99 standard */
+#include
+#include
+
+/* example from C99 standard with minor additions to be a test */
+int
+main(void)
+{
+int errs=0;
+static wchar_t str1[] = L"?a???b,,,#c";
+static wchar_t str2[] = L"\t \t";
+wchar_t *t, *ptr1, *ptr2;
+
+t = wcstok(str1, L"?", &ptr1); // t points to the token L"a"
+if(wcscmp(t,L"a")) errs++;
+t = wcstok(NULL, L",", &ptr1); // t points to the token L"??b"
+if(wcscmp(t,L"??b")) errs++;
+t = wcstok(str2, L" \t", &ptr2); // t is a null pointer
+if(t != NULL) errs++;
+t = wcstok(NULL, L"#,", &ptr1); // t points to the token L"c"
+if(wcscmp(t,L"c")) errs++;
+t = wcstok(NULL, L"?", &ptr1); // t is a null pointer
+if(t != NULL) errs++;
+
+printf("wcstok() test ");
+if(errs) printf("FAILED %d test cases", errs);
+ else printf("passed");
+printf(".\n");
+
+return(errs);
+}
+#endif /* defined(_REGRESSION_TEST) ] */
wcstok.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memchr.c
===================================================================
--- memchr.c (nonexistent)
+++ memchr.c (revision 520)
@@ -0,0 +1,134 @@
+/*
+FUNCTION
+ <>---find character in memory
+
+INDEX
+ memchr
+
+ANSI_SYNOPSIS
+ #include
+ void *memchr(const void *<[src]>, int <[c]>, size_t <[length]>);
+
+TRAD_SYNOPSIS
+ #include
+ void *memchr(<[src]>, <[c]>, <[length]>)
+ void *<[src]>;
+ void *<[c]>;
+ size_t <[length]>;
+
+DESCRIPTION
+ This function searches memory starting at <<*<[src]>>> for the
+ character <[c]>. The search only ends with the first
+ occurrence of <[c]>, or after <[length]> characters; in
+ particular, <> does not terminate the search.
+
+RETURNS
+ If the character <[c]> is found within <[length]> characters
+ of <<*<[src]>>>, a pointer to the character is returned. If
+ <[c]> is not found, then <> is returned.
+
+PORTABILITY
+<> is ANSI C.
+
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ memchr ansi pure
+*/
+
+#include <_ansi.h>
+#include
+#include
+
+/* Nonzero if either X or Y is not aligned on a "long" boundary. */
+#define UNALIGNED(X) ((long)X & (sizeof (long) - 1))
+
+/* How many bytes are loaded each iteration of the word copy loop. */
+#define LBLOCKSIZE (sizeof (long))
+
+/* Threshhold for punting to the bytewise iterator. */
+#define TOO_SMALL(LEN) ((LEN) < LBLOCKSIZE)
+
+#if LONG_MAX == 2147483647L
+#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
+#else
+#if LONG_MAX == 9223372036854775807L
+/* Nonzero if X (a long int) contains a NULL byte. */
+#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
+#else
+#error long int is not a 32bit or 64bit type.
+#endif
+#endif
+
+#ifndef DETECTNULL
+#error long int is not a 32bit or 64bit byte
+#endif
+
+/* DETECTCHAR returns nonzero if (long)X contains the byte used
+ to fill (long)MASK. */
+#define DETECTCHAR(X,MASK) (DETECTNULL(X ^ MASK))
+
+_PTR
+_DEFUN (memchr, (src_void, c, length),
+ _CONST _PTR src_void _AND
+ int c _AND
+ size_t length)
+{
+ _CONST unsigned char *src = (_CONST unsigned char *) src_void;
+ unsigned char d = c;
+
+#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__)
+ unsigned long *asrc;
+ unsigned long mask;
+ int i;
+
+ while (UNALIGNED (src))
+ {
+ if (!length--)
+ return NULL;
+ if (*src == d)
+ return (void *) src;
+ src++;
+ }
+
+ if (!TOO_SMALL (length))
+ {
+ /* If we get this far, we know that length is large and src is
+ word-aligned. */
+ /* The fast code reads the source one word at a time and only
+ performs the bytewise search on word-sized segments if they
+ contain the search character, which is detected by XORing
+ the word-sized segment with a word-sized block of the search
+ character and then detecting for the presence of NUL in the
+ result. */
+ asrc = (unsigned long *) src;
+ mask = d << 8 | d;
+ mask = mask << 16 | mask;
+ for (i = 32; i < LBLOCKSIZE * 8; i <<= 1)
+ mask = (mask << i) | mask;
+
+ while (length >= LBLOCKSIZE)
+ {
+ if (DETECTCHAR (*asrc, mask))
+ break;
+ length -= LBLOCKSIZE;
+ asrc++;
+ }
+
+ /* If there are fewer than LBLOCKSIZE characters left,
+ then we resort to the bytewise loop. */
+
+ src = (unsigned char *) asrc;
+ }
+
+#endif /* not PREFER_SIZE_OVER_SPEED */
+
+ while (length--)
+ {
+ if (*src == d)
+ return (void *) src;
+ src++;
+ }
+
+ return NULL;
+}
memchr.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: bcopy.c
===================================================================
--- bcopy.c (nonexistent)
+++ bcopy.c (revision 520)
@@ -0,0 +1,38 @@
+/*
+FUNCTION
+ <>---copy memory regions
+
+ANSI_SYNOPSIS
+ #include
+ void bcopy(const void *<[in]>, void *<[out]>, size_t <[n]>);
+
+TRAD_SYNOPSIS
+ void bcopy(<[in]>, <[out]>, <[n]>
+ const void *<[in]>;
+ void *<[out]>;
+ size_t <[n]>;
+
+DESCRIPTION
+ This function copies <[n]> bytes from the memory region
+ pointed to by <[in]> to the memory region pointed to by
+ <[out]>.
+
+ This function is implemented in term of <>.
+
+PORTABILITY
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ bcopy - pure
+*/
+
+#include
+
+void
+_DEFUN (bcopy, (b1, b2, length),
+ _CONST void *b1 _AND
+ void *b2 _AND
+ size_t length)
+{
+ memmove (b2, b1, length);
+}
bcopy.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wcscspn.c
===================================================================
--- wcscspn.c (nonexistent)
+++ wcscspn.c (revision 520)
@@ -0,0 +1,86 @@
+/*
+FUNCTION
+ <>---get length of a complementary wide substring
+
+ANSI_SYNOPSIS
+ #include
+ size_t wcscspn(const wchar_t *<[s]>, wchar_t *<[set]>);
+
+TRAD_SYNOPSIS
+ size_t wcscspn(<[s]>, <[set]>
+ const wchar_t *<[s]>;
+ const wchar_t *<[set]>;
+
+DESCRIPTION
+ The <> function computes the length of the maximum initial
+ segment of the wide-character string pointed to by <[s]> which consists
+ entirely of wide-character codes not from the wide-character string
+ pointed to by <[set]>.
+
+RETURNS
+ The <> function returns the length of the initial substring of
+ <[s1]>; no return value is reserved to indicate an error.
+
+PORTABILITY
+<> is ISO/IEC 9899/AMD1:1995 (ISO C).
+
+No supporting OS subroutines are required.
+*/
+
+/* $NetBSD: wcscspn.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */
+
+/*-
+ * Copyright (c)1999 Citrus Project,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * citrus Id: wcscspn.c,v 1.1 1999/12/29 21:47:45 tshiozak Exp
+ */
+
+#include <_ansi.h>
+#include
+
+size_t
+_DEFUN (wcscspn, (s, set),
+ _CONST wchar_t * s _AND
+ _CONST wchar_t * set)
+{
+ _CONST wchar_t *p;
+ _CONST wchar_t *q;
+
+ p = s;
+ while (*p)
+ {
+ q = set;
+ while (*q)
+ {
+ if (*p == *q)
+ goto done;
+ q++;
+ }
+ p++;
+ }
+
+done:
+ return (p - s);
+}
wcscspn.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: bcmp.c
===================================================================
--- bcmp.c (nonexistent)
+++ bcmp.c (revision 520)
@@ -0,0 +1,48 @@
+/*
+FUNCTION
+ <>---compare two memory areas
+
+INDEX
+ bcmp
+
+ANSI_SYNOPSIS
+ #include
+ int bcmp(const void *<[s1]>, const void *<[s2]>, size_t <[n]>);
+
+TRAD_SYNOPSIS
+ #include
+ int bcmp(<[s1]>, <[s2]>, <[n]>)
+ const void *<[s1]>;
+ const void *<[s2]>;
+ size_t <[n]>;
+
+DESCRIPTION
+ This function compares not more than <[n]> bytes of the
+ object pointed to by <[s1]> with the object pointed to by <[s2]>.
+
+ This function is identical to <>.
+
+RETURNS
+ The function returns an integer greater than, equal to or
+ less than zero according to whether the object pointed to by
+ <[s1]> is greater than, equal to or less than the object
+ pointed to by <[s2]>.
+
+PORTABILITY
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ bcmp ansi pure
+*/
+
+#include
+
+int
+_DEFUN (bcmp, (m1, m2, n),
+ _CONST void *m1 _AND
+ _CONST void *m2 _AND
+ size_t n)
+
+{
+ return memcmp (m1, m2, n);
+}
bcmp.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strerror.c
===================================================================
--- strerror.c (nonexistent)
+++ strerror.c (revision 520)
@@ -0,0 +1,793 @@
+/***
+**** CAUTION!!! KEEP DOC CONSISTENT---if you change text of a message
+**** here, change two places:
+**** 1) the leading doc section (alphabetized by macro)
+**** 2) the real text inside switch(errnum)
+***/
+
+/*
+FUNCTION
+ <>---convert error number to string
+
+INDEX
+ strerror
+
+ANSI_SYNOPSIS
+ #include
+ char *strerror(int <[errnum]>);
+
+TRAD_SYNOPSIS
+ #include
+ char *strerror(<[errnum]>)
+ int <[errnum]>;
+
+DESCRIPTION
+<> converts the error number <[errnum]> into a
+string. The value of <[errnum]> is usually a copy of <>.
+If <> is not a known error number, the result points to an
+empty string.
+
+This implementation of <> prints out the following strings
+for each of the values defined in `<>':
+
+o+
+o E2BIG
+Arg list too long
+
+o EACCES
+Permission denied
+
+o EADDRINUSE
+Address already in use
+
+o EADV
+Advertise error
+
+o EAFNOSUPPORT
+Address family not supported by protocol family
+
+o EAGAIN
+No more processes
+
+o EALREADY
+Socket already connected
+
+o EBADF
+Bad file number
+
+o EBADMSG
+Bad message
+
+o EBUSY
+Device or resource busy
+
+o ECHILD
+No children
+
+o ECOMM
+Communication error
+
+o ECONNABORTED
+Software caused connection abort
+
+o ECONNREFUSED
+Connection refused
+
+o EDEADLK
+Deadlock
+
+o EDESTADDRREQ
+Destination address required
+
+o EEXIST
+File exists
+
+o EDOM
+Math argument
+
+o EFAULT
+Bad address
+
+o EFBIG
+File too large
+
+o EHOSTDOWN
+Host is down
+
+o EHOSTUNREACH
+Host is unreachable
+
+o EIDRM
+Identifier removed
+
+o EINPROGRESS
+Connection already in progress
+
+o EINTR
+Interrupted system call
+
+o EINVAL
+Invalid argument
+
+o EIO
+I/O error
+
+o EISCONN
+Socket is already connected
+
+o EISDIR
+Is a directory
+
+o ELIBACC
+Cannot access a needed shared library
+
+o ELIBBAD
+Accessing a corrupted shared library
+
+o ELIBEXEC
+Cannot exec a shared library directly
+
+o ELIBMAX
+Attempting to link in more shared libraries than system limit
+
+o ELIBSCN
+<<.lib>> section in a.out corrupted
+
+o EMFILE
+Too many open files
+
+o EMLINK
+Too many links
+
+o EMSGSIZE
+Message too long
+
+o EMULTIHOP
+Multihop attempted
+
+o ENAMETOOLONG
+File or path name too long
+
+o ENETDOWN
+Network interface not configured
+
+o ENETUNREACH
+Network is unreachable
+
+o ENFILE
+Too many open files in system
+
+o ENODEV
+No such device
+
+o ENOENT
+No such file or directory
+
+o ENOEXEC
+Exec format error
+
+o ENOLCK
+No lock
+
+o ENOLINK
+Virtual circuit is gone
+
+o ENOMEM
+Not enough space
+
+o ENOMSG
+No message of desired type
+
+o ENONET
+Machine is not on the network
+
+o ENOPKG
+No package
+
+o ENOPROTOOPT
+Protocol not available
+
+o ENOSPC
+No space left on device
+
+o ENOSR
+No stream resources
+
+o ENOSTR
+Not a stream
+
+o ENOSYS
+Function not implemented
+
+o ENOTBLK
+Block device required
+
+o ENOTCONN
+Socket is not connected
+
+o ENOTDIR
+Not a directory
+
+o ENOTEMPTY
+Directory not empty
+
+o ENOTSOCK
+Socket operation on non-socket
+
+o ENOTSUP
+Not supported
+
+o ENOTTY
+Not a character device
+
+o ENXIO
+No such device or address
+
+o EPERM
+Not owner
+
+o EPIPE
+Broken pipe
+
+o EPROTO
+Protocol error
+
+o EPROTOTYPE
+Protocol wrong type for socket
+
+o EPROTONOSUPPORT
+Unknown protocol
+
+o ERANGE
+Result too large
+
+o EREMOTE
+Resource is remote
+
+o EROFS
+Read-only file system
+
+o ESHUTDOWN
+Can't send after socket shutdown
+
+o ESOCKTNOSUPPORT
+Socket type not supported
+
+o ESPIPE
+Illegal seek
+
+o ESRCH
+No such process
+
+o ESRMNT
+Srmount error
+
+o ETIME
+Stream ioctl timeout
+
+o ETIMEDOUT
+Connection timed out
+
+o ETXTBSY
+Text file busy
+
+o EXDEV
+Cross-device link
+
+o ECANCELED
+Operation canceled
+
+o ENOTRECOVERABLE
+State not recoverable
+
+o EOWNERDEAD
+Previous owner died
+
+o ESTRPIPE
+Strings pipe error
+
+o-
+
+RETURNS
+This function returns a pointer to a string. Your application must
+not modify that string.
+
+PORTABILITY
+ANSI C requires <>, but does not specify the strings used
+for each error number.
+
+Although this implementation of <> is reentrant, ANSI C
+declares that subsequent calls to <> may overwrite the
+result string; therefore portable code cannot depend on the reentrancy
+of this subroutine.
+
+This implementation of <> provides for user-defined
+extensibility. <> defines <[__ELASTERROR]>, which can be
+used as a base for user-defined error values. If the user supplies a
+routine named <<_user_strerror>>, and <[errnum]> passed to
+<> does not match any of the supported values,
+<<_user_strerror>> is called with <[errnum]> as its argument.
+
+<<_user_strerror>> takes one argument of type <[int]>, and returns a
+character pointer. If <[errnum]> is unknown to <<_user_strerror>>,
+<<_user_strerror>> returns <[NULL]>. The default <<_user_strerror>>
+returns <[NULL]> for all input values.
+
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ strerror ansi pure
+*/
+
+#include
+#include
+
+char *
+_DEFUN (strerror, (errnum),
+ int errnum)
+{
+ char *error;
+ extern char *_user_strerror _PARAMS ((int));
+
+ switch (errnum)
+ {
+/* go32 defines EPERM as EACCES */
+#if defined (EPERM) && (!defined (EACCES) || (EPERM != EACCES))
+ case EPERM:
+ error = "Not owner";
+ break;
+#endif
+#ifdef ENOENT
+ case ENOENT:
+ error = "No such file or directory";
+ break;
+#endif
+#ifdef ESRCH
+ case ESRCH:
+ error = "No such process";
+ break;
+#endif
+#ifdef EINTR
+ case EINTR:
+ error = "Interrupted system call";
+ break;
+#endif
+#ifdef EIO
+ case EIO:
+ error = "I/O error";
+ break;
+#endif
+/* go32 defines ENXIO as ENODEV */
+#if defined (ENXIO) && (!defined (ENODEV) || (ENXIO != ENODEV))
+ case ENXIO:
+ error = "No such device or address";
+ break;
+#endif
+#ifdef E2BIG
+ case E2BIG:
+ error = "Arg list too long";
+ break;
+#endif
+#ifdef ENOEXEC
+ case ENOEXEC:
+ error = "Exec format error";
+ break;
+#endif
+#ifdef EALREADY
+ case EALREADY:
+ error = "Socket already connected";
+ break;
+#endif
+#ifdef EBADF
+ case EBADF:
+ error = "Bad file number";
+ break;
+#endif
+#ifdef ECHILD
+ case ECHILD:
+ error = "No children";
+ break;
+#endif
+#ifdef EDESTADDRREQ
+ case EDESTADDRREQ:
+ error = "Destination address required";
+ break;
+#endif
+#ifdef EAGAIN
+ case EAGAIN:
+ error = "No more processes";
+ break;
+#endif
+#ifdef ENOMEM
+ case ENOMEM:
+ error = "Not enough space";
+ break;
+#endif
+#ifdef EACCES
+ case EACCES:
+ error = "Permission denied";
+ break;
+#endif
+#ifdef EFAULT
+ case EFAULT:
+ error = "Bad address";
+ break;
+#endif
+#ifdef ENOTBLK
+ case ENOTBLK:
+ error = "Block device required";
+ break;
+#endif
+#ifdef EBUSY
+ case EBUSY:
+ error = "Device or resource busy";
+ break;
+#endif
+#ifdef EEXIST
+ case EEXIST:
+ error = "File exists";
+ break;
+#endif
+#ifdef EXDEV
+ case EXDEV:
+ error = "Cross-device link";
+ break;
+#endif
+#ifdef ENODEV
+ case ENODEV:
+ error = "No such device";
+ break;
+#endif
+#ifdef ENOTDIR
+ case ENOTDIR:
+ error = "Not a directory";
+ break;
+#endif
+#ifdef EHOSTDOWN
+ case EHOSTDOWN:
+ error = "Host is down";
+ break;
+#endif
+#ifdef EINPROGRESS
+ case EINPROGRESS:
+ error = "Connection already in progress";
+ break;
+#endif
+#ifdef EISDIR
+ case EISDIR:
+ error = "Is a directory";
+ break;
+#endif
+#ifdef EINVAL
+ case EINVAL:
+ error = "Invalid argument";
+ break;
+#endif
+#ifdef ENETDOWN
+ case ENETDOWN:
+ error = "Network interface is not configured";
+ break;
+#endif
+#ifdef ENFILE
+ case ENFILE:
+ error = "Too many open files in system";
+ break;
+#endif
+#ifdef EMFILE
+ case EMFILE:
+ error = "Too many open files";
+ break;
+#endif
+#ifdef ENOTTY
+ case ENOTTY:
+ error = "Not a character device";
+ break;
+#endif
+#ifdef ETXTBSY
+ case ETXTBSY:
+ error = "Text file busy";
+ break;
+#endif
+#ifdef EFBIG
+ case EFBIG:
+ error = "File too large";
+ break;
+#endif
+#ifdef EHOSTUNREACH
+ case EHOSTUNREACH:
+ error = "Host is unreachable";
+ break;
+#endif
+#ifdef ENOSPC
+ case ENOSPC:
+ error = "No space left on device";
+ break;
+#endif
+#ifdef ENOTSUP
+ case ENOTSUP:
+ error = "Not supported";
+ break;
+#endif
+#ifdef ESPIPE
+ case ESPIPE:
+ error = "Illegal seek";
+ break;
+#endif
+#ifdef EROFS
+ case EROFS:
+ error = "Read-only file system";
+ break;
+#endif
+#ifdef EMLINK
+ case EMLINK:
+ error = "Too many links";
+ break;
+#endif
+#ifdef EPIPE
+ case EPIPE:
+ error = "Broken pipe";
+ break;
+#endif
+#ifdef EDOM
+ case EDOM:
+ error = "Math argument";
+ break;
+#endif
+#ifdef ERANGE
+ case ERANGE:
+ error = "Result too large";
+ break;
+#endif
+#ifdef ENOMSG
+ case ENOMSG:
+ error = "No message of desired type";
+ break;
+#endif
+#ifdef EIDRM
+ case EIDRM:
+ error = "Identifier removed";
+ break;
+#endif
+#ifdef EDEADLK
+ case EDEADLK:
+ error = "Deadlock";
+ break;
+#endif
+#ifdef ENETUNREACH
+ case ENETUNREACH:
+ error = "Network is unreachable";
+ break;
+#endif
+#ifdef ENOLCK
+ case ENOLCK:
+ error = "No lock";
+ break;
+#endif
+#ifdef ENOSTR
+ case ENOSTR:
+ error = "Not a stream";
+ break;
+#endif
+#ifdef ETIME
+ case ETIME:
+ error = "Stream ioctl timeout";
+ break;
+#endif
+#ifdef ENOSR
+ case ENOSR:
+ error = "No stream resources";
+ break;
+#endif
+#ifdef ENONET
+ case ENONET:
+ error = "Machine is not on the network";
+ break;
+#endif
+#ifdef ENOPKG
+ case ENOPKG:
+ error = "No package";
+ break;
+#endif
+#ifdef EREMOTE
+ case EREMOTE:
+ error = "Resource is remote";
+ break;
+#endif
+#ifdef ENOLINK
+ case ENOLINK:
+ error = "Virtual circuit is gone";
+ break;
+#endif
+#ifdef EADV
+ case EADV:
+ error = "Advertise error";
+ break;
+#endif
+#ifdef ESRMNT
+ case ESRMNT:
+ error = "Srmount error";
+ break;
+#endif
+#ifdef ECOMM
+ case ECOMM:
+ error = "Communication error";
+ break;
+#endif
+#ifdef EPROTO
+ case EPROTO:
+ error = "Protocol error";
+ break;
+#endif
+#ifdef EPROTONOSUPPORT
+ case EPROTONOSUPPORT:
+ error = "Unknown protocol";
+ break;
+#endif
+#ifdef EMULTIHOP
+ case EMULTIHOP:
+ error = "Multihop attempted";
+ break;
+#endif
+#ifdef EBADMSG
+ case EBADMSG:
+ error = "Bad message";
+ break;
+#endif
+#ifdef ELIBACC
+ case ELIBACC:
+ error = "Cannot access a needed shared library";
+ break;
+#endif
+#ifdef ELIBBAD
+ case ELIBBAD:
+ error = "Accessing a corrupted shared library";
+ break;
+#endif
+#ifdef ELIBSCN
+ case ELIBSCN:
+ error = ".lib section in a.out corrupted";
+ break;
+#endif
+#ifdef ELIBMAX
+ case ELIBMAX:
+ error = "Attempting to link in more shared libraries than system limit";
+ break;
+#endif
+#ifdef ELIBEXEC
+ case ELIBEXEC:
+ error = "Cannot exec a shared library directly";
+ break;
+#endif
+#ifdef ENOSYS
+ case ENOSYS:
+ error = "Function not implemented";
+ break;
+#endif
+#ifdef ENMFILE
+ case ENMFILE:
+ error = "No more files";
+ break;
+#endif
+#ifdef ENOTEMPTY
+ case ENOTEMPTY:
+ error = "Directory not empty";
+ break;
+#endif
+#ifdef ENAMETOOLONG
+ case ENAMETOOLONG:
+ error = "File or path name too long";
+ break;
+#endif
+#ifdef ELOOP
+ case ELOOP:
+ error = "Too many symbolic links";
+ break;
+#endif
+#ifdef ENOBUFS
+ case ENOBUFS:
+ error = "No buffer space available";
+ break;
+#endif
+#ifdef EAFNOSUPPORT
+ case EAFNOSUPPORT:
+ error = "Address family not supported by protocol family";
+ break;
+#endif
+#ifdef EPROTOTYPE
+ case EPROTOTYPE:
+ error = "Protocol wrong type for socket";
+ break;
+#endif
+#ifdef ENOTSOCK
+ case ENOTSOCK:
+ error = "Socket operation on non-socket";
+ break;
+#endif
+#ifdef ENOPROTOOPT
+ case ENOPROTOOPT:
+ error = "Protocol not available";
+ break;
+#endif
+#ifdef ESHUTDOWN
+ case ESHUTDOWN:
+ error = "Can't send after socket shutdown";
+ break;
+#endif
+#ifdef ECONNREFUSED
+ case ECONNREFUSED:
+ error = "Connection refused";
+ break;
+#endif
+#ifdef EADDRINUSE
+ case EADDRINUSE:
+ error = "Address already in use";
+ break;
+#endif
+#ifdef ECONNABORTED
+ case ECONNABORTED:
+ error = "Software caused connection abort";
+ break;
+#endif
+#if (defined(EWOULDBLOCK) && (!defined (EAGAIN) || (EWOULDBLOCK != EAGAIN)))
+ case EWOULDBLOCK:
+ error = "Operation would block";
+ break;
+#endif
+#ifdef ENOTCONN
+ case ENOTCONN:
+ error = "Socket is not connected";
+ break;
+#endif
+#ifdef ESOCKTNOSUPPORT
+ case ESOCKTNOSUPPORT:
+ error = "Socket type not supported";
+ break;
+#endif
+#ifdef EISCONN
+ case EISCONN:
+ error = "Socket is already connected";
+ break;
+#endif
+#ifdef ECANCELED
+ case ECANCELED:
+ error = "Operation canceled";
+ break;
+#endif
+#ifdef ENOTRECOVERABLE
+ case ENOTRECOVERABLE:
+ error = "State not recoverable";
+ break;
+#endif
+#ifdef EOWNERDEAD
+ case EOWNERDEAD:
+ error = "Previous owner died";
+ break;
+#endif
+#ifdef ESTRPIPE
+ case ESTRPIPE:
+ error = "Streams pipe error";
+ break;
+#endif
+#if defined(EOPNOTSUPP) && (!defined(ENOTSUP) || (ENOTSUP != EOPNOTSUPP))
+ case EOPNOTSUPP:
+ error = "Operation not supported on socket";
+ break;
+#endif
+#ifdef EMSGSIZE
+ case EMSGSIZE:
+ error = "Message too long";
+ break;
+#endif
+#ifdef ETIMEDOUT
+ case ETIMEDOUT:
+ error = "Connection timed out";
+ break;
+#endif
+ default:
+ if ((error = _user_strerror (errnum)) == 0)
+ error = "";
+ break;
+ }
+
+ return error;
+}
strerror.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strcpy.c
===================================================================
--- strcpy.c (nonexistent)
+++ strcpy.c (revision 520)
@@ -0,0 +1,99 @@
+/*
+FUNCTION
+ <>---copy string
+
+INDEX
+ strcpy
+
+ANSI_SYNOPSIS
+ #include
+ char *strcpy(char *<[dst]>, const char *<[src]>);
+
+TRAD_SYNOPSIS
+ #include
+ char *strcpy(<[dst]>, <[src]>)
+ char *<[dst]>;
+ char *<[src]>;
+
+DESCRIPTION
+ <> copies the string pointed to by <[src]>
+ (including the terminating null character) to the array
+ pointed to by <[dst]>.
+
+RETURNS
+ This function returns the initial value of <[dst]>.
+
+PORTABILITY
+<> is ANSI C.
+
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ strcpy ansi pure
+*/
+
+#include
+#include
+
+/*SUPPRESS 560*/
+/*SUPPRESS 530*/
+
+/* Nonzero if either X or Y is not aligned on a "long" boundary. */
+#define UNALIGNED(X, Y) \
+ (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
+
+#if LONG_MAX == 2147483647L
+#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
+#else
+#if LONG_MAX == 9223372036854775807L
+/* Nonzero if X (a long int) contains a NULL byte. */
+#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
+#else
+#error long int is not a 32bit or 64bit type.
+#endif
+#endif
+
+#ifndef DETECTNULL
+#error long int is not a 32bit or 64bit byte
+#endif
+
+char*
+_DEFUN (strcpy, (dst0, src0),
+ char *dst0 _AND
+ _CONST char *src0)
+{
+#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
+ char *s = dst0;
+
+ while (*dst0++ = *src0++)
+ ;
+
+ return s;
+#else
+ char *dst = dst0;
+ _CONST char *src = src0;
+ long *aligned_dst;
+ _CONST long *aligned_src;
+
+ /* If SRC or DEST is unaligned, then copy bytes. */
+ if (!UNALIGNED (src, dst))
+ {
+ aligned_dst = (long*)dst;
+ aligned_src = (long*)src;
+
+ /* SRC and DEST are both "long int" aligned, try to do "long int"
+ sized copies. */
+ while (!DETECTNULL(*aligned_src))
+ {
+ *aligned_dst++ = *aligned_src++;
+ }
+
+ dst = (char*)aligned_dst;
+ src = (char*)aligned_src;
+ }
+
+ while ((*dst++ = *src++))
+ ;
+ return dst0;
+#endif /* not PREFER_SIZE_OVER_SPEED */
+}
strcpy.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strrchr.c
===================================================================
--- strrchr.c (nonexistent)
+++ strrchr.c (revision 520)
@@ -0,0 +1,59 @@
+/*
+FUNCTION
+ <>---reverse search for character in string
+
+INDEX
+ strrchr
+
+ANSI_SYNOPSIS
+ #include
+ char * strrchr(const char *<[string]>, int <[c]>);
+
+TRAD_SYNOPSIS
+ #include
+ char * strrchr(<[string]>, <[c]>);
+ char *<[string]>;
+ int *<[c]>;
+
+DESCRIPTION
+ This function finds the last occurence of <[c]> (converted to
+ a char) in the string pointed to by <[string]> (including the
+ terminating null character).
+
+RETURNS
+ Returns a pointer to the located character, or a null pointer
+ if <[c]> does not occur in <[string]>.
+
+PORTABILITY
+<> is ANSI C.
+
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ strrchr ansi pure
+*/
+
+#include
+
+char *
+_DEFUN (strrchr, (s, i),
+ _CONST char *s _AND
+ int i)
+{
+ _CONST char *last = NULL;
+
+ if (i)
+ {
+ while ((s=strchr(s, i)))
+ {
+ last = s;
+ s++;
+ }
+ }
+ else
+ {
+ last = strchr(s, i);
+ }
+
+ return (char *) last;
+}
strrchr.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wcschr.c
===================================================================
--- wcschr.c (nonexistent)
+++ wcschr.c (revision 520)
@@ -0,0 +1,82 @@
+/*
+FUNCTION
+ <>---wide-character string scanning operation
+
+ANSI_SYNOPSIS
+ #include
+ wchar_t *wcschr(const wchar_t *<[s]>, wchar_t <[c]>);
+
+TRAD_SYNOPSIS
+ wchar_t *wcschr(<[s]>, <[c]>
+ const wchar_t *<[s]>;
+ wchar_t <[c]>;
+
+DESCRIPTION
+ The <> function locates the first occurrence of <[c]> in the
+ wide-character string pointed to by <[s]>. The value of <[c]> must be a
+ character representable as a type wchar_t and must be a wide-character
+ code corresponding to a valid character in the current locale.
+ The terminating null wide-character string.
+
+RETURNS
+ Upon completion, <> returns a pointer to the wide-character
+ code, or a null pointer if the wide-character code is not found.
+
+PORTABILITY
+<> is ISO/IEC 9899/AMD1:1995 (ISO C).
+
+No supporting OS subroutines are required.
+*/
+
+/* $NetBSD: wcschr.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */
+
+/*-
+ * Copyright (c)1999 Citrus Project,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * citrus Id: wcschr.c,v 1.2 2000/12/21 05:07:25 itojun Exp
+ */
+
+#include <_ansi.h>
+#include
+#include
+
+wchar_t *
+_DEFUN (wcschr, (s, c),
+ _CONST wchar_t * s _AND
+ wchar_t c)
+{
+ _CONST wchar_t *p;
+
+ p = s;
+ do
+ {
+ if (*p == c)
+ {
+ /* LINTED interface specification */
+ return (wchar_t *) p;
+ }
+ } while (*p++);
+ return NULL;
+}
wcschr.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wcswidth.c
===================================================================
--- wcswidth.c (nonexistent)
+++ wcswidth.c (revision 520)
@@ -0,0 +1,73 @@
+/*
+FUNCTION
+ <>---number of column positions of a wide-character string
+
+INDEX
+ wcswidth
+
+ANSI_SYNOPSIS
+ #include
+ int wcswidth(const wchar_t *<[pwcs]>, size_t <[n]>);
+
+TRAD_SYNOPSIS
+ #include
+ int wcswidth(<[pwcs]>, <[n]>)
+ wchar_t *<[wc]>;
+ size_t <[n]>;
+
+DESCRIPTION
+ The <> function shall determine the number of column
+ positions required for <[n]> wide-character codes (or fewer than <[n]>
+ wide-character codes if a null wide-character code is encountered
+ before <[n]> wide-character codes are exhausted) in the string pointed
+ to by <[pwcs]>.
+
+RETURNS
+ The <> function either shall return 0 (if <[pwcs]> points to a
+ null wide-character code), or return the number of column positions
+ to be occupied by the wide-character string pointed to by <[pwcs]>, or
+ return -1 (if any of the first <[n]> wide-character codes in the
+ wide-character string pointed to by <[pwcs]> is not a printable
+ wide-character code).
+
+PORTABILITY
+<> has been introduced in the Single UNIX Specification Volume 2.
+<> has been marked as an extension in the Single UNIX Specification Volume 3.
+*/
+
+#include <_ansi.h>
+#include
+#include "local.h"
+
+int
+_DEFUN (wcswidth, (pwcs, n),
+ _CONST wchar_t *pwcs _AND
+ size_t n)
+
+{
+ int w, len = 0;
+ if (!pwcs || n == 0)
+ return 0;
+ do {
+ wint_t wi = *pwcs;
+
+#ifdef _MB_CAPABLE
+ wi = _jp2uc (wi);
+ /* First half of a surrogate pair? */
+ if (sizeof (wchar_t) == 2 && wi >= 0xd800 && wi <= 0xdbff)
+ {
+ wint_t wi2;
+
+ /* Extract second half and check for validity. */
+ if (--n == 0 || (wi2 = _jp2uc (*++pwcs)) < 0xdc00 || wi2 > 0xdfff)
+ return -1;
+ /* Compute actual unicode value to use in call to __wcwidth. */
+ wi = (((wi & 0x3ff) << 10) | (wi2 & 0x3ff)) + 0x10000;
+ }
+#endif /* _MB_CAPABLE */
+ if ((w = __wcwidth (wi)) < 0)
+ return -1;
+ len += w;
+ } while (*pwcs++ && --n > 0);
+ return len;
+}
wcswidth.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: local.h
===================================================================
--- local.h (nonexistent)
+++ local.h (revision 520)
@@ -0,0 +1,9 @@
+#include <_ansi.h>
+#include <../ctype/local.h>
+
+/* internal function to compute width of wide char. */
+int _EXFUN (__wcwidth, (wint_t));
+
+/* Defined in locale/locale.c. Returns a value != 0 if the current
+ language is assumed to use CJK fonts. */
+int __locale_cjk_lang ();
local.h
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strlcpy.c
===================================================================
--- strlcpy.c (nonexistent)
+++ strlcpy.c (revision 520)
@@ -0,0 +1,70 @@
+/* $OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp $ */
+
+/*
+ * Copyright (c) 1998 Todd C. Miller
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char *rcsid = "$OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include
+#include
+
+/*
+ * Copy src to string dst of size siz. At most siz-1 characters
+ * will be copied. Always NUL terminates (unless siz == 0).
+ * Returns strlen(src); if retval >= siz, truncation occurred.
+ */
+size_t
+_DEFUN (strlcpy, (dst, src, siz),
+ char *dst _AND
+ _CONST char *src _AND
+ size_t siz)
+{
+ register char *d = dst;
+ register const char *s = src;
+ register size_t n = siz;
+
+ /* Copy as many bytes as will fit */
+ if (n != 0 && --n != 0) {
+ do {
+ if ((*d++ = *s++) == 0)
+ break;
+ } while (--n != 0);
+ }
+
+ /* Not enough room in dst, add NUL and traverse rest of src */
+ if (n == 0) {
+ if (siz != 0)
+ *d = '\0'; /* NUL-terminate dst */
+ while (*s++)
+ ;
+ }
+
+ return(s - src - 1); /* count does not include NUL */
+}
+
strlcpy.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strcat.c
===================================================================
--- strcat.c (nonexistent)
+++ strcat.c (revision 520)
@@ -0,0 +1,104 @@
+/*
+FUNCTION
+ <>---concatenate strings
+
+INDEX
+ strcat
+
+ANSI_SYNOPSIS
+ #include
+ char *strcat(char *<[dst]>, const char *<[src]>);
+
+TRAD_SYNOPSIS
+ #include
+ char *strcat(<[dst]>, <[src]>)
+ char *<[dst]>;
+ char *<[src]>;
+
+DESCRIPTION
+ <> appends a copy of the string pointed to by <[src]>
+ (including the terminating null character) to the end of the
+ string pointed to by <[dst]>. The initial character of
+ <[src]> overwrites the null character at the end of <[dst]>.
+
+RETURNS
+ This function returns the initial value of <[dst]>
+
+PORTABILITY
+<> is ANSI C.
+
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ strcat ansi pure
+*/
+
+#include
+#include
+
+/* Nonzero if X is aligned on a "long" boundary. */
+#define ALIGNED(X) \
+ (((long)X & (sizeof (long) - 1)) == 0)
+
+#if LONG_MAX == 2147483647L
+#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
+#else
+#if LONG_MAX == 9223372036854775807L
+/* Nonzero if X (a long int) contains a NULL byte. */
+#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
+#else
+#error long int is not a 32bit or 64bit type.
+#endif
+#endif
+
+#ifndef DETECTNULL
+#error long int is not a 32bit or 64bit byte
+#endif
+
+
+/*SUPPRESS 560*/
+/*SUPPRESS 530*/
+
+char *
+_DEFUN (strcat, (s1, s2),
+ char *s1 _AND
+ _CONST char *s2)
+{
+#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
+ char *s = s1;
+
+ while (*s1)
+ s1++;
+
+ while (*s1++ = *s2++)
+ ;
+ return s;
+#else
+ char *s = s1;
+
+
+ /* Skip over the data in s1 as quickly as possible. */
+ if (ALIGNED (s1))
+ {
+ unsigned long *aligned_s1 = (unsigned long *)s1;
+ while (!DETECTNULL (*aligned_s1))
+ aligned_s1++;
+
+ s1 = (char *)aligned_s1;
+ }
+
+ while (*s1)
+ s1++;
+
+ /* s1 now points to the its trailing null character, we can
+ just use strcpy to do the work for us now.
+
+ ?!? We might want to just include strcpy here.
+ Also, this will cause many more unaligned string copies because
+ s1 is much less likely to be aligned. I don't know if its worth
+ tweaking strcpy to handle this better. */
+ strcpy (s1, s2);
+
+ return s;
+#endif /* not PREFER_SIZE_OVER_SPEED */
+}
strcat.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strdup_r.c
===================================================================
--- strdup_r.c (nonexistent)
+++ strdup_r.c (revision 520)
@@ -0,0 +1,17 @@
+#include
+#include
+#include
+
+char *
+_DEFUN (_strdup_r, (reent_ptr, str),
+ struct _reent *reent_ptr _AND
+ _CONST char *str)
+{
+ size_t len = strlen (str) + 1;
+ char *copy = _malloc_r (reent_ptr, len);
+ if (copy)
+ {
+ memcpy (copy, str, len);
+ }
+ return copy;
+}
strdup_r.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wcsncasecmp.c
===================================================================
--- wcsncasecmp.c (nonexistent)
+++ wcsncasecmp.c (revision 520)
@@ -0,0 +1,64 @@
+/*
+FUNCTION
+ <>---case-insensitive wide character string compare
+
+INDEX
+ wcsncasecmp
+
+ANSI_SYNOPSIS
+ #include
+ int wcsncasecmp(const wchar_t *<[a]>, const wchar_t * <[b]>, size_t <[length]>);
+
+TRAD_SYNOPSIS
+ #include
+ int wcsncasecmp(<[a]>, <[b]>, <[length]>)
+ wchar_t *<[a]>;
+ wchar_t *<[b]>;
+ size_t <[length]>
+
+DESCRIPTION
+ <> compares up to <[length]> wide characters
+ from the string at <[a]> to the string at <[b]> in a
+ case-insensitive manner.
+
+RETURNS
+
+ If <<*<[a]>>> sorts lexicographically after <<*<[b]>>> (after
+ both are converted to uppercase), <> returns a
+ number greater than zero. If the two strings are equivalent,
+ <> returns zero. If <<*<[a]>>> sorts
+ lexicographically before <<*<[b]>>>, <> returns a
+ number less than zero.
+
+PORTABILITY
+POSIX-1.2008
+
+<> requires no supporting OS subroutines. It uses
+tolower() from elsewhere in this library.
+
+QUICKREF
+ wcsncasecmp
+*/
+
+#include
+#include
+
+int
+_DEFUN (wcsncasecmp, (s1, s2, n),
+ _CONST wchar_t *s1 _AND
+ _CONST wchar_t *s2 _AND
+ size_t n)
+{
+ if (n == 0)
+ return 0;
+
+ while (n-- != 0 && towlower(*s1) == towlower(*s2))
+ {
+ if (n == 0 || *s1 == '\0' || *s2 == '\0')
+ break;
+ s1++;
+ s2++;
+ }
+
+ return towlower(*s1) - towlower(*s2);
+}
wcsncasecmp.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strlen.c
===================================================================
--- strlen.c (nonexistent)
+++ strlen.c (revision 520)
@@ -0,0 +1,88 @@
+/*
+FUNCTION
+ <>---character string length
+
+INDEX
+ strlen
+
+ANSI_SYNOPSIS
+ #include
+ size_t strlen(const char *<[str]>);
+
+TRAD_SYNOPSIS
+ #include
+ size_t strlen(<[str]>)
+ char *<[src]>;
+
+DESCRIPTION
+ The <> function works out the length of the string
+ starting at <<*<[str]>>> by counting chararacters until it
+ reaches a <> character.
+
+RETURNS
+ <> returns the character count.
+
+PORTABILITY
+<> is ANSI C.
+
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ strlen ansi pure
+*/
+
+#include <_ansi.h>
+#include
+#include
+
+#define LBLOCKSIZE (sizeof (long))
+#define UNALIGNED(X) ((long)X & (LBLOCKSIZE - 1))
+
+#if LONG_MAX == 2147483647L
+#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
+#else
+#if LONG_MAX == 9223372036854775807L
+/* Nonzero if X (a long int) contains a NULL byte. */
+#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
+#else
+#error long int is not a 32bit or 64bit type.
+#endif
+#endif
+
+#ifndef DETECTNULL
+#error long int is not a 32bit or 64bit byte
+#endif
+
+size_t
+_DEFUN (strlen, (str),
+ _CONST char *str)
+{
+ _CONST char *start = str;
+
+#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__)
+ unsigned long *aligned_addr;
+
+ /* Align the pointer, so we can search a word at a time. */
+ while (UNALIGNED (str))
+ {
+ if (!*str)
+ return str - start;
+ str++;
+ }
+
+ /* If the string is word-aligned, we can check for the presence of
+ a null in each word-sized block. */
+ aligned_addr = (unsigned long *)str;
+ while (!DETECTNULL (*aligned_addr))
+ aligned_addr++;
+
+ /* Once a null is detected, we check each byte in that block for a
+ precise position of the null. */
+ str = (char *) aligned_addr;
+
+#endif /* not PREFER_SIZE_OVER_SPEED */
+
+ while (*str)
+ str++;
+ return str - start;
+}
strlen.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strcmp.c
===================================================================
--- strcmp.c (nonexistent)
+++ strcmp.c (revision 520)
@@ -0,0 +1,106 @@
+/*
+FUNCTION
+ <>---character string compare
+
+INDEX
+ strcmp
+
+ANSI_SYNOPSIS
+ #include
+ int strcmp(const char *<[a]>, const char *<[b]>);
+
+TRAD_SYNOPSIS
+ #include
+ int strcmp(<[a]>, <[b]>)
+ char *<[a]>;
+ char *<[b]>;
+
+DESCRIPTION
+ <> compares the string at <[a]> to
+ the string at <[b]>.
+
+RETURNS
+ If <<*<[a]>>> sorts lexicographically after <<*<[b]>>>,
+ <> returns a number greater than zero. If the two
+ strings match, <> returns zero. If <<*<[a]>>>
+ sorts lexicographically before <<*<[b]>>>, <> returns a
+ number less than zero.
+
+PORTABILITY
+<> is ANSI C.
+
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ strcmp ansi pure
+*/
+
+#include
+#include
+
+/* Nonzero if either X or Y is not aligned on a "long" boundary. */
+#define UNALIGNED(X, Y) \
+ (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
+
+/* DETECTNULL returns nonzero if (long)X contains a NULL byte. */
+#if LONG_MAX == 2147483647L
+#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
+#else
+#if LONG_MAX == 9223372036854775807L
+#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
+#else
+#error long int is not a 32bit or 64bit type.
+#endif
+#endif
+
+#ifndef DETECTNULL
+#error long int is not a 32bit or 64bit byte
+#endif
+
+int
+_DEFUN (strcmp, (s1, s2),
+ _CONST char *s1 _AND
+ _CONST char *s2)
+{
+#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
+ while (*s1 != '\0' && *s1 == *s2)
+ {
+ s1++;
+ s2++;
+ }
+
+ return (*(unsigned char *) s1) - (*(unsigned char *) s2);
+#else
+ unsigned long *a1;
+ unsigned long *a2;
+
+ /* If s1 or s2 are unaligned, then compare bytes. */
+ if (!UNALIGNED (s1, s2))
+ {
+ /* If s1 and s2 are word-aligned, compare them a word at a time. */
+ a1 = (unsigned long*)s1;
+ a2 = (unsigned long*)s2;
+ while (*a1 == *a2)
+ {
+ /* To get here, *a1 == *a2, thus if we find a null in *a1,
+ then the strings must be equal, so return zero. */
+ if (DETECTNULL (*a1))
+ return 0;
+
+ a1++;
+ a2++;
+ }
+
+ /* A difference was detected in last few bytes of s1, so search bytewise */
+ s1 = (char*)a1;
+ s2 = (char*)a2;
+ }
+
+ while (*s1 != '\0' && *s1 == *s2)
+ {
+ s1++;
+ s2++;
+ }
+ return (*(unsigned char *) s1) - (*(unsigned char *) s2);
+#endif /* not PREFER_SIZE_OVER_SPEED */
+}
strcmp.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: mempcpy.c
===================================================================
--- mempcpy.c (nonexistent)
+++ mempcpy.c (revision 520)
@@ -0,0 +1,108 @@
+/*
+FUNCTION
+ <>---copy memory regions and return end pointer
+
+ANSI_SYNOPSIS
+ #include
+ void* mempcpy(void *<[out]>, const void *<[in]>, size_t <[n]>);
+
+TRAD_SYNOPSIS
+ void *mempcpy(<[out]>, <[in]>, <[n]>
+ void *<[out]>;
+ void *<[in]>;
+ size_t <[n]>;
+
+DESCRIPTION
+ This function copies <[n]> bytes from the memory region
+ pointed to by <[in]> to the memory region pointed to by
+ <[out]>.
+
+ If the regions overlap, the behavior is undefined.
+
+RETURNS
+ <> returns a pointer to the byte following the
+ last byte copied to the <[out]> region.
+
+PORTABILITY
+<> is a GNU extension.
+
+<> requires no supporting OS subroutines.
+
+ */
+
+#include <_ansi.h>
+#include
+#include
+#include
+
+/* Nonzero if either X or Y is not aligned on a "long" boundary. */
+#define UNALIGNED(X, Y) \
+ (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
+
+/* How many bytes are copied each iteration of the 4X unrolled loop. */
+#define BIGBLOCKSIZE (sizeof (long) << 2)
+
+/* How many bytes are copied each iteration of the word copy loop. */
+#define LITTLEBLOCKSIZE (sizeof (long))
+
+/* Threshhold for punting to the byte copier. */
+#define TOO_SMALL(LEN) ((LEN) < BIGBLOCKSIZE)
+
+_PTR
+_DEFUN (mempcpy, (dst0, src0, len0),
+ _PTR dst0 _AND
+ _CONST _PTR src0 _AND
+ size_t len0)
+{
+#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
+ char *dst = (char *) dst0;
+ char *src = (char *) src0;
+
+ while (len0--)
+ {
+ *dst++ = *src++;
+ }
+
+ return dst;
+#else
+ char *dst = dst0;
+ _CONST char *src = src0;
+ long *aligned_dst;
+ _CONST long *aligned_src;
+ int len = len0;
+
+ /* If the size is small, or either SRC or DST is unaligned,
+ then punt into the byte copy loop. This should be rare. */
+ if (!TOO_SMALL(len) && !UNALIGNED (src, dst))
+ {
+ aligned_dst = (long*)dst;
+ aligned_src = (long*)src;
+
+ /* Copy 4X long words at a time if possible. */
+ while (len >= BIGBLOCKSIZE)
+ {
+ *aligned_dst++ = *aligned_src++;
+ *aligned_dst++ = *aligned_src++;
+ *aligned_dst++ = *aligned_src++;
+ *aligned_dst++ = *aligned_src++;
+ len -= BIGBLOCKSIZE;
+ }
+
+ /* Copy one long word at a time if possible. */
+ while (len >= LITTLEBLOCKSIZE)
+ {
+ *aligned_dst++ = *aligned_src++;
+ len -= LITTLEBLOCKSIZE;
+ }
+
+ /* Pick up any residual with a byte copier. */
+ dst = (char*)aligned_dst;
+ src = (char*)aligned_src;
+ }
+
+ while (len--)
+ *dst++ = *src++;
+
+ return dst;
+#endif /* not PREFER_SIZE_OVER_SPEED */
+}
mempcpy.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wcspbrk.c
===================================================================
--- wcspbrk.c (nonexistent)
+++ wcspbrk.c (revision 520)
@@ -0,0 +1,88 @@
+/*
+FUNCTION
+ <>----scan wide-character string for a wide-character code
+
+ANSI_SYNOPSIS
+ #include
+ wchar_t *wcspbrk(const wchar_t *<[s]>, const wchar_t *<[set]>);
+
+TRAD_SYNOPSIS
+ wchar_t *wcspbrk(<[s]>, <[set]>
+ const wchar_t *<[s]>;
+ const wchar_t *<[set]>;
+
+DESCRIPTION
+ The <> function locates the first occurrence in the
+ wide-character string pointed to by <[s]> of any wide-character code
+ from the wide-character string pointed to by <[set]>.
+
+RETURNS
+ Upon successful completion, <> returns a pointer to the
+ wide-character code or a null pointer if no wide-character code from
+ <[set]> occurs in <[s]>.
+
+PORTABILITY
+<> is ISO/IEC 9899/AMD1:1995 (ISO C).
+
+No supporting OS subroutines are required.
+*/
+
+/* $NetBSD: wcspbrk.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */
+
+/*-
+ * Copyright (c)1999 Citrus Project,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * citrus Id: wcspbrk.c,v 1.2 2000/12/21 05:07:25 itojun Exp
+ */
+
+#include <_ansi.h>
+#include
+#include
+
+wchar_t *
+_DEFUN (wcspbrk, (s, set),
+ _CONST wchar_t * s _AND
+ _CONST wchar_t * set)
+{
+ _CONST wchar_t *p;
+ _CONST wchar_t *q;
+
+ p = s;
+ while (*p)
+ {
+ q = set;
+ while (*q)
+ {
+ if (*p == *q)
+ {
+ /* LINTED interface specification */
+ return (wchar_t *) p;
+ }
+ q++;
+ }
+ p++;
+ }
+ return NULL;
+}
wcspbrk.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strlcat.c
===================================================================
--- strlcat.c (nonexistent)
+++ strlcat.c (revision 520)
@@ -0,0 +1,74 @@
+/* $OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp $ */
+
+/*
+ * Copyright (c) 1998 Todd C. Miller
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+static char *rcsid = "$OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp $";
+#endif /* LIBC_SCCS and not lint */
+
+#include
+#include
+
+/*
+ * Appends src to string dst of size siz (unlike strncat, siz is the
+ * full size of dst, not space left). At most siz-1 characters
+ * will be copied. Always NUL terminates (unless siz <= strlen(dst)).
+ * Returns strlen(src) + MIN(siz, strlen(initial dst)).
+ * If retval >= siz, truncation occurred.
+ */
+size_t
+_DEFUN (strlcat, (dst, src, siz),
+ char *dst _AND
+ _CONST char *src _AND
+ size_t siz)
+{
+ register char *d = dst;
+ register const char *s = src;
+ register size_t n = siz;
+ size_t dlen;
+
+ /* Find the end of dst and adjust bytes left but don't go past end */
+ while (n-- != 0 && *d != '\0')
+ d++;
+ dlen = d - dst;
+ n = siz - dlen;
+
+ if (n == 0)
+ return(dlen + strlen(s));
+ while (*s != '\0') {
+ if (n != 1) {
+ *d++ = *s;
+ n--;
+ }
+ s++;
+ }
+ *d = '\0';
+
+ return(dlen + (s - src)); /* count does not include NUL */
+}
+
strlcat.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memmem.c
===================================================================
--- memmem.c (nonexistent)
+++ memmem.c (revision 520)
@@ -0,0 +1,102 @@
+/* Byte-wise substring search, using the Two-Way algorithm.
+ * Copyright (C) 2008 Eric Blake
+ * Permission to use, copy, modify, and distribute this software
+ * is freely granted, provided that this notice is preserved.
+ */
+
+/*
+FUNCTION
+ <>---find memory segment
+
+INDEX
+ memmem
+
+ANSI_SYNOPSIS
+ #include
+ char *memmem(const void *<[s1]>, size_t <[l1]>, const void *<[s2]>,
+ size_t <[l2]>);
+
+DESCRIPTION
+
+ Locates the first occurrence in the memory region pointed to
+ by <[s1]> with length <[l1]> of the sequence of bytes pointed
+ to by <[s2]> of length <[l2]>. If you already know the
+ lengths of your haystack and needle, <> can be much
+ faster than <>.
+
+RETURNS
+ Returns a pointer to the located segment, or a null pointer if
+ <[s2]> is not found. If <[l2]> is 0, <[s1]> is returned.
+
+PORTABILITY
+<> is a newlib extension.
+
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ memmem pure
+*/
+
+#include
+
+#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__)
+# define RETURN_TYPE void *
+# define AVAILABLE(h, h_l, j, n_l) ((j) <= (h_l) - (n_l))
+# include "str-two-way.h"
+#endif
+
+void *
+_DEFUN (memmem, (haystack_start, haystack_len, needle_start, needle_len),
+ const void *haystack_start _AND
+ size_t haystack_len _AND
+ const void *needle_start _AND
+ size_t needle_len)
+{
+ /* Abstract memory is considered to be an array of 'unsigned char' values,
+ not an array of 'char' values. See ISO C 99 section 6.2.6.1. */
+ const unsigned char *haystack = (const unsigned char *) haystack_start;
+ const unsigned char *needle = (const unsigned char *) needle_start;
+
+ if (needle_len == 0)
+ /* The first occurrence of the empty string is deemed to occur at
+ the beginning of the string. */
+ return (void *) haystack;
+
+#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
+
+ /* Less code size, but quadratic performance in the worst case. */
+ while (needle_len <= haystack_len)
+ {
+ if (!memcmp (haystack, needle, needle_len))
+ return (void *) haystack;
+ haystack++;
+ haystack_len--;
+ }
+ return NULL;
+
+#else /* compilation for speed */
+
+ /* Larger code size, but guaranteed linear performance. */
+
+ /* Sanity check, otherwise the loop might search through the whole
+ memory. */
+ if (haystack_len < needle_len)
+ return NULL;
+
+ /* Use optimizations in memchr when possible, to reduce the search
+ size of haystack using a linear algorithm with a smaller
+ coefficient. However, avoid memchr for long needles, since we
+ can often achieve sublinear performance. */
+ if (needle_len < LONG_NEEDLE_THRESHOLD)
+ {
+ haystack = memchr (haystack, *needle, haystack_len);
+ if (!haystack || needle_len == 1)
+ return (void *) haystack;
+ haystack_len -= haystack - (const unsigned char *) haystack_start;
+ if (haystack_len < needle_len)
+ return NULL;
+ return two_way_short_needle (haystack, haystack_len, needle, needle_len);
+ }
+ return two_way_long_needle (haystack, haystack_len, needle, needle_len);
+#endif /* compilation for speed */
+}
memmem.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wcsspn.c
===================================================================
--- wcsspn.c (nonexistent)
+++ wcsspn.c (revision 520)
@@ -0,0 +1,88 @@
+/*
+FUNCTION
+ <>---get length of a wide substring
+
+ANSI_SYNOPSIS
+ #include
+ size_t wcsspn(const wchar_t *<[s]>, const wchar_t *<[set]>);
+
+TRAD_SYNOPSIS
+ size_t wcsspn(<[s]>, <[set]>
+ const wchar_t *<[s]>;
+ const wchar_t *<[set]>;
+
+DESCRIPTION
+ The <> function computes the length of the maximum initial
+ segment of the wide-character string pointed to by <[s]> which consists
+ entirely of wide-character codes from the wide-character string
+ pointed to by <[set]>.
+
+RETURNS
+ The wcsspn() function returns the length <[s1]>; no return value is
+ reserved to indicate an error.
+
+PORTABILITY
+<> is ISO/IEC 9899/AMD1:1995 (ISO C).
+
+No supporting OS subroutines are required.
+*/
+
+/* $NetBSD: wcsspn.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */
+
+/*-
+ * Copyright (c)1999 Citrus Project,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * citrus Id: wcsspn.c,v 1.1 1999/12/29 21:47:45 tshiozak Exp
+ */
+
+#include <_ansi.h>
+#include
+
+size_t
+_DEFUN (wcsspn, (s, set),
+ _CONST wchar_t * s _AND
+ _CONST wchar_t * set)
+{
+ _CONST wchar_t *p;
+ _CONST wchar_t *q;
+
+ p = s;
+ while (*p)
+ {
+ q = set;
+ while (*q)
+ {
+ if (*p == *q)
+ break;
+ q++;
+ }
+ if (!*q)
+ goto done;
+ p++;
+ }
+
+done:
+ return (p - s);
+}
wcsspn.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strsep.c
===================================================================
--- strsep.c (nonexistent)
+++ strsep.c (revision 520)
@@ -0,0 +1,19 @@
+/* BSD strsep function */
+
+/* Copyright 2002, Red Hat Inc. */
+
+/* undef STRICT_ANSI so that strsep prototype will be defined */
+#undef __STRICT_ANSI__
+#include
+#include <_ansi.h>
+#include
+
+extern char *__strtok_r (char *, const char *, char **, int);
+
+char *
+_DEFUN (strsep, (source_ptr, delim),
+ register char **source_ptr _AND
+ register const char *delim)
+{
+ return __strtok_r (*source_ptr, delim, source_ptr, 0);
+}
strsep.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strdup.c
===================================================================
--- strdup.c (nonexistent)
+++ strdup.c (revision 520)
@@ -0,0 +1,13 @@
+#ifndef _REENT_ONLY
+
+#include
+#include
+#include
+
+char *
+_DEFUN (strdup, (str), _CONST char *str)
+{
+ return _strdup_r (_REENT, str);
+}
+
+#endif /* !_REENT_ONLY */
strdup.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: bzero.c
===================================================================
--- bzero.c (nonexistent)
+++ bzero.c (revision 520)
@@ -0,0 +1,43 @@
+/*
+FUNCTION
+<>---initialize memory to zero
+
+INDEX
+ bzero
+
+ANSI_SYNOPSIS
+ #include
+ void bzero(void *<[b]>, size_t <[length]>);
+
+TRAD_SYNOPSIS
+ #include
+ void bzero(<[b]>, <[length]>)
+ void *<[b]>;
+ size_t <[length]>;
+
+DESCRIPTION
+<> initializes <[length]> bytes of memory, starting at address
+<[b]>, to zero.
+
+RETURNS
+<> does not return a result.
+
+PORTABILITY
+<> is in the Berkeley Software Distribution.
+Neither ANSI C nor the System V Interface Definition (Issue 2) require
+<>.
+
+<> requires no supporting OS subroutines.
+*/
+
+#include
+
+_VOID
+_DEFUN (bzero, (b, length),
+ void *b _AND
+ size_t length)
+{
+ char *ptr = (char *)b;
+ while (length--)
+ *ptr++ = 0;
+}
bzero.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strcoll.c
===================================================================
--- strcoll.c (nonexistent)
+++ strcoll.c (revision 520)
@@ -0,0 +1,48 @@
+/*
+FUNCTION
+ <>---locale-specific character string compare
+
+INDEX
+ strcoll
+
+ANSI_SYNOPSIS
+ #include
+ int strcoll(const char *<[stra]>, const char * <[strb]>);
+
+TRAD_SYNOPSIS
+ #include
+ int strcoll(<[stra]>, <[strb]>)
+ char *<[stra]>;
+ char *<[strb]>;
+
+DESCRIPTION
+ <> compares the string pointed to by <[stra]> to
+ the string pointed to by <[strb]>, using an interpretation
+ appropriate to the current <> state.
+
+RETURNS
+ If the first string is greater than the second string,
+ <> returns a number greater than zero. If the two
+ strings are equivalent, <> returns zero. If the first
+ string is less than the second string, <> returns a
+ number less than zero.
+
+PORTABILITY
+<> is ANSI C.
+
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ strcoll ansi pure
+*/
+
+#include
+
+int
+_DEFUN (strcoll, (a, b),
+ _CONST char *a _AND
+ _CONST char *b)
+
+{
+ return strcmp (a, b);
+}
strcoll.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wcsstr.c
===================================================================
--- wcsstr.c (nonexistent)
+++ wcsstr.c (revision 520)
@@ -0,0 +1,105 @@
+/*
+FUNCTION
+ <>---find a wide-character substring
+
+ANSI_SYNOPSIS
+ #include
+ wchar_t *wcsstr(const wchar_t *<[big]>, const wchar_t *<[little]>);
+
+TRAD_SYNOPSIS
+ wchar_t *wcsstr(<[big]>, <[little]>
+ const wchar_t *<[big]>;
+ const wchar_t *<[little]>;
+
+DESCRIPTION
+ The <> function locates the first occurrence in the
+ wide-character string pointed to by <[big]> of the sequence of
+ wide characters (excluding the terminating null wide character) in the
+ wide-character string pointed to by <[little]>.
+
+RETURNS
+ On successful completion, <> returns a pointer to the located
+ wide-character string, or a null pointer if the wide-character string
+ is not found.
+
+ If <[little]> points to a wide-character string with zero length,
+ the function returns <[big]>.
+
+PORTABILITY
+<> is ISO/IEC 9899/AMD1:1995 (ISO C).
+
+*/
+
+/* $NetBSD: wcsstr.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */
+
+/*-
+ * Copyright (c)1999 Citrus Project,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * citrus Id: wcsstr.c,v 1.2 2000/12/21 05:07:25 itojun Exp
+ */
+
+#include <_ansi.h>
+#include
+#include
+
+wchar_t *
+_DEFUN (wcsstr, (big, little),
+ _CONST wchar_t * big _AND
+ _CONST wchar_t * little)
+{
+ _CONST wchar_t *p;
+ _CONST wchar_t *q;
+ _CONST wchar_t *r;
+
+ if (!*little)
+ {
+ /* LINTED interface specification */
+ return (wchar_t *) big;
+ }
+ if (wcslen (big) < wcslen (little))
+ return NULL;
+
+ p = big;
+ q = little;
+ while (*p)
+ {
+ q = little;
+ r = p;
+ while (*q)
+ {
+ if (*r != *q)
+ break;
+ q++;
+ r++;
+ }
+ if (!*q)
+ {
+ /* LINTED interface specification */
+ return (wchar_t *) p;
+ }
+ p++;
+ }
+ return NULL;
+}
wcsstr.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wcsncpy.c
===================================================================
--- wcsncpy.c (nonexistent)
+++ wcsncpy.c (revision 520)
@@ -0,0 +1,58 @@
+/*
+FUNCTION
+ <>---copy part of a wide-character string
+
+ANSI_SYNOPSIS
+ #include
+ wchar_t *wcsncpy(wchar_t *<[s1]>, const wchar_t *<[s2]>, size_t <[n]>);
+
+TRAD_SYNOPSIS
+ wchar_t *wcsncpy(<[s1]>, <[s2]>, <[n]>
+ wchar_t *<[s1]>;
+ const wchar_t *<[s2]>;
+ size_t <[n]>;
+
+DESCRIPTION
+ The <> function copies not more than <[n]> wide-character codes
+ (wide-character codes that follow a null wide-character code are not
+ copied) from the array pointed to by <[s2]> to the array pointed to
+ by <[s1]>. If copying takes place between objects that overlap, the
+ behaviour is undefined. Note that if <[s1]> contains more than <[n]>
+ wide characters before its terminating null, the result is not
+ null-terminated.
+
+ If the array pointed to by <[s2]> is a wide-character string that is
+ shorter than <[n]> wide-character codes, null wide-character codes are
+ appended to the copy in the array pointed to by <[s1]>, until <[n]>
+ wide-character codes in all are written.
+
+RETURNS
+ The <> function returns <[s1]>; no return value is reserved to
+ indicate an error.
+
+PORTABILITY
+ISO/IEC 9899; POSIX.1.
+
+No supporting OS subroutines are required.
+*/
+
+#include <_ansi.h>
+#include
+
+wchar_t *
+_DEFUN (wcsncpy, (s1, s2, n),
+ wchar_t * s1 _AND
+ _CONST wchar_t * s2 _AND
+ size_t n)
+{
+ wchar_t *dscan=s1;
+
+ while(n > 0)
+ {
+ --n;
+ if((*dscan++ = *s2++) == L'\0') break;
+ }
+ while(n-- > 0) *dscan++ = L'\0';
+
+ return s1;
+}
wcsncpy.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strtok.c
===================================================================
--- strtok.c (nonexistent)
+++ strtok.c (revision 520)
@@ -0,0 +1,101 @@
+/*
+FUNCTION
+ <>, <>, <>---get next token from a string
+
+INDEX
+ strtok
+
+INDEX
+ strtok_r
+
+INDEX
+ strsep
+
+ANSI_SYNOPSIS
+ #include
+ char *strtok(char *<[source]>, const char *<[delimiters]>)
+ char *strtok_r(char *<[source]>, const char *<[delimiters]>,
+ char **<[lasts]>)
+ char *strsep(char **<[source_ptr]>, const char *<[delimiters]>)
+
+TRAD_SYNOPSIS
+ #include
+ char *strtok(<[source]>, <[delimiters]>)
+ char *<[source]>;
+ char *<[delimiters]>;
+
+ char *strtok_r(<[source]>, <[delimiters]>, <[lasts]>)
+ char *<[source]>;
+ char *<[delimiters]>;
+ char **<[lasts]>;
+
+ char *strsep(<[source_ptr]>, <[delimiters]>)
+ char **<[source_ptr]>;
+ char *<[delimiters]>;
+
+DESCRIPTION
+ The <> function is used to isolate sequential tokens in a
+ null-terminated string, <<*<[source]>>>. These tokens are delimited
+ in the string by at least one of the characters in <<*<[delimiters]>>>.
+ The first time that <> is called, <<*<[source]>>> should be
+ specified; subsequent calls, wishing to obtain further tokens from
+ the same string, should pass a null pointer instead. The separator
+ string, <<*<[delimiters]>>>, must be supplied each time and may
+ change between calls.
+
+ The <> function returns a pointer to the beginning of each
+ subsequent token in the string, after replacing the separator
+ character itself with a null character. When no more tokens remain,
+ a null pointer is returned.
+
+ The <> function has the same behavior as <>, except
+ a pointer to placeholder <<*<[lasts]>>> must be supplied by the caller.
+
+ The <> function is similar in behavior to <>, except
+ a pointer to the string pointer must be supplied <<<[source_ptr]>>> and
+ the function does not skip leading delimiters. When the string starts
+ with a delimiter, the delimiter is changed to the null character and
+ the empty string is returned. Like <> and <>, the
+ <<*<[source_ptr]>>> is updated to the next character following the
+ last delimiter found or NULL if the end of string is reached with
+ no more delimiters.
+
+RETURNS
+ <>, <>, and <> all return a pointer to the
+ next token, or <> if no more tokens can be found. For
+ <>, a token may be the empty string.
+
+NOTES
+ <> is unsafe for multi-threaded applications. <>
+ and <> are thread-safe and should be used instead.
+
+PORTABILITY
+<> is ANSI C.
+<> is POSIX.
+<> is a BSD extension.
+
+<>, <>, and <> require no supporting OS subroutines.
+
+QUICKREF
+ strtok ansi impure
+*/
+
+/* undef STRICT_ANSI so that strtok_r prototype will be defined */
+#undef __STRICT_ANSI__
+#include
+#include <_ansi.h>
+#include
+
+#ifndef _REENT_ONLY
+
+extern char *__strtok_r (char *, const char *, char **, int);
+
+char *
+_DEFUN (strtok, (s, delim),
+ register char *s _AND
+ register const char *delim)
+{
+ _REENT_CHECK_MISC(_REENT);
+ return __strtok_r (s, delim, &(_REENT_STRTOK_LAST(_REENT)), 1);
+}
+#endif
strtok.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wcsxfrm.c
===================================================================
--- wcsxfrm.c (nonexistent)
+++ wcsxfrm.c (revision 520)
@@ -0,0 +1,52 @@
+/*
+FUNCTION
+ <>---locale-specific wide-character string transformation
+
+INDEX
+ wcsxfrm
+
+ANSI_SYNOPSIS
+ #include
+ int wcsxfrm(wchar_t *<[stra]>, const wchar_t * <[strb]>, size_t <[n]>);
+
+TRAD_SYNOPSIS
+ #include
+ size_t wcsxfrm(<[stra]>, <[strb]>, <[n]>)
+ wchar_t *<[stra]>;
+ wchar_t *<[strb]>;
+ size_t <[n]>
+
+DESCRIPTION
+ <> transforms the wide-character string pointed to by
+ <[strb]> to the wide-character string pointed to by <[stra]>,
+ Comparing two transformed wide strings with <> should return
+ the same result as comparing the original strings with <>.
+ No more than <[n]> wide characters are transformed, including the
+ trailing null character.
+
+ If <[n]> is 0, <[stra]> may be a NULL pointer.
+
+ The current implementation of <> simply uses <>
+ and does not support any language-specific transformations.
+
+RETURNS
+ <> returns the length of the transformed wide character
+ string. if the return value is greater or equal to <[n]>, the
+ content of <[stra]> is undefined.
+
+PORTABILITY
+<> is ISO/IEC 9899/AMD1:1995 (ISO C).
+*/
+
+#include <_ansi.h>
+#include
+
+size_t
+_DEFUN (wcsxfrm, (a, b, n),
+ wchar_t *a _AND
+ _CONST wchar_t *b _AND
+ size_t n)
+
+{
+ return wcslcpy (a, b, n);
+}
wcsxfrm.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strcspn.c
===================================================================
--- strcspn.c (nonexistent)
+++ strcspn.c (revision 520)
@@ -0,0 +1,54 @@
+/*
+FUNCTION
+ <>---count characters not in string
+
+INDEX
+ strcspn
+
+ANSI_SYNOPSIS
+ size_t strcspn(const char *<[s1]>, const char *<[s2]>);
+
+TRAD_SYNOPSIS
+ size_t strcspn(<[s1]>, <[s2]>)
+ char *<[s1]>;
+ char *<[s2]>;
+
+DESCRIPTION
+ This function computes the length of the initial part of
+ the string pointed to by <[s1]> which consists entirely of
+ characters <[NOT]> from the string pointed to by <[s2]>
+ (excluding the terminating null character).
+
+RETURNS
+ <> returns the length of the substring found.
+
+PORTABILITY
+<> is ANSI C.
+
+<> requires no supporting OS subroutines.
+ */
+
+#include
+
+size_t
+_DEFUN (strcspn, (s1, s2),
+ _CONST char *s1 _AND
+ _CONST char *s2)
+{
+ _CONST char *s = s1;
+ _CONST char *c;
+
+ while (*s1)
+ {
+ for (c = s2; *c; c++)
+ {
+ if (*s1 == *c)
+ break;
+ }
+ if (*c)
+ break;
+ s1++;
+ }
+
+ return s1 - s;
+}
strcspn.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: swab.c
===================================================================
--- swab.c (nonexistent)
+++ swab.c (revision 520)
@@ -0,0 +1,44 @@
+/*
+FUNCTION
+ <>---swap adjacent bytes
+
+ANSI_SYNOPSIS
+ #include
+ void swab(const void *<[in]>, void *<[out]>, ssize_t <[n]>);
+
+TRAD_SYNOPSIS
+ void swab(<[in]>, <[out]>, <[n]>
+ void *<[in]>;
+ void *<[out]>;
+ ssize_t <[n]>;
+
+DESCRIPTION
+ This function copies <[n]> bytes from the memory region
+ pointed to by <[in]> to the memory region pointed to by
+ <[out]>, exchanging adjacent even and odd bytes.
+
+PORTABILITY
+<> requires no supporting OS subroutines.
+*/
+
+#include
+
+void
+_DEFUN (swab, (b1, b2, length),
+ _CONST void *b1 _AND
+ void *b2 _AND
+ ssize_t length)
+{
+ const char *from = b1;
+ char *to = b2;
+ ssize_t ptr;
+ for (ptr = 1; ptr < length; ptr += 2)
+ {
+ char p = from[ptr];
+ char q = from[ptr-1];
+ to[ptr-1] = p;
+ to[ptr ] = q;
+ }
+ if (ptr == length) /* I.e., if length is odd, */
+ to[ptr-1] = 0; /* then pad with a NUL. */
+}
swab.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strcasestr.c
===================================================================
--- strcasestr.c (nonexistent)
+++ strcasestr.c (revision 520)
@@ -0,0 +1,147 @@
+/*
+FUNCTION
+ <>---case-insensitive character string search
+
+INDEX
+ strcasestr
+
+ANSI_SYNOPSIS
+ #include
+ char *strcasestr(const char *<[s]>, const char *<[find]>);
+
+TRAD_SYNOPSIS
+ #include
+ int strcasecmp(<[s]>, <[find]>)
+ char *<[s]>;
+ char *<[find]>;
+
+DESCRIPTION
+ <> searchs the string <[s]> for
+ the first occurrence of the sequence <[find]>. <>
+ is identical to <> except the search is
+ case-insensitive.
+
+RETURNS
+
+ A pointer to the first case-insensitive occurrence of the sequence
+ <[find]> or <> if no match was found.
+
+PORTABILITY
+<> is in the Berkeley Software Distribution.
+
+<> requires no supporting OS subroutines. It uses
+tolower() from elsewhere in this library.
+
+QUICKREF
+ strcasestr
+*/
+
+/*-
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * The quadratic code is derived from software contributed to Berkeley by
+ * Chris Torek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+/* Linear algorithm Copyright (C) 2008 Eric Blake
+ * Permission to use, copy, modify, and distribute the linear portion of
+ * software is freely granted, provided that this notice is preserved.
+ */
+
+#include
+
+#include
+#include
+
+#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__)
+# define RETURN_TYPE char *
+# define AVAILABLE(h, h_l, j, n_l) \
+ (!memchr ((h) + (h_l), '\0', (j) + (n_l) - (h_l)) \
+ && ((h_l) = (j) + (n_l)))
+# define CANON_ELEMENT(c) tolower (c)
+# define CMP_FUNC strncasecmp
+# include "str-two-way.h"
+#endif
+
+/*
+ * Find the first occurrence of find in s, ignore case.
+ */
+char *
+strcasestr(s, find)
+ const char *s, *find;
+{
+#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
+
+ /* Less code size, but quadratic performance in the worst case. */
+ char c, sc;
+ size_t len;
+
+ if ((c = *find++) != 0) {
+ c = tolower((unsigned char)c);
+ len = strlen(find);
+ do {
+ do {
+ if ((sc = *s++) == 0)
+ return (NULL);
+ } while ((char)tolower((unsigned char)sc) != c);
+ } while (strncasecmp(s, find, len) != 0);
+ s--;
+ }
+ return ((char *)s);
+
+#else /* compilation for speed */
+
+ /* Larger code size, but guaranteed linear performance. */
+ const char *haystack = s;
+ const char *needle = find;
+ size_t needle_len; /* Length of NEEDLE. */
+ size_t haystack_len; /* Known minimum length of HAYSTACK. */
+ int ok = 1; /* True if NEEDLE is prefix of HAYSTACK. */
+
+ /* Determine length of NEEDLE, and in the process, make sure
+ HAYSTACK is at least as long (no point processing all of a long
+ NEEDLE if HAYSTACK is too short). */
+ while (*haystack && *needle)
+ ok &= (tolower ((unsigned char) *haystack++)
+ == tolower ((unsigned char) *needle++));
+ if (*needle)
+ return NULL;
+ if (ok)
+ return (char *) s;
+ needle_len = needle - find;
+ haystack = s + 1;
+ haystack_len = needle_len - 1;
+
+ /* Perform the search. */
+ if (needle_len < LONG_NEEDLE_THRESHOLD)
+ return two_way_short_needle ((const unsigned char *) haystack,
+ haystack_len,
+ (const unsigned char *) find, needle_len);
+ return two_way_long_needle ((const unsigned char *) haystack, haystack_len,
+ (const unsigned char *) find, needle_len);
+#endif /* compilation for speed */
+}
strcasestr.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wcsncat.c
===================================================================
--- wcsncat.c (nonexistent)
+++ wcsncat.c (revision 520)
@@ -0,0 +1,91 @@
+/*
+FUNCTION
+ <>---concatenate part of two wide-character strings
+
+ANSI_SYNOPSIS
+ #include
+ wchar_t *wcsncat(wchar_t *<[s1]>, const wchar_t *<[s2]>, size_t <[n]>);
+
+TRAD_SYNOPSIS
+ wchar_t *wcsncat(<[s1]>, <[s2]>, <[n]>
+ wchar_t *<[s1]>;
+ const wchar_t *<[s2]>;
+ size_t <[n]>;
+
+DESCRIPTION
+ The <> function appends not more than <[n]> wide-character
+ codes (a null wide-character code and wide-character codes that follow
+ it are not appended) from the array pointed to by <[s2]> to the end of
+ the wide-character string pointed to by <[s1]>. The initial
+ wide-character code of <[s2]> overwrites the null wide-character code
+ at the end of <[s1]>.
+ A terminating null wide-character code is always appended to the result.
+ If copying takes place between objects that overlap, the behaviour is
+ undefined.
+
+RETURNS
+ The <> function returns <[s1]>; no return value is reserved to
+ indicate an error.
+
+PORTABILITY
+<> is ISO/IEC 9899/AMD1:1995 (ISO C).
+
+No supporting OS subroutines are required.
+*/
+
+/* $NetBSD: wcsncat.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */
+
+/*-
+ * Copyright (c)1999 Citrus Project,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * citrus Id: wcsncat.c,v 1.1 1999/12/29 21:47:45 tshiozak Exp
+ */
+
+#include <_ansi.h>
+#include
+
+wchar_t *
+_DEFUN (wcsncat, (s1, s2, n),
+ wchar_t * s1 _AND
+ _CONST wchar_t * s2 _AND
+ size_t n)
+{
+ wchar_t *p;
+ wchar_t *q;
+ _CONST wchar_t *r;
+
+ p = s1;
+ while (*p)
+ p++;
+ q = p;
+ r = s2;
+ while (*r && n)
+ {
+ *q++ = *r++;
+ n--;
+ }
+ *q = '\0';
+ return s1;
+}
wcsncat.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strerror_r.c
===================================================================
--- strerror_r.c (nonexistent)
+++ strerror_r.c (revision 520)
@@ -0,0 +1,53 @@
+/*
+FUNCTION
+ <>---convert error number to string and copy to buffer
+
+INDEX
+ strerror_r
+
+ANSI_SYNOPSIS
+ #include
+ char *strerror_r(int <[errnum]>, char *<[buffer]>, size_t <[n]>);
+
+TRAD_SYNOPSIS
+ #include
+ char *strerror_r(<[errnum]>, <[buffer]>, <[n]>)
+ int <[errnum]>;
+ char *<[buffer]>;
+ size_t <[n]>;
+
+DESCRIPTION
+<> converts the error number <[errnum]> into a
+string and copies the result into the supplied <[buffer]> for
+a length up to <[n]>, including the NUL terminator. The value of
+<[errnum]> is usually a copy of <>. If <> is not a known
+error number, the result is the empty string.
+
+See <> for how strings are mapped to <>.
+
+RETURNS
+This function returns a pointer to a string. Your application must
+not modify that string.
+
+PORTABILITY
+<> is a GNU extension.
+
+<> requires no supporting OS subroutines.
+
+*/
+
+#undef __STRICT_ANSI__
+#include
+#include
+
+char *
+_DEFUN (strerror_r, (errnum, buffer, n),
+ int errnum _AND
+ char *buffer _AND
+ size_t n)
+{
+ char *error;
+ error = strerror (errnum);
+
+ return strncpy (buffer, (const char *)error, n);
+}
strerror_r.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strchr.c
===================================================================
--- strchr.c (nonexistent)
+++ strchr.c (revision 520)
@@ -0,0 +1,123 @@
+/*
+FUNCTION
+ <>---search for character in string
+
+INDEX
+ strchr
+
+ANSI_SYNOPSIS
+ #include
+ char * strchr(const char *<[string]>, int <[c]>);
+
+TRAD_SYNOPSIS
+ #include
+ char * strchr(<[string]>, <[c]>);
+ const char *<[string]>;
+ int <[c]>;
+
+DESCRIPTION
+ This function finds the first occurence of <[c]> (converted to
+ a char) in the string pointed to by <[string]> (including the
+ terminating null character).
+
+RETURNS
+ Returns a pointer to the located character, or a null pointer
+ if <[c]> does not occur in <[string]>.
+
+PORTABILITY
+<> is ANSI C.
+
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ strchr ansi pure
+*/
+
+#include
+#include
+
+/* Nonzero if X is not aligned on a "long" boundary. */
+#define UNALIGNED(X) ((long)X & (sizeof (long) - 1))
+
+/* How many bytes are loaded each iteration of the word copy loop. */
+#define LBLOCKSIZE (sizeof (long))
+
+#if LONG_MAX == 2147483647L
+#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
+#else
+#if LONG_MAX == 9223372036854775807L
+/* Nonzero if X (a long int) contains a NULL byte. */
+#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
+#else
+#error long int is not a 32bit or 64bit type.
+#endif
+#endif
+
+/* DETECTCHAR returns nonzero if (long)X contains the byte used
+ to fill (long)MASK. */
+#define DETECTCHAR(X,MASK) (DETECTNULL(X ^ MASK))
+
+char *
+_DEFUN (strchr, (s1, i),
+ _CONST char *s1 _AND
+ int i)
+{
+ _CONST unsigned char *s = (_CONST unsigned char *)s1;
+ unsigned char c = i;
+
+#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__)
+ unsigned long mask,j;
+ unsigned long *aligned_addr;
+
+ /* Special case for finding 0. */
+ if (!c)
+ {
+ while (UNALIGNED (s))
+ {
+ if (!*s)
+ return (char *) s;
+ s++;
+ }
+ /* Operate a word at a time. */
+ aligned_addr = (unsigned long *) s;
+ while (!DETECTNULL (*aligned_addr))
+ aligned_addr++;
+ /* Found the end of string. */
+ s = (const unsigned char *) aligned_addr;
+ while (*s)
+ s++;
+ return (char *) s;
+ }
+
+ /* All other bytes. Align the pointer, then search a long at a time. */
+ while (UNALIGNED (s))
+ {
+ if (!*s)
+ return NULL;
+ if (*s == c)
+ return (char *) s;
+ s++;
+ }
+
+ mask = c;
+ for (j = 8; j < LBLOCKSIZE * 8; j <<= 1)
+ mask = (mask << j) | mask;
+
+ aligned_addr = (unsigned long *) s;
+ while (!DETECTNULL (*aligned_addr) && !DETECTCHAR (*aligned_addr, mask))
+ aligned_addr++;
+
+ /* The block of bytes currently pointed to by aligned_addr
+ contains either a null or the target char, or both. We
+ catch it using the bytewise search. */
+
+ s = (unsigned char *) aligned_addr;
+
+#endif /* not PREFER_SIZE_OVER_SPEED */
+
+ while (*s && *s != c)
+ s++;
+ if (*s == c)
+ return (char *)s;
+ return NULL;
+}
strchr.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: index.c
===================================================================
--- index.c (nonexistent)
+++ index.c (revision 520)
@@ -0,0 +1,44 @@
+/*
+FUNCTION
+ <>---search for character in string
+
+INDEX
+ index
+
+ANSI_SYNOPSIS
+ #include
+ char * index(const char *<[string]>, int <[c]>);
+
+TRAD_SYNOPSIS
+ #include
+ char * index(<[string]>, <[c]>);
+ char *<[string]>;
+ int *<[c]>;
+
+DESCRIPTION
+ This function finds the first occurence of <[c]> (converted to
+ a char) in the string pointed to by <[string]> (including the
+ terminating null character).
+
+ This function is identical to <>.
+
+RETURNS
+ Returns a pointer to the located character, or a null pointer
+ if <[c]> does not occur in <[string]>.
+
+PORTABILITY
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ index - pure
+*/
+
+#include
+
+char *
+_DEFUN (index, (s, c),
+ _CONST char *s _AND
+ int c)
+{
+ return strchr (s, c);
+}
index.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wcwidth.c
===================================================================
--- wcwidth.c (nonexistent)
+++ wcwidth.c (revision 520)
@@ -0,0 +1,343 @@
+/*
+FUNCTION
+ <>---number of column positions of a wide-character code
+
+INDEX
+ wcwidth
+
+ANSI_SYNOPSIS
+ #include
+ int wcwidth(const wchar_t <[wc]>);
+
+TRAD_SYNOPSIS
+ #include
+ int wcwidth(<[wc]>)
+ wchar_t *<[wc]>;
+
+DESCRIPTION
+ The <> function shall determine the number of column
+ positions required for the wide character <[wc]>. The application
+ shall ensure that the value of <[wc]> is a character representable
+ as a wchar_t, and is a wide-character code corresponding to a
+ valid character in the current locale.
+
+RETURNS
+ The <> function shall either return 0 (if <[wc]> is a null
+ wide-character code), or return the number of column positions to
+ be occupied by the wide-character code <[wc]>, or return -1 (if <[wc]>
+ does not correspond to a printable wide-character code).
+
+PORTABILITY
+<> has been introduced in the Single UNIX Specification Volume 2.
+<> has been marked as an extension in the Single UNIX Specification Volume 3.
+*/
+
+/*
+ * This is an implementation of wcwidth() (defined in
+ * IEEE Std 1002.1-2001) for Unicode.
+ *
+ * http://www.opengroup.org/onlinepubs/007904975/functions/wcwidth.html
+ *
+ * In fixed-width output devices, Latin characters all occupy a single
+ * "cell" position of equal width, whereas ideographic CJK characters
+ * occupy two such cells. Interoperability between terminal-line
+ * applications and (teletype-style) character terminals using the
+ * UTF-8 encoding requires agreement on which character should advance
+ * the cursor by how many cell positions. No established formal
+ * standards exist at present on which Unicode character shall occupy
+ * how many cell positions on character terminals. These routines are
+ * a first attempt of defining such behavior based on simple rules
+ * applied to data provided by the Unicode Consortium.
+ *
+ * For some graphical characters, the Unicode standard explicitly
+ * defines a character-cell width via the definition of the East Asian
+ * FullWidth (F), Wide (W), Half-width (H), and Narrow (Na) classes.
+ * In all these cases, there is no ambiguity about which width a
+ * terminal shall use. For characters in the East Asian Ambiguous (A)
+ * class, the width choice depends purely on a preference of backward
+ * compatibility with either historic CJK or Western practice.
+ * Choosing single-width for these characters is easy to justify as
+ * the appropriate long-term solution, as the CJK practice of
+ * displaying these characters as double-width comes from historic
+ * implementation simplicity (8-bit encoded characters were displayed
+ * single-width and 16-bit ones double-width, even for Greek,
+ * Cyrillic, etc.) and not any typographic considerations.
+ *
+ * Much less clear is the choice of width for the Not East Asian
+ * (Neutral) class. Existing practice does not dictate a width for any
+ * of these characters. It would nevertheless make sense
+ * typographically to allocate two character cells to characters such
+ * as for instance EM SPACE or VOLUME INTEGRAL, which cannot be
+ * represented adequately with a single-width glyph. The following
+ * routines at present merely assign a single-cell width to all
+ * neutral characters, in the interest of simplicity. This is not
+ * entirely satisfactory and should be reconsidered before
+ * establishing a formal standard in this area. At the moment, the
+ * decision which Not East Asian (Neutral) characters should be
+ * represented by double-width glyphs cannot yet be answered by
+ * applying a simple rule from the Unicode database content. Setting
+ * up a proper standard for the behavior of UTF-8 character terminals
+ * will require a careful analysis not only of each Unicode character,
+ * but also of each presentation form, something the author of these
+ * routines has avoided to do so far.
+ *
+ * http://www.unicode.org/unicode/reports/tr11/
+ *
+ * Markus Kuhn -- 2007-05-26 (Unicode 5.0)
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * for any purpose and without fee is hereby granted. The author
+ * disclaims all warranties with regard to this software.
+ *
+ * Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
+ */
+
+#include <_ansi.h>
+#include
+#include "local.h"
+
+#ifdef _MB_CAPABLE
+struct interval
+{
+ int first;
+ int last;
+};
+
+/* auxiliary function for binary search in interval table */
+static int
+bisearch(wint_t ucs, const struct interval *table, int max)
+{
+ int min = 0;
+ int mid;
+
+ if (ucs < table[0].first || ucs > table[max].last)
+ return 0;
+ while (max >= min)
+ {
+ mid = (min + max) / 2;
+ if (ucs > table[mid].last)
+ min = mid + 1;
+ else if (ucs < table[mid].first)
+ max = mid - 1;
+ else
+ return 1;
+ }
+
+ return 0;
+}
+#endif /* _MB_CAPABLE */
+
+/* The following function defines the column width of an ISO 10646
+ * character as follows:
+ *
+ * - The null character (U+0000) has a column width of 0.
+ *
+ * - Other C0/C1 control characters and DEL will lead to a return
+ * value of -1.
+ *
+ * - If the current language is recognized as a language usually using
+ * CJK fonts, spacing characters in the East Asian Ambiguous (A)
+ * category as defined in Unicode Technical Report #11 have a column
+ * width of 2.
+ *
+ * - Non-spacing and enclosing combining characters (general
+ * category code Mn or Me in the Unicode database) have a
+ * column width of 0.
+ *
+ * - SOFT HYPHEN (U+00AD) has a column width of 1.
+ *
+ * - Other format characters (general category code Cf in the Unicode
+ * database) and ZERO WIDTH SPACE (U+200B) have a column width of 0.
+ *
+ * - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF)
+ * have a column width of 0.
+ *
+ * - Spacing characters in the East Asian Wide (W) or East Asian
+ * Full-width (F) category as defined in Unicode Technical
+ * Report #11 have a column width of 2.
+ *
+ * - All remaining characters (including all printable
+ * ISO 8859-1 and WGL4 characters, Unicode control characters,
+ * etc.) have a column width of 1.
+ *
+ * This implementation assumes that wint_t characters are encoded
+ * in ISO 10646.
+ */
+
+int
+_DEFUN (__wcwidth, (ucs),
+ _CONST wint_t ucs)
+{
+#ifdef _MB_CAPABLE
+ /* sorted list of non-overlapping intervals of East Asian Ambiguous
+ * characters, generated by "uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c" */
+ static const struct interval ambiguous[] = {
+ { 0x00A1, 0x00A1 }, { 0x00A4, 0x00A4 }, { 0x00A7, 0x00A8 },
+ { 0x00AA, 0x00AA }, { 0x00AE, 0x00AE }, { 0x00B0, 0x00B4 },
+ { 0x00B6, 0x00BA }, { 0x00BC, 0x00BF }, { 0x00C6, 0x00C6 },
+ { 0x00D0, 0x00D0 }, { 0x00D7, 0x00D8 }, { 0x00DE, 0x00E1 },
+ { 0x00E6, 0x00E6 }, { 0x00E8, 0x00EA }, { 0x00EC, 0x00ED },
+ { 0x00F0, 0x00F0 }, { 0x00F2, 0x00F3 }, { 0x00F7, 0x00FA },
+ { 0x00FC, 0x00FC }, { 0x00FE, 0x00FE }, { 0x0101, 0x0101 },
+ { 0x0111, 0x0111 }, { 0x0113, 0x0113 }, { 0x011B, 0x011B },
+ { 0x0126, 0x0127 }, { 0x012B, 0x012B }, { 0x0131, 0x0133 },
+ { 0x0138, 0x0138 }, { 0x013F, 0x0142 }, { 0x0144, 0x0144 },
+ { 0x0148, 0x014B }, { 0x014D, 0x014D }, { 0x0152, 0x0153 },
+ { 0x0166, 0x0167 }, { 0x016B, 0x016B }, { 0x01CE, 0x01CE },
+ { 0x01D0, 0x01D0 }, { 0x01D2, 0x01D2 }, { 0x01D4, 0x01D4 },
+ { 0x01D6, 0x01D6 }, { 0x01D8, 0x01D8 }, { 0x01DA, 0x01DA },
+ { 0x01DC, 0x01DC }, { 0x0251, 0x0251 }, { 0x0261, 0x0261 },
+ { 0x02C4, 0x02C4 }, { 0x02C7, 0x02C7 }, { 0x02C9, 0x02CB },
+ { 0x02CD, 0x02CD }, { 0x02D0, 0x02D0 }, { 0x02D8, 0x02DB },
+ { 0x02DD, 0x02DD }, { 0x02DF, 0x02DF }, { 0x0391, 0x03A1 },
+ { 0x03A3, 0x03A9 }, { 0x03B1, 0x03C1 }, { 0x03C3, 0x03C9 },
+ { 0x0401, 0x0401 }, { 0x0410, 0x044F }, { 0x0451, 0x0451 },
+ { 0x2010, 0x2010 }, { 0x2013, 0x2016 }, { 0x2018, 0x2019 },
+ { 0x201C, 0x201D }, { 0x2020, 0x2022 }, { 0x2024, 0x2027 },
+ { 0x2030, 0x2030 }, { 0x2032, 0x2033 }, { 0x2035, 0x2035 },
+ { 0x203B, 0x203B }, { 0x203E, 0x203E }, { 0x2074, 0x2074 },
+ { 0x207F, 0x207F }, { 0x2081, 0x2084 }, { 0x20AC, 0x20AC },
+ { 0x2103, 0x2103 }, { 0x2105, 0x2105 }, { 0x2109, 0x2109 },
+ { 0x2113, 0x2113 }, { 0x2116, 0x2116 }, { 0x2121, 0x2122 },
+ { 0x2126, 0x2126 }, { 0x212B, 0x212B }, { 0x2153, 0x2154 },
+ { 0x215B, 0x215E }, { 0x2160, 0x216B }, { 0x2170, 0x2179 },
+ { 0x2190, 0x2199 }, { 0x21B8, 0x21B9 }, { 0x21D2, 0x21D2 },
+ { 0x21D4, 0x21D4 }, { 0x21E7, 0x21E7 }, { 0x2200, 0x2200 },
+ { 0x2202, 0x2203 }, { 0x2207, 0x2208 }, { 0x220B, 0x220B },
+ { 0x220F, 0x220F }, { 0x2211, 0x2211 }, { 0x2215, 0x2215 },
+ { 0x221A, 0x221A }, { 0x221D, 0x2220 }, { 0x2223, 0x2223 },
+ { 0x2225, 0x2225 }, { 0x2227, 0x222C }, { 0x222E, 0x222E },
+ { 0x2234, 0x2237 }, { 0x223C, 0x223D }, { 0x2248, 0x2248 },
+ { 0x224C, 0x224C }, { 0x2252, 0x2252 }, { 0x2260, 0x2261 },
+ { 0x2264, 0x2267 }, { 0x226A, 0x226B }, { 0x226E, 0x226F },
+ { 0x2282, 0x2283 }, { 0x2286, 0x2287 }, { 0x2295, 0x2295 },
+ { 0x2299, 0x2299 }, { 0x22A5, 0x22A5 }, { 0x22BF, 0x22BF },
+ { 0x2312, 0x2312 }, { 0x2460, 0x24E9 }, { 0x24EB, 0x254B },
+ { 0x2550, 0x2573 }, { 0x2580, 0x258F }, { 0x2592, 0x2595 },
+ { 0x25A0, 0x25A1 }, { 0x25A3, 0x25A9 }, { 0x25B2, 0x25B3 },
+ { 0x25B6, 0x25B7 }, { 0x25BC, 0x25BD }, { 0x25C0, 0x25C1 },
+ { 0x25C6, 0x25C8 }, { 0x25CB, 0x25CB }, { 0x25CE, 0x25D1 },
+ { 0x25E2, 0x25E5 }, { 0x25EF, 0x25EF }, { 0x2605, 0x2606 },
+ { 0x2609, 0x2609 }, { 0x260E, 0x260F }, { 0x2614, 0x2615 },
+ { 0x261C, 0x261C }, { 0x261E, 0x261E }, { 0x2640, 0x2640 },
+ { 0x2642, 0x2642 }, { 0x2660, 0x2661 }, { 0x2663, 0x2665 },
+ { 0x2667, 0x266A }, { 0x266C, 0x266D }, { 0x266F, 0x266F },
+ { 0x273D, 0x273D }, { 0x2776, 0x277F }, { 0xE000, 0xF8FF },
+ { 0xFFFD, 0xFFFD }, { 0xF0000, 0xFFFFD }, { 0x100000, 0x10FFFD }
+ };
+ /* sorted list of non-overlapping intervals of non-spacing characters */
+ /* generated by "uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c" */
+ static const struct interval combining[] = {
+ { 0x0300, 0x036F }, { 0x0483, 0x0486 }, { 0x0488, 0x0489 },
+ { 0x0591, 0x05BD }, { 0x05BF, 0x05BF }, { 0x05C1, 0x05C2 },
+ { 0x05C4, 0x05C5 }, { 0x05C7, 0x05C7 }, { 0x0600, 0x0603 },
+ { 0x0610, 0x0615 }, { 0x064B, 0x065E }, { 0x0670, 0x0670 },
+ { 0x06D6, 0x06E4 }, { 0x06E7, 0x06E8 }, { 0x06EA, 0x06ED },
+ { 0x070F, 0x070F }, { 0x0711, 0x0711 }, { 0x0730, 0x074A },
+ { 0x07A6, 0x07B0 }, { 0x07EB, 0x07F3 }, { 0x0901, 0x0902 },
+ { 0x093C, 0x093C }, { 0x0941, 0x0948 }, { 0x094D, 0x094D },
+ { 0x0951, 0x0954 }, { 0x0962, 0x0963 }, { 0x0981, 0x0981 },
+ { 0x09BC, 0x09BC }, { 0x09C1, 0x09C4 }, { 0x09CD, 0x09CD },
+ { 0x09E2, 0x09E3 }, { 0x0A01, 0x0A02 }, { 0x0A3C, 0x0A3C },
+ { 0x0A41, 0x0A42 }, { 0x0A47, 0x0A48 }, { 0x0A4B, 0x0A4D },
+ { 0x0A70, 0x0A71 }, { 0x0A81, 0x0A82 }, { 0x0ABC, 0x0ABC },
+ { 0x0AC1, 0x0AC5 }, { 0x0AC7, 0x0AC8 }, { 0x0ACD, 0x0ACD },
+ { 0x0AE2, 0x0AE3 }, { 0x0B01, 0x0B01 }, { 0x0B3C, 0x0B3C },
+ { 0x0B3F, 0x0B3F }, { 0x0B41, 0x0B43 }, { 0x0B4D, 0x0B4D },
+ { 0x0B56, 0x0B56 }, { 0x0B82, 0x0B82 }, { 0x0BC0, 0x0BC0 },
+ { 0x0BCD, 0x0BCD }, { 0x0C3E, 0x0C40 }, { 0x0C46, 0x0C48 },
+ { 0x0C4A, 0x0C4D }, { 0x0C55, 0x0C56 }, { 0x0CBC, 0x0CBC },
+ { 0x0CBF, 0x0CBF }, { 0x0CC6, 0x0CC6 }, { 0x0CCC, 0x0CCD },
+ { 0x0CE2, 0x0CE3 }, { 0x0D41, 0x0D43 }, { 0x0D4D, 0x0D4D },
+ { 0x0DCA, 0x0DCA }, { 0x0DD2, 0x0DD4 }, { 0x0DD6, 0x0DD6 },
+ { 0x0E31, 0x0E31 }, { 0x0E34, 0x0E3A }, { 0x0E47, 0x0E4E },
+ { 0x0EB1, 0x0EB1 }, { 0x0EB4, 0x0EB9 }, { 0x0EBB, 0x0EBC },
+ { 0x0EC8, 0x0ECD }, { 0x0F18, 0x0F19 }, { 0x0F35, 0x0F35 },
+ { 0x0F37, 0x0F37 }, { 0x0F39, 0x0F39 }, { 0x0F71, 0x0F7E },
+ { 0x0F80, 0x0F84 }, { 0x0F86, 0x0F87 }, { 0x0F90, 0x0F97 },
+ { 0x0F99, 0x0FBC }, { 0x0FC6, 0x0FC6 }, { 0x102D, 0x1030 },
+ { 0x1032, 0x1032 }, { 0x1036, 0x1037 }, { 0x1039, 0x1039 },
+ { 0x1058, 0x1059 }, { 0x1160, 0x11FF }, { 0x135F, 0x135F },
+ { 0x1712, 0x1714 }, { 0x1732, 0x1734 }, { 0x1752, 0x1753 },
+ { 0x1772, 0x1773 }, { 0x17B4, 0x17B5 }, { 0x17B7, 0x17BD },
+ { 0x17C6, 0x17C6 }, { 0x17C9, 0x17D3 }, { 0x17DD, 0x17DD },
+ { 0x180B, 0x180D }, { 0x18A9, 0x18A9 }, { 0x1920, 0x1922 },
+ { 0x1927, 0x1928 }, { 0x1932, 0x1932 }, { 0x1939, 0x193B },
+ { 0x1A17, 0x1A18 }, { 0x1B00, 0x1B03 }, { 0x1B34, 0x1B34 },
+ { 0x1B36, 0x1B3A }, { 0x1B3C, 0x1B3C }, { 0x1B42, 0x1B42 },
+ { 0x1B6B, 0x1B73 }, { 0x1DC0, 0x1DCA }, { 0x1DFE, 0x1DFF },
+ { 0x200B, 0x200F }, { 0x202A, 0x202E }, { 0x2060, 0x2063 },
+ { 0x206A, 0x206F }, { 0x20D0, 0x20EF }, { 0x302A, 0x302F },
+ { 0x3099, 0x309A }, { 0xA806, 0xA806 }, { 0xA80B, 0xA80B },
+ { 0xA825, 0xA826 }, { 0xFB1E, 0xFB1E }, { 0xFE00, 0xFE0F },
+ { 0xFE20, 0xFE23 }, { 0xFEFF, 0xFEFF }, { 0xFFF9, 0xFFFB },
+ { 0x10A01, 0x10A03 }, { 0x10A05, 0x10A06 }, { 0x10A0C, 0x10A0F },
+ { 0x10A38, 0x10A3A }, { 0x10A3F, 0x10A3F }, { 0x1D167, 0x1D169 },
+ { 0x1D173, 0x1D182 }, { 0x1D185, 0x1D18B }, { 0x1D1AA, 0x1D1AD },
+ { 0x1D242, 0x1D244 }, { 0xE0001, 0xE0001 }, { 0xE0020, 0xE007F },
+ { 0xE0100, 0xE01EF }
+ };
+
+ /* Test for NUL character */
+ if (ucs == 0)
+ return 0;
+
+ /* Test for printable ASCII characters */
+ if (ucs >= 0x20 && ucs < 0x7f)
+ return 1;
+
+ /* Test for control characters */
+ if (ucs < 0xa0)
+ return -1;
+
+ /* Test for surrogate pair values. */
+ if (ucs >= 0xd800 && ucs <= 0xdfff)
+ return -1;
+
+ /* binary search in table of ambiguous characters */
+ if (__locale_cjk_lang ()
+ && bisearch(ucs, ambiguous,
+ sizeof(ambiguous) / sizeof(struct interval) - 1))
+ return 2;
+
+ /* binary search in table of non-spacing characters */
+ if (bisearch(ucs, combining,
+ sizeof(combining) / sizeof(struct interval) - 1))
+ return 0;
+
+ /* if we arrive here, ucs is not a combining or C0/C1 control character */
+
+ return 1 +
+ (ucs >= 0x1100 &&
+ (ucs <= 0x115f || /* Hangul Jamo init. consonants */
+ ucs == 0x2329 || ucs == 0x232a ||
+ (ucs >= 0x2e80 && ucs <= 0xa4cf &&
+ ucs != 0x303f) || /* CJK ... Yi */
+ (ucs >= 0xac00 && ucs <= 0xd7a3) || /* Hangul Syllables */
+ (ucs >= 0xf900 && ucs <= 0xfaff) || /* CJK Compatibility Ideographs */
+ (ucs >= 0xfe10 && ucs <= 0xfe19) || /* Vertical forms */
+ (ucs >= 0xfe30 && ucs <= 0xfe6f) || /* CJK Compatibility Forms */
+ (ucs >= 0xff00 && ucs <= 0xff60) || /* Fullwidth Forms */
+ (ucs >= 0xffe0 && ucs <= 0xffe6) ||
+ (ucs >= 0x20000 && ucs <= 0x2fffd) ||
+ (ucs >= 0x30000 && ucs <= 0x3fffd)));
+#else /* !_MB_CAPABLE */
+ if (iswprint (ucs))
+ return 1;
+ if (iswcntrl (ucs) || ucs == L'\0')
+ return 0;
+ return -1;
+#endif /* _MB_CAPABLE */
+}
+
+int
+_DEFUN (wcwidth, (wc),
+ _CONST wchar_t wc)
+{
+ wint_t wi = wc;
+
+#ifdef _MB_CAPABLE
+ wi = _jp2uc (wi);
+#endif /* _MB_CAPABLE */
+ return __wcwidth (wi);
+}
wcwidth.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wcsnlen.c
===================================================================
--- wcsnlen.c (nonexistent)
+++ wcsnlen.c (revision 520)
@@ -0,0 +1,75 @@
+/*
+FUNCTION
+ <>---get fixed-size wide-character string length
+
+INDEX
+ wcsnlen
+
+ANSI_SYNOPSIS
+ #include
+ size_t wcsnlen(const wchar_t *<[s]>, size_t <[maxlen]>);
+
+TRAD_SYNOPSIS
+ #include
+ size_t wcsnlen(<[s]>, <[maxlen]>)
+ wchar_t *<[s]>;
+ size_t <[maxlen]>;
+
+DESCRIPTION
+ The <> function computes the number of wide-character codes
+ in the wide-character string pointed to by <[s]> not including the
+ terminating L'\0' wide character but at most <[maxlen]> wide
+ characters.
+
+RETURNS
+ <> returns the length of <[s]> if it is less then <[maxlen]>,
+ or <[maxlen]> if there is no L'\0' wide character in first <[maxlen]>
+ characters.
+
+PORTABILITY
+<> is a GNU extension.
+
+<> requires no supporting OS subroutines.
+*/
+
+/*
+ * Copyright (c) 2003, Artem B. Bityuckiy (dedekind@mail.ru).
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the above copyright notice,
+ * this condition statement, and the following disclaimer are retained
+ * in any redistributions of the source code.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <_ansi.h>
+#include
+#include
+
+size_t
+_DEFUN(wcsnlen, (s, maxlen),
+ _CONST wchar_t *s _AND
+ size_t maxlen)
+{
+ _CONST wchar_t *p;
+
+ p = s;
+ while (*p && maxlen-- > 0)
+ p++;
+
+ return (size_t)(p - s);
+}
+
+
+
wcsnlen.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wcsncmp.c
===================================================================
--- wcsncmp.c (nonexistent)
+++ wcsncmp.c (revision 520)
@@ -0,0 +1,91 @@
+/*
+FUNCTION
+ <>---compare part of two wide-character strings
+
+ANSI_SYNOPSIS
+ #include
+ int wcsncmp(const wchar_t *<[s1]>, const wchar_t *<[s2]>, size_t <[n]>);
+
+TRAD_SYNOPSIS
+ int wcsncmp(<[s1]>, <[s2]>, <[n]>
+ const wchar_t *<[s1]>;
+ const wchar_t *<[s2]>;
+ size_t <[n]>;
+
+DESCRIPTION
+ The <> function compares not more than <[n]> wide-character
+ codes (wide-character codes that follow a null wide-character code are
+ not compared) from the array pointed to by <[s1]> to the array pointed
+ to by <[s2]>.
+
+ The sign of a non-zero return value is determined by the sign of the
+ difference between the values of the first pair of wide-character codes
+ that differ in the objects being compared.
+
+RETURNS
+ Upon successful completion, <> returns an integer greater than,
+ equal to or less than 0, if the possibly null-terminated array pointed
+ to by <[s1]> is greater than, equal to or less than the possibly
+ null-terminated array pointed to by <[s2]> respectively.
+
+PORTABILITY
+<> is ISO/IEC 9899/AMD1:1995 (ISO C).
+
+No supporting OS subroutines are required.
+*/
+
+/* $NetBSD$ */
+
+/*
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <_ansi.h>
+#include
+
+int
+_DEFUN (wcsncmp, (s1, s2, n),
+ _CONST wchar_t * s1 _AND
+ _CONST wchar_t * s2 _AND
+ size_t n)
+{
+
+ if (n == 0)
+ return (0);
+ do
+ {
+ if (*s1 != *s2++)
+ {
+ return (*s1 - *--s2);
+ }
+ if (*s1++ == 0)
+ break;
+ }
+ while (--n != 0);
+ return (0);
+}
wcsncmp.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wmemcpy.c
===================================================================
--- wmemcpy.c (nonexistent)
+++ wmemcpy.c (revision 520)
@@ -0,0 +1,76 @@
+/*
+FUNCTION
+ <>---copy wide characters in memory
+
+ANSI_SYNOPSIS
+ #include
+ wchar_t *wmemcpy(wchar_t *<[d]>, const wchar_t *<[s]>, size_t <[n]>);
+
+TRAD_SYNOPSIS
+ wchar_t *wmemcpy(<[d]>, <[s]>, <[n]>
+ wchar_t *<[d]>;
+ const wchar_t *<[s]>;
+ size_t <[n]>;
+
+DESCRIPTION
+ The <> function copies <[n]> wide characters from the object
+ pointed to by <[s]> to the object pointed to be <[d]>. This function
+ is not affected by locale and all wchar_t values are treated
+ identically. The null wide character and wchar_t values not
+ corresponding to valid characters are not treated specially.
+
+ If <[n]> is zero, <[d]> and <[s]> must be a valid pointers, and the
+ function copies zero wide characters.
+
+RETURNS
+ The <> function returns the value of <[d]>.
+
+PORTABILITY
+<> is ISO/IEC 9899/AMD1:1995 (ISO C).
+
+No supporting OS subroutines are required.
+*/
+
+/* $NetBSD: wmemcpy.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */
+
+/*-
+ * Copyright (c)1999 Citrus Project,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * citrus Id: wmemcpy.c,v 1.2 2000/12/20 14:08:31 itojun Exp
+ */
+
+#include <_ansi.h>
+#include
+#include
+
+wchar_t *
+_DEFUN (wmemcpy, (d, s, n),
+ wchar_t * d _AND
+ _CONST wchar_t * s _AND
+ size_t n)
+{
+
+ return (wchar_t *) memcpy (d, s, n * sizeof (wchar_t));
+}
wmemcpy.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: stpcpy.c
===================================================================
--- stpcpy.c (nonexistent)
+++ stpcpy.c (revision 520)
@@ -0,0 +1,91 @@
+/*
+FUNCTION
+ <>---copy string returning a pointer to its end
+
+INDEX
+ stpcpy
+
+ANSI_SYNOPSIS
+ #include
+ char *stpcpy(char *<[dst]>, const char *<[src]>);
+
+TRAD_SYNOPSIS
+ #include
+ char *stpcpy(<[dst]>, <[src]>)
+ char *<[dst]>;
+ char *<[src]>;
+
+DESCRIPTION
+ <> copies the string pointed to by <[src]>
+ (including the terminating null character) to the array
+ pointed to by <[dst]>.
+
+RETURNS
+ This function returns a pointer to the end of the destination string,
+ thus pointing to the trailing '\0'.
+
+PORTABILITY
+<> is a GNU extension, candidate for inclusion into POSIX/SUSv4.
+
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ stpcpy gnu
+*/
+
+#include
+#include
+
+/*SUPPRESS 560*/
+/*SUPPRESS 530*/
+
+/* Nonzero if either X or Y is not aligned on a "long" boundary. */
+#define UNALIGNED(X, Y) \
+ (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
+
+#if LONG_MAX == 2147483647L
+#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
+#else
+#if LONG_MAX == 9223372036854775807L
+/* Nonzero if X (a long int) contains a NULL byte. */
+#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
+#else
+#error long int is not a 32bit or 64bit type.
+#endif
+#endif
+
+#ifndef DETECTNULL
+#error long int is not a 32bit or 64bit byte
+#endif
+
+char*
+_DEFUN (stpcpy, (dst, src),
+ char *dst _AND
+ _CONST char *src)
+{
+#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__)
+ long *aligned_dst;
+ _CONST long *aligned_src;
+
+ /* If SRC or DEST is unaligned, then copy bytes. */
+ if (!UNALIGNED (src, dst))
+ {
+ aligned_dst = (long*)dst;
+ aligned_src = (long*)src;
+
+ /* SRC and DEST are both "long int" aligned, try to do "long int"
+ sized copies. */
+ while (!DETECTNULL(*aligned_src))
+ {
+ *aligned_dst++ = *aligned_src++;
+ }
+
+ dst = (char*)aligned_dst;
+ src = (char*)aligned_src;
+ }
+#endif /* not PREFER_SIZE_OVER_SPEED */
+
+ while ((*dst++ = *src++))
+ ;
+ return --dst;
+}
stpcpy.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strncasecmp.c
===================================================================
--- strncasecmp.c (nonexistent)
+++ strncasecmp.c (revision 520)
@@ -0,0 +1,63 @@
+/*
+FUNCTION
+ <>---case-insensitive character string compare
+
+INDEX
+ strncasecmp
+
+ANSI_SYNOPSIS
+ #include
+ int strncasecmp(const char *<[a]>, const char * <[b]>, size_t <[length]>);
+
+TRAD_SYNOPSIS
+ #include
+ int strncasecmp(<[a]>, <[b]>, <[length]>)
+ char *<[a]>;
+ char *<[b]>;
+ size_t <[length]>
+
+DESCRIPTION
+ <> compares up to <[length]> characters
+ from the string at <[a]> to the string at <[b]> in a
+ case-insensitive manner.
+
+RETURNS
+
+ If <<*<[a]>>> sorts lexicographically after <<*<[b]>>> (after
+ both are converted to lowercase), <> returns a
+ number greater than zero. If the two strings are equivalent,
+ <> returns zero. If <<*<[a]>>> sorts
+ lexicographically before <<*<[b]>>>, <> returns a
+ number less than zero.
+
+PORTABILITY
+<> is in the Berkeley Software Distribution.
+
+<> requires no supporting OS subroutines. It uses
+tolower() from elsewhere in this library.
+
+QUICKREF
+ strncasecmp
+*/
+
+#include
+#include
+
+int
+_DEFUN (strncasecmp, (s1, s2, n),
+ _CONST char *s1 _AND
+ _CONST char *s2 _AND
+ size_t n)
+{
+ _CONST unsigned char *ucs1 = (_CONST unsigned char *) s1;
+ _CONST unsigned char *ucs2 = (_CONST unsigned char *) s2;
+ int d = 0;
+ for ( ; n != 0; n--)
+ {
+ _CONST int c1 = tolower(*ucs1++);
+ _CONST int c2 = tolower(*ucs2++);
+ if (((d = c1 - c2) != 0) || (c2 == '\0'))
+ break;
+ }
+ return d;
+}
strncasecmp.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strpbrk.c
===================================================================
--- strpbrk.c (nonexistent)
+++ strpbrk.c (revision 520)
@@ -0,0 +1,58 @@
+/*
+FUNCTION
+ <>---find characters in string
+
+INDEX
+ strpbrk
+
+ANSI_SYNOPSIS
+ #include
+ char *strpbrk(const char *<[s1]>, const char *<[s2]>);
+
+TRAD_SYNOPSIS
+ #include
+ char *strpbrk(<[s1]>, <[s2]>)
+ char *<[s1]>;
+ char *<[s2]>;
+
+DESCRIPTION
+ This function locates the first occurence in the string
+ pointed to by <[s1]> of any character in string pointed to by
+ <[s2]> (excluding the terminating null character).
+
+RETURNS
+ <> returns a pointer to the character found in <[s1]>, or a
+ null pointer if no character from <[s2]> occurs in <[s1]>.
+
+PORTABILITY
+<> requires no supporting OS subroutines.
+*/
+
+#include
+
+char *
+_DEFUN (strpbrk, (s1, s2),
+ _CONST char *s1 _AND
+ _CONST char *s2)
+{
+ _CONST char *c = s2;
+ if (!*s1)
+ return (char *) NULL;
+
+ while (*s1)
+ {
+ for (c = s2; *c; c++)
+ {
+ if (*s1 == *c)
+ break;
+ }
+ if (*c)
+ break;
+ s1++;
+ }
+
+ if (*c == '\0')
+ s1 = NULL;
+
+ return (char *) s1;
+}
strpbrk.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wcscasecmp.c
===================================================================
--- wcscasecmp.c (nonexistent)
+++ wcscasecmp.c (revision 520)
@@ -0,0 +1,56 @@
+/*
+FUNCTION
+ <>---case-insensitive wide character string compare
+
+INDEX
+ wcscasecmp
+
+ANSI_SYNOPSIS
+ #include
+ int wcscasecmp(const wchar_t *<[a]>, const wchar_t *<[b]>);
+
+TRAD_SYNOPSIS
+ #include
+ int wcscasecmp(<[a]>, <[b]>)
+ wchar_t *<[a]>;
+ wchar_t *<[b]>;
+
+DESCRIPTION
+ <> compares the wide character string at <[a]> to
+ the wide character string at <[b]> in a case-insensitive manner.
+
+RETURNS
+
+ If <<*<[a]>>> sorts lexicographically after <<*<[b]>>> (after
+ both are converted to uppercase), <> returns a
+ number greater than zero. If the two strings match,
+ <> returns zero. If <<*<[a]>>> sorts
+ lexicographically before <<*<[b]>>>, <> returns a
+ number less than zero.
+
+PORTABILITY
+POSIX-1.2008
+
+<> requires no supporting OS subroutines. It uses
+tolower() from elsewhere in this library.
+
+QUICKREF
+ wcscasecmp
+*/
+
+#include
+#include
+
+int
+_DEFUN (wcscasecmp, (s1, s2),
+ _CONST wchar_t *s1 _AND
+ _CONST wchar_t *s2)
+{
+ while (*s1 != '\0' && towlower(*s1) == towlower(*s2))
+ {
+ s1++;
+ s2++;
+ }
+
+ return towlower(*s1) - towlower(*s2);
+}
wcscasecmp.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strspn.c
===================================================================
--- strspn.c (nonexistent)
+++ strspn.c (revision 520)
@@ -0,0 +1,59 @@
+/*
+FUNCTION
+ <>---find initial match
+
+INDEX
+ strspn
+
+ANSI_SYNOPSIS
+ #include
+ size_t strspn(const char *<[s1]>, const char *<[s2]>);
+
+TRAD_SYNOPSIS
+ #include
+ size_t strspn(<[s1]>, <[s2]>)
+ char *<[s1]>;
+ char *<[s2]>;
+
+DESCRIPTION
+ This function computes the length of the initial segment of
+ the string pointed to by <[s1]> which consists entirely of
+ characters from the string pointed to by <[s2]> (excluding the
+ terminating null character).
+
+RETURNS
+ <> returns the length of the segment found.
+
+PORTABILITY
+<> is ANSI C.
+
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ strspn ansi pure
+*/
+
+#include
+
+size_t
+_DEFUN (strspn, (s1, s2),
+ _CONST char *s1 _AND
+ _CONST char *s2)
+{
+ _CONST char *s = s1;
+ _CONST char *c;
+
+ while (*s1)
+ {
+ for (c = s2; *c; c++)
+ {
+ if (*s1 == *c)
+ break;
+ }
+ if (*c == '\0')
+ break;
+ s1++;
+ }
+
+ return s1 - s;
+}
strspn.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memcpy.c
===================================================================
--- memcpy.c (nonexistent)
+++ memcpy.c (revision 520)
@@ -0,0 +1,111 @@
+/*
+FUNCTION
+ <>---copy memory regions
+
+ANSI_SYNOPSIS
+ #include
+ void* memcpy(void *<[out]>, const void *<[in]>, size_t <[n]>);
+
+TRAD_SYNOPSIS
+ #include
+ void *memcpy(<[out]>, <[in]>, <[n]>
+ void *<[out]>;
+ void *<[in]>;
+ size_t <[n]>;
+
+DESCRIPTION
+ This function copies <[n]> bytes from the memory region
+ pointed to by <[in]> to the memory region pointed to by
+ <[out]>.
+
+ If the regions overlap, the behavior is undefined.
+
+RETURNS
+ <> returns a pointer to the first byte of the <[out]>
+ region.
+
+PORTABILITY
+<> is ANSI C.
+
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ memcpy ansi pure
+ */
+
+#include <_ansi.h>
+#include
+
+/* Nonzero if either X or Y is not aligned on a "long" boundary. */
+#define UNALIGNED(X, Y) \
+ (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
+
+/* How many bytes are copied each iteration of the 4X unrolled loop. */
+#define BIGBLOCKSIZE (sizeof (long) << 2)
+
+/* How many bytes are copied each iteration of the word copy loop. */
+#define LITTLEBLOCKSIZE (sizeof (long))
+
+/* Threshhold for punting to the byte copier. */
+#define TOO_SMALL(LEN) ((LEN) < BIGBLOCKSIZE)
+
+_PTR
+_DEFUN (memcpy, (dst0, src0, len0),
+ _PTR dst0 _AND
+ _CONST _PTR src0 _AND
+ size_t len0)
+{
+#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
+ char *dst = (char *) dst0;
+ char *src = (char *) src0;
+
+ _PTR save = dst0;
+
+ while (len0--)
+ {
+ *dst++ = *src++;
+ }
+
+ return save;
+#else
+ char *dst = dst0;
+ _CONST char *src = src0;
+ long *aligned_dst;
+ _CONST long *aligned_src;
+ int len = len0;
+
+ /* If the size is small, or either SRC or DST is unaligned,
+ then punt into the byte copy loop. This should be rare. */
+ if (!TOO_SMALL(len) && !UNALIGNED (src, dst))
+ {
+ aligned_dst = (long*)dst;
+ aligned_src = (long*)src;
+
+ /* Copy 4X long words at a time if possible. */
+ while (len >= BIGBLOCKSIZE)
+ {
+ *aligned_dst++ = *aligned_src++;
+ *aligned_dst++ = *aligned_src++;
+ *aligned_dst++ = *aligned_src++;
+ *aligned_dst++ = *aligned_src++;
+ len -= BIGBLOCKSIZE;
+ }
+
+ /* Copy one long word at a time if possible. */
+ while (len >= LITTLEBLOCKSIZE)
+ {
+ *aligned_dst++ = *aligned_src++;
+ len -= LITTLEBLOCKSIZE;
+ }
+
+ /* Pick up any residual with a byte copier. */
+ dst = (char*)aligned_dst;
+ src = (char*)aligned_src;
+ }
+
+ while (len--)
+ *dst++ = *src++;
+
+ return dst0;
+#endif /* not PREFER_SIZE_OVER_SPEED */
+}
memcpy.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wmemmove.c
===================================================================
--- wmemmove.c (nonexistent)
+++ wmemmove.c (revision 520)
@@ -0,0 +1,82 @@
+/*
+FUNCTION
+ <>---copy wide characters in memory with overlapping areas
+
+ANSI_SYNOPSIS
+ #include
+ wchar_t *wmemmove(wchar_t *<[d]>, const wchar_t *<[s]>, size_t <[n]>);
+
+TRAD_SYNOPSIS
+ wchar_t *wmemmove(<[d]>, <[s]>, <[n]>
+ wchar_t *<[d]>;
+ const wchar_t *<[s]>;
+ size_t <[n]>;
+
+DESCRIPTION
+ The <> function copies <[n]> wide characters from the object
+ pointed to by <[s]> to the object pointed to by <[d]>. Copying takes
+ place as if the <[n]> wide characters from the object pointed to by
+ <[s]> are first copied into a temporary array of <[n]> wide characters
+ that does not overlap the objects pointed to by <[d]> or <[s]>, and then
+ the <[n]> wide characters from the temporary array are copied into the
+ object pointed to by <[d]>.
+
+ This function is not affected by locale and all wchar_t values are
+ treated identically. The null wide character and wchar_t values not
+ corresponding to valid characters are not treated specially.
+
+ If <[n]> is zero, <[d]> and <[s]> must be a valid pointers, and the
+ function copies zero wide characters.
+
+RETURNS
+ The <> function returns the value of <[d]>.
+
+PORTABILITY
+<> is ISO/IEC 9899/AMD1:1995 (ISO C).
+
+No supporting OS subroutines are required.
+*/
+
+/* $NetBSD: wmemmove.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */
+
+/*-
+ * Copyright (c)1999 Citrus Project,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * citrus Id: wmemmove.c,v 1.2 2000/12/20 14:08:31 itojun Exp
+ */
+
+#include <_ansi.h>
+#include
+#include
+
+wchar_t *
+_DEFUN (wmemmove, (d, s, n),
+ wchar_t * d _AND
+ _CONST wchar_t * s _AND
+ size_t n)
+{
+
+ return (wchar_t *) memmove (d, s, n * sizeof (wchar_t));
+}
wmemmove.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strupr.c
===================================================================
--- strupr.c (nonexistent)
+++ strupr.c (revision 520)
@@ -0,0 +1,46 @@
+/*
+FUNCTION
+ <>---force string to uppercase
+
+INDEX
+ strupr
+
+ANSI_SYNOPSIS
+ #include
+ char *strupr(char *<[a]>);
+
+TRAD_SYNOPSIS
+ #include
+ char *strupr(<[a]>)
+ char *<[a]>;
+
+DESCRIPTION
+ <> converts each character in the string at <[a]> to
+ uppercase.
+
+RETURNS
+ <> returns its argument, <[a]>.
+
+PORTABILITY
+<> is not widely portable.
+
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ strupr
+*/
+
+#include
+#include
+
+char *
+_DEFUN (strupr, (s),
+ char *s)
+{
+ unsigned char *ucs = (unsigned char *) s;
+ for ( ; *ucs != '\0'; ucs++)
+ {
+ *ucs = toupper(*ucs);
+ }
+ return s;
+}
strupr.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: stpncpy.c
===================================================================
--- stpncpy.c (nonexistent)
+++ stpncpy.c (revision 520)
@@ -0,0 +1,114 @@
+/*
+FUNCTION
+ <>---counted copy string returning a pointer to its end
+
+INDEX
+ stpncpy
+
+ANSI_SYNOPSIS
+ #include
+ char *stpncpy(char *<[dst]>, const char *<[src]>, size_t <[length]>);
+
+TRAD_SYNOPSIS
+ #include
+ char *stpncpy(<[dst]>, <[src]>, <[length]>)
+ char *<[dst]>;
+ char *<[src]>;
+ size_t <[length]>;
+
+DESCRIPTION
+ <> copies not more than <[length]> characters from the
+ the string pointed to by <[src]> (including the terminating
+ null character) to the array pointed to by <[dst]>. If the
+ string pointed to by <[src]> is shorter than <[length]>
+ characters, null characters are appended to the destination
+ array until a total of <[length]> characters have been
+ written.
+
+RETURNS
+ This function returns a pointer to the end of the destination string,
+ thus pointing to the trailing '\0', or, if the destination string is
+ not null-terminated, pointing to dst + n.
+
+PORTABILITY
+<> is a GNU extension, candidate for inclusion into POSIX/SUSv4.
+
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ stpncpy gnu
+*/
+
+#include
+#include
+
+/*SUPPRESS 560*/
+/*SUPPRESS 530*/
+
+/* Nonzero if either X or Y is not aligned on a "long" boundary. */
+#define UNALIGNED(X, Y) \
+ (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
+
+#if LONG_MAX == 2147483647L
+#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
+#else
+#if LONG_MAX == 9223372036854775807L
+/* Nonzero if X (a long int) contains a NULL byte. */
+#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
+#else
+#error long int is not a 32bit or 64bit type.
+#endif
+#endif
+
+#ifndef DETECTNULL
+#error long int is not a 32bit or 64bit byte
+#endif
+
+#define TOO_SMALL(LEN) ((LEN) < sizeof (long))
+
+char *
+_DEFUN (stpncpy, (dst, src),
+ char *dst _AND
+ _CONST char *src _AND
+ size_t count)
+{
+ char *ret = NULL;
+
+#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__)
+ long *aligned_dst;
+ _CONST long *aligned_src;
+
+ /* If SRC and DEST is aligned and count large enough, then copy words. */
+ if (!UNALIGNED (src, dst) && !TOO_SMALL (count))
+ {
+ aligned_dst = (long*)dst;
+ aligned_src = (long*)src;
+
+ /* SRC and DEST are both "long int" aligned, try to do "long int"
+ sized copies. */
+ while (count >= sizeof (long int) && !DETECTNULL(*aligned_src))
+ {
+ count -= sizeof (long int);
+ *aligned_dst++ = *aligned_src++;
+ }
+
+ dst = (char*)aligned_dst;
+ src = (char*)aligned_src;
+ }
+#endif /* not PREFER_SIZE_OVER_SPEED */
+
+ while (count > 0)
+ {
+ --count;
+ if ((*dst++ = *src++) == '\0')
+ {
+ ret = dst - 1;
+ break;
+ }
+ }
+
+ while (count-- > 0)
+ *dst++ = '\0';
+
+ return ret ? ret : dst;
+}
stpncpy.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wcstrings.tex
===================================================================
--- wcstrings.tex (nonexistent)
+++ wcstrings.tex (revision 520)
@@ -0,0 +1,126 @@
+@node Wchar strings
+@chapter Wide Character Strings (@file{wchar.h})
+
+This chapter describes wide-character string-handling functions and
+managing areas of memory containing wide characters. The corresponding
+declarations are in @file{wchar.h}.
+
+@menu
+* wmemchr:: Find wide character in memory
+* wmemcmp:: Compare two wide-character memory areas
+* wmemcpy:: Copy wide-character memory regions
+* wmemmove:: Move possibly overlapping wide-character memory
+* wmemset:: Set an area of memory to a specified wide character
+* wcscat:: Concatenate wide-character strings
+* wcschr:: Search for wide character in string
+* wcscmp:: Wide-character string compare
+* wcscoll:: Locale-specific wide-character string compare
+* wcscpy:: Copy wide-character string
+* wcpcpy:: Copy a wide-character string returning a pointer to its end
+* wcscspn:: Count wide characters not in string
+* wcsftime:: Convert date and time to a formatted wide-character string
+* wcslcat:: Concatenate wide-character strings to specified length
+* wcslcpy:: Copy wide-character string to specified length
+* wcslen:: Wide-character string length
+* wcsncat:: Concatenate wide-character strings
+* wcsncmp:: Wide-character string compare
+* wcsncpy:: Counted copy wide-character string
+* wcpncpy:: Copy part of a wide-character string returning a pointer to its end
+* wcsnlen:: Wide-character string length with maximum limit
+* wcspbrk:: Find wide characters in string
+* wcsrchr:: Reverse search for wide character in string
+* wcsspn:: Find initial match in wide-character string
+* wcsstr:: Find wide-character string segment
+* wcstok:: Tokenize wide-character string
+* wcswidth:: Number of column positions of a wide-character string
+* wcsxfrm:: Locale-specific wide-character string transformation
+* wcwidth:: Number of column positions of a wide-character code
+@end menu
+
+@page
+@include string/wmemchr.def
+
+@page
+@include string/wmemcmp.def
+
+@page
+@include string/wmemcpy.def
+
+@page
+@include string/wmemmove.def
+
+@page
+@include string/wmemset.def
+
+@page
+@include string/wcscat.def
+
+@page
+@include string/wcschr.def
+
+@page
+@include string/wcscmp.def
+
+@page
+@include string/wcscoll.def
+
+@page
+@include string/wcscpy.def
+
+@page
+@include string/wcpcpy.def
+
+@page
+@include string/wcscspn.def
+
+@page
+@include time/wcsftime.def
+
+@page
+@include string/wcslcat.def
+
+@page
+@include string/wcslcpy.def
+
+@page
+@include string/wcslen.def
+
+@page
+@include string/wcsncat.def
+
+@page
+@include string/wcsncmp.def
+
+@page
+@include string/wcsncpy.def
+
+@page
+@include string/wcpncpy.def
+
+@page
+@include string/wcsnlen.def
+
+@page
+@include string/wcspbrk.def
+
+@page
+@include string/wcsrchr.def
+
+@page
+@include string/wcsspn.def
+
+@page
+@include string/wcsstr.def
+
+@page
+@include string/wcstok.def
+
+@page
+@include string/wcswidth.def
+
+@page
+@include string/wcsxfrm.def
+
+@page
+@include string/wcwidth.def
+
Index: strstr.c
===================================================================
--- strstr.c (nonexistent)
+++ strstr.c (revision 520)
@@ -0,0 +1,121 @@
+/*
+FUNCTION
+ <>---find string segment
+
+INDEX
+ strstr
+
+ANSI_SYNOPSIS
+ #include
+ char *strstr(const char *<[s1]>, const char *<[s2]>);
+
+TRAD_SYNOPSIS
+ #include
+ char *strstr(<[s1]>, <[s2]>)
+ char *<[s1]>;
+ char *<[s2]>;
+
+DESCRIPTION
+ Locates the first occurrence in the string pointed to by <[s1]> of
+ the sequence of characters in the string pointed to by <[s2]>
+ (excluding the terminating null character).
+
+RETURNS
+ Returns a pointer to the located string segment, or a null
+ pointer if the string <[s2]> is not found. If <[s2]> points to
+ a string with zero length, <[s1]> is returned.
+
+PORTABILITY
+<> is ANSI C.
+
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ strstr ansi pure
+*/
+
+#include
+
+#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__)
+# define RETURN_TYPE char *
+# define AVAILABLE(h, h_l, j, n_l) \
+ (!memchr ((h) + (h_l), '\0', (j) + (n_l) - (h_l)) \
+ && ((h_l) = (j) + (n_l)))
+# include "str-two-way.h"
+#endif
+
+char *
+_DEFUN (strstr, (searchee, lookfor),
+ _CONST char *searchee _AND
+ _CONST char *lookfor)
+{
+#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
+
+ /* Less code size, but quadratic performance in the worst case. */
+ if (*searchee == 0)
+ {
+ if (*lookfor)
+ return (char *) NULL;
+ return (char *) searchee;
+ }
+
+ while (*searchee)
+ {
+ size_t i;
+ i = 0;
+
+ while (1)
+ {
+ if (lookfor[i] == 0)
+ {
+ return (char *) searchee;
+ }
+
+ if (lookfor[i] != searchee[i])
+ {
+ break;
+ }
+ i++;
+ }
+ searchee++;
+ }
+
+ return (char *) NULL;
+
+#else /* compilation for speed */
+
+ /* Larger code size, but guaranteed linear performance. */
+ const char *haystack = searchee;
+ const char *needle = lookfor;
+ size_t needle_len; /* Length of NEEDLE. */
+ size_t haystack_len; /* Known minimum length of HAYSTACK. */
+ int ok = 1; /* True if NEEDLE is prefix of HAYSTACK. */
+
+ /* Determine length of NEEDLE, and in the process, make sure
+ HAYSTACK is at least as long (no point processing all of a long
+ NEEDLE if HAYSTACK is too short). */
+ while (*haystack && *needle)
+ ok &= *haystack++ == *needle++;
+ if (*needle)
+ return NULL;
+ if (ok)
+ return (char *) searchee;
+
+ /* Reduce the size of haystack using strchr, since it has a smaller
+ linear coefficient than the Two-Way algorithm. */
+ needle_len = needle - lookfor;
+ haystack = strchr (searchee + 1, *lookfor);
+ if (!haystack || needle_len == 1)
+ return (char *) haystack;
+ haystack_len = (haystack > searchee + needle_len ? 1
+ : needle_len + searchee - haystack);
+
+ /* Perform the search. */
+ if (needle_len < LONG_NEEDLE_THRESHOLD)
+ return two_way_short_needle ((const unsigned char *) haystack,
+ haystack_len,
+ (const unsigned char *) lookfor, needle_len);
+ return two_way_long_needle ((const unsigned char *) haystack, haystack_len,
+ (const unsigned char *) lookfor, needle_len);
+#endif /* compilation for speed */
+}
strstr.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strncpy.c
===================================================================
--- strncpy.c (nonexistent)
+++ strncpy.c (revision 520)
@@ -0,0 +1,125 @@
+/*
+FUNCTION
+ <>---counted copy string
+
+INDEX
+ strncpy
+
+ANSI_SYNOPSIS
+ #include
+ char *strncpy(char *<[dst]>, const char *<[src]>, size_t <[length]>);
+
+TRAD_SYNOPSIS
+ #include
+ char *strncpy(<[dst]>, <[src]>, <[length]>)
+ char *<[dst]>;
+ char *<[src]>;
+ size_t <[length]>;
+
+DESCRIPTION
+ <> copies not more than <[length]> characters from the
+ the string pointed to by <[src]> (including the terminating
+ null character) to the array pointed to by <[dst]>. If the
+ string pointed to by <[src]> is shorter than <[length]>
+ characters, null characters are appended to the destination
+ array until a total of <[length]> characters have been
+ written.
+
+RETURNS
+ This function returns the initial value of <[dst]>.
+
+PORTABILITY
+<> is ANSI C.
+
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ strncpy ansi pure
+*/
+
+#include
+#include
+
+/*SUPPRESS 560*/
+/*SUPPRESS 530*/
+
+/* Nonzero if either X or Y is not aligned on a "long" boundary. */
+#define UNALIGNED(X, Y) \
+ (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
+
+#if LONG_MAX == 2147483647L
+#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
+#else
+#if LONG_MAX == 9223372036854775807L
+/* Nonzero if X (a long int) contains a NULL byte. */
+#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
+#else
+#error long int is not a 32bit or 64bit type.
+#endif
+#endif
+
+#ifndef DETECTNULL
+#error long int is not a 32bit or 64bit byte
+#endif
+
+#define TOO_SMALL(LEN) ((LEN) < sizeof (long))
+
+char *
+_DEFUN (strncpy, (dst0, src0),
+ char *dst0 _AND
+ _CONST char *src0 _AND
+ size_t count)
+{
+#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
+ char *dscan;
+ _CONST char *sscan;
+
+ dscan = dst0;
+ sscan = src0;
+ while (count > 0)
+ {
+ --count;
+ if ((*dscan++ = *sscan++) == '\0')
+ break;
+ }
+ while (count-- > 0)
+ *dscan++ = '\0';
+
+ return dst0;
+#else
+ char *dst = dst0;
+ _CONST char *src = src0;
+ long *aligned_dst;
+ _CONST long *aligned_src;
+
+ /* If SRC and DEST is aligned and count large enough, then copy words. */
+ if (!UNALIGNED (src, dst) && !TOO_SMALL (count))
+ {
+ aligned_dst = (long*)dst;
+ aligned_src = (long*)src;
+
+ /* SRC and DEST are both "long int" aligned, try to do "long int"
+ sized copies. */
+ while (count >= sizeof (long int) && !DETECTNULL(*aligned_src))
+ {
+ count -= sizeof (long int);
+ *aligned_dst++ = *aligned_src++;
+ }
+
+ dst = (char*)aligned_dst;
+ src = (char*)aligned_src;
+ }
+
+ while (count > 0)
+ {
+ --count;
+ if ((*dst++ = *src++) == '\0')
+ break;
+ }
+
+ while (count-- > 0)
+ *dst++ = '\0';
+
+ return dst0;
+#endif /* not PREFER_SIZE_OVER_SPEED */
+}
strncpy.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strxfrm.c
===================================================================
--- strxfrm.c (nonexistent)
+++ strxfrm.c (revision 520)
@@ -0,0 +1,75 @@
+/*
+FUNCTION
+ <>---transform string
+
+INDEX
+ strxfrm
+
+ANSI_SYNOPSIS
+ #include
+ size_t strxfrm(char *<[s1]>, const char *<[s2]>, size_t <[n]>);
+
+TRAD_SYNOPSIS
+ #include
+ size_t strxfrm(<[s1]>, <[s2]>, <[n]>);
+ char *<[s1]>;
+ char *<[s2]>;
+ size_t <[n]>;
+
+DESCRIPTION
+ This function transforms the string pointed to by <[s2]> and
+ places the resulting string into the array pointed to by
+ <[s1]>. The transformation is such that if the <>
+ function is applied to the two transformed strings, it returns
+ a value greater than, equal to, or less than zero,
+ correspoinding to the result of a <> function applied
+ to the same two original strings.
+
+ No more than <[n]> characters are placed into the resulting
+ array pointed to by <[s1]>, including the terminating null
+ character. If <[n]> is zero, <[s1]> may be a null pointer. If
+ copying takes place between objects that overlap, the behavior
+ is undefined.
+
+ With a C locale, this function just copies.
+
+RETURNS
+ The <> function returns the length of the transformed string
+ (not including the terminating null character). If the value returned
+ is <[n]> or more, the contents of the array pointed to by
+ <[s1]> are indeterminate.
+
+PORTABILITY
+<> is ANSI C.
+
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ strxfrm ansi pure
+*/
+
+#include
+
+size_t
+_DEFUN (strxfrm, (s1, s2, n),
+ char *s1 _AND
+ _CONST char *s2 _AND
+ size_t n)
+{
+ size_t res;
+ res = 0;
+ while (n-- > 0)
+ {
+ if ((*s1++ = *s2++) != '\0')
+ ++res;
+ else
+ return res;
+ }
+ while (*s2)
+ {
+ ++s2;
+ ++res;
+ }
+
+ return res;
+}
strxfrm.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wmemcmp.c
===================================================================
--- wmemcmp.c (nonexistent)
+++ wmemcmp.c (revision 520)
@@ -0,0 +1,89 @@
+/*
+FUNCTION
+ <>---compare wide characters in memory
+
+ANSI_SYNOPSIS
+ #include
+ int wmemcmp(const wchar_t *<[s1]>, const wchar_t *<[s2]>, size_t <[n]>);
+
+TRAD_SYNOPSIS
+ int wmemcmp(<[s1]>, <[s2]>, <[n]>
+ const wchar_t *<[s1]>;
+ const wchar_t *<[s2]>;
+ size_t <[n]>;
+
+DESCRIPTION
+ The <> function compares the first <[n]> wide characters of the
+ object pointed to by <[s1]> to the first <[n]> wide characters of the
+ object pointed to by <[s2]>. This function is not affected by locale
+ and all wchar_t values are treated identically. The null wide character
+ and wchar_t values not corresponding to valid characters are not treated
+ specially.
+
+ If <[n]> is zero, <[s1]> and <[s2]> must be a valid pointers and the
+ function behaves as if the two objects compare equal.
+
+RETURNS
+ The <> function returns an integer greater than, equal to,
+ or less than zero, accordingly as the object pointed to by <[s1]> is
+ greater than, equal to, or less than the object pointed to by <[s2]>.
+
+PORTABILITY
+<> is ISO/IEC 9899/AMD1:1995 (ISO C).
+
+No supporting OS subroutines are required.
+*/
+
+/* $NetBSD: wmemcmp.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */
+
+/*-
+ * Copyright (c)1999 Citrus Project,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * citrus Id: wmemcmp.c,v 1.2 2000/12/20 14:08:31 itojun Exp
+ */
+
+#include <_ansi.h>
+#include
+
+int
+_DEFUN (wmemcmp, (s1, s2, n),
+ _CONST wchar_t * s1 _AND
+ _CONST wchar_t * s2 _AND
+ size_t n)
+{
+ size_t i;
+
+ for (i = 0; i < n; i++)
+ {
+ if (*s1 != *s2)
+ {
+ /* wchar might be unsigned */
+ return *s1 > *s2 ? 1 : -1;
+ }
+ s1++;
+ s2++;
+ }
+ return 0;
+}
wmemcmp.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strtok_r.c
===================================================================
--- strtok_r.c (nonexistent)
+++ strtok_r.c (revision 520)
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 1988 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include
+
+char *
+_DEFUN (__strtok_r, (s, delim, lasts, skip_leading_delim),
+ register char *s _AND
+ register const char *delim _AND
+ char **lasts _AND
+ int skip_leading_delim)
+{
+ register char *spanp;
+ register int c, sc;
+ char *tok;
+
+
+ if (s == NULL && (s = *lasts) == NULL)
+ return (NULL);
+
+ /*
+ * Skip (span) leading delimiters (s += strspn(s, delim), sort of).
+ */
+cont:
+ c = *s++;
+ for (spanp = (char *)delim; (sc = *spanp++) != 0;) {
+ if (c == sc) {
+ if (skip_leading_delim) {
+ goto cont;
+ }
+ else {
+ *lasts = s;
+ s[-1] = 0;
+ return (s - 1);
+ }
+ }
+ }
+
+ if (c == 0) { /* no non-delimiter characters */
+ *lasts = NULL;
+ return (NULL);
+ }
+ tok = s - 1;
+
+ /*
+ * Scan token (scan for delimiters: s += strcspn(s, delim), sort of).
+ * Note that delim must have one NUL; we stop if we see that, too.
+ */
+ for (;;) {
+ c = *s++;
+ spanp = (char *)delim;
+ do {
+ if ((sc = *spanp++) == c) {
+ if (c == 0)
+ s = NULL;
+ else
+ s[-1] = 0;
+ *lasts = s;
+ return (tok);
+ }
+ } while (sc != 0);
+ }
+ /* NOTREACHED */
+}
+
+char *
+_DEFUN (strtok_r, (s, delim, lasts),
+ register char *s _AND
+ register const char *delim _AND
+ char **lasts)
+{
+ return __strtok_r (s, delim, lasts, 1);
+}
strtok_r.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strings.tex
===================================================================
--- strings.tex (nonexistent)
+++ strings.tex (revision 520)
@@ -0,0 +1,181 @@
+@node Strings
+@chapter Strings and Memory (@file{string.h})
+
+This chapter describes string-handling functions and functions for
+managing areas of memory. The corresponding declarations are in
+@file{string.h}.
+
+@menu
+* bcmp:: Compare two memory areas
+* bcopy:: Copy memory regions
+* bzero:: Initialize memory to zero
+* index:: Search for character in string
+* memccpy:: Copy memory regions up to end-token
+* memchr:: Find character in memory
+* memcmp:: Compare two memory areas
+* memcpy:: Copy memory regions
+* memmem:: Find memory segment
+* memmove:: Move possibly overlapping memory
+* mempcpy:: Copy memory regions and locate end
+* memset:: Set an area of memory
+* rindex:: Reverse search for character in string
+* stpcpy:: Copy string returning a pointer to its end
+* stpncpy:: Counted copy string returning a pointer to its end
+* strcasecmp:: Compare strings ignoring case
+* strcasestr:: Find string segment ignoring case
+* strcat:: Concatenate strings
+* strchr:: Search for character in string
+* strcmp:: Character string compare
+* strcoll:: Locale-specific character string compare
+* strcpy:: Copy string
+* strcspn:: Count chars not in string
+* strerror:: Convert error number to string
+* strerror_r:: Convert error number to string
+* strlen:: Character string length
+* strlwr:: Convert string to lowercase
+* strncasecmp:: Compare strings ignoring case
+* strncat:: Concatenate strings
+* strncmp:: Character string compare
+* strncpy:: Counted copy string
+* strnlen:: Character string length
+* strpbrk:: Find chars in string
+* strrchr:: Reverse search for character in string
+* strspn:: Find initial match
+* strstr:: Find string segment
+* strtok:: Get next token from a string
+* strupr:: Convert string to upper case
+* strxfrm:: Transform string
+* swab:: Swap adjacent bytes
+* wcscasecmp:: Compare wide character strings ignoring case
+* wcsdup:: Wide character string duplicate
+* wcsncasecmp:: Compare wide character strings ignoring case
+@end menu
+
+@page
+@include string/bcmp.def
+
+@page
+@include string/bcopy.def
+
+@page
+@include string/bzero.def
+
+@page
+@include string/index.def
+
+@page
+@include string/memccpy.def
+
+@page
+@include string/memchr.def
+
+@page
+@include string/memcmp.def
+
+@page
+@include string/memcpy.def
+
+@page
+@include string/memmem.def
+
+@page
+@include string/memmove.def
+
+@page
+@include string/mempcpy.def
+
+@page
+@include string/memset.def
+
+@page
+@include string/rindex.def
+
+@page
+@include string/stpcpy.def
+
+@page
+@include string/stpncpy.def
+
+@page
+@include string/strcasecmp.def
+
+@page
+@include string/strcasestr.def
+
+@page
+@include string/strcat.def
+
+@page
+@include string/strchr.def
+
+@page
+@include string/strcmp.def
+
+@page
+@include string/strcoll.def
+
+@page
+@include string/strcpy.def
+
+@page
+@include string/strcspn.def
+
+@page
+@include string/strerror.def
+
+@page
+@include string/strerror_r.def
+
+@page
+@include string/strlen.def
+
+@page
+@include string/strlwr.def
+
+@page
+@include string/strncasecmp.def
+
+@page
+@include string/strncat.def
+
+@page
+@include string/strncmp.def
+
+@page
+@include string/strncpy.def
+
+@page
+@include string/strnlen.def
+
+@page
+@include string/strpbrk.def
+
+@page
+@include string/strrchr.def
+
+@page
+@include string/strspn.def
+
+@page
+@include string/strstr.def
+
+@page
+@include string/strtok.def
+
+@page
+@include string/strupr.def
+
+@page
+@include string/strxfrm.def
+
+@page
+@include string/swab.def
+
+@page
+@include string/wcscasecmp.def
+
+@page
+@include string/wcsdup.def
+
+@page
+@include string/wcsncasecmp.def
Index: wcscpy.c
===================================================================
--- wcscpy.c (nonexistent)
+++ wcscpy.c (revision 520)
@@ -0,0 +1,79 @@
+/*
+FUNCTION
+ <>---copy a wide-character string
+
+ANSI_SYNOPSIS
+ #include
+ wchar_t *wcscpy(wchar_t *<[s1]>, const wchar_t *,<[s2]>);
+
+TRAD_SYNOPSIS
+ wchar_t *wcscpy(<[s1]>, <[s2]>
+ wchar_t *<[s1]>;
+ const wchar_t *<[s2]>;
+
+DESCRIPTION
+ The <> function copies the wide-character string pointed to by
+ <[s2]> (including the terminating null wide-character code) into the
+ array pointed to by <[s1]>. If copying takes place between objects that
+ overlap, the behaviour is undefined.
+
+RETURNS
+ The <> function returns <[s1]>; no return value is reserved to
+ indicate an error.
+
+PORTABILITY
+<> is ISO/IEC 9899/AMD1:1995 (ISO C).
+
+No supporting OS subroutines are required.
+*/
+
+/* $NetBSD: wcscpy.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */
+
+/*-
+ * Copyright (c)1999 Citrus Project,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * citrus Id: wcscpy.c,v 1.2 2000/12/21 04:51:09 itojun Exp
+ */
+
+#include <_ansi.h>
+#include
+
+wchar_t *
+_DEFUN (wcscpy, (s1, s2),
+ wchar_t * s1 _AND
+ _CONST wchar_t * s2)
+{
+ wchar_t *p;
+ _CONST wchar_t *q;
+
+ *s1 = '\0';
+ p = s1;
+ q = s2;
+ while (*q)
+ *p++ = *q++;
+ *p = '\0';
+
+ return s1;
+}
wcscpy.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wcsrchr.c
===================================================================
--- wcsrchr.c (nonexistent)
+++ wcsrchr.c (revision 520)
@@ -0,0 +1,88 @@
+/*
+FUNCTION
+ <>---wide-character string scanning operation
+
+ANSI_SYNOPSIS
+ #include
+ wchar_t *wcsrchr(const wchar_t *<[s]>, wchar_t <[c]>);
+
+TRAD_SYNOPSIS
+ #include
+ wchar_t *wcsrchr(<[s]>, <[c]>
+ const wchar_t *<[s]>;
+ wchar_t <[c]>;
+
+DESCRIPTION
+ The <> function locates the last occurrence of <[c]> in the
+ wide-character string pointed to by <[s]>. The value of <[c]> must be a
+ character representable as a type wchar_t and must be a wide-character
+ code corresponding to a valid character in the current locale.
+ The terminating null wide-character code is considered to be part of
+ the wide-character string.
+
+RETURNS
+ Upon successful completion, <> returns a pointer to the
+ wide-character code or a null pointer if <[c]> does not occur in the
+ wide-character string.
+
+PORTABILITY
+<> is ISO/IEC 9899/AMD1:1995 (ISO C).
+
+No supporting OS subroutines are required.
+*/
+
+/* $NetBSD: wcsrchr.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */
+
+/*-
+ * Copyright (c)1999 Citrus Project,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * citrus Id: wcsrchr.c,v 1.2 2000/12/21 05:07:25 itojun Exp
+ */
+
+#include <_ansi.h>
+#include
+#include
+
+wchar_t *
+_DEFUN (wcsrchr, (s, c),
+ _CONST wchar_t * s _AND
+ wchar_t c)
+{
+ _CONST wchar_t *p;
+
+ p = s;
+ while (*p)
+ p++;
+ while (s <= p)
+ {
+ if (*p == c)
+ {
+ /* LINTED interface specification */
+ return (wchar_t *) p;
+ }
+ p--;
+ }
+ return NULL;
+}
wcsrchr.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strncat.c
===================================================================
--- strncat.c (nonexistent)
+++ strncat.c (revision 520)
@@ -0,0 +1,114 @@
+/*
+FUNCTION
+ <>---concatenate strings
+
+INDEX
+ strncat
+
+ANSI_SYNOPSIS
+ #include
+ char *strncat(char *<[dst]>, const char *<[src]>, size_t <[length]>);
+
+TRAD_SYNOPSIS
+ #include
+ char *strncat(<[dst]>, <[src]>, <[length]>)
+ char *<[dst]>;
+ char *<[src]>;
+ size_t <[length]>;
+
+DESCRIPTION
+ <> appends not more than <[length]> characters from
+ the string pointed to by <[src]> (including the terminating
+ null character) to the end of the string pointed to by
+ <[dst]>. The initial character of <[src]> overwrites the null
+ character at the end of <[dst]>. A terminating null character
+ is always appended to the result
+
+WARNINGS
+ Note that a null is always appended, so that if the copy is
+ limited by the <[length]> argument, the number of characters
+ appended to <[dst]> is <>.
+
+RETURNS
+ This function returns the initial value of <[dst]>
+
+PORTABILITY
+<> is ANSI C.
+
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ strncat ansi pure
+*/
+
+#include
+#include
+
+/* Nonzero if X is aligned on a "long" boundary. */
+#define ALIGNED(X) \
+ (((long)X & (sizeof (long) - 1)) == 0)
+
+#if LONG_MAX == 2147483647L
+#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
+#else
+#if LONG_MAX == 9223372036854775807L
+/* Nonzero if X (a long int) contains a NULL byte. */
+#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
+#else
+#error long int is not a 32bit or 64bit type.
+#endif
+#endif
+
+#ifndef DETECTNULL
+#error long int is not a 32bit or 64bit byte
+#endif
+
+char *
+_DEFUN (strncat, (s1, s2, n),
+ char *s1 _AND
+ _CONST char *s2 _AND
+ size_t n)
+{
+#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
+ char *s = s1;
+
+ while (*s1)
+ s1++;
+ while (n-- != 0 && (*s1++ = *s2++))
+ {
+ if (n == 0)
+ *s1 = '\0';
+ }
+
+ return s;
+#else
+ char *s = s1;
+
+ /* Skip over the data in s1 as quickly as possible. */
+ if (ALIGNED (s1))
+ {
+ unsigned long *aligned_s1 = (unsigned long *)s1;
+ while (!DETECTNULL (*aligned_s1))
+ aligned_s1++;
+
+ s1 = (char *)aligned_s1;
+ }
+
+ while (*s1)
+ s1++;
+
+ /* s1 now points to the its trailing null character, now copy
+ up to N bytes from S2 into S1 stopping if a NULL is encountered
+ in S2.
+
+ It is not safe to use strncpy here since it copies EXACTLY N
+ characters, NULL padding if necessary. */
+ while (n-- != 0 && (*s1++ = *s2++))
+ {
+ if (n == 0)
+ *s1 = '\0';
+ }
+
+ return s;
+#endif /* not PREFER_SIZE_OVER_SPEED */
+}
strncat.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memcmp.c
===================================================================
--- memcmp.c (nonexistent)
+++ memcmp.c (revision 520)
@@ -0,0 +1,113 @@
+/*
+FUNCTION
+ <>---compare two memory areas
+
+INDEX
+ memcmp
+
+ANSI_SYNOPSIS
+ #include
+ int memcmp(const void *<[s1]>, const void *<[s2]>, size_t <[n]>);
+
+TRAD_SYNOPSIS
+ #include
+ int memcmp(<[s1]>, <[s2]>, <[n]>)
+ void *<[s1]>;
+ void *<[s2]>;
+ size_t <[n]>;
+
+DESCRIPTION
+ This function compares not more than <[n]> characters of the
+ object pointed to by <[s1]> with the object pointed to by <[s2]>.
+
+
+RETURNS
+ The function returns an integer greater than, equal to or
+ less than zero according to whether the object pointed to by
+ <[s1]> is greater than, equal to or less than the object
+ pointed to by <[s2]>.
+
+PORTABILITY
+<> is ANSI C.
+
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ memcmp ansi pure
+*/
+
+#include
+
+
+/* Nonzero if either X or Y is not aligned on a "long" boundary. */
+#define UNALIGNED(X, Y) \
+ (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
+
+/* How many bytes are copied each iteration of the word copy loop. */
+#define LBLOCKSIZE (sizeof (long))
+
+/* Threshhold for punting to the byte copier. */
+#define TOO_SMALL(LEN) ((LEN) < LBLOCKSIZE)
+
+int
+_DEFUN (memcmp, (m1, m2, n),
+ _CONST _PTR m1 _AND
+ _CONST _PTR m2 _AND
+ size_t n)
+{
+#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
+ unsigned char *s1 = (unsigned char *) m1;
+ unsigned char *s2 = (unsigned char *) m2;
+
+ while (n--)
+ {
+ if (*s1 != *s2)
+ {
+ return *s1 - *s2;
+ }
+ s1++;
+ s2++;
+ }
+ return 0;
+#else
+ unsigned char *s1 = (unsigned char *) m1;
+ unsigned char *s2 = (unsigned char *) m2;
+ unsigned long *a1;
+ unsigned long *a2;
+
+ /* If the size is too small, or either pointer is unaligned,
+ then we punt to the byte compare loop. Hopefully this will
+ not turn up in inner loops. */
+ if (!TOO_SMALL(n) && !UNALIGNED(s1,s2))
+ {
+ /* Otherwise, load and compare the blocks of memory one
+ word at a time. */
+ a1 = (unsigned long*) s1;
+ a2 = (unsigned long*) s2;
+ while (n >= LBLOCKSIZE)
+ {
+ if (*a1 != *a2)
+ break;
+ a1++;
+ a2++;
+ n -= LBLOCKSIZE;
+ }
+
+ /* check m mod LBLOCKSIZE remaining characters */
+
+ s1 = (unsigned char*)a1;
+ s2 = (unsigned char*)a2;
+ }
+
+ while (n--)
+ {
+ if (*s1 != *s2)
+ return *s1 - *s2;
+ s1++;
+ s2++;
+ }
+
+ return 0;
+#endif /* not PREFER_SIZE_OVER_SPEED */
+}
+
memcmp.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strndup_r.c
===================================================================
--- strndup_r.c (nonexistent)
+++ strndup_r.c (revision 520)
@@ -0,0 +1,27 @@
+#include
+#include
+#include
+
+char *
+_DEFUN (_strndup_r, (reent_ptr, str, n),
+ struct _reent *reent_ptr _AND
+ _CONST char *str _AND
+ size_t n)
+{
+ _CONST char *ptr = str;
+ size_t len;
+ char *copy;
+
+ while (n-- > 0 && *ptr)
+ ptr++;
+
+ len = ptr - str;
+
+ copy = _malloc_r (reent_ptr, len + 1);
+ if (copy)
+ {
+ memcpy (copy, str, len);
+ copy[len] = '\0';
+ }
+ return copy;
+}
strndup_r.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wmemset.c
===================================================================
--- wmemset.c (nonexistent)
+++ wmemset.c (revision 520)
@@ -0,0 +1,82 @@
+/*
+FUNCTION
+ <>---set wide characters in memory
+
+ANSI_SYNOPSIS
+ #include
+ wchar_t *wmemset(wchar_t *<[s]>, wchar_t <[c]>, size_t <[n]>);
+
+TRAD_SYNOPSIS
+ wchar_t *wmemset(<[s]>, <[c]>, <[n]>
+ wchar_t *<[s]>;
+ wchar_t <[c]>;
+ size_t <[n]>;
+
+DESCRIPTION
+ The <> function copies the value of <[c]> into each of the
+ first <[n]> wide characters of the object pointed to by <[s]>. This
+ function is not affected by locale and all wchar_t values are treated
+ identically. The null wide character and wchar_t values not
+ corresponding to valid characters are not treated specially.
+
+ If <[n]> is zero, <[s]> must be a valid pointer and the function
+ copies zero wide characters.
+
+RETURNS
+ The <> function returns the value of <[s]>.
+
+PORTABILITY
+<> is ISO/IEC 9899/AMD1:1995 (ISO C).
+
+No supporting OS subroutines are required.
+*/
+
+/* $NetBSD: wmemset.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */
+
+/*-
+ * Copyright (c)1999 Citrus Project,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * citrus Id: wmemset.c,v 1.2 2000/12/20 14:08:31 itojun Exp
+ */
+
+#include <_ansi.h>
+#include
+
+wchar_t *
+_DEFUN(wmemset, (s, c, n),
+ wchar_t *s _AND
+ wchar_t c _AND
+ size_t n)
+{
+ size_t i;
+ wchar_t *p;
+
+ p = (wchar_t *)s;
+ for (i = 0; i < n; i++) {
+ *p = c;
+ p++;
+ }
+ return s;
+}
wmemset.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: str-two-way.h
===================================================================
--- str-two-way.h (nonexistent)
+++ str-two-way.h (revision 520)
@@ -0,0 +1,415 @@
+/* Byte-wise substring search, using the Two-Way algorithm.
+ * Copyright (C) 2008 Eric Blake
+ * Permission to use, copy, modify, and distribute this software
+ * is freely granted, provided that this notice is preserved.
+ */
+
+
+/* Before including this file, you need to include , and define:
+ RESULT_TYPE A macro that expands to the return type.
+ AVAILABLE(h, h_l, j, n_l) A macro that returns nonzero if there are
+ at least N_L bytes left starting at
+ H[J]. H is 'unsigned char *', H_L, J,
+ and N_L are 'size_t'; H_L is an
+ lvalue. For NUL-terminated searches,
+ H_L can be modified each iteration to
+ avoid having to compute the end of H
+ up front.
+
+ For case-insensitivity, you may optionally define:
+ CMP_FUNC(p1, p2, l) A macro that returns 0 iff the first L
+ characters of P1 and P2 are equal.
+ CANON_ELEMENT(c) A macro that canonicalizes an element
+ right after it has been fetched from
+ one of the two strings. The argument
+ is an 'unsigned char'; the result must
+ be an 'unsigned char' as well.
+
+ This file undefines the macros documented above, and defines
+ LONG_NEEDLE_THRESHOLD.
+*/
+
+#include
+#include
+
+/* We use the Two-Way string matching algorithm, which guarantees
+ linear complexity with constant space. Additionally, for long
+ needles, we also use a bad character shift table similar to the
+ Boyer-Moore algorithm to achieve improved (potentially sub-linear)
+ performance.
+
+ See http://www-igm.univ-mlv.fr/~lecroq/string/node26.html#SECTION00260
+ and http://en.wikipedia.org/wiki/Boyer-Moore_string_search_algorithm
+*/
+
+/* Point at which computing a bad-byte shift table is likely to be
+ worthwhile. Small needles should not compute a table, since it
+ adds (1 << CHAR_BIT) + NEEDLE_LEN computations of preparation for a
+ speedup no greater than a factor of NEEDLE_LEN. The larger the
+ needle, the better the potential performance gain. On the other
+ hand, on non-POSIX systems with CHAR_BIT larger than eight, the
+ memory required for the table is prohibitive. */
+#if CHAR_BIT < 10
+# define LONG_NEEDLE_THRESHOLD 32U
+#else
+# define LONG_NEEDLE_THRESHOLD SIZE_MAX
+#endif
+
+#define MAX(a, b) ((a < b) ? (b) : (a))
+
+#ifndef CANON_ELEMENT
+# define CANON_ELEMENT(c) c
+#endif
+#ifndef CMP_FUNC
+# define CMP_FUNC memcmp
+#endif
+
+/* Perform a critical factorization of NEEDLE, of length NEEDLE_LEN.
+ Return the index of the first byte in the right half, and set
+ *PERIOD to the global period of the right half.
+
+ The global period of a string is the smallest index (possibly its
+ length) at which all remaining bytes in the string are repetitions
+ of the prefix (the last repetition may be a subset of the prefix).
+
+ When NEEDLE is factored into two halves, a local period is the
+ length of the smallest word that shares a suffix with the left half
+ and shares a prefix with the right half. All factorizations of a
+ non-empty NEEDLE have a local period of at least 1 and no greater
+ than NEEDLE_LEN.
+
+ A critical factorization has the property that the local period
+ equals the global period. All strings have at least one critical
+ factorization with the left half smaller than the global period.
+
+ Given an ordered alphabet, a critical factorization can be computed
+ in linear time, with 2 * NEEDLE_LEN comparisons, by computing the
+ larger of two ordered maximal suffixes. The ordered maximal
+ suffixes are determined by lexicographic comparison of
+ periodicity. */
+static size_t
+critical_factorization (const unsigned char *needle, size_t needle_len,
+ size_t *period)
+{
+ /* Index of last byte of left half, or SIZE_MAX. */
+ size_t max_suffix, max_suffix_rev;
+ size_t j; /* Index into NEEDLE for current candidate suffix. */
+ size_t k; /* Offset into current period. */
+ size_t p; /* Intermediate period. */
+ unsigned char a, b; /* Current comparison bytes. */
+
+ /* Invariants:
+ 0 <= j < NEEDLE_LEN - 1
+ -1 <= max_suffix{,_rev} < j (treating SIZE_MAX as if it were signed)
+ min(max_suffix, max_suffix_rev) < global period of NEEDLE
+ 1 <= p <= global period of NEEDLE
+ p == global period of the substring NEEDLE[max_suffix{,_rev}+1...j]
+ 1 <= k <= p
+ */
+
+ /* Perform lexicographic search. */
+ max_suffix = SIZE_MAX;
+ j = 0;
+ k = p = 1;
+ while (j + k < needle_len)
+ {
+ a = CANON_ELEMENT (needle[j + k]);
+ b = CANON_ELEMENT (needle[(size_t)(max_suffix + k)]);
+ if (a < b)
+ {
+ /* Suffix is smaller, period is entire prefix so far. */
+ j += k;
+ k = 1;
+ p = j - max_suffix;
+ }
+ else if (a == b)
+ {
+ /* Advance through repetition of the current period. */
+ if (k != p)
+ ++k;
+ else
+ {
+ j += p;
+ k = 1;
+ }
+ }
+ else /* b < a */
+ {
+ /* Suffix is larger, start over from current location. */
+ max_suffix = j++;
+ k = p = 1;
+ }
+ }
+ *period = p;
+
+ /* Perform reverse lexicographic search. */
+ max_suffix_rev = SIZE_MAX;
+ j = 0;
+ k = p = 1;
+ while (j + k < needle_len)
+ {
+ a = CANON_ELEMENT (needle[j + k]);
+ b = CANON_ELEMENT (needle[max_suffix_rev + k]);
+ if (b < a)
+ {
+ /* Suffix is smaller, period is entire prefix so far. */
+ j += k;
+ k = 1;
+ p = j - max_suffix_rev;
+ }
+ else if (a == b)
+ {
+ /* Advance through repetition of the current period. */
+ if (k != p)
+ ++k;
+ else
+ {
+ j += p;
+ k = 1;
+ }
+ }
+ else /* a < b */
+ {
+ /* Suffix is larger, start over from current location. */
+ max_suffix_rev = j++;
+ k = p = 1;
+ }
+ }
+
+ /* Choose the longer suffix. Return the first byte of the right
+ half, rather than the last byte of the left half. */
+ if (max_suffix_rev + 1 < max_suffix + 1)
+ return max_suffix + 1;
+ *period = p;
+ return max_suffix_rev + 1;
+}
+
+/* Return the first location of non-empty NEEDLE within HAYSTACK, or
+ NULL. HAYSTACK_LEN is the minimum known length of HAYSTACK. This
+ method is optimized for NEEDLE_LEN < LONG_NEEDLE_THRESHOLD.
+ Performance is guaranteed to be linear, with an initialization cost
+ of 2 * NEEDLE_LEN comparisons.
+
+ If AVAILABLE does not modify HAYSTACK_LEN (as in memmem), then at
+ most 2 * HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching.
+ If AVAILABLE modifies HAYSTACK_LEN (as in strstr), then at most 3 *
+ HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching. */
+static RETURN_TYPE
+two_way_short_needle (const unsigned char *haystack, size_t haystack_len,
+ const unsigned char *needle, size_t needle_len)
+{
+ size_t i; /* Index into current byte of NEEDLE. */
+ size_t j; /* Index into current window of HAYSTACK. */
+ size_t period; /* The period of the right half of needle. */
+ size_t suffix; /* The index of the right half of needle. */
+
+ /* Factor the needle into two halves, such that the left half is
+ smaller than the global period, and the right half is
+ periodic (with a period as large as NEEDLE_LEN - suffix). */
+ suffix = critical_factorization (needle, needle_len, &period);
+
+ /* Perform the search. Each iteration compares the right half
+ first. */
+ if (CMP_FUNC (needle, needle + period, suffix) == 0)
+ {
+ /* Entire needle is periodic; a mismatch can only advance by the
+ period, so use memory to avoid rescanning known occurrences
+ of the period. */
+ size_t memory = 0;
+ j = 0;
+ while (AVAILABLE (haystack, haystack_len, j, needle_len))
+ {
+ /* Scan for matches in right half. */
+ i = MAX (suffix, memory);
+ while (i < needle_len && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ ++i;
+ if (needle_len <= i)
+ {
+ /* Scan for matches in left half. */
+ i = suffix - 1;
+ while (memory < i + 1 && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ --i;
+ if (i + 1 < memory + 1)
+ return (RETURN_TYPE) (haystack + j);
+ /* No match, so remember how many repetitions of period
+ on the right half were scanned. */
+ j += period;
+ memory = needle_len - period;
+ }
+ else
+ {
+ j += i - suffix + 1;
+ memory = 0;
+ }
+ }
+ }
+ else
+ {
+ /* The two halves of needle are distinct; no extra memory is
+ required, and any mismatch results in a maximal shift. */
+ period = MAX (suffix, needle_len - suffix) + 1;
+ j = 0;
+ while (AVAILABLE (haystack, haystack_len, j, needle_len))
+ {
+ /* Scan for matches in right half. */
+ i = suffix;
+ while (i < needle_len && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ ++i;
+ if (needle_len <= i)
+ {
+ /* Scan for matches in left half. */
+ i = suffix - 1;
+ while (i != SIZE_MAX && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ --i;
+ if (i == SIZE_MAX)
+ return (RETURN_TYPE) (haystack + j);
+ j += period;
+ }
+ else
+ j += i - suffix + 1;
+ }
+ }
+ return NULL;
+}
+
+/* Return the first location of non-empty NEEDLE within HAYSTACK, or
+ NULL. HAYSTACK_LEN is the minimum known length of HAYSTACK. This
+ method is optimized for LONG_NEEDLE_THRESHOLD <= NEEDLE_LEN.
+ Performance is guaranteed to be linear, with an initialization cost
+ of 3 * NEEDLE_LEN + (1 << CHAR_BIT) operations.
+
+ If AVAILABLE does not modify HAYSTACK_LEN (as in memmem), then at
+ most 2 * HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching,
+ and sublinear performance O(HAYSTACK_LEN / NEEDLE_LEN) is possible.
+ If AVAILABLE modifies HAYSTACK_LEN (as in strstr), then at most 3 *
+ HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching, and
+ sublinear performance is not possible. */
+static RETURN_TYPE
+two_way_long_needle (const unsigned char *haystack, size_t haystack_len,
+ const unsigned char *needle, size_t needle_len)
+{
+ size_t i; /* Index into current byte of NEEDLE. */
+ size_t j; /* Index into current window of HAYSTACK. */
+ size_t period; /* The period of the right half of needle. */
+ size_t suffix; /* The index of the right half of needle. */
+ size_t shift_table[1U << CHAR_BIT]; /* See below. */
+
+ /* Factor the needle into two halves, such that the left half is
+ smaller than the global period, and the right half is
+ periodic (with a period as large as NEEDLE_LEN - suffix). */
+ suffix = critical_factorization (needle, needle_len, &period);
+
+ /* Populate shift_table. For each possible byte value c,
+ shift_table[c] is the distance from the last occurrence of c to
+ the end of NEEDLE, or NEEDLE_LEN if c is absent from the NEEDLE.
+ shift_table[NEEDLE[NEEDLE_LEN - 1]] contains the only 0. */
+ for (i = 0; i < 1U << CHAR_BIT; i++)
+ shift_table[i] = needle_len;
+ for (i = 0; i < needle_len; i++)
+ shift_table[CANON_ELEMENT (needle[i])] = needle_len - i - 1;
+
+ /* Perform the search. Each iteration compares the right half
+ first. */
+ if (CMP_FUNC (needle, needle + period, suffix) == 0)
+ {
+ /* Entire needle is periodic; a mismatch can only advance by the
+ period, so use memory to avoid rescanning known occurrences
+ of the period. */
+ size_t memory = 0;
+ size_t shift;
+ j = 0;
+ while (AVAILABLE (haystack, haystack_len, j, needle_len))
+ {
+ /* Check the last byte first; if it does not match, then
+ shift to the next possible match location. */
+ shift = shift_table[CANON_ELEMENT (haystack[j + needle_len - 1])];
+ if (0 < shift)
+ {
+ if (memory && shift < period)
+ {
+ /* Since needle is periodic, but the last period has
+ a byte out of place, there can be no match until
+ after the mismatch. */
+ shift = needle_len - period;
+ memory = 0;
+ }
+ j += shift;
+ continue;
+ }
+ /* Scan for matches in right half. The last byte has
+ already been matched, by virtue of the shift table. */
+ i = MAX (suffix, memory);
+ while (i < needle_len - 1 && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ ++i;
+ if (needle_len - 1 <= i)
+ {
+ /* Scan for matches in left half. */
+ i = suffix - 1;
+ while (memory < i + 1 && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ --i;
+ if (i + 1 < memory + 1)
+ return (RETURN_TYPE) (haystack + j);
+ /* No match, so remember how many repetitions of period
+ on the right half were scanned. */
+ j += period;
+ memory = needle_len - period;
+ }
+ else
+ {
+ j += i - suffix + 1;
+ memory = 0;
+ }
+ }
+ }
+ else
+ {
+ /* The two halves of needle are distinct; no extra memory is
+ required, and any mismatch results in a maximal shift. */
+ size_t shift;
+ period = MAX (suffix, needle_len - suffix) + 1;
+ j = 0;
+ while (AVAILABLE (haystack, haystack_len, j, needle_len))
+ {
+ /* Check the last byte first; if it does not match, then
+ shift to the next possible match location. */
+ shift = shift_table[CANON_ELEMENT (haystack[j + needle_len - 1])];
+ if (0 < shift)
+ {
+ j += shift;
+ continue;
+ }
+ /* Scan for matches in right half. The last byte has
+ already been matched, by virtue of the shift table. */
+ i = suffix;
+ while (i < needle_len - 1 && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ ++i;
+ if (needle_len - 1 <= i)
+ {
+ /* Scan for matches in left half. */
+ i = suffix - 1;
+ while (i != SIZE_MAX && (CANON_ELEMENT (needle[i])
+ == CANON_ELEMENT (haystack[i + j])))
+ --i;
+ if (i == SIZE_MAX)
+ return (RETURN_TYPE) (haystack + j);
+ j += period;
+ }
+ else
+ j += i - suffix + 1;
+ }
+ }
+ return NULL;
+}
+
+#undef AVAILABLE
+#undef CANON_ELEMENT
+#undef CMP_FUNC
+#undef MAX
+#undef RETURN_TYPE
str-two-way.h
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wcpncpy.c
===================================================================
--- wcpncpy.c (nonexistent)
+++ wcpncpy.c (revision 520)
@@ -0,0 +1,61 @@
+/*
+FUNCTION
+ <>---copy part of a wide-character string returning a pointer to its end
+
+ANSI_SYNOPSIS
+ #include
+ wchar_t *wcpncpy(wchar_t *<[s1]>, const wchar_t *<[s2]>, size_t <[n]>);
+
+TRAD_SYNOPSIS
+ wchar_t *wcpncpy(<[s1]>, <[s2]>, <[n]>
+ wchar_t *<[s1]>;
+ const wchar_t *<[s2]>;
+ size_t <[n]>;
+
+DESCRIPTION
+ The <> function copies not more than n wide-character codes
+ (wide-character codes that follow a null wide-character code are not
+ copied) from the array pointed to by <[s2]> to the array pointed to
+ by <[s1]>. If copying takes place between objects that overlap, the
+ behaviour is undefined.
+
+ If the array pointed to by <[s2]> is a wide-character string that is
+ shorter than <[n]> wide-character codes, null wide-character codes are
+ appended to the copy in the array pointed to by <[s1]>, until <[n]>
+ wide-character codes in all are written.
+
+RETURNS
+ The <> function returns <[s1]>; no return value is reserved to
+ indicate an error.
+
+PORTABILITY
+<> is ISO/IEC 9899/AMD1:1995 (ISO C).
+
+No supporting OS subroutines are required.
+*/
+
+#include <_ansi.h>
+#include
+
+wchar_t *
+_DEFUN (wcpncpy, (dst, src, count),
+ wchar_t * dst _AND
+ _CONST wchar_t * src _AND
+ size_t count)
+{
+ wchar_t *ret = NULL;
+
+ while (count > 0)
+ {
+ --count;
+ if ((*dst++ = *src++) == L'\0')
+ {
+ ret = dst - 1;
+ break;
+ }
+ }
+ while (count-- > 0)
+ *dst++ = L'\0';
+
+ return ret ? ret : dst;
+}
wcpncpy.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wcscat.c
===================================================================
--- wcscat.c (nonexistent)
+++ wcscat.c (revision 520)
@@ -0,0 +1,85 @@
+/*
+FUNCTION
+ <>---concatenate two wide-character strings
+INDEX
+ wcscat
+
+ANSI_SYNOPSIS
+ #include
+ wchar_t *wcscat(wchar_t *<[s1]>, const wchar_t *<[s2]>);
+
+TRAD_SYNOPSIS
+ wchar_t *wcscat(<[s1]>, <[s2]>
+ wchar_t *<[s1]>;
+ const wchar_t *<[s2]>;
+
+DESCRIPTION
+ The <> function appends a copy of the wide-character string
+ pointed to by <[s2]> (including the terminating null wide-character
+ code) to the end of the wide-character string pointed to by <[s1]>.
+ The initial wide-character code of <[s2]> overwrites the null
+ wide-character code at the end of <[s1]>. If copying takes place between
+ objects that overlap, the behaviour is undefined.
+
+RETURNS
+ The <> function returns <[s1]>;
+ no return value is reserved to indicate an error.
+
+PORTABILITY
+<> is ISO/IEC 9899/AMD1:1995 (ISO C).
+
+No supporting OS subroutines are required.
+*/
+
+/* $NetBSD: wcscat.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */
+
+/*-
+ * Copyright (c)1999 Citrus Project,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * citrus Id: wcscat.c,v 1.1 1999/12/29 21:47:45 tshiozak Exp
+ */
+
+#include <_ansi.h>
+#include
+
+wchar_t *
+_DEFUN (wcscat, (s1, s2),
+ wchar_t * s1 _AND
+ _CONST wchar_t * s2)
+{
+ wchar_t *p;
+ wchar_t *q;
+ _CONST wchar_t *r;
+
+ p = s1;
+ while (*p)
+ p++;
+ q = p;
+ r = s2;
+ while (*r)
+ *q++ = *r++;
+ *q = '\0';
+ return s1;
+}
wcscat.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wcslcpy.c
===================================================================
--- wcslcpy.c (nonexistent)
+++ wcslcpy.c (revision 520)
@@ -0,0 +1,102 @@
+/*
+FUNCTION
+ <>---copy a wide-character string to specified length
+
+ANSI_SYNOPSIS
+ #include
+ size_t wcslcpy(wchar_t *<[dst]>, const wchar_t *<[src]>, size_t <[siz]>);
+
+TRAD_SYNOPSIS
+ #include
+ size_t wcslcpy(<[dst]>, <[src]>, <[siz]>)
+ wchar_t *<[dst]>;
+ const wchar_t *<[src]>;
+ size_t <[siz]>;
+
+DESCRIPTION
+ <> copies wide characters from <[src]> to <[dst]>
+ such that up to <[siz]> - 1 characters are copied. A
+ terminating null is appended to the result, unless <[siz]>
+ is zero.
+
+RETURNS
+ <> returns the number of wide characters in <[src]>,
+ not including the terminating null wide character. If the
+ return value is greater than or equal to <[siz]>, then
+ not all wide characters were copied from <[src]> and truncation
+ occurred.
+
+PORTABILITY
+No supporting OS subroutines are required.
+*/
+
+/* $NetBSD: wcslcpy.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */
+/* from OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp */
+
+/*
+ * Copyright (c) 1998 Todd C. Miller
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+ * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <_ansi.h>
+#include
+
+/*
+ * Copy src to string dst of size siz. At most siz-1 characters
+ * will be copied. Always NUL terminates (unless siz == 0).
+ * Returns wcslen(src); if retval >= siz, truncation occurred.
+ */
+size_t
+_DEFUN (wcslcpy, (dst, src, siz),
+ wchar_t * dst _AND
+ _CONST wchar_t * src _AND
+ size_t siz)
+{
+ wchar_t *d = dst;
+ _CONST wchar_t *s = src;
+ size_t n = siz;
+
+ /* Copy as many bytes as will fit */
+ if (n != 0 && --n != 0)
+ {
+ do
+ {
+ if ((*d++ = *s++) == 0)
+ break;
+ }
+ while (--n != 0);
+ }
+
+ /* Not enough room in dst, add NUL and traverse rest of src */
+ if (n == 0)
+ {
+ if (siz != 0)
+ *d = '\0'; /* NUL-terminate dst */
+ while (*s++)
+ ;
+ }
+
+ return (s - src - 1); /* count does not include NUL */
+}
wcslcpy.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strnlen.c
===================================================================
--- strnlen.c (nonexistent)
+++ strnlen.c (revision 520)
@@ -0,0 +1,49 @@
+/*
+FUNCTION
+ <>---character string length
+
+INDEX
+ strnlen
+
+ANSI_SYNOPSIS
+ #include
+ size_t strnlen(const char *<[str]>, size_t <[n]>);
+
+TRAD_SYNOPSIS
+ #include
+ size_t strnlen(<[str]>, <[n]>)
+ char *<[src]>;
+ size_t <[n]>;
+
+DESCRIPTION
+ The <> function works out the length of the string
+ starting at <<*<[str]>>> by counting chararacters until it
+ reaches a NUL character or the maximum: <[n]> number of
+ characters have been inspected.
+
+RETURNS
+ <> returns the character count or <[n]>.
+
+PORTABILITY
+<> is a GNU extension.
+
+<> requires no supporting OS subroutines.
+
+*/
+
+#undef __STRICT_ANSI__
+#include <_ansi.h>
+#include
+
+size_t
+_DEFUN (strnlen, (str, n),
+ _CONST char *str _AND
+ size_t n)
+{
+ _CONST char *start = str;
+
+ while (n-- > 0 && *str)
+ str++;
+
+ return str - start;
+}
strnlen.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strncmp.c
===================================================================
--- strncmp.c (nonexistent)
+++ strncmp.c (revision 520)
@@ -0,0 +1,122 @@
+/*
+FUNCTION
+ <>---character string compare
+
+INDEX
+ strncmp
+
+ANSI_SYNOPSIS
+ #include
+ int strncmp(const char *<[a]>, const char * <[b]>, size_t <[length]>);
+
+TRAD_SYNOPSIS
+ #include
+ int strncmp(<[a]>, <[b]>, <[length]>)
+ char *<[a]>;
+ char *<[b]>;
+ size_t <[length]>
+
+DESCRIPTION
+ <> compares up to <[length]> characters
+ from the string at <[a]> to the string at <[b]>.
+
+RETURNS
+ If <<*<[a]>>> sorts lexicographically after <<*<[b]>>>,
+ <> returns a number greater than zero. If the two
+ strings are equivalent, <> returns zero. If <<*<[a]>>>
+ sorts lexicographically before <<*<[b]>>>, <> returns a
+ number less than zero.
+
+PORTABILITY
+<> is ANSI C.
+
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ strncmp ansi pure
+*/
+
+#include
+#include
+
+/* Nonzero if either X or Y is not aligned on a "long" boundary. */
+#define UNALIGNED(X, Y) \
+ (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
+
+/* DETECTNULL returns nonzero if (long)X contains a NULL byte. */
+#if LONG_MAX == 2147483647L
+#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
+#else
+#if LONG_MAX == 9223372036854775807L
+#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
+#else
+#error long int is not a 32bit or 64bit type.
+#endif
+#endif
+
+#ifndef DETECTNULL
+#error long int is not a 32bit or 64bit byte
+#endif
+
+int
+_DEFUN (strncmp, (s1, s2, n),
+ _CONST char *s1 _AND
+ _CONST char *s2 _AND
+ size_t n)
+{
+#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
+ if (n == 0)
+ return 0;
+
+ while (n-- != 0 && *s1 == *s2)
+ {
+ if (n == 0 || *s1 == '\0')
+ break;
+ s1++;
+ s2++;
+ }
+
+ return (*(unsigned char *) s1) - (*(unsigned char *) s2);
+#else
+ unsigned long *a1;
+ unsigned long *a2;
+
+ if (n == 0)
+ return 0;
+
+ /* If s1 or s2 are unaligned, then compare bytes. */
+ if (!UNALIGNED (s1, s2))
+ {
+ /* If s1 and s2 are word-aligned, compare them a word at a time. */
+ a1 = (unsigned long*)s1;
+ a2 = (unsigned long*)s2;
+ while (n >= sizeof (long) && *a1 == *a2)
+ {
+ n -= sizeof (long);
+
+ /* If we've run out of bytes or hit a null, return zero
+ since we already know *a1 == *a2. */
+ if (n == 0 || DETECTNULL (*a1))
+ return 0;
+
+ a1++;
+ a2++;
+ }
+
+ /* A difference was detected in last few bytes of s1, so search bytewise */
+ s1 = (char*)a1;
+ s2 = (char*)a2;
+ }
+
+ while (n-- > 0 && *s1 == *s2)
+ {
+ /* If we've run out of bytes or hit a null, return zero
+ since we already know *s1 == *s2. */
+ if (n == 0 || *s1 == '\0')
+ return 0;
+ s1++;
+ s2++;
+ }
+ return (*(unsigned char *) s1) - (*(unsigned char *) s2);
+#endif /* not PREFER_SIZE_OVER_SPEED */
+}
strncmp.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: Makefile.am
===================================================================
--- Makefile.am (nonexistent)
+++ Makefile.am (revision 520)
@@ -0,0 +1,156 @@
+## Process this file with automake to generate Makefile.in
+
+AUTOMAKE_OPTIONS = cygnus
+
+INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
+
+GENERAL_SOURCES = \
+ bcopy.c \
+ bzero.c \
+ index.c \
+ memchr.c \
+ memcmp.c \
+ memcpy.c \
+ memmove.c \
+ memset.c \
+ rindex.c \
+ strcasecmp.c \
+ strcat.c \
+ strchr.c \
+ strcmp.c \
+ strcoll.c \
+ strcpy.c \
+ strcspn.c \
+ strdup.c \
+ strdup_r.c \
+ strerror.c \
+ strerror_r.c \
+ strlcat.c \
+ strlcpy.c \
+ strlen.c \
+ strlwr.c \
+ strncasecmp.c \
+ strncat.c \
+ strncmp.c \
+ strncpy.c \
+ strnlen.c \
+ strpbrk.c \
+ strrchr.c \
+ strsep.c \
+ strspn.c \
+ strtok.c \
+ strtok_r.c \
+ strupr.c \
+ strxfrm.c \
+ strstr.c \
+ swab.c \
+ u_strerr.c \
+ wcscat.c \
+ wcschr.c \
+ wcscmp.c \
+ wcscoll.c \
+ wcscpy.c \
+ wcscspn.c \
+ wcslcat.c \
+ wcslcpy.c \
+ wcslen.c \
+ wcsncat.c \
+ wcsncmp.c \
+ wcsncpy.c \
+ wcsnlen.c \
+ wcspbrk.c \
+ wcsrchr.c \
+ wcsspn.c \
+ wcsstr.c \
+ wcstok.c \
+ wcswidth.c \
+ wcsxfrm.c \
+ wcwidth.c \
+ wmemchr.c \
+ wmemcmp.c \
+ wmemcpy.c \
+ wmemmove.c \
+ wmemset.c
+
+if ELIX_LEVEL_1
+ELIX_2_SOURCES =
+else
+ELIX_2_SOURCES = \
+ bcmp.c \
+ memccpy.c \
+ mempcpy.c \
+ stpcpy.c \
+ stpncpy.c \
+ strndup.c \
+ strcasestr.c \
+ strndup_r.c \
+ wcpcpy.c \
+ wcpncpy.c \
+ wcsdup.c
+endif !ELIX_LEVEL_1
+
+if ELIX_LEVEL_1
+ELIX_4_SOURCES =
+else
+if ELIX_LEVEL_2
+ELIX_4_SOURCES =
+else
+if ELIX_LEVEL_3
+ELIX_4_SOURCES =
+else
+ELIX_4_SOURCES = \
+ memmem.c \
+ wcscasecmp.c \
+ wcsncasecmp.c
+endif !ELIX_LEVEL_3
+endif !ELIX_LEVEL_2
+endif !ELIX_LEVEL_1
+
+libstring_la_LDFLAGS = -Xcompiler -nostdlib
+
+if USE_LIBTOOL
+noinst_LTLIBRARIES = libstring.la
+libstring_la_SOURCES = $(GENERAL_SOURCES) $(ELIX_2_SOURCES) $(ELIX_4_SOURCES)
+noinst_DATA = objectlist.awk.in
+else
+noinst_LIBRARIES = lib.a
+lib_a_SOURCES = $(GENERAL_SOURCES) $(ELIX_2_SOURCES) $(ELIX_4_SOURCES)
+lib_a_CFLAGS = $(AM_CFLAGS)
+noinst_DATA =
+endif # USE_LIBTOOL
+
+include $(srcdir)/../../Makefile.shared
+
+CHEWOUT_FILES=\
+bcmp.def memcpy.def strcmp.def strncat.def strstr.def \
+bcopy.def memmove.def strcoll.def strncmp.def strtok.def \
+bzero.def memset.def strcpy.def strncpy.def strxfrm.def \
+index.def rindex.def strcspn.def strpbrk.def swab.def \
+memchr.def strcat.def strerror.def strerror_r.def strrchr.def \
+memcmp.def strchr.def strlen.def strnlen.def strspn.def \
+strcasecmp.def strncasecmp.def strcasestr.def strlwr.def strupr.def \
+memccpy.def mempcpy.def stpcpy.def stpncpy.def \
+wcscasecmp.def wcscat.def wcschr.def wcscmp.def wcscoll.def \
+wcscpy.def wcscspn.def wcpcpy.def wcpncpy.def wcsdup.def \
+wcslcat.def wcslcpy.def wcslen.def wcsncasecmp.def wcsncat.def \
+wcsncmp.def wcsncpy.def wcsnlen.def wcspbrk.def \
+wcsrchr.def wcsspn.def wcsstr.def wcstok.def \
+wcswidth.def wcsxfrm.def wcwidth.def wmemchr.def \
+wmemcmp.def wmemcpy.def wmemmove.def wmemset.def \
+memmem.def
+
+SUFFIXES = .def
+
+CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str
+
+.c.def:
+ $(CHEW) < $< > $*.def 2> $*.ref
+ touch stmp-def
+
+TARGETDOC = ../tmp.texi
+
+doc: $(CHEWOUT_FILES)
+ cat $(srcdir)/strings.tex >> $(TARGETDOC)
+ cat $(srcdir)/wcstrings.tex >> $(TARGETDOC)
+
+CLEANFILES = $(CHEWOUT_FILES) *.ref
Makefile.am
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: rindex.c
===================================================================
--- rindex.c (nonexistent)
+++ rindex.c (revision 520)
@@ -0,0 +1,44 @@
+/*
+FUNCTION
+ <>---reverse search for character in string
+
+INDEX
+ rindex
+
+ANSI_SYNOPSIS
+ #include
+ char * rindex(const char *<[string]>, int <[c]>);
+
+TRAD_SYNOPSIS
+ #include
+ char * rindex(<[string]>, <[c]>);
+ char *<[string]>;
+ int *<[c]>;
+
+DESCRIPTION
+ This function finds the last occurence of <[c]> (converted to
+ a char) in the string pointed to by <[string]> (including the
+ terminating null character).
+
+ This function is identical to <>.
+
+RETURNS
+ Returns a pointer to the located character, or a null pointer
+ if <[c]> does not occur in <[string]>.
+
+PORTABILITY
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ rindex - pure
+*/
+
+#include
+
+char *
+_DEFUN (rindex, (s, c),
+ _CONST char *s _AND
+ int c)
+{
+ return strrchr (s, c);
+}
rindex.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memset.c
===================================================================
--- memset.c (nonexistent)
+++ memset.c (revision 520)
@@ -0,0 +1,102 @@
+/*
+FUNCTION
+ <>---set an area of memory
+
+INDEX
+ memset
+
+ANSI_SYNOPSIS
+ #include
+ void *memset(void *<[dst]>, int <[c]>, size_t <[length]>);
+
+TRAD_SYNOPSIS
+ #include
+ void *memset(<[dst]>, <[c]>, <[length]>)
+ void *<[dst]>;
+ int <[c]>;
+ size_t <[length]>;
+
+DESCRIPTION
+ This function converts the argument <[c]> into an unsigned
+ char and fills the first <[length]> characters of the array
+ pointed to by <[dst]> to the value.
+
+RETURNS
+ <> returns the value of <[dst]>.
+
+PORTABILITY
+<> is ANSI C.
+
+ <> requires no supporting OS subroutines.
+
+QUICKREF
+ memset ansi pure
+*/
+
+#include
+
+#define LBLOCKSIZE (sizeof(long))
+#define UNALIGNED(X) ((long)X & (LBLOCKSIZE - 1))
+#define TOO_SMALL(LEN) ((LEN) < LBLOCKSIZE)
+
+_PTR
+_DEFUN (memset, (m, c, n),
+ _PTR m _AND
+ int c _AND
+ size_t n)
+{
+ char *s = (char *) m;
+
+#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__)
+ int i;
+ unsigned long buffer;
+ unsigned long *aligned_addr;
+ unsigned int d = c & 0xff; /* To avoid sign extension, copy C to an
+ unsigned variable. */
+
+ while (UNALIGNED (s))
+ {
+ if (n--)
+ *s++ = (char) c;
+ else
+ return m;
+ }
+
+ if (!TOO_SMALL (n))
+ {
+ /* If we get this far, we know that n is large and s is word-aligned. */
+ aligned_addr = (unsigned long *) s;
+
+ /* Store D into each char sized location in BUFFER so that
+ we can set large blocks quickly. */
+ buffer = (d << 8) | d;
+ buffer |= (buffer << 16);
+ for (i = 32; i < LBLOCKSIZE * 8; i <<= 1)
+ buffer = (buffer << i) | buffer;
+
+ /* Unroll the loop. */
+ while (n >= LBLOCKSIZE*4)
+ {
+ *aligned_addr++ = buffer;
+ *aligned_addr++ = buffer;
+ *aligned_addr++ = buffer;
+ *aligned_addr++ = buffer;
+ n -= 4*LBLOCKSIZE;
+ }
+
+ while (n >= LBLOCKSIZE)
+ {
+ *aligned_addr++ = buffer;
+ n -= LBLOCKSIZE;
+ }
+ /* Pick up the remainder with a bytewise loop. */
+ s = (char*)aligned_addr;
+ }
+
+#endif /* not PREFER_SIZE_OVER_SPEED */
+
+ while (n--)
+ *s++ = (char) c;
+
+ return m;
+}
memset.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wcslen.c
===================================================================
--- wcslen.c (nonexistent)
+++ wcslen.c (revision 520)
@@ -0,0 +1,72 @@
+/*
+FUNCTION
+ <>---get wide-character string length
+
+ANSI_SYNOPSIS
+ #include
+ size_t wcslen(const wchar_t *<[s]>);
+
+TRAD_SYNOPSIS
+ size_t wcslen(<[s]>
+ const wchar_t *<[s]>;
+
+DESCRIPTION
+ The <> function computes the number of wide-character codes
+ in the wide-character string to which <[s]> points, not including the
+ terminating null wide-character code.
+
+RETURNS
+ The <> function returns the length of <[s]>; no return value is
+ reserved to indicate an error.
+
+PORTABILITY
+<> is ISO/IEC 9899/AMD1:1995 (ISO C).
+
+No supporting OS subroutines are required.
+*/
+
+/* $NetBSD: wcslen.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */
+
+/*-
+ * Copyright (c)1999 Citrus Project,
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * citrus Id: wcslen.c,v 1.1 1999/12/29 21:47:45 tshiozak Exp
+ */
+
+#include <_ansi.h>
+#include
+
+size_t
+_DEFUN (wcslen, (s),
+ _CONST wchar_t * s)
+{
+ _CONST wchar_t *p;
+
+ p = s;
+ while (*p)
+ p++;
+
+ return p - s;
+}
wcslen.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: wcscmp.c
===================================================================
--- wcscmp.c (nonexistent)
+++ wcscmp.c (revision 520)
@@ -0,0 +1,83 @@
+/*
+FUNCTION
+ <>---compare two wide-character strings
+
+ANSI_SYNOPSIS
+ #include
+ int wcscmp(const wchar_t *<[s1]>, *<[s2]>);
+
+TRAD_SYNOPSIS
+ int wcscmp(<[s1]>, <[s2]>
+ const wchar_t *<[s1]>, <[s2]>;
+
+DESCRIPTION
+ The <> function compares the wide-character string pointed to
+ by <[s1]> to the wide-character string pointed to by <[s2]>.
+
+ The sign of a non-zero return value is determined by the sign of the
+ difference between the values of the first pair of wide-character codes
+ that differ in the objects being compared.
+
+RETURNS
+ Upon completion, <> returns an integer greater than, equal to
+ or less than 0, if the wide-character string pointed to by <[s1]> is
+ greater than, equal to or less than the wide-character string pointed
+ to by <[s2]> respectively.
+
+PORTABILITY
+<> is ISO/IEC 9899/AMD1:1995 (ISO C).
+
+No supporting OS subroutines are required.
+*/
+
+/* $NetBSD$ */
+
+/*-
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Chris Torek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <_ansi.h>
+#include
+
+/*
+ * Compare strings.
+ */
+int
+_DEFUN (wcscmp, (s1, s2),
+ _CONST wchar_t * s1 _AND
+ _CONST wchar_t * s2)
+{
+
+ while (*s1 == *s2++)
+ if (*s1++ == 0)
+ return (0);
+ return (*s1 - *--s2);
+}
wcscmp.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: strlwr.c
===================================================================
--- strlwr.c (nonexistent)
+++ strlwr.c (revision 520)
@@ -0,0 +1,46 @@
+/*
+FUNCTION
+ <>---force string to lowercase
+
+INDEX
+ strlwr
+
+ANSI_SYNOPSIS
+ #include
+ char *strlwr(char *<[a]>);
+
+TRAD_SYNOPSIS
+ #include
+ char *strlwr(<[a]>)
+ char *<[a]>;
+
+DESCRIPTION
+ <> converts each character in the string at <[a]> to
+ lowercase.
+
+RETURNS
+ <> returns its argument, <[a]>.
+
+PORTABILITY
+<> is not widely portable.
+
+<> requires no supporting OS subroutines.
+
+QUICKREF
+ strlwr
+*/
+
+#include
+#include
+
+char *
+_DEFUN (strlwr, (s),
+ char *s)
+{
+ unsigned char *ucs = (unsigned char *) s;
+ for ( ; *ucs != '\0'; ucs++)
+ {
+ *ucs = tolower(*ucs);
+ }
+ return s;
+}
strlwr.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: memccpy.c
===================================================================
--- memccpy.c (nonexistent)
+++ memccpy.c (revision 520)
@@ -0,0 +1,145 @@
+/*
+FUNCTION
+ <>---copy memory regions with end-token check
+
+ANSI_SYNOPSIS
+ #include
+ void* memccpy(void *<[out]>, const void *<[in]>,
+ int <[endchar]>, size_t <[n]>);
+
+TRAD_SYNOPSIS
+ void *memccpy(<[out]>, <[in]>, <[endchar]>, <[n]>
+ void *<[out]>;
+ void *<[in]>;
+ int <[endchar]>;
+ size_t <[n]>;
+
+DESCRIPTION
+ This function copies up to <[n]> bytes from the memory region
+ pointed to by <[in]> to the memory region pointed to by
+ <[out]>. If a byte matching the <[endchar]> is encountered,
+ the byte is copied and copying stops.
+
+ If the regions overlap, the behavior is undefined.
+
+RETURNS
+ <> returns a pointer to the first byte following the
+ <[endchar]> in the <[out]> region. If no byte matching
+ <[endchar]> was copied, then <> is returned.
+
+PORTABILITY
+<> is a GNU extension.
+
+<> requires no supporting OS subroutines.
+
+ */
+
+#include <_ansi.h>
+#include
+#include
+#include
+
+/* Nonzero if either X or Y is not aligned on a "long" boundary. */
+#define UNALIGNED(X, Y) \
+ (((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
+
+/* How many bytes are copied each iteration of the word copy loop. */
+#define LITTLEBLOCKSIZE (sizeof (long))
+
+/* Threshhold for punting to the byte copier. */
+#define TOO_SMALL(LEN) ((LEN) < LITTLEBLOCKSIZE)
+
+/* Macros for detecting endchar */
+#if LONG_MAX == 2147483647L
+#define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
+#else
+#if LONG_MAX == 9223372036854775807L
+/* Nonzero if X (a long int) contains a NULL byte. */
+#define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
+#else
+#error long int is not a 32bit or 64bit type.
+#endif
+#endif
+
+
+_PTR
+_DEFUN (memccpy, (dst0, src0, endchar, len0),
+ _PTR dst0 _AND
+ _CONST _PTR src0 _AND
+ int endchar0 _AND
+ size_t len0)
+{
+
+#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
+ _PTR ptr = NULL;
+ char *dst = (char *) dst0;
+ char *src = (char *) src0;
+ char endchar = endchar0 & 0xff;
+
+ while (len0--)
+ {
+ if ((*dst++ = *src++) == endchar)
+ {
+ ptr = dst;
+ break;
+ }
+ }
+
+ return ptr;
+#else
+ _PTR ptr = NULL;
+ char *dst = dst0;
+ _CONST char *src = src0;
+ long *aligned_dst;
+ _CONST long *aligned_src;
+ int len = len0;
+ char endchar = endchar0 & 0xff;
+
+ /* If the size is small, or either SRC or DST is unaligned,
+ then punt into the byte copy loop. This should be rare. */
+ if (!TOO_SMALL(len) && !UNALIGNED (src, dst))
+ {
+ int i;
+ unsigned long mask = 0;
+
+ aligned_dst = (long*)dst;
+ aligned_src = (long*)src;
+
+ /* The fast code reads the ASCII one word at a time and only
+ performs the bytewise search on word-sized segments if they
+ contain the search character, which is detected by XORing
+ the word-sized segment with a word-sized block of the search
+ character and then detecting for the presence of NULL in the
+ result. */
+ for (i = 0; i < LITTLEBLOCKSIZE; i++)
+ mask = (mask << 8) + endchar;
+
+
+ /* Copy one long word at a time if possible. */
+ while (len >= LITTLEBLOCKSIZE)
+ {
+ unsigned long buffer = (unsigned long)(*aligned_src);
+ buffer ^= mask;
+ if (DETECTNULL (buffer))
+ break; /* endchar is found, go byte by byte from here */
+ *aligned_dst++ = *aligned_src++;
+ len -= LITTLEBLOCKSIZE;
+ }
+
+ /* Pick up any residual with a byte copier. */
+ dst = (char*)aligned_dst;
+ src = (char*)aligned_src;
+ }
+
+ while (len--)
+ {
+ if ((*dst++ = *src++) == endchar)
+ {
+ ptr = dst;
+ break;
+ }
+ }
+
+ return ptr;
+#endif /* not PREFER_SIZE_OVER_SPEED */
+}
memccpy.c
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property