TOUPPER(3POSIX)

๐Ÿ’– TOUPPER(3POSIX) โ€” the POSIX Programmer's Manual glow-up ๐Ÿ’–

okay bestie, welcome to toupper(3POSIX), the POSIX Programmer's Manual page for everyone's fave lowercase-to-uppercase glow-up service. pull up a chair, grab a strawberry ๐Ÿ“, and let's get into it.

๐ŸŒธ PROLOG ๐ŸŒธ

so, 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 โ€” and this is the tragic part โ€” the interface may not even be implemented on Linux at all. ๐Ÿ’€


โœจ NAME โœจ

toupper, toupper_l โ€” transliterate lowercase characters to uppercase

no cap, that's the whole job. lowercase in, uppercase out. it's giving elevator pitch. ๐Ÿ‘‘


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

#include <ctype.h>

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

๐Ÿ’… DESCRIPTION ๐Ÿ’…

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 โ€” not me causing drama with the standards bodies, I promise. ๐Ÿ™ˆ this volume of POSIX.1โ€2017 defers to the ISO C standard.

the actual vibe:

toupper() and toupper_l() have as a domain a type int, the value of which is representable as an unsigned char or the value of EOF. if the argument has any other value, the behavior is undefined. so like, stay in your lane, bestie. ๐Ÿšง

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) โ€” then the result shall be the corresponding uppercase letter. slay. โœจ

all other arguments in the domain are returned unchanged. iconic behavior honestly, it just hands them back to you. ๐Ÿซถ

โš ๏ธ the behavior is undefined if the locale argument to toupper_l() is the special locale object LC_GLOBAL_LOCALE or is not a valid locale object handle. do not do this. do not pass go. do not collect $200. ๐Ÿ˜ญ

โญ 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. that's it, that's the whole personality. ๐Ÿ’œ


๐Ÿ’€ ERRORS ๐Ÿ’€

no errors are defined. zero. none. the girlies are unbothered. ๐Ÿ™…โ€โ™€๏ธ

the following sections are informative.


๐ŸŽ€ EXAMPLES ๐ŸŽ€

none. (we're keeping it mysterious, iykyk.) ๐Ÿงš


๐ŸŒˆ APPLICATION USAGE ๐ŸŒˆ

none. โœจ


๐Ÿง  RATIONALE ๐Ÿง 

none. ๐Ÿ’…


๐Ÿ”ฎ FUTURE DIRECTIONS ๐Ÿ”ฎ

none. the future is bright and also empty here. โญ


๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘

  • setlocale()
  • uselocale()
  • 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!! this absolute queen of a manpage was brought to you by IEEE/The Open Group, dated 2017, filed under TOUPPER(3POSIX). mwah, stay uppercase. ๐Ÿ’–โœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from