summaryrefslogtreecommitdiff
path: root/src/libdatastruct/bigkv_search.c
blob: bb91e3a1dd70ac37fdaa4a7e973e0a36d0fa8375 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
/* ISC license. */

#include <skalibs/genalloc.h>
#include <skalibs/avltree.h>
#include <skalibs/bigkv.h>

char const *bigkv_search (bigkv_t const *b, char const *k)
{
  uint32_t i ;
  if (!avltree_search(&b->map, k, &i)) return 0 ;
  return b->storage.s + genalloc_s(bigkv_node_t, &b->nodes)[i].v ;
}