CTYPE(3) — NEWS-OS Programmer’s Manual
NAME
isalpha, isupper, islower, isdigit, isxdigit, isalnum, isspace, ispunct, isprint, isgraph, iscntrl, isascii, iskanji, iskanji2, iskana, iskana2, iskpun, iskmoji, is1byte, is2byte, is3byte, isjis, iseuc, iseuckana, issjis1, issjis2, istca1, istca2, toascii, toupper, tolower − character classification macros
SYNOPSIS
#include <ctype.h>
isalpha(c)
.....
DESCRIPTION
These macros classify character-coded integer values by table lookup. All return nonzero for true, zero for false.
isascii is defined on all integer values and the other macros are defined on unsigned char values.
The return values of isalpha, isupper, islower, isalnum, isprint, isgraph, iskanji, iskanji2, iskana, is1byte, is2byte, and is3byte depend on the code set by setlocale(3) function.
isalpha c is a letter
isupper c is an upper case letter
islower c is a lower case letter
isdigit c is a digit
isxdigit c is a hexadecimal digit
isalnum c is an alphanumeric character
isspace c is a space, tab, carriage return, newline, or formfeed
ispunct c is a punctuation character (neither control nor alphanumeric)
isprint c is a printable character.
isgraph c is a graphic character, same as isprint except in the case of space (0x20) is false.
iscntrl c is a delete character (0x7f) or ordinary control character.
isascii c is an ASCII character, code less than 0x80
iskanji c is the first byte of a kanji character.
In Shift-JIS mode, 0x81 ≤ c ≤ 0x9f or 0xe0 ≤ c ≤ 0xfc.
In EUC mode, 0xa1 ≤ c ≤ 0xfe.
In TCA mode, 0x81 ≤ c ≤ 0xfd.
In ISO 8859-1 mode, always returns false.
iskanji2 c is the second byte of a kanji character.
In Shift-JIS mode, 0x40 ≤ c ≤ 0xfc and c != 0x7f.
In EUC mode, 0xa1 ≤ c ≤ 0xfe.
In TCA mode, 0x30 ≤ c ≤ 0x39, 0x41 ≤ c ≤ 0x5a, 0x61 ≤ c ≤ 0x7a, or 0x80 ≤ c ≤ 0xfd.
In ISO 8859-1 mode, always returns the false.
iskana c is a hankaku-kana (0xa1 ≤ c ≤ 0xdf) in Shift-JIS mode,
c is the first byte of a hankaku-kana in EUC mode. Single shift 2 (0x8e)
In ISO 8859-1 and TCA mode, always returns the false.
iskana2 c is a hankaku-kana (0xa1 ≤ c ≤ 0xdf)
iskpun c is a hankaku-kana punctuation (0xa1 ≤ c ≤ 0xa5)
iskmoji c is just a hankaku-kana character except puntuation (0xa6 ≤ c ≤ 0xdf)
is2byte c is a single byte character.
is2byte c is the first byte of a 2-byte-code.
In Shift-JIS mode, 0x81 ≤ c ≤ 0x9f or 0xe0 ≤ c ≤ 0xfc.
In EUC mode, 0xa1 ≤ c ≤ 0xfe or c == 0x8e.
In TCA mode, 0x81 ≤ c ≤ 0xfd.
In ISO 8859-1 mode, always returns the false.
is3byte c is the first byte of a 3-byte-code.
isjis c is a code of a kanji character of JIS code (0x21 ≤ c ≤ 0x7e)
iseuc c is a code of a kanji character of EUC code (0xa1 ≤ c ≤ 0xfe)
iseuckana c is the first byte of a hankaku-kana of EUC code. Single shift 2 (0x8e)
issjis1 c is the first byte of a kanji character of Shift-JIS code (0x81 ≤ c ≤ 0x9f or 0xe0 ≤ c ≤ 0xfc)
issjis2 c is the second byte of a kanji character of Shift-JIS code (0x40 ≤ c ≤ 0xfc and c != 0x7f)
istca1 c is the first byte of a kanji character of TCA code (0x81 ≤ c ≤ 0xfd)
istca2 c is the second byte of a kanji character of TCA code (0x30 ≤ c ≤ 0x39, 0x41 ≤ c ≤ 0x5a, 0x61 ≤ c ≤ 0x7a, or 0x80 ≤ c ≤ 0xfd)
toascii c is converted to be a valid ascii character.
tolower c is converted to lower case. It will return c if not isupper(c). It is not a macro but a function.
toupper c is converted to upper case. It will return c if not islower(c). It is not a macro but a function.
_tolower c is converted to lower case. Return value is not undefined if not (isascii(c) && isupper(c))
_toupper c is converted to upper case. Return value is not undefined if not (isascii(c) && islower(c))
SEE ALSO
ascii(7), jctype(3J), jstring(3J), setlocale(3)
NEWS-OSRelease 4.1C