Newer
Older
/*
* Copyright (C) 2013 Cloudius Systems, Ltd.
*
* This work is open source software, licensed under the terms of the
* BSD license as described in the LICENSE file in the top-level directory.
*/
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
#include <iostream>
#include <ctype.h>
namespace {
void do_ctype(std::ostream& os, int i, int (*f)(int), std::string name)
{
if (f(i)) {
os << " | " << name;
}
}
}
#define DO(x) do_ctype(std::cout, i, is##x, "_IS" #x)
int main(int ac, char **av)
{
for (int i = -127; i < 256; ++i) {
std::cout << "0";
DO(alnum);
DO(alpha);
/* DO(ascii); */
DO(blank);
DO(cntrl);
DO(digit);
DO(graph);
DO(lower);
DO(print);
DO(punct);
DO(space);
DO(upper);
DO(xdigit);
std::cout << ",\n";
}
}