1ISLOWER(3P)                POSIX Programmer's Manual               ISLOWER(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       islower, islower_l — test for a lowercase letter
13

SYNOPSIS

15       #include <ctype.h>
16
17       int islower(int c);
18       int islower_l(int c, locale_t locale);
19

DESCRIPTION

21       For islower(): The functionality described on this  reference  page  is
22       aligned  with the ISO C standard. Any conflict between the requirements
23       described here and the ISO C standard is unintentional. This volume  of
24       POSIX.1‐2017 defers to the ISO C standard.
25
26       The islower() and islower_l() functions shall test whether c is a char‐
27       acter of class lower in the current locale, or  in  the  locale  repre‐
28       sented  by  locale,  respectively;  see  the Base Definitions volume of
29       POSIX.1‐2017, Chapter 7, Locale.
30
31       The c argument is an int, the value  of  which  the  application  shall
32       ensure is a character representable as an unsigned char or equal to the
33       value of the macro EOF. If the argument has any other value, the behav‐
34       ior is undefined.
35
36       The  behavior is undefined if the locale argument to islower_l() is the
37       special locale object LC_GLOBAL_LOCALE or is not a valid locale  object
38       handle.
39

RETURN VALUE

41       The islower() and islower_l() functions shall return non-zero if c is a
42       lowercase letter; otherwise, they shall return 0.
43

ERRORS

45       No errors are defined.
46
47       The following sections are informative.
48

EXAMPLES

50   Testing for a Lowercase Letter
51       Two examples follow, the first using islower(), the second using multi‐
52       ple concurrent locales and islower_l().
53
54       The examples test whether the value is a lowercase letter, based on the
55       current locale, then use it as part of a key value.
56
57
58           /* Example 1 -- using islower() */
59           #include <ctype.h>
60           #include <stdlib.h>
61           #include <locale.h>
62           ...
63           char *keystr;
64           int elementlen, len;
65           unsigned char c;
66           ...
67           setlocale(LC_ALL, "");
68           ...
69           len = 0;
70           while (len < elementlen) {
71               c = (unsigned char) (rand() % 256);
72           ...
73               if (islower(c))
74                   keystr[len++] = c;
75               }
76           ...
77
78           /* Example 2 -- using islower_l() */
79           #include <ctype.h>
80           #include <stdlib.h>
81           #include <locale.h>
82           ...
83           char *keystr;
84           int elementlen, len;
85           unsigned char c;
86           ...
87           locale_t loc = newlocale (LC_ALL_MASK, "", (locale_t) 0);
88           ...
89           len = 0;
90           while (len < elementlen) {
91               c = (unsigned char) (rand() % 256);
92           ...
93               if (islower_l(c, loc))
94                   keystr[len++] = c;
95               }
96           ...
97

APPLICATION USAGE

99       To ensure applications  portability,  especially  across  natural  lan‐
100       guages,  only  these functions and the functions in the reference pages
101       listed in the SEE ALSO section should be used for character classifica‐
102       tion.
103

RATIONALE

105       None.
106

FUTURE DIRECTIONS

108       None.
109

SEE ALSO

111       isalnum(),   isalpha(),  isblank(),  iscntrl(),  isdigit(),  isgraph(),
112       isprint(), ispunct(), isspace(),  isupper(),  isxdigit(),  setlocale(),
113       uselocale()
114
115       The  Base  Definitions  volume  of  POSIX.1‐2017,  Chapter  7,  Locale,
116       <ctype.h>, <locale.h>
117
119       Portions of this text are reprinted and reproduced in  electronic  form
120       from  IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
121       table Operating System Interface (POSIX), The Open Group Base  Specifi‐
122       cations  Issue  7, 2018 Edition, Copyright (C) 2018 by the Institute of
123       Electrical and Electronics Engineers, Inc and The Open Group.   In  the
124       event of any discrepancy between this version and the original IEEE and
125       The Open Group Standard, the original IEEE and The Open Group  Standard
126       is  the  referee document. The original Standard can be obtained online
127       at http://www.opengroup.org/unix/online.html .
128
129       Any typographical or formatting errors that appear  in  this  page  are
130       most likely to have been introduced during the conversion of the source
131       files to man page format. To report such errors,  see  https://www.ker
132       nel.org/doc/man-pages/reporting_bugs.html .
133
134
135
136IEEE/The Open Group                  2017                          ISLOWER(3P)
Impressum