+ hTabAddItem (htab, key, item);
+}
+
+/** Simple implementation of a hash table which uses
+ string (key, value) pairs. If a key already exists in the
+ table, the newly added value will replace it.
+ This is used for the assembler token table. The replace existing
+ condition is used to implement inheritance.
+*/
+static int
+_compare (const void *s1, const void *s2)
+{
+ return !strcmp (s1, s2);
+}
+
+static int
+_hash (const char *sz)
+{
+ /* Dumb for now */
+ return *sz;
+}
+
+void
+shash_add (hTab ** h, const char *szKey, const char *szValue)
+{
+ char *val;
+ int key = _hash (szKey);
+
+ /* Find value of the item */
+ val = (char *)hTabFindByKey(*h, key, szKey, _compare);
+ /* Delete any that currently exist */
+ hTabDeleteByKey(h, key, szKey, _compare);
+ /* Deallocate old value in not NULL */
+ if (val != NULL)
+ Safe_free(val);
+ /* Duplicate new value if not NULL */
+ if (szValue != NULL)
+ szValue = Safe_strdup(szValue);
+ /* Now add in ours */
+ hTabAddItemLong (h, key, Safe_strdup (szKey), (void *)szValue);
+}
+
+const char *
+shash_find (hTab * h, const char *szKey)
+{
+ int key = _hash (szKey);
+ return (char *) hTabFindByKey (h, key, szKey, _compare);