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

#include <stdint.h>
#include <skalibs/avltreen.h>

int avltreen_insert (avltreen *t, uint32_t d)
{
  uint32_t i = avltreen_newnode(t, d) ;
  if (i >= avltreen_totalsize(t)) return 0 ;
  avltreen_insertnode(t, i) ;
  return 1 ;
}