ISLOWER(3POSIX)

πŸ’– ISLOWER(3POSIX) πŸ’–

okay bestie, so this is a page from the POSIX Programmer's Manual (yes, that's the manual name, 3POSIX, section 3, we love a section) and it's all about checking if a character is a lil lowercase letter πŸ₯°


✨ PROLOG ✨

so like, real talk first: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ β€” so if you're on Linux and something's giving different energy, go consult the corresponding Linux manual page for the deets on Linux behavior. Also possible: the interface might just straight up not be implemented on Linux at all. πŸ™ˆ no cap.


🌸 NAME 🌸

islower, islower_l β€” test for a lowercase letter


πŸŽ€ SYNOPSIS πŸŽ€

#include <ctype.h>

int islower(int c);
int islower_l(int c, locale_t locale);

πŸ’… DESCRIPTION πŸ’…

okay so for islower(): 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 islower() and islower_l() functions shall test whether c is a character of class lower 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 an int, the value of which the application shall ensure is 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. 🫣

🚨 also undefined behavior alert: the behavior is undefined if the locale argument to islower_l() is the special locale object LC_GLOBAL_LOCALE or is not a valid locale object handle. not me being dramatic, that's literally what it says.

⭐ RETURN VALUE ⭐

The islower() and islower_l() functions shall return non-zero if c is a lowercase letter; otherwise, they shall return 0. that's it, that's the whole vibe check ✨


πŸ’€ ERRORS πŸ’€

No errors are defined. (iconic of them honestly, zero drama)

The following sections are informative.


πŸ¦‹ EXAMPLES πŸ¦‹

🌈 Testing for a Lowercase Letter 🌈

Two examples follow β€” the first using islower(), the second using multiple concurrent locales and islower_l().

The examples test whether the value is a lowercase letter, based on the current locale, then use it as part of a key value. πŸ”‘

/* Example 1 -- using islower() */
#include <ctype.h>
#include <stdlib.h>
#include <locale.h>
...
char *keystr;
int elementlen, len;
unsigned char c;
...
setlocale(LC_ALL, "");
...
len = 0;
while (len < elementlen) {
    c = (unsigned char) (rand() % 256);
...
    if (islower(c))
        keystr[len++] = c;
    }
...
/* Example 2 -- using islower_l() */
#include <ctype.h>
#include <stdlib.h>
#include <locale.h>
...
char *keystr;
int elementlen, len;
unsigned char c;
...
locale_t loc = newlocale (LC_ALL_MASK, "", (locale_t) 0);
...
len = 0;
while (len < elementlen) {
    c = (unsigned char) (rand() % 256);
...
    if (islower_l(c, loc))
        keystr[len++] = c;
    }
...

🌸 APPLICATION USAGE 🌸

To ensure applications portability β€” especially across natural languages, which is so real β€” only these functions and the functions in the reference pages listed in the SEE ALSO section should be used for character classification. like, don't freestyle it bestie. 🫢


🧚 RATIONALE 🧚

None. (mysterious. enigmatic. main character energy. πŸ’…)


πŸ”₯ FUTURE DIRECTIONS πŸ”₯

None. (nothing's changing, she's perfect as she is ✨)


πŸ‘‘ SEE ALSO πŸ‘‘

  • isalnum()
  • isalpha()
  • isblank()
  • iscntrl()
  • isdigit()
  • isgraph()
  • isprint()
  • ispunct()
  • isspace()
  • isupper()
  • isxdigit()
  • 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 lil masterpiece came to you from IEEE/The Open Group, 2017 β€” that's the source/version and date, kiss kiss, bye bye, go test your lowercase letters πŸ’œ