ISCNTRL(3P)
๐ธ ISCNTRL(3P) โ bestie edition ๐ธ
okay so this one lives in the POSIX Programmer's Manual (that's the manual name, bestie, it's giving official ๐ ). One lil heads-up before we dive in:
๐จ PROLOG ๐จ
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ โ so bestie, if you're on Linux, go consult the corresponding Linux manual page for the tea on Linux behavior โ. Or honestly? The interface may not even be implemented on Linux at all. Yeah. ๐
โจ NAME โจ
iscntrl, iscntrl_l โ test for a control character ๐
๐ฆ SYNOPSIS ๐ฆ
#include <ctype.h>
int iscntrl(int c);
int iscntrl_l(int c, locale_t locale);
๐ DESCRIPTION ๐
For iscntrl(): the functionality described on this reference page is aligned with the ISO C standard. If there's any conflict between what's written here and the ISO C standard, that was not on purpose โ unintentional, fr fr. This volume of POSIX.1โ2017 defers to the ISO C standard. periodt.
The iscntrl() and iscntrl_l() functions shall test whether c is a character of class cntrl in the current locale, or in the locale represented by locale, respectively โ see the Base Definitions volume of POSIX.1โ2017, Chapter 7, Locale. iykyk ๐
The c argument is a type int, and the value of it? The application shall make sure it's a character representable as an unsigned char, or equal to the value of the macro EOF. If the argument has any other value, the behavior is undefined ๐ no cap.
Also undefined behavior: if the locale argument you pass toiscntrl_l()is the special locale objectLC_GLOBAL_LOCALE, or if it's not a valid locale object handle. So don't do that. ๐
๐ RETURN VALUE ๐
iscntrl() and iscntrl_l() shall return non-zero if c is a control character; otherwise, they shall return 0. Simple as that, bestie โจ
๐ ERRORS ๐
No errors are defined. Iconic, honestly. Nothing to report. ๐
The following sections are informative.
๐ง EXAMPLES ๐ง
None. That's it. That's the section. ๐
๐ APPLICATION USAGE ๐
So for your app to be portable โ especially across natural languages โ only these functions and the functions in the reference pages listed in the SEE ALSO section should be used for character classification. That's the rule, bestie. ๐ซถ
๐ RATIONALE ๐
None. Nothing. Empty. Slay. โจ
โญ FUTURE DIRECTIONS โญ
None. The future is a mystery but this section is not. ๐ฎ
๐ SEE ALSO ๐
isalnum()isalpha()isblank()isdigit()isgraph()islower()isprint()ispunct()isspace()isupper()isxdigit()setlocale()uselocale()
Also, the Base Definitions volume of POSIX.1โ2017, Chapter 7, Locale, <ctype.h>, <locale.h> ๐ฆ
๐ COPYRIGHT ๐
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
and that's the whole page, bestie!! brought to you by IEEE/The Open Group, dated 2017, and rewritten with so much love for you specifically ๐ go classify some characters, you got this ๐ซถ
๐ฆ where this page comes from
- alpine 3.22: man-pages-posix 2017a-r0 ยท custom
- alpine 3.23: man-pages-posix 2017a-r0 ยท custom
- alpine 3.24: man-pages-posix 2017a-r0 ยท custom
- arch rolling: man-pages 6.19-1
- 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-posix 2017a
- opensuse-leap 16.0: man-pages-posix 2017a-160000.4.1 ยท SUSE-IEEE
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms