TOUPPER(3P)

πŸ’– TOUPPER(3P) πŸ’–

okay bestie, gather round, because this one is a POSIX Programmer's Manual page for toupper β€” yes, the little function that makes your lowercase letters ✨shout✨ β€” and we are going to read it together like the icons we are.


🌸 PROLOG 🌸

Real talk first: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (so bestie, consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux at all. πŸ’€ Not every vibe ships everywhere, iykyk.


πŸŽ€ NAME πŸŽ€

toupper, toupper_l β€” transliterate lowercase characters to uppercase

it's giving glow-up, but for letters. πŸ‘‘


✨ SYNOPSIS ✨

#include <ctype.h>

int toupper(int c);
int toupper_l(int c, locale_t locale);

two sisters, one include, no cap.


πŸ’… DESCRIPTION πŸ’…

Okay so, for toupper(): 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. This volume of POSIX.1‐2017 defers to the ISO C standard. she's polite like that, she lets ISO take the mic. 🎀

The toupper() and toupper_l() functions have as a domain a type int, the value of which is representable as an unsigned char or the value of EOF.

🚨 bestie this is the part where you listen: if the argument has any other value, the behavior is undefined. not "kinda weird", not "probably fine" β€” undefined. do not play with her. πŸ™ˆ

If the argument of toupper() or toupper_l() represents a lowercase letter, and there exists a corresponding uppercase letter as defined by character type information in the current locale β€” or in the locale represented by locale, respectively β€” (category LC_CTYPE), the result shall be the corresponding uppercase letter. matching outfits, but make it uppercase. πŸ’–

All other arguments in the domain are returned unchanged. no notes, she just hands it right back to you. 🫢

And one more warning because we care about you: the behavior is undefined if the locale argument to toupper_l() is the special locale object LC_GLOBAL_LOCALE, or if it is not a valid locale object handle. ⚠️ literally do not.


🌈 RETURN VALUE 🌈

Upon successful completion, toupper() and toupper_l() shall return the uppercase letter corresponding to the argument passed; otherwise, they shall return the argument unchanged. either she glows you up or she leaves you exactly as you are β€” both are valid. ✨


πŸ’€ ERRORS πŸ’€

No errors are defined.

iconic behavior honestly. nothing to report, no drama, no errno chaos. πŸŽ€

The following sections are informative. (translation: cute to know, not binding. the vibe is lore, not law.)


πŸ¦‹ EXAMPLES πŸ¦‹

None.

not a single example, and yet she ate. the confidence. 😭


πŸ“ APPLICATION USAGE πŸ“

None.

nothing to add, she said what she said. πŸ’…


🌸 RATIONALE 🌸

None.

no justification needed when you're this correct. πŸ‘‘


⭐ FUTURE DIRECTIONS ⭐

None.

she's not going anywhere, bestie. she's eternal. ✨


πŸ”₯ SEE ALSO πŸ”₯

  • setlocale()
  • uselocale()

Also, from the Base Definitions volume of POSIX.1‐2017: Chapter 7, Locale, <ctype.h>, <locale.h>. πŸ“š go read those, they're the supporting cast and they also serve.


okay legal besties, here's the receipts, keeping it exactly as written because lawyers do not appreciate a remix:

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. this one came from IEEE/The Open Group, dated 2017, and it's the TOUPPER(3P) page from the POSIX Programmer's Manual. lowercase in, uppercase out, undefined behavior if you get weird with it. slay responsibly. πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from