1 .\"
   2 .\" This file and its contents are supplied under the terms of the
   3 .\" Common Development and Distribution License ("CDDL"), version 1.0.
   4 .\" You may only use this file in accordance with the terms of version
   5 .\" 1.0 of the CDDL.
   6 .\"
   7 .\" A full copy of the text of the CDDL should have accompanied this
   8 .\" source.  A copy of the CDDL is also available via the Internet at
   9 .\" http://www.illumos.org/license/CDDL.
  10 .\"
  11 .\"
  12 .\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
  13 .\"
  14 .Dd "Jul 27, 2014"
  15 .Dt WCSLEN 3C
  16 .Os
  17 .Sh NAME
  18 .Nm wcslen ,
  19 .Nm wcsnlen
  20 .Nd get length of wide-character string
  21 .Sh SYNOPSIS
  22 .In wchar.h
  23 .
  24 .Ft wchar_t
  25 .Fo wcslen
  26 .Fa "const wchar_t *string"
  27 .Fc
  28 .
  29 .Ft wchar_t
  30 .Fo wcsnlen
  31 .Fa "const wchar_t *string"
  32 .Fa "size_t maxlen"
  33 .Fc
  34 .
  35 .Sh DESCRIPTION
  36 The
  37 .Fn wcslen
  38 and
  39 .Fn wcsnlen
  40 functions count the number of wide-characters that are present
  41 .Fa string .
  42 They stop counting when they encounter a null wide-character.
  43 The terminating null wide-character is not included in the NULL.
  44 .Lp
  45 Additionally,
  46 .Fn wcsnlen
  47 stops counting after it has counted
  48 .Fa maxlen
  49 wide-characters.
  50 .Lp
  51 The
  52 .Fn wcslen
  53 and
  54 .Fn wcsnlen
  55 functions are the wide-character equivalents of
  56 .Xr strlen 3C
  57 and
  58 .Xr strnlen 3C ,
  59 respectively.
  60 .Sh RETURN VALUES
  61 The
  62 .Fn wcslen
  63 function returns the length of
  64 .Fa string .
  65 The
  66 .Fn wcsnlen
  67 function returns the smaller of the length of
  68 .Fa string
  69 and
  70 .Fa maxlen .
  71 .Sh ERRORS
  72 None.
  73 .Sh INTERFACE STABILITY
  74 .Sy Standard .
  75 .Sh MT-LEVEL
  76 .Sy MT-Safe .
  77 .Sh SEE ALSO
  78 .Xr free 3C ,
  79 .Xr strlen 3C ,
  80 .Xr strnlen 3C ,
  81 .Xr wchar.h 3HEAD ,
  82 .Xr locale 5 ,
  83 .Xr standards 5
  84 .Sh STANDARDS
  85 The
  86 .Fn wcslen
  87 function was introduced in
  88 .St -xpg4
  89 and standardized in
  90 .St -isoC-99 .
  91 The
  92 .Fn wcsnlen
  93 function was introduced in
  94 .St -p1003.1-2008 .