man/l_roff-char.7.in: fix Bernd Warken (Dave Kemper, Werner Lemberg)..
[s-roff.git] / include / cset.h
blob0d69e22fc9452780d17c6fabb401a8370594762c
1 /*@
2 * Copyright (c) 2014 - 2017 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
4 * Copyright (C) 1989 - 1992 Free Software Foundation, Inc.
5 * Written by James Clark (jjc@jclark.com)
7 * This is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License as published by the Free
9 * Software Foundation; either version 2, or (at your option) any later
10 * version.
12 * This is distributed in the hope that it will be useful, but WITHOUT ANY
13 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with groff; see the file COPYING. If not, write to the Free Software
19 * Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef _CSET_H
22 #define _CSET_H
24 #include "config.h"
26 #include <limits.h>
28 enum cset_builtin { CSET_BUILTIN };
30 class cset
32 friend class cset_init;
34 char v[UCHAR_MAX +1];
35 void clear();
37 public:
38 cset();
39 cset(cset_builtin);
40 cset(const char *);
41 cset(const unsigned char *);
42 int operator()(unsigned char) const;
44 cset &operator|=(const cset &);
45 cset &operator|=(unsigned char);
48 inline int cset::operator()(unsigned char c) const
50 return v[c];
53 inline cset &cset::operator|=(unsigned char c)
55 v[c] = 1;
56 return *this;
59 extern cset csalpha;
60 extern cset csupper;
61 extern cset cslower;
62 extern cset csdigit;
63 extern cset csxdigit;
64 extern cset csspace;
65 extern cset cspunct;
66 extern cset csalnum;
67 extern cset csprint;
68 extern cset csgraph;
69 extern cset cscntrl;
71 static class cset_init { /* FIXME oh my god.. injection initializers!! */
72 static int initialised;
73 public:
74 cset_init();
75 } _cset_init;
77 #endif // _CSET_H
78 // s-it2-mode