Sync usage with man page.
[netbsd-mini2440.git] / gnu / dist / groff / src / include / symbol.h
blob98390b87ec3b646af435fff781c1679d545c5815
1 /* $NetBSD$ */
3 // -*- C++ -*-
4 /* Copyright (C) 1989, 1990, 1991, 1992, 2002, 2004
5 Free Software Foundation, Inc.
6 Written by James Clark (jjc@jclark.com)
8 This file is part of groff.
10 groff is free software; you can redistribute it and/or modify it under
11 the terms of the GNU General Public License as published by the Free
12 Software Foundation; either version 2, or (at your option) any later
13 version.
15 groff is distributed in the hope that it will be useful, but WITHOUT ANY
16 WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 for more details.
20 You should have received a copy of the GNU General Public License along
21 with groff; see the file COPYING. If not, write to the Free Software
22 Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA. */
24 #define DONT_STORE 1
25 #define MUST_ALREADY_EXIST 2
27 class symbol {
28 static const char **table;
29 static int table_used;
30 static int table_size;
31 static char *block;
32 static int block_size;
33 const char *s;
34 public:
35 symbol(const char *p, int how = 0);
36 symbol();
37 unsigned long hash() const;
38 int operator ==(symbol) const;
39 int operator !=(symbol) const;
40 const char *contents() const;
41 int is_null() const;
42 int is_empty() const;
46 extern const symbol NULL_SYMBOL;
47 extern const symbol EMPTY_SYMBOL;
49 inline symbol::symbol() : s(0)
53 inline int symbol::operator==(symbol p) const
55 return s == p.s;
58 inline int symbol::operator!=(symbol p) const
60 return s != p.s;
63 inline unsigned long symbol::hash() const
65 return (unsigned long)s;
68 inline const char *symbol::contents() const
70 return s;
73 inline int symbol::is_null() const
75 return s == 0;
78 inline int symbol::is_empty() const
80 return s != 0 && *s == 0;
83 symbol concat(symbol, symbol);
85 extern symbol default_symbol;