refactor cursetree into node.c & tree.c
This commit is contained in:
parent
daaaaf979c
commit
2d76f8221e
6 changed files with 288 additions and 304 deletions
30
cursetree/tree.c
Normal file
30
cursetree/tree.c
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
#include "ncrswrap.h"
|
||||
#include "tree.h"
|
||||
|
||||
/*
|
||||
*/
|
||||
static struct crs_node *init_root_node(void) {
|
||||
WINDOW *rootwin;
|
||||
|
||||
rootwin = root_window();
|
||||
return init_window_node(rootwin);
|
||||
}
|
||||
|
||||
int init_tree(struct crs_tree **const tree) {
|
||||
*tree = (struct crs_tree *)malloc(sizeof(struct crs_tree));
|
||||
(*tree)->root = init_root_node();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
void destroy_tree(struct crs_tree *const tree) {
|
||||
destroy_node(tree->root);
|
||||
endwin();
|
||||
free(tree);
|
||||
}
|
||||
|
||||
void resize_tree(struct crs_tree *const tree, struct crs_nodedims *const dims) {
|
||||
resize_node(tree->root, dims);
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue