Sync usage with man page.
[netbsd-mini2440.git] / gnu / dist / groff / src / include / cset.h
blob84113f5948ea873f7fe8ccff11889c59d4fecf0b
1 /* $NetBSD$ */
3 // -*- C++ -*-
4 /* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
5 Written by James Clark (jjc@jclark.com)
7 This file is part of groff.
9 groff is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free
11 Software Foundation; either version 2, or (at your option) any later
12 version.
14 groff is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 for more details.
19 You should have received a copy of the GNU General Public License along
20 with groff; see the file COPYING. If not, write to the Free Software
21 Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
23 #ifdef HAVE_CC_LIMITS_H
24 #include <limits.h>
25 #else /* not HAVE_CC_LIMITS_H */
26 #ifndef UCHAR_MAX
27 #define UCHAR_MAX 255
28 #endif
29 #endif /* not HAVE_CC_LIMITS_H */
31 enum cset_builtin { CSET_BUILTIN };
33 class cset {
34 public:
35 cset();
36 cset(cset_builtin);
37 cset(const char *);
38 cset(const unsigned char *);
39 int operator()(unsigned char) const;
41 cset &operator|=(const cset &);
42 cset &operator|=(unsigned char);
44 friend class cset_init;
45 private:
46 char v[UCHAR_MAX+1];
47 void clear();
50 inline int cset::operator()(unsigned char c) const
52 return v[c];
55 inline cset &cset::operator|=(unsigned char c)
57 v[c] = 1;
58 return *this;
61 extern cset csalpha;
62 extern cset csupper;
63 extern cset cslower;
64 extern cset csdigit;
65 extern cset csxdigit;
66 extern cset csspace;
67 extern cset cspunct;
68 extern cset csalnum;
69 extern cset csprint;
70 extern cset csgraph;
71 extern cset cscntrl;
73 static class cset_init {
74 static int initialised;
75 public:
76 cset_init();
77 } _cset_init;