Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src add wmem* functions, from citrus. bump libc shlib minor.



details:   https://anonhg.NetBSD.org/src/rev/2a2feb27d965
branches:  trunk
changeset: 500913:2a2feb27d965
user:      itojun <itojun%NetBSD.org@localhost>
date:      Wed Dec 20 14:53:23 2000 +0000

description:
add wmem* functions, from citrus.  bump libc shlib minor.

diffstat:

 distrib/sets/lists/base/shl.mi |   4 +-
 include/wchar.h                |  37 +++++++++++++++++++++++++++-
 lib/libc/locale/Makefile.inc   |   5 ++-
 lib/libc/locale/wmemchr.c      |  53 ++++++++++++++++++++++++++++++++++++++++
 lib/libc/locale/wmemcmp.c      |  55 ++++++++++++++++++++++++++++++++++++++++++
 lib/libc/locale/wmemcpy.c      |  46 +++++++++++++++++++++++++++++++++++
 lib/libc/locale/wmemmove.c     |  46 +++++++++++++++++++++++++++++++++++
 lib/libc/locale/wmemset.c      |  53 ++++++++++++++++++++++++++++++++++++++++
 8 files changed, 294 insertions(+), 5 deletions(-)

diffs (truncated from 362 to 300 lines):

diff -r e9bed735e07d -r 2a2feb27d965 distrib/sets/lists/base/shl.mi
--- a/distrib/sets/lists/base/shl.mi    Wed Dec 20 14:53:18 2000 +0000
+++ b/distrib/sets/lists/base/shl.mi    Wed Dec 20 14:53:23 2000 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: shl.mi,v 1.98 2000/12/19 14:34:10 kleink Exp $
+# $NetBSD: shl.mi,v 1.99 2000/12/20 14:53:25 itojun Exp $
 # Note: libtermcap and libtermlib are hardlinked and share the same version.
 ./usr/lib/libamu.so.1.2
 ./usr/lib/libasn1.so.3.0
 ./usr/lib/libbz2.so.0.0
-./usr/lib/libc.so.12.68
+./usr/lib/libc.so.12.69
 ./usr/lib/libcom_err.so.3.0
 ./usr/lib/libcrypt.so.0.0
 ./usr/lib/libcrypto.so.0.2
diff -r e9bed735e07d -r 2a2feb27d965 include/wchar.h
--- a/include/wchar.h   Wed Dec 20 14:53:18 2000 +0000
+++ b/include/wchar.h   Wed Dec 20 14:53:23 2000 +0000
@@ -1,4 +1,30 @@
-/*     $NetBSD: wchar.h,v 1.1 2000/04/20 09:56:37 kleink Exp $ */
+/*     $NetBSD: wchar.h,v 1.2 2000/12/20 14:53:23 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.
+ */
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -39,6 +65,7 @@
 #ifndef _WCHAR_H_
 #define _WCHAR_H_
 
+#include <sys/cdefs.h>
 #include <machine/ansi.h>
 
 #ifdef _BSD_WCHAR_T_
@@ -56,4 +83,12 @@
 #undef _BSD_SIZE_T_
 #endif
 
+__BEGIN_DECLS
+wchar_t        *wmemchr __P((const wchar_t *, wchar_t, size_t));
+int    wmemcmp __P((const wchar_t *, const wchar_t *, size_t));
+wchar_t        *wmemcpy __P((wchar_t *, const wchar_t *, size_t));
+wchar_t        *wmemmove __P((wchar_t *, const wchar_t *, size_t));
+wchar_t        *wmemset __P((wchar_t *, wchar_t, size_t));
+__END_DECLS
+
 #endif /* !_WCHAR_H_ */
diff -r e9bed735e07d -r 2a2feb27d965 lib/libc/locale/Makefile.inc
--- a/lib/libc/locale/Makefile.inc      Wed Dec 20 14:53:18 2000 +0000
+++ b/lib/libc/locale/Makefile.inc      Wed Dec 20 14:53:23 2000 +0000
@@ -1,11 +1,12 @@
 #      from: @(#)Makefile.inc  5.1 (Berkeley) 2/18/91
-#      $NetBSD: Makefile.inc,v 1.17 2000/08/08 22:31:14 tshiozak Exp $
+#      $NetBSD: Makefile.inc,v 1.18 2000/12/20 14:53:24 itojun Exp $
 
 # locale sources
 .PATH: ${ARCHDIR}/locale ${.CURDIR}/locale
 
 SRCS+= _def_messages.c _def_monetary.c _def_numeric.c _def_time.c \
-       ctypeio.c localeconv.c nl_langinfo.c setlocale.c setlocale_sb.c
+       ctypeio.c localeconv.c nl_langinfo.c setlocale.c setlocale_sb.c \
+       wmemchr.c wmemcmp.c wmemcpy.c wmemmove.c wmemset.c
 
 MAN+=  nl_langinfo.3 setlocale.3
 
diff -r e9bed735e07d -r 2a2feb27d965 lib/libc/locale/wmemchr.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/locale/wmemchr.c Wed Dec 20 14:53:23 2000 +0000
@@ -0,0 +1,53 @@
+/*     $NetBSD: wmemchr.c,v 1.2 2000/12/20 14:53:24 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 <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: wmemchr.c,v 1.2 2000/12/20 14:53:24 itojun Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#include <wchar.h>
+#include <sys/null.h>
+
+wchar_t        *
+wmemchr(s, c, n)
+       const wchar_t *s;
+       wchar_t c;
+       size_t n;
+{
+       size_t i;
+
+       for (i = 0; i < n; i++) {
+               if (*s == c)
+                       return (wchar_t *)s;
+               s++;
+       }
+       return NULL;
+}
diff -r e9bed735e07d -r 2a2feb27d965 lib/libc/locale/wmemcmp.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/locale/wmemcmp.c Wed Dec 20 14:53:23 2000 +0000
@@ -0,0 +1,55 @@
+/*     $NetBSD: wmemcmp.c,v 1.2 2000/12/20 14:53:24 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 <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: wmemcmp.c,v 1.2 2000/12/20 14:53:24 itojun Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#include <wchar.h>
+
+int
+wmemcmp(s1, s2, n)
+       const wchar_t *s1;
+       const wchar_t *s2;
+       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;
+}
diff -r e9bed735e07d -r 2a2feb27d965 lib/libc/locale/wmemcpy.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/locale/wmemcpy.c Wed Dec 20 14:53:23 2000 +0000
@@ -0,0 +1,46 @@
+/*     $NetBSD: wmemcpy.c,v 1.2 2000/12/20 14:53:24 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 <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: wmemcpy.c,v 1.2 2000/12/20 14:53:24 itojun Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#include <wchar.h>
+#include <string.h>
+
+wchar_t *
+wmemcpy(d, s, n)
+       wchar_t *d;
+       const wchar_t *s;
+       size_t n;
+{
+       return (wchar_t *)memcpy(d, s, n * sizeof(wchar_t));
+}
diff -r e9bed735e07d -r 2a2feb27d965 lib/libc/locale/wmemmove.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/locale/wmemmove.c        Wed Dec 20 14:53:23 2000 +0000
@@ -0,0 +1,46 @@
+/*     $NetBSD: wmemmove.c,v 1.2 2000/12/20 14:53:24 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 <sys/cdefs.h>
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: wmemmove.c,v 1.2 2000/12/20 14:53:24 itojun Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#include <wchar.h>
+#include <string.h>
+
+wchar_t *
+wmemmove(d, s, n)
+       wchar_t *d;



Home | Main Index | Thread Index | Old Index