2 492a274f 2021-10-07 op * Copyright (c) 2021 Omar Polo <op@omarpolo.com>
4 492a274f 2021-10-07 op * Permission to use, copy, modify, and distribute this software for any
5 492a274f 2021-10-07 op * purpose with or without fee is hereby granted, provided that the above
6 492a274f 2021-10-07 op * copyright notice and this permission notice appear in all copies.
8 492a274f 2021-10-07 op * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 492a274f 2021-10-07 op * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 492a274f 2021-10-07 op * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 492a274f 2021-10-07 op * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 492a274f 2021-10-07 op * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 492a274f 2021-10-07 op * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 492a274f 2021-10-07 op * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 492a274f 2021-10-07 op #include <sys/tree.h>
19 492a274f 2021-10-07 op #include <stdio.h>
23 492a274f 2021-10-07 op SPLAY_ENTRY(tree) entry;
25 492a274f 2021-10-07 op SPLAY_HEAD(tree_id, tree);
28 492a274f 2021-10-07 op tree_cmp(struct tree *a, struct tree *b)
30 492a274f 2021-10-07 op if (a->i == b->i)
32 492a274f 2021-10-07 op else if (a->i < b->i)
38 492a274f 2021-10-07 op SPLAY_PROTOTYPE(tree_id, tree, entry, tree_cmp);
39 492a274f 2021-10-07 op SPLAY_GENERATE(tree_id, tree, entry, tree_cmp);