-/* hash.c - hash tables for ipkg
+/* hash.c - hash tables for opkg
Steven M. Ayer, Jamey Hicks
#include <stdlib.h>
#include <string.h>
#include "hash_table.h"
-#include "ipkg_message.h"
+#include "opkg_message.h"
static int hash_index(hash_table_t *hash, const char *pkg_name);
if (hash_entry->key)
{
if (strcmp(key, hash_entry->key) == 0) {
- // ipkg_message(NULL, IPKG_DEBUG, "Function: %s. Key found for '%s' \n", __FUNCTION__, key);
+ // opkg_message(NULL, OPKG_DEBUG, "Function: %s. Key found for '%s' \n", __FUNCTION__, key);
return hash_entry->data;
}
}
{
int ndx= hash_index(hash, key);
hash_entry_t *hash_entry = hash->entries + ndx;
- if (0) ipkg_message(NULL, IPKG_DEBUG2, "Function: %s. Inserting in hash for '%s' \n", __FUNCTION__, key);
+ if (0) opkg_message(NULL, OPKG_DEBUG2, "Function: %s. Inserting in hash for '%s' \n", __FUNCTION__, key);
if (hash_entry->key) {
if (strcmp(hash_entry->key, key) == 0) {
/* alread in table, update the value */
- if (0) ipkg_message(NULL, IPKG_DEBUG2, "Function: %s. Value already in hash for '%s' \n", __FUNCTION__, key);
+ if (0) opkg_message(NULL, OPKG_DEBUG2, "Function: %s. Value already in hash for '%s' \n", __FUNCTION__, key);
hash_entry->data = value;
return 0;
} else {
* then add a new entry
* before we can hook up the value
*/
- if (0) ipkg_message(NULL, IPKG_DEBUG2, "Function: %s. Value already in hash by collision for '%s' \n", __FUNCTION__, key);
+ if (0) opkg_message(NULL, OPKG_DEBUG2, "Function: %s. Value already in hash by collision for '%s' \n", __FUNCTION__, key);
while (hash_entry->next)
hash_entry = hash_entry->next;
hash_entry->next = (hash_entry_t *)malloc(sizeof(hash_entry_t));