1 |
/* Keeping a unique copy of strings. |
/* Keeping a unique copy of strings. |
2 |
Copyright (C) 2002 Free Software Foundation, Inc. |
|
3 |
|
Copyright (C) 2002, 2003 Free Software Foundation, Inc. |
4 |
|
|
5 |
This file is part of Bison, the GNU Compiler Compiler. |
This file is part of Bison, the GNU Compiler Compiler. |
6 |
|
|
28 |
|
|
29 |
typedef char const *uniqstr; |
typedef char const *uniqstr; |
30 |
|
|
31 |
/* Return the uniqstr for S. */ |
/* Return the uniqstr for STR. */ |
32 |
uniqstr uniqstr_new (char const *s); |
uniqstr uniqstr_new (char const *str); |
33 |
|
|
34 |
/* Two uniqstr have the same value iff they are the same. */ |
/* Two uniqstr values have the same value iff they are the same. */ |
35 |
#define UNIQSTR_EQ(S1, S2) ((S1) == (S2)) |
#define UNIQSTR_EQ(USTR1, USTR2) ((USTR1) == (USTR2)) |
36 |
|
|
37 |
/*--------------------------------------. |
/*--------------------------------------. |
38 |
| Initializing, destroying, debugging. | |
| Initializing, destroying, debugging. | |
41 |
/* Create the string table. */ |
/* Create the string table. */ |
42 |
void uniqstrs_new (void); |
void uniqstrs_new (void); |
43 |
|
|
44 |
/* Die if S is not a uniqstr. */ |
/* Die if STR is not a uniqstr. */ |
45 |
void uniqstr_assert (char const *s); |
void uniqstr_assert (char const *str); |
46 |
|
|
47 |
/* Free all the memory allocated for symbols. */ |
/* Free all the memory allocated for symbols. */ |
48 |
void uniqstrs_free (void); |
void uniqstrs_free (void); |