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

/** test whether a character is alphanumeric **/
int isalnum(int c)
{
	ASSERT_REPRESENTABLE(c, 0, UCHAR_MAX, unsigned char, EOF);
	/*
	RETURN(NONZERO, ARGUMENT(c) is an alpanumeric character);
	RETURN(0, ARGUMENT(c) is not an alphanumeric character);
	*/
	return isalpha(c) || isdigit(c);
}

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