1 /* Copyright (c) 2002 Thomas Fitzsimmons <fitzsim@redhat.com> */
2 /*
3 FUNCTION
4 	<<isblank>>, <<isblank_l>>---blank character predicate
5 
6 INDEX
7 	isblank
8 
9 INDEX
10 	isblank_l
11 
12 SYNOPSIS
13 	#include <ctype.h>
14 	int isblank(int <[c]>);
15 
16 	#include <ctype.h>
17 	int isblank_l(int <[c]>, locale_t <[locale]>);
18 
19 DESCRIPTION
20 <<isblank>> is a function which classifies singlebyte charset values by table
21 lookup.  It is a predicate returning non-zero for blank characters, and 0
22 for other characters.  It is defined only if <[c]> is representable as an
23 unsigned char or if <[c]> is EOF.
24 
25 <<isblank_l>> is like <<isblank>> but performs the check based on the
26 locale specified by the locale object locale.  If <[locale]> is
27 LC_GLOBAL_LOCALE or not a valid locale object, the behaviour is undefined.
28 
29 RETURNS
30 <<isblank>>, <<isblank_l>> return non-zero if <[c]> is a blank character.
31 
32 PORTABILITY
33 <<isblank>> is C99.
34 <<isblank_l>> is POSIX-1.2008.
35 
36 No supporting OS subroutines are required.
37 */
38 
39 #define _DEFINING_ISBLANK
40 #include <_ansi.h>
41 #include <ctype.h>
42 
43 int
isblank(int c)44 isblank (int c)
45 {
46 	return c == ' ' || c == '\t';
47 }
48