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 to iscntrl_l() is the special locale object LC_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> ๐Ÿฆ‹


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