Rev 4874 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4874 | Rev 4921 | ||
---|---|---|---|
1 | /* |
1 | /* |
2 | FUNCTION |
2 | FUNCTION |
3 | < |
3 | < |
4 | 4 | ||
5 | INDEX |
5 | INDEX |
6 | isdigit |
6 | isdigit |
7 | 7 | ||
8 | ANSI_SYNOPSIS |
8 | ANSI_SYNOPSIS |
9 | #include |
9 | #include |
10 | int isdigit(int <[c]>); |
10 | int isdigit(int <[c]>); |
11 | 11 | ||
12 | TRAD_SYNOPSIS |
12 | TRAD_SYNOPSIS |
13 | #include |
13 | #include |
14 | int isdigit(<[c]>); |
14 | int isdigit(<[c]>); |
15 | 15 | ||
16 | DESCRIPTION |
16 | DESCRIPTION |
17 | < |
17 | < |
18 | lookup. It is a predicate returning non-zero for decimal digits, and 0 for |
18 | lookup. It is a predicate returning non-zero for decimal digits, and 0 for |
19 | other characters. It is defined only when < |
19 | other characters. It is defined only if <[c]> is representable as an |
20 | or <[c]> is EOF. |
20 | unsigned char or if <[c]> is EOF. |
21 | 21 | ||
22 | You can use a compiled subroutine instead of the macro definition by |
22 | You can use a compiled subroutine instead of the macro definition by |
23 | undefining the macro using `<<#undef isdigit>>'. |
23 | undefining the macro using `<<#undef isdigit>>'. |
24 | 24 | ||
25 | RETURNS |
25 | RETURNS |
26 | < |
26 | < |
27 | 27 | ||
28 | PORTABILITY |
28 | PORTABILITY |
29 | < |
29 | < |
30 | 30 | ||
31 | No supporting OS subroutines are required. |
31 | No supporting OS subroutines are required. |
32 | */ |
32 | */ |
33 | 33 | ||
34 | #include <_ansi.h> |
34 | #include <_ansi.h> |
35 | #include |
35 | #include |
36 | 36 | ||
37 | 37 | ||
38 | #undef isdigit |
38 | #undef isdigit |
39 | int |
39 | int |
40 | _DEFUN(isdigit,(c),int c) |
40 | _DEFUN(isdigit,(c),int c) |
41 | { |
41 | { |
42 | return(__ctype_ptr__[c+1] & _N); |
42 | return(__ctype_ptr__[c+1] & _N); |
43 | } |
43 | } |