htable: add htable_count().
[ccan] / ccan / tal / stack / stack.c
1 /* Licensed under BSD-MIT - see LICENSE file for details */
2
3 #include <ccan/tal/stack/stack.h>
4 #include <assert.h>
5
6 static tal_t *h = NULL;
7
8 static void _free_frame(tal_t *o)
9 {
10         h = tal_parent(o);
11 }
12
13 tal_t *tal_newframe_(const char *label)
14 {
15         h = tal_label(h, char, label);
16         assert(h != NULL);
17         tal_add_destructor(h, _free_frame);
18         return h;
19 }
20
21 tal_t *tal_curframe(void)
22 {
23         return h;
24 }