]> rtime.felk.cvut.cz Git - frescor/frsh-include.git/blobdiff - frsh_hash_table.h
cpu id default in conf params
[frescor/frsh-include.git] / frsh_hash_table.h
index 31fc0f2b3f27aff5d6720ff8e89cbaf1060e109e..1551d3c535ea1122ec8d0366243282f2a0cfc19e 100644 (file)
@@ -87,9 +87,9 @@ frsh_hash_entry_status_t;
  * Type that defines a table entry
  */
 typedef struct {
-  char key[FRSH_HASH_TABLE_MAX_CHARS];    // array where the key is stored
-  int value;     // integer value (assumed non negative)
-  frsh_hash_entry_status_t status;  // indicates the entry status
+  char key[FRSH_HASH_TABLE_MAX_CHARS]; // array where the key is stored
+  unsigned int value;                  // unsigned integer value 
+  frsh_hash_entry_status_t status;     // indicates the entry status
 } frsh_hash_entry_t;
 
 /**
@@ -138,13 +138,14 @@ void frsh_hash_table_clean (frsh_hash_table_t *table);
  *          FRSH_ERR_NO_SPACE if the maximum number of keys would be exceeded
  */
 int frsh_hash_table_put (frsh_hash_table_t *table, 
-                        const char * key, int value);
+                        const char * key, unsigned int value);
 
 /**
  * Get the value assigned to a key. 
- * Returns -1 if the key is not present
+ * Returns 0 if successful or -1 if the key is not present
  */
-int frsh_hash_table_get (frsh_hash_table_t *table, const char * key);
+int frsh_hash_table_get (frsh_hash_table_t *table,
+                        const char * key, unsigned int * value);
 
 /**
  * Indicate whether or not the specified key is contained in the table
@@ -152,13 +153,12 @@ int frsh_hash_table_get (frsh_hash_table_t *table, const char * key);
 bool frsh_hash_table_contains_key (frsh_hash_table_t *table, const char * key);
 
 /**
- * Remove an entry from the table
+ * Remove an entry from the table given a key
  * Returns 0 if successful, or -1 if the key is not contained in the table
  */
 int frsh_hash_table_remove (frsh_hash_table_t *table, const char * key);
 
 
-
 #endif // FRSH_HASH_TABLE