Sync usage with man page.
[netbsd-mini2440.git] / gnu / usr.bin / groff / libgroff / cset.h
blob8c5eedffc46a1302a592b49cc7e1d37d97f9e4e2
1 // -*- C++ -*-
2 /* Copyright (C) 1989, 1990 Free Software Foundation, Inc.
3 Written by James Clark (jjc@jclark.uucp)
5 This file is part of groff.
7 groff 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 1, or (at your option) any later
10 version.
12 groff 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 LICENSE. If not, write to the Free Software
19 Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
21 #ifndef UCHAR_MAX
22 #define UCHAR_MAX 255
23 #endif
25 enum cset_builtin { CSET_BUILTIN };
27 class cset {
28 public:
29 cset();
30 cset(cset_builtin);
31 cset(const char *);
32 cset(const unsigned char *);
33 int operator()(unsigned char) const;
35 cset &operator|=(const cset &);
36 cset &operator|=(unsigned char);
38 friend class cset_init;
39 private:
40 char v[UCHAR_MAX+1];
41 void clear();
44 inline int cset::operator()(unsigned char c) const
46 return v[c];
49 inline cset &cset::operator|=(unsigned char c)
51 v[c] = 1;
52 return *this;
55 extern cset csalpha;
56 extern cset csupper;
57 extern cset cslower;
58 extern cset csdigit;
59 extern cset csxdigit;
60 extern cset csspace;
61 extern cset cspunct;
62 extern cset csalnum;
63 extern cset csprint;
64 extern cset csgraph;
65 extern cset cscntrl;
67 static class cset_init {
68 static int initialised;
69 public:
70 cset_init();
71 } _cset_init;