summaryrefslogtreecommitdiff
path: root/src/libdatastruct/bigkv_search.c
blob: e9efe7ade2b5306808590df41abdbbd556ddc174 (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 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, &b->nodes)[i].v ;
}