aboutsummaryrefslogtreecommitdiff
path: root/gas/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'gas/hash.c')
-rw-r--r--gas/hash.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gas/hash.c b/gas/hash.c
index 5ddd88e..aa6424e 100644
--- a/gas/hash.c
+++ b/gas/hash.c
@@ -20,6 +20,26 @@
#include "as.h"
+/* Hash function for a string_tuple. */
+
+hashval_t
+hash_string_tuple (const void *e)
+{
+ string_tuple_t *tuple = (string_tuple_t *) e;
+ return htab_hash_string (tuple->key);
+}
+
+/* Equality function for a string_tuple. */
+
+int
+eq_string_tuple (const void *a, const void *b)
+{
+ const string_tuple_t *ea = (const string_tuple_t *) a;
+ const string_tuple_t *eb = (const string_tuple_t *) b;
+
+ return strcmp (ea->key, eb->key) == 0;
+}
+
/* Insert ELEMENT into HTAB. If REPLACE is non-zero existing elements
are overwritten. If ELEMENT already exists, a pointer to the slot
is returned. Otherwise NULL is returned. */