summaryrefslogtreecommitdiff
path: root/src/ctype/isalnum.c
blob: b8ffc4147057ba4ee8450093006c3752ffd82b33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <ctype.h>
#include <limits.h>
#include <stdio.h>
#include "_safety.h"

/** test whether a character is alphanumeric **/

int isalnum(int c)
{
	SIGNAL_SAFE(0);
	ASSERT_REPRESENTABLE(c, 0, UCHAR_MAX, unsigned char, EOF);
	return isalpha(c) || isdigit(c);
}

__check_1(int, 0, isalnum, int)

/***
tests whether ARGUMENT(c) is a character in the class
CHARACTER_CLASS(alpha) or CHARACTER_CLASS(digit) in the current locale.
***/

/*
RETURN(NONZERO, ARGUMENT(c) is an alpanumeric character)
RETURN(0, ARGUMENT(c) is not an alphanumeric character)
LC_CTYPE
STDC(1)
*/