skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

avlnode_search.c (354B)


      1 /* ISC license. */
      2 
      3 #include <errno.h>
      4 #include <skalibs/avlnode.h>
      5 
      6 int avlnode_search (avlnode const *s, uint32_t max, uint32_t r, void const *k, uint32_t *data, dtok_func_ref dtok, cmp_func_ref f, void *p)
      7 {
      8   uint32_t i = avlnode_searchnode(s, max, r, k, dtok, f, p) ;
      9   if (i >= max) return (errno = ESRCH, 0) ;
     10   *data = s[i].data ;
     11   return 1 ;
     12 }