+static bool add_one(trbt_tree_t *rb, bool exist, unsigned int i)
+{
+ int *new = talloc_memdup(rb, &i, sizeof(i));
+ int *p;
+
+ if (!new)
+ return false;
+
+ p = trbt_insert32(rb, i, new);
+ if (p) {
+ if (!exist)
+ return false;
+ if (*p != i)
+ return false;
+ } else {
+ if (exist)
+ return false;
+ else
+ if (!trbt_lookup32(rb, i))
+ return false;
+ }
+ return true;
+}
+