30 lines
586 B
C
30 lines
586 B
C
#include <stdlib.h>
|
|
|
|
#include "ncrswrap.h"
|
|
#include "tree.h"
|
|
|
|
/*
|
|
*/
|
|
static struct ct_node *init_root_node(void) {
|
|
WINDOW *rootwin;
|
|
|
|
rootwin = root_window();
|
|
return init_window_node(rootwin);
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
void destroy_tree(struct ct_tree *const tree) {
|
|
destroy_node(tree->root);
|
|
endwin();
|
|
free(tree);
|
|
}
|
|
|
|
void resize_tree(struct ct_tree *const tree, struct ct_dims *const dims) {
|
|
resize_node(tree->root, dims);
|
|
}
|
|
|