2 /* Copyright (C) 1989-2014 Free Software Foundation, Inc.
3 Written by James Clark (jjc@jclark.com)
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 3 of the License, or
10 (at your option) any later 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
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 #define MUST_ALREADY_EXIST 2
24 static const char **table;
25 static int table_used;
26 static int table_size;
28 static int block_size;
31 symbol(const char *p, int how = 0);
33 unsigned long hash() const;
34 int operator ==(symbol) const;
35 int operator !=(symbol) const;
36 const char *contents() const;
42 extern const symbol NULL_SYMBOL;
43 extern const symbol EMPTY_SYMBOL;
45 inline symbol::symbol() : s(0)
49 inline int symbol::operator==(symbol p) const
54 inline int symbol::operator!=(symbol p) const
59 inline unsigned long symbol::hash() const
61 return (unsigned long)s;
64 inline const char *symbol::contents() const
69 inline int symbol::is_null() const
74 inline int symbol::is_empty() const
76 return s != 0 && *s == 0;
79 symbol concat(symbol, symbol);
81 extern symbol default_symbol;