ISSPECIAL(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

okay so we're looking at isspecial(3) from the Library Functions Manual, and it's literally the special-character vibe check bestie ✨

🌸 NAME 🌸

isspecial, isspecial_l β€” special character test. that's the whole icon behavior, no cap πŸ’…

πŸ“š LIBRARY πŸ“š

Standard C Library (libc, -lc) β€” yes, link it with -lc, that's the move 🫢

🧾 SYNOPSIS 🧾

#include <ctype.h>

int
isspecial(int c);

int
isspecial_l(int c, locale_t loc);

πŸ’– DESCRIPTION πŸ’–

The isspecial() and isspecial_l() functions test for a special character. that's the main character energy of this page πŸŽ€

The isspecial_l() function takes an explicit locale argument, whereas the isspecial() function uses the current global or per-thread locale. so _l is the one where you hand over the locale yourself, and plain isspecial() just rolls with whatever global or per-thread locale is current 🌈

πŸ” RETURN VALUES πŸ”

The isspecial() and isspecial_l() functions return zero if the character tests false and return non-zero if the character tests true.

so: zero = nope, non-zero = yep. simple as that, bestie πŸ’–

⚠️ COMPATIBILITY ⚠️

🚨 okay listen, this part matters: The 4.4BSD extension of accepting arguments outside of the range of the unsigned char type in locales with large character sets is considered obsolete and may not be supported in future releases. The iswspecial() or iswspecial_l() function should be used instead.

so if you're out here relying on that old 4.4BSD behavior, it's giving deprecated-adjacent, and future releases might not have your back 😭 the move is iswspecial() or iswspecial_l() instead.

πŸ‘€ SEE ALSO πŸ‘€

go read these next, iykyk:

πŸ•°οΈ HISTORY πŸ•°οΈ

The isspecial() function appeared in 4.4BSD. okay history lesson over, she's old but iconic πŸ‘‘


mwah πŸ’‹ β€” this page is from Debian, dated December 19, 2022.

πŸ“¦ where this page comes from