Browse Source

K&R -> ANSI

APIWARN
okay millert@, otto@
OPENBSD_3_8
espie 19 years ago
parent
commit
9e5b556fca
22 changed files with 79 additions and 120 deletions
  1. +8
    -5
      src/lib/libc/string/wcscat.c
  2. +3
    -5
      src/lib/libc/string/wcschr.c
  3. +3
    -4
      src/lib/libc/string/wcscmp.c
  4. +8
    -5
      src/lib/libc/string/wcscpy.c
  5. +3
    -5
      src/lib/libc/string/wcscspn.c
  6. +3
    -6
      src/lib/libc/string/wcslcat.c
  7. +3
    -6
      src/lib/libc/string/wcslcpy.c
  8. +3
    -4
      src/lib/libc/string/wcslen.c
  9. +3
    -6
      src/lib/libc/string/wcsncat.c
  10. +3
    -5
      src/lib/libc/string/wcsncmp.c
  11. +3
    -6
      src/lib/libc/string/wcsncpy.c
  12. +3
    -5
      src/lib/libc/string/wcspbrk.c
  13. +3
    -5
      src/lib/libc/string/wcsrchr.c
  14. +3
    -5
      src/lib/libc/string/wcsspn.c
  15. +4
    -6
      src/lib/libc/string/wcsstr.c
  16. +4
    -6
      src/lib/libc/string/wcstok.c
  17. +3
    -5
      src/lib/libc/string/wcswidth.c
  18. +3
    -6
      src/lib/libc/string/wmemchr.c
  19. +3
    -6
      src/lib/libc/string/wmemcmp.c
  20. +3
    -6
      src/lib/libc/string/wmemcpy.c
  21. +3
    -6
      src/lib/libc/string/wmemmove.c
  22. +4
    -7
      src/lib/libc/string/wmemset.c

+ 8
- 5
src/lib/libc/string/wcscat.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: wcscat.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */
/* $OpenBSD: wcscat.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */
/* $NetBSD: wcscat.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */ /* $NetBSD: wcscat.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */
/*- /*-
@ -30,15 +30,18 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: wcscat.c,v 1.1 2005/04/13 16:35:58 espie Exp $";
static char *rcsid = "$OpenBSD: wcscat.c,v 1.2 2005/06/19 22:12:07 espie Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <wchar.h> #include <wchar.h>
#if defined(APIWARN)
__warn_references(wcscat,
"warning: wcscat() is almost always misused, please use wcslcat()");
#endif
wchar_t * wchar_t *
wcscat(s1, s2)
wchar_t *s1;
const wchar_t *s2;
wcscat(wchar_t *s1, const wchar_t *s2)
{ {
wchar_t *p; wchar_t *p;
wchar_t *q; wchar_t *q;


+ 3
- 5
src/lib/libc/string/wcschr.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: wcschr.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */
/* $OpenBSD: wcschr.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */
/* $NetBSD: wcschr.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */ /* $NetBSD: wcschr.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */
/*- /*-
@ -30,15 +30,13 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: wcschr.c,v 1.1 2005/04/13 16:35:58 espie Exp $";
static char *rcsid = "$OpenBSD: wcschr.c,v 1.2 2005/06/19 22:12:07 espie Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <wchar.h> #include <wchar.h>
wchar_t * wchar_t *
wcschr(s, c)
const wchar_t *s;
wchar_t c;
wcschr(const wchar_t *s, wchar_t c)
{ {
const wchar_t *p; const wchar_t *p;


+ 3
- 4
src/lib/libc/string/wcscmp.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: wcscmp.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */
/* $OpenBSD: wcscmp.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */
/* $NetBSD: wcscmp.c,v 1.5 2003/08/07 16:43:54 agc Exp $ */ /* $NetBSD: wcscmp.c,v 1.5 2003/08/07 16:43:54 agc Exp $ */
/*- /*-
@ -34,7 +34,7 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: wcscmp.c,v 1.1 2005/04/13 16:35:58 espie Exp $";
static char *rcsid = "$OpenBSD: wcscmp.c,v 1.2 2005/06/19 22:12:07 espie Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <wchar.h> #include <wchar.h>
@ -44,8 +44,7 @@ static char *rcsid = "$OpenBSD: wcscmp.c,v 1.1 2005/04/13 16:35:58 espie Exp $";
* Compare strings. * Compare strings.
*/ */
int int
wcscmp(s1, s2)
const wchar_t *s1, *s2;
wcscmp(const wchar_t *s1, const wchar_t *s2)
{ {
while (*s1 == *s2++) while (*s1 == *s2++)


+ 8
- 5
src/lib/libc/string/wcscpy.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: wcscpy.c,v 1.2 2005/04/16 10:40:45 tom Exp $ */
/* $OpenBSD: wcscpy.c,v 1.3 2005/06/19 22:12:07 espie Exp $ */
/* $NetBSD: wcscpy.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */ /* $NetBSD: wcscpy.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */
/*- /*-
@ -30,15 +30,18 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: wcscpy.c,v 1.2 2005/04/16 10:40:45 tom Exp $";
static char *rcsid = "$OpenBSD: wcscpy.c,v 1.3 2005/06/19 22:12:07 espie Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <wchar.h> #include <wchar.h>
#if defined(APIWARN)
__warn_references(wcscpy,
"warning: wcscpy() is almost always misused, please use wcslcpy()");
#endif
wchar_t * wchar_t *
wcscpy(s1, s2)
wchar_t *s1;
const wchar_t *s2;
wcscpy(wchar_t *s1, const wchar_t *s2)
{ {
wchar_t *p; wchar_t *p;
const wchar_t *q; const wchar_t *q;


+ 3
- 5
src/lib/libc/string/wcscspn.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: wcscspn.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */
/* $OpenBSD: wcscspn.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */
/* $NetBSD: wcscspn.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */ /* $NetBSD: wcscspn.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */
/*- /*-
@ -30,15 +30,13 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: wcscspn.c,v 1.1 2005/04/13 16:35:58 espie Exp $";
static char *rcsid = "$OpenBSD: wcscspn.c,v 1.2 2005/06/19 22:12:07 espie Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <wchar.h> #include <wchar.h>
size_t size_t
wcscspn(s, set)
const wchar_t *s;
const wchar_t *set;
wcscspn(const wchar_t *s, const wchar_t *set)
{ {
const wchar_t *p; const wchar_t *p;
const wchar_t *q; const wchar_t *q;


+ 3
- 6
src/lib/libc/string/wcslcat.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: wcslcat.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */
/* $OpenBSD: wcslcat.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */
/* $NetBSD: wcslcat.c,v 1.2 2001/01/03 14:33:02 lukem Exp $ */ /* $NetBSD: wcslcat.c,v 1.2 2001/01/03 14:33:02 lukem Exp $ */
/* from OpenBSD: strlcat.c,v 1.3 2000/11/24 11:10:02 itojun Exp */ /* from OpenBSD: strlcat.c,v 1.3 2000/11/24 11:10:02 itojun Exp */
@ -30,7 +30,7 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: wcslcat.c,v 1.1 2005/04/13 16:35:58 espie Exp $";
static char *rcsid = "$OpenBSD: wcslcat.c,v 1.2 2005/06/19 22:12:07 espie Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <sys/types.h> #include <sys/types.h>
@ -44,10 +44,7 @@ static char *rcsid = "$OpenBSD: wcslcat.c,v 1.1 2005/04/13 16:35:58 espie Exp $"
* truncation occurred. * truncation occurred.
*/ */
size_t size_t
wcslcat(dst, src, siz)
wchar_t *dst;
const wchar_t *src;
size_t siz;
wcslcat(wchar_t *dst, const wchar_t *src, size_t siz)
{ {
wchar_t *d = dst; wchar_t *d = dst;
const wchar_t *s = src; const wchar_t *s = src;


+ 3
- 6
src/lib/libc/string/wcslcpy.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: wcslcpy.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */
/* $OpenBSD: wcslcpy.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */
/* $NetBSD: wcslcpy.c,v 1.2 2001/01/03 14:33:02 lukem Exp $ */ /* $NetBSD: wcslcpy.c,v 1.2 2001/01/03 14:33:02 lukem Exp $ */
/* from OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp */ /* from OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp */
@ -30,7 +30,7 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: wcslcpy.c,v 1.1 2005/04/13 16:35:58 espie Exp $";
static char *rcsid = "$OpenBSD: wcslcpy.c,v 1.2 2005/06/19 22:12:07 espie Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <sys/types.h> #include <sys/types.h>
@ -42,10 +42,7 @@ static char *rcsid = "$OpenBSD: wcslcpy.c,v 1.1 2005/04/13 16:35:58 espie Exp $"
* Returns wcslen(src); if retval >= siz, truncation occurred. * Returns wcslen(src); if retval >= siz, truncation occurred.
*/ */
size_t size_t
wcslcpy(dst, src, siz)
wchar_t *dst;
const wchar_t *src;
size_t siz;
wcslcpy(wchar_t *dst, const wchar_t *src, size_t siz)
{ {
wchar_t *d = dst; wchar_t *d = dst;
const wchar_t *s = src; const wchar_t *s = src;


+ 3
- 4
src/lib/libc/string/wcslen.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: wcslen.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */
/* $OpenBSD: wcslen.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */
/* $NetBSD: wcslen.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */ /* $NetBSD: wcslen.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */
/*- /*-
@ -30,14 +30,13 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: wcslen.c,v 1.1 2005/04/13 16:35:58 espie Exp $";
static char *rcsid = "$OpenBSD: wcslen.c,v 1.2 2005/06/19 22:12:07 espie Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <wchar.h> #include <wchar.h>
size_t size_t
wcslen(s)
const wchar_t *s;
wcslen(const wchar_t *s)
{ {
const wchar_t *p; const wchar_t *p;


+ 3
- 6
src/lib/libc/string/wcsncat.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: wcsncat.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */
/* $OpenBSD: wcsncat.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */
/* $NetBSD: wcsncat.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */ /* $NetBSD: wcsncat.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */
/*- /*-
@ -30,16 +30,13 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: wcsncat.c,v 1.1 2005/04/13 16:35:58 espie Exp $";
static char *rcsid = "$OpenBSD: wcsncat.c,v 1.2 2005/06/19 22:12:07 espie Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <wchar.h> #include <wchar.h>
wchar_t * wchar_t *
wcsncat(s1, s2, n)
wchar_t *s1;
const wchar_t *s2;
size_t n;
wcsncat(wchar_t *s1, const wchar_t *s2, size_t n)
{ {
wchar_t *p; wchar_t *p;
wchar_t *q; wchar_t *q;


+ 3
- 5
src/lib/libc/string/wcsncmp.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: wcsncmp.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */
/* $OpenBSD: wcsncmp.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */
/* $NetBSD: wcsncmp.c,v 1.5 2003/08/07 16:43:54 agc Exp $ */ /* $NetBSD: wcsncmp.c,v 1.5 2003/08/07 16:43:54 agc Exp $ */
/* /*
@ -31,16 +31,14 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: wcsncmp.c,v 1.1 2005/04/13 16:35:58 espie Exp $";
static char *rcsid = "$OpenBSD: wcsncmp.c,v 1.2 2005/06/19 22:12:07 espie Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <wchar.h> #include <wchar.h>
#include "locale/runetype.h" #include "locale/runetype.h"
int int
wcsncmp(s1, s2, n)
const wchar_t *s1, *s2;
size_t n;
wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n)
{ {
if (n == 0) if (n == 0)


+ 3
- 6
src/lib/libc/string/wcsncpy.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: wcsncpy.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */
/* $OpenBSD: wcsncpy.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */
/* $NetBSD: wcsncpy.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /* $NetBSD: wcsncpy.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*- /*-
@ -30,16 +30,13 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: wcsncpy.c,v 1.1 2005/04/13 16:35:58 espie Exp $";
static char *rcsid = "$OpenBSD: wcsncpy.c,v 1.2 2005/06/19 22:12:07 espie Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <wchar.h> #include <wchar.h>
wchar_t * wchar_t *
wcsncpy(s1, s2, n)
wchar_t *s1;
const wchar_t *s2;
size_t n;
wcsncpy(wchar_t *s1, const wchar_t *s2, size_t n)
{ {
wchar_t *p; wchar_t *p;
const wchar_t *q; const wchar_t *q;


+ 3
- 5
src/lib/libc/string/wcspbrk.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: wcspbrk.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */
/* $OpenBSD: wcspbrk.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */
/* $NetBSD: wcspbrk.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /* $NetBSD: wcspbrk.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*- /*-
@ -30,15 +30,13 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: wcspbrk.c,v 1.1 2005/04/13 16:35:58 espie Exp $";
static char *rcsid = "$OpenBSD: wcspbrk.c,v 1.2 2005/06/19 22:12:07 espie Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <wchar.h> #include <wchar.h>
wchar_t * wchar_t *
wcspbrk(s, set)
const wchar_t *s;
const wchar_t *set;
wcspbrk(const wchar_t *s, const wchar_t *set)
{ {
const wchar_t *p; const wchar_t *p;
const wchar_t *q; const wchar_t *q;


+ 3
- 5
src/lib/libc/string/wcsrchr.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: wcsrchr.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */
/* $OpenBSD: wcsrchr.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */
/* $NetBSD: wcsrchr.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /* $NetBSD: wcsrchr.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*- /*-
@ -30,15 +30,13 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: wcsrchr.c,v 1.1 2005/04/13 16:35:58 espie Exp $";
static char *rcsid = "$OpenBSD: wcsrchr.c,v 1.2 2005/06/19 22:12:07 espie Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <wchar.h> #include <wchar.h>
wchar_t * wchar_t *
wcsrchr(s, c)
const wchar_t *s;
wchar_t c;
wcsrchr(const wchar_t *s, wchar_t c)
{ {
const wchar_t *p; const wchar_t *p;


+ 3
- 5
src/lib/libc/string/wcsspn.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: wcsspn.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */
/* $OpenBSD: wcsspn.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */
/* $NetBSD: wcsspn.c,v 1.3 2001/09/21 16:09:15 yamt Exp $ */ /* $NetBSD: wcsspn.c,v 1.3 2001/09/21 16:09:15 yamt Exp $ */
/*- /*-
@ -30,15 +30,13 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: wcsspn.c,v 1.1 2005/04/13 16:35:58 espie Exp $";
static char *rcsid = "$OpenBSD: wcsspn.c,v 1.2 2005/06/19 22:12:07 espie Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <wchar.h> #include <wchar.h>
size_t size_t
wcsspn(s, set)
const wchar_t *s;
const wchar_t *set;
wcsspn(const wchar_t *s, const wchar_t *set)
{ {
const wchar_t *p; const wchar_t *p;
const wchar_t *q; const wchar_t *q;


+ 4
- 6
src/lib/libc/string/wcsstr.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: wcsstr.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */
/* $OpenBSD: wcsstr.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */
/* $NetBSD: wcsstr.c,v 1.3 2003/03/05 20:18:17 tshiozak Exp $ */ /* $NetBSD: wcsstr.c,v 1.3 2003/03/05 20:18:17 tshiozak Exp $ */
/*- /*-
@ -30,19 +30,17 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: wcsstr.c,v 1.1 2005/04/13 16:35:58 espie Exp $";
static char *rcsid = "$OpenBSD: wcsstr.c,v 1.2 2005/06/19 22:12:07 espie Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <wchar.h> #include <wchar.h>
wchar_t * wchar_t *
#ifdef WCSWCS #ifdef WCSWCS
wcswcs(big, little)
wcswcs(const wchar_t *big, const wchar_t *little)
#else #else
wcsstr(big, little)
wcsstr(const wchar_t *big, const wchar_t *little)
#endif #endif
const wchar_t *big;
const wchar_t *little;
{ {
const wchar_t *p; const wchar_t *p;
const wchar_t *q; const wchar_t *q;


+ 4
- 6
src/lib/libc/string/wcstok.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: wcstok.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */
/* $OpenBSD: wcstok.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */
/* $NetBSD: wcstok.c,v 1.3 2003/07/10 08:50:48 tshiozak Exp $ */ /* $NetBSD: wcstok.c,v 1.3 2003/07/10 08:50:48 tshiozak Exp $ */
/*- /*-
@ -43,16 +43,14 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: wcstok.c,v 1.1 2005/04/13 16:35:58 espie Exp $";
static char *rcsid = "$OpenBSD: wcstok.c,v 1.2 2005/06/19 22:12:07 espie Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <wchar.h> #include <wchar.h>
wchar_t * wchar_t *
wcstok(s, delim, last)
wchar_t * __restrict s;
const wchar_t * __restrict delim;
wchar_t ** __restrict last;
wcstok(wchar_t * __restrict s, const wchar_t * __restrict delim,
wchar_t ** __restrict last)
{ {
const wchar_t *spanp; const wchar_t *spanp;
wchar_t c, sc; wchar_t c, sc;


+ 3
- 5
src/lib/libc/string/wcswidth.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: wcswidth.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */
/* $OpenBSD: wcswidth.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */
/* $NetBSD: wcswidth.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /* $NetBSD: wcswidth.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*- /*-
@ -30,15 +30,13 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: wcswidth.c,v 1.1 2005/04/13 16:35:58 espie Exp $";
static char *rcsid = "$OpenBSD: wcswidth.c,v 1.2 2005/06/19 22:12:07 espie Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <wchar.h> #include <wchar.h>
int int
wcswidth(s, n)
const wchar_t *s;
size_t n;
wcswidth(const wchar_t *s, size_t n)
{ {
int w; int w;


+ 3
- 6
src/lib/libc/string/wmemchr.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: wmemchr.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */
/* $OpenBSD: wmemchr.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */
/* $NetBSD: wmemchr.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /* $NetBSD: wmemchr.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*- /*-
@ -30,16 +30,13 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: wmemchr.c,v 1.1 2005/04/13 16:35:58 espie Exp $";
static char *rcsid = "$OpenBSD: wmemchr.c,v 1.2 2005/06/19 22:12:07 espie Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <wchar.h> #include <wchar.h>
wchar_t * wchar_t *
wmemchr(s, c, n)
const wchar_t *s;
wchar_t c;
size_t n;
wmemchr(const wchar_t *s, wchar_t c, size_t n)
{ {
size_t i; size_t i;


+ 3
- 6
src/lib/libc/string/wmemcmp.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: wmemcmp.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */
/* $OpenBSD: wmemcmp.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */
/* $NetBSD: wmemcmp.c,v 1.3 2003/04/06 18:33:23 tshiozak Exp $ */ /* $NetBSD: wmemcmp.c,v 1.3 2003/04/06 18:33:23 tshiozak Exp $ */
/*- /*-
@ -30,17 +30,14 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: wmemcmp.c,v 1.1 2005/04/13 16:35:58 espie Exp $";
static char *rcsid = "$OpenBSD: wmemcmp.c,v 1.2 2005/06/19 22:12:07 espie Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <wchar.h> #include <wchar.h>
#include "locale/runetype.h" #include "locale/runetype.h"
int int
wmemcmp(s1, s2, n)
const wchar_t *s1;
const wchar_t *s2;
size_t n;
wmemcmp(const wchar_t *s1, const wchar_t *s2, size_t n)
{ {
size_t i; size_t i;


+ 3
- 6
src/lib/libc/string/wmemcpy.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: wmemcpy.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */
/* $OpenBSD: wmemcpy.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */
/* $NetBSD: wmemcpy.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /* $NetBSD: wmemcpy.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*- /*-
@ -30,17 +30,14 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: wmemcpy.c,v 1.1 2005/04/13 16:35:58 espie Exp $";
static char *rcsid = "$OpenBSD: wmemcpy.c,v 1.2 2005/06/19 22:12:07 espie Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <string.h> #include <string.h>
#include <wchar.h> #include <wchar.h>
wchar_t * wchar_t *
wmemcpy(d, s, n)
wchar_t *d;
const wchar_t *s;
size_t n;
wmemcpy(wchar_t *d, const wchar_t *s, size_t n)
{ {
return (wchar_t *)memcpy(d, s, n * sizeof(wchar_t)); return (wchar_t *)memcpy(d, s, n * sizeof(wchar_t));


+ 3
- 6
src/lib/libc/string/wmemmove.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: wmemmove.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */
/* $OpenBSD: wmemmove.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */
/* $NetBSD: wmemmove.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /* $NetBSD: wmemmove.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*- /*-
@ -30,17 +30,14 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: wmemmove.c,v 1.1 2005/04/13 16:35:58 espie Exp $";
static char *rcsid = "$OpenBSD: wmemmove.c,v 1.2 2005/06/19 22:12:07 espie Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <string.h> #include <string.h>
#include <wchar.h> #include <wchar.h>
wchar_t * wchar_t *
wmemmove(d, s, n)
wchar_t *d;
const wchar_t *s;
size_t n;
wmemmove(wchar_t *d, const wchar_t *s, size_t n)
{ {
return (wchar_t *)memmove(d, s, n * sizeof(wchar_t)); return (wchar_t *)memmove(d, s, n * sizeof(wchar_t));


+ 4
- 7
src/lib/libc/string/wmemset.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: wmemset.c,v 1.1 2005/04/13 16:35:58 espie Exp $ */
/* $OpenBSD: wmemset.c,v 1.2 2005/06/19 22:12:07 espie Exp $ */
/* $NetBSD: wmemset.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /* $NetBSD: wmemset.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */
/*- /*-
@ -30,21 +30,18 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: wmemset.c,v 1.1 2005/04/13 16:35:58 espie Exp $";
static char *rcsid = "$OpenBSD: wmemset.c,v 1.2 2005/06/19 22:12:07 espie Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <wchar.h> #include <wchar.h>
wchar_t * wchar_t *
wmemset(s, c, n)
wchar_t *s;
wchar_t c;
size_t n;
wmemset(wchar_t *s, wchar_t c, size_t n)
{ {
size_t i; size_t i;
wchar_t *p; wchar_t *p;
p = (wchar_t *)s;
p = s;
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
*p = c; *p = c;
p++; p++;


Loading…
Cancel
Save