Debian Codegraph @

upstream/debian-unstable/man3/wcsstr.3

raw
1 '\" t
2 .\" Copyright, Bruno Haible <[email protected]>
3 .\" Copyright, the authors of the Linux man-pages project
4 .\"
5 .\" SPDX-License-Identifier: GPL-2.0-or-later
6 .\"
7 .TH wcsstr 3 2026-02-08 "Linux man-pages 6.18"
8 .SH NAME
9 wcsstr \- locate a substring in a wide-character string
10 .SH LIBRARY
11 Standard C library
12 .RI ( libc ,\~ \-lc )
13 .SH SYNOPSIS
14 .nf
15 .B #include <wchar.h>
16 .P
17 .BI "wchar_t *wcsstr(const wchar_t *" haystack ", const wchar_t *" needle );
18 .fi
19 .SH DESCRIPTION
20 The
21 .BR wcsstr ()
22 function is the wide-character equivalent of the
23 .BR strstr (3)
24 function.
25 It searches for the first occurrence of the wide-character string
26 .I needle
27 (without its terminating null wide character (L\[aq]\[rs]0\[aq]))
28 as a substring in the wide-character string
29 .IR haystack .
30 .SH RETURN VALUE
31 The
32 .BR wcsstr ()
33 function returns a pointer to the first occurrence of
34 .I needle
35 in
36 .IR haystack .
37 It returns NULL if
38 .I needle
39 does not occur
40 as a substring in
41 .IR haystack .
42 .P
43 Note the special case:
44 If
45 .I needle
46 is the empty wide-character string,
47 the return value is always
48 .I haystack
49 itself.
50 .SH ATTRIBUTES
51 For an explanation of the terms used in this section, see
52 .BR attributes (7).
53 .TS
54 allbox;
55 lbx lb lb
56 l l l.
57 Interface Attribute Value
58 T{
59 .na
60 .nh
61 .BR wcsstr ()
62 T} Thread safety MT-Safe
63 .TE
64 .SH STANDARDS
65 C11, POSIX.1-2008.
66 .SH HISTORY
67 POSIX.1-2001, C99.
68 .SH SEE ALSO
69 .BR strstr (3),
70 .BR wcschr (3)