summaryrefslogtreecommitdiff
path: root/src/ctype/isalnum.c
blob: f09170940ba028aa0cfa89245115081fc8c99dfc (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
#include <ctype.h>
#include <limits.h>
#include <stdio.h>
#include "_assert.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);
}

/***
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)
*/