wcspbrk(3)

πŸ’– wcspbrk(3) β€” the wide-char glow-up of strpbrk πŸ’–

okay bestie, so this one lives in the Library Functions Manual section 3, and it's a libc girlie. let's get into it ✨


✨ NAME ✨

wcspbrk β€” search a wide-character string for any of a set of wide characters

like. she's the friend who scans the whole group chat to find out if anyone said the thing 🫢


πŸ“š LIBRARY πŸ“š

Standard C library (libc, -lc)

so you already have her. no extra package, no side quest, she's just there. queen behavior πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

#include <wchar.h>

wchar_t *wcspbrk(const wchar_t *wcs, const wchar_t *accept);

🌸 DESCRIPTION 🌸

okay so real talk. wcspbrk() is the wide-character equivalent of the strpbrk(3) function. that's the whole vibe β€” same energy, but for wchar_t strings instead of plain char strings πŸ¦‹

what she actually does: she searches for the first occurrence in the wide-character string pointed to by wcs of any of the characters in the wide-character string pointed to by accept.

so like… accept is the guest list πŸ“ and wcs is the party πŸŽ‰ and she walks down the line going "do I know you? do I know you?" and the second she finds someone on the list, she grabs them and points at them. iconic. no cap.

it's giving "which one of you is on the list" and she does NOT read past the first match. main character energy fr fr πŸ’…


πŸ”₯ RETURN VALUE πŸ”₯

wcspbrk() returns a pointer to the first occurrence in wcs of any of the characters listed in accept.

and if wcs contains none of these characters? you get NULL. no match, no pointer, no nothing. she says "nobody's on the list bestie, we're going home" 😭


πŸ’… ATTRIBUTES πŸ’…

for an explanation of the terms used in this section, see attributes(7).

  • wcspbrk() β€” Thread safety: MT-Safe βœ…

translation: multi-threaded? she does not care. she's not out here starting drama with your other threads. safe to share, safe to vibe, no locking required πŸ’–


πŸ‘‘ STANDARDS πŸ‘‘

C11, POSIX.1-2008.

she's certified. she's official. she's in the standard, periodt ✨


🌈 HISTORY 🌈

POSIX.1-2001, C99.

she's been around. an OG. she was doing wide-character matching before it was cool 🌸


πŸ¦‹ SEE ALSO πŸ¦‹

  • strpbrk(3) β€” her narrow-char sister
  • wcschr(3) β€” finds ONE specific char, not a whole set
  • wcscspn(3) β€” counts how far you can go without hitting the set

go read those too, they're all part of the same friend group 🫢


and that's the whole page! this little love letter to wcspbrk(3) shipped as part of Linux man-pages 6.20, dated 2026-02-08. ty for reading, ily, go write some wide-char code πŸŽ€πŸ’œβœ¨

πŸ“¦ where this page comes from
  • arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • πŸ“œ the page's license: GPL-2.0-or-later
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms