ISWUPPER(3POSIX)

๐Ÿ’… ISWUPPER(3POSIX) โ€” the POSIX Programmer's Manual page, bestie edition โœจ

okay so this is iswupper(3POSIX), straight out of the POSIX Programmer's Manual, and we're about to make character classification make sense. no cap. ๐Ÿซถ


๐ŸŒธ PROLOG ๐ŸŒธ

bestie, real talk first: this manual page is part of the POSIX Programmer's Manual. the Linux implementation of this interface may differ (so like, go check the corresponding Linux manual page for the deets on Linux behavior), or honestly the interface may not even be implemented on Linux at all. ๐Ÿ’€ so don't come for me if your system's doing its own thing.


โœจ NAME โœจ

iswupper, iswupper_l โ€” test for an uppercase letter wide-character code. that's the whole vibe. ๐ŸŽ€


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

#include <wctype.h>

int iswupper(wint_t wc);
int iswupper_l(wint_t wc, locale_t locale);

look at that. two little functions. iconic. ๐Ÿ‘‘


๐Ÿ’– DESCRIPTION ๐Ÿ’–

so for iswupper(): the functionality described on this reference page is aligned with the ISO C standard. any conflict between the requirements described here and the ISO C standard is unintentional โ€” like, not on purpose at all. this volume of POSIX.1โ€2017 defers to the ISO C standard. periodt. ๐Ÿซก

the iswupper() and iswupper_l() functions shall test whether wc is a wide-character code representing a character of class upper in the current locale, or in the locale represented by locale, respectively. (if you wanna know what a locale even is, go see the Base Definitions volume of POSIX.1โ€2017, Chapter 7, Locale. it's giving required reading. ๐Ÿ“š)

now, the wc argument is a wint_t, and the value of it โ€” your application shall make sure it's a wide-character code corresponding to a valid character in the locale used by the function, or equal to the value of the macro WEOF. that's the assignment, bestie.

๐Ÿšจ if the argument has any other value, the behavior is undefined. not "kinda weird", not "a little off" โ€” undefined. we don't go there. ๐Ÿ’€

and one more thing, highkey important:

๐Ÿšจ the behavior is undefined if the locale argument to iswupper_l() is the special locale object LC_GLOBAL_LOCALE or is not a valid locale object handle. so like, don't. ๐Ÿ™ˆ

๐ŸŒˆ RETURN VALUE ๐ŸŒˆ

the iswupper() and iswupper_l() functions shall return non-zero if wc is an uppercase letter wide-character code; otherwise, they shall return 0. that's it. binary queen energy. ๐Ÿ’…


๐Ÿ“ ERRORS ๐Ÿ“

no errors are defined. slay, honestly. nothing to worry about here. โœจ

the following sections are informative โ€” aka, they're here to help, not to boss you around. ๐Ÿงš


๐ŸŽ€ EXAMPLES ๐ŸŽ€

None. (yes, literally none. we're keeping it real.) ๐Ÿ˜ญ


๐Ÿ‘‘ APPLICATION USAGE ๐Ÿ‘‘

to ensure applications portability โ€” especially across natural languages, which is a whole thing โ€” only these functions and the functions in the reference pages listed in the SEE ALSO section should be used for character classification. iykyk. ๐ŸŒ


๐Ÿง  RATIONALE ๐Ÿง 

None. moving on, bestie. ๐Ÿ’œ


๐Ÿ”ฎ FUTURE DIRECTIONS ๐Ÿ”ฎ

None. the future is bright and empty of changes here. โญ


๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

go read these too, they're all part of the same friend group:

  • iswalnum()
  • iswalpha()
  • iswcntrl()
  • iswctype()
  • iswdigit()
  • iswgraph()
  • iswlower()
  • iswprint()
  • iswpunct()
  • iswspace()
  • iswxdigit()
  • setlocale()
  • uselocale()

also, the Base Definitions volume of POSIX.1โ€2017, Chapter 7, Locale, plus the headers <locale.h> and <wctype.h>. ๐Ÿซถ


okay legal moment, but make it cute:

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 is the main character, basically. ๐Ÿ‘‘) 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!! this masterpiece was brought to you by IEEE/The Open Group, dated 2017, and it's the ISWUPPER(3POSIX) page โ€” thanks for reading, ily, go classify some characters responsibly. ๐Ÿ’–โœจ๐ŸŽ€๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from