dorne/cursetree/tree.c

31 lines
586 B
C
Raw Normal View History

#include <stdlib.h>
#include "ncrswrap.h"
#include "tree.h"
/*
*/
2025-09-13 11:21:34 +10:00
static struct ct_node *init_root_node(void) {
WINDOW *rootwin;
rootwin = root_window();
return init_window_node(rootwin);
}
2025-09-13 11:21:34 +10:00
int init_tree(struct ct_tree **const tree) {
*tree = (struct ct_tree *)malloc(sizeof(struct ct_tree));
(*tree)->root = init_root_node();
return EXIT_SUCCESS;
}
2025-09-13 11:21:34 +10:00
void destroy_tree(struct ct_tree *const tree) {
destroy_node(tree->root);
endwin();
free(tree);
}
2025-09-13 11:21:34 +10:00
void resize_tree(struct ct_tree *const tree, struct ct_dims *const dims) {
resize_node(tree->root, dims);
}