skalibs

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

avltreen_insert.c (229B)


      1 /* ISC license. */
      2 
      3 #include <skalibs/avltreen.h>
      4 
      5 int avltreen_insert (avltreen *t, uint32_t d)
      6 {
      7   uint32_t i = avltreen_newnode(t, d) ;
      8   if (i >= avltreen_totalsize(t)) return 0 ;
      9   avltreen_insertnode(t, i) ;
     10   return 1 ;
     11 }