-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathctype.d
68 lines (64 loc) · 1.14 KB
/
ctype.d
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/**
* D header file for C99.
*
* $(C_HEADER_DESCRIPTION pubs.opengroup.org/onlinepubs/009695399/basedefs/_ctype.h.html, _ctype.h)
*
* Copyright: Copyright Sean Kelly 2005 - 2009.
* License: Distributed under the
* $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0).
* (See accompanying file LICENSE)
* Authors: Sean Kelly
* Source: $(DRUNTIMESRC core/stdc/_ctype.d)
* Standards: ISO/IEC 9899:1999 (E)
*/
extern (C):
@trusted: // All of these operate on integers only.
nothrow:
@nogc:
///
pure int isalnum(int c);
///
pure int isalpha(int c);
///
pure int isblank(int c);
///
pure int iscntrl(int c)
{
return cast(uint)c < 0x20 || c == 0x7f;
}
///
pure int isdigit(int c);
///
pure int isgraph(int c);
///
pure int islower(int c);
///
pure int isprint(int c);
///
pure int ispunct(int c);
///
pure int isspace(int c);
///
pure int isupper(int c)
{
return cast(uint)c-'A' < 26;
}
///
pure int isxdigit(int c);
///
pure int toupper(int c);
///
int tolower(int c)
{
if (isupper(c)) return c | 32;
return c;
}
int __maskrune(int c, uint _f)
{
//stub
return 0;
}
int isascii(int c)
{
return !(c&~0x7f);
}