X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/3e6656f9ab66ae7e629f8e5d5b41810bf070f09d..b17a1fc541456df871fa672c99d8d92cc7c084dd:/src/struniq.h diff --git a/src/struniq.h b/src/struniq.h index e83a0834..f72116c3 100644 --- a/src/struniq.h +++ b/src/struniq.h @@ -25,10 +25,13 @@ | struniq_t -- pointers to unique copies of C strings. | `------------------------------------------------------*/ -typedef char *struniq_t; +typedef const char *struniq_t; /* Return the struniq for S. */ -const struniq_t struniq_new (const char *s); +struniq_t struniq_new (const char *s); + +/* Two struniq have the same value iff they are the same. */ +#define STRUNIQ_EQ(S1, S2) ((S1) == (S2)) /*--------------------------------------. | Initializing, destroying, debugging. | @@ -37,6 +40,9 @@ const struniq_t struniq_new (const char *s); /* Create the string table. */ void struniqs_new (void); +/* Die if S is not a struniq. */ +void struniq_assert (const char *s); + /* Free all the memory allocated for symbols. */ void struniqs_free (void);