+/** int OSHash_Update(OSHash *self, char *key, void *data)
+ * Returns 0 on error (not found).
+ * Returns 1 on successduplicated key (not added)
+ * Key must not be NULL.
+ */
+int OSHash_Update(OSHash *self, const char *key, void *data)
+{
+ unsigned int hash_key;
+ unsigned int index;
+ OSHashNode *curr_node;
+
+ /* Generate hash of the message */
+ hash_key = _os_genhash(self, key);
+
+ /* Get array index */
+ index = hash_key % self->rows;
+
+ /* Check for duplicated entries in the index */
+ curr_node = self->table[index];
+ while (curr_node) {
+ /* Checking for duplicated key -- not adding */
+ if (strcmp(curr_node->key, key) == 0) {
+ curr_node->data = data;
+ return (1);
+ }
+ curr_node = curr_node->next;
+ }
+ return (0);
+}