summaryrefslogtreecommitdiff
path: root/lib/libc/string
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/string')
-rw-r--r--lib/libc/string/Makefile.inc8
-rw-r--r--lib/libc/string/wcscmp.c6
-rw-r--r--lib/libc/string/wcsncmp.c6
-rw-r--r--lib/libc/string/wcswidth.c60
-rw-r--r--lib/libc/string/wmemcmp.c6
5 files changed, 14 insertions, 72 deletions
diff --git a/lib/libc/string/Makefile.inc b/lib/libc/string/Makefile.inc
index 6ff9fd5effd..c0e92cd2edb 100644
--- a/lib/libc/string/Makefile.inc
+++ b/lib/libc/string/Makefile.inc
@@ -1,5 +1,5 @@
# from: @(#)Makefile.inc 8.1 (Berkeley) 6/4/93
-# $NetBSD: Makefile.inc,v 1.67 2007/02/17 09:32:58 wiz Exp $
+# $NetBSD: Makefile.inc,v 1.68 2009/01/02 00:20:21 tnozaki Exp $
# string sources
.PATH: ${ARCHDIR}/string ${.CURDIR}/string
@@ -13,8 +13,10 @@ SRCS+= bm.c strcasecmp.c strncasecmp.c strcasestr.c strcoll.c strdup.c \
SRCS+= wcscat.c wcschr.c wcscmp.c wcscpy.c wcscspn.c wcslcat.c wcslcpy.c \
wcslen.c wcsncat.c wcscasecmp.c wcsdup.c wcsncasecmp.c \
wcsncmp.c wcsncpy.c wcspbrk.c wcsrchr.c wcsspn.c wcsstr.c wcstok.c \
- wcswcs.c wcswidth.c \
- wmemchr.c wmemcmp.c wmemcpy.c wmemmove.c wmemset.c
+ wcswcs.c wmemchr.c wmemcmp.c wmemcpy.c wmemmove.c wmemset.c
+CPPFLAGS.wcscmp.c+= -I${LIBCDIR}/locale
+CPPFLAGS.wcsncmp.c+= -I${LIBCDIR}/locale
+CPPFLAGS.wmemcmp.c+= -I${LIBCDIR}/locale
# namespace protection wrappers
SRCS+= _strlcat.c _strlcpy.c _strerror_r.c
diff --git a/lib/libc/string/wcscmp.c b/lib/libc/string/wcscmp.c
index f81fa702f61..652b84b5d18 100644
--- a/lib/libc/string/wcscmp.c
+++ b/lib/libc/string/wcscmp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wcscmp.c,v 1.5 2003/08/07 16:43:54 agc Exp $ */
+/* $NetBSD: wcscmp.c,v 1.6 2009/01/02 00:20:21 tnozaki Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -37,13 +37,13 @@
#if 0
static char sccsid[] = "@(#)strcmp.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: wcscmp.c,v 1.5 2003/08/07 16:43:54 agc Exp $");
+__RCSID("$NetBSD: wcscmp.c,v 1.6 2009/01/02 00:20:21 tnozaki Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <wchar.h>
-#include "locale/runetype.h"
+#include "runetype.h"
/*
* Compare strings.
diff --git a/lib/libc/string/wcsncmp.c b/lib/libc/string/wcsncmp.c
index 5fe8354b57c..45345c8aca2 100644
--- a/lib/libc/string/wcsncmp.c
+++ b/lib/libc/string/wcsncmp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wcsncmp.c,v 1.5 2003/08/07 16:43:54 agc Exp $ */
+/* $NetBSD: wcsncmp.c,v 1.6 2009/01/02 00:20:21 tnozaki Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -34,13 +34,13 @@
#if 0
static char sccsid[] = "@(#)strncmp.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: wcsncmp.c,v 1.5 2003/08/07 16:43:54 agc Exp $");
+__RCSID("$NetBSD: wcsncmp.c,v 1.6 2009/01/02 00:20:21 tnozaki Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <wchar.h>
-#include "locale/runetype.h"
+#include "runetype.h"
int
wcsncmp(s1, s2, n)
diff --git a/lib/libc/string/wcswidth.c b/lib/libc/string/wcswidth.c
deleted file mode 100644
index 801089ef07f..00000000000
--- a/lib/libc/string/wcswidth.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* $NetBSD: wcswidth.c,v 1.5 2008/08/12 21:59:27 tnozaki 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: wcswidth.c,v 1.1 1999/12/29 21:47:45 tshiozak Exp
- */
-
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: wcswidth.c,v 1.5 2008/08/12 21:59:27 tnozaki Exp $");
-#endif /* LIBC_SCCS and not lint */
-
-#include "namespace.h"
-#include <assert.h>
-#include <wchar.h>
-
-int
-wcswidth(s, n)
- const wchar_t *s;
- size_t n;
-{
- int w, x;
-
- _DIAGASSERT(s != NULL);
-
- w = 0;
- while (n && *s) {
- x = wcwidth(*s);
- if (x < 0)
- return -1;
- w += x;
- s++;
- n--;
- }
-
- return w;
-}
diff --git a/lib/libc/string/wmemcmp.c b/lib/libc/string/wmemcmp.c
index d7db891f654..4ceeb30289e 100644
--- a/lib/libc/string/wmemcmp.c
+++ b/lib/libc/string/wmemcmp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wmemcmp.c,v 1.3 2003/04/06 18:33:23 tshiozak Exp $ */
+/* $NetBSD: wmemcmp.c,v 1.4 2009/01/02 00:20:21 tnozaki Exp $ */
/*-
* Copyright (c)1999 Citrus Project,
@@ -30,12 +30,12 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: wmemcmp.c,v 1.3 2003/04/06 18:33:23 tshiozak Exp $");
+__RCSID("$NetBSD: wmemcmp.c,v 1.4 2009/01/02 00:20:21 tnozaki Exp $");
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <wchar.h>
-#include "locale/runetype.h"
+#include "runetype.h"
int
wmemcmp(s1, s2, n)