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
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
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. */
25 #define MUST_ALREADY_EXIST 2
28 static const char **table
;
29 static int table_used
;
30 static int table_size
;
32 static int block_size
;
35 symbol(const char *p
, int how
= 0);
37 unsigned long hash() const;
38 int operator ==(symbol
) const;
39 int operator !=(symbol
) const;
40 const char *contents() 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
58 inline int symbol::operator!=(symbol p
) const
63 inline unsigned long symbol::hash() const
65 return (unsigned long)s
;
68 inline const char *symbol::contents() const
73 inline int symbol::is_null() const
78 inline int symbol::is_empty() const
80 return s
!= 0 && *s
== 0;
83 symbol
concat(symbol
, symbol
);
85 extern symbol default_symbol
;