]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_c/Maasha/src/inc/hash.h
added bed2fixedstep.c
[biopieces.git] / code_c / Maasha / src / inc / hash.h
index 50ef219502e514116c7ab8a057ade51b9fdc4983..28a9197111b1933a17289608caa23f3a743d92e2 100644 (file)
@@ -13,10 +13,12 @@ typedef struct _hash_elem hash_elem;
 /* Structure of a generic hash. */
 struct _hash
 {
-    hash_elem **table;        /* Hash table. */
-    size_t      mask;         /* Mask to trim hashed keys. */
-    size_t      table_size;   /* Size of hash table. */
-    size_t      nmemb;        /* Number of elements in hash table. */
+    hash_elem **table;          /* Hash table. */
+    size_t      mask;           /* Mask to trim hashed keys. */
+    size_t      table_size;     /* Size of hash table. */
+    size_t      nmemb;          /* Number of elements in hash table. */
+    size_t      index_table;    /* Index for iterating hash table. */
+    hash_elem  *index_bucket;   /* Index for iterating buckets. */
 };
 
 typedef struct _hash hash;
@@ -39,6 +41,9 @@ void *hash_get( hash *hash_pt, char *key );
 /* Lookup a key in a given hash and return the hash element - or NULL if not found. */
 hash_elem *hash_elem_get( hash *hash_pt, char *key );
 
+/* Get the next key/value pair from a hash table. */
+bool hash_each( hash *hash_pt, char **key_ppt, void *val );
+
 /* Deallocate memory for hash and all hash elements. */
 void hash_destroy( hash *hash_pt );