commit - d96f10f4be4eade4e406a1bec60916560587062c
commit + f89beeaa3f66b7fee1e7d23d35e74cf47aa61335
blob - 12a062ac12fc0331996d8de2deb89f687319439f
blob + d14b04eed473e9ae7b3a22dfdca6431d1ed5174c
--- table_static.c
+++ table_static.c
#include "compat.h"
#include <stdlib.h>
+#include <string.h>
#include "kamid.h"
#include "utils.h"
struct kp *kp;
unsigned int slot;
+#if 0
slot = ohash_qlookup(t->t_handle, key);
if ((kp = ohash_find(t->t_handle, slot)) == NULL)
return -1;
*ret_val = xstrdup(kp->val);
return 0;
+#endif
+
+ for (kp = ohash_first(t->t_handle, &slot);
+ kp != NULL;
+ kp = ohash_next(t->t_handle, &slot)) {
+ if (!strcmp(kp->key, key)) {
+ *ret_val = xstrdup(kp->val);
+ return 0;
+ }
+ }
+ return -1;
}
static void