2 * Copyright (c) 2014 - 2017 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
4 * Copyright (C) 1989 - 1992, 2002, 2004
5 * Free Software Foundation, Inc.
6 * Written by James Clark (jjc@jclark.com)
8 * This is free software; you can redistribute it and/or modify it under
9 * the terms of the GNU General Public License as published by the Free
10 * Software Foundation; either version 2, or (at your option) any later
13 * This is distributed in the hope that it will be useful, but WITHOUT ANY
14 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 * You should have received a copy of the GNU General Public License along
19 * with groff; see the file COPYING. If not, write to the Free Software
20 * Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
28 #define MUST_ALREADY_EXIST 2
32 static const char **table
;
33 static int table_used
;
34 static int table_size
;
36 static int block_size
;
41 symbol(const char *p
, int how
= 0);
43 unsigned long hash() const;
44 int operator ==(symbol
) const;
45 int operator !=(symbol
) const;
46 const char *contents() const;
51 extern const symbol NULL_SYMBOL
;
52 extern const symbol EMPTY_SYMBOL
;
54 inline symbol::symbol() : s(0)
58 inline int symbol::operator==(symbol p
) const
63 inline int symbol::operator!=(symbol p
) const
68 inline unsigned long symbol::hash() const
70 return (unsigned long)s
;
73 inline const char *symbol::contents() const
78 inline int symbol::is_null() const
83 inline int symbol::is_empty() const
85 return s
!= 0 && *s
== 0;
88 symbol
concat(symbol
, symbol
);
90 extern symbol default_symbol
;