source: trunk/libs/newlib/src/newlib/libc/ctype/isblank.c @ 444

Last change on this file since 444 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

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