aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/libbio.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/include/libbio.h b/include/libbio.h
index 0bda4d7..4b92587 100644
--- a/include/libbio.h
+++ b/include/libbio.h
@@ -12,21 +12,27 @@ typedef struct bio·Node
int nchild;
int ndescendent;
struct bio·Node *parent;
+ // NOTE: Sibiling allows for polytomies
struct bio·Node *child[2];
struct bio·Node *sibling;
} bio·Node;
-error phylo·addchild(bio·Node *parent, bio·Node* child);
-bool phylo·isleaf(bio·Node *node);
-
typedef struct bio·Tree
{
bio·Node *root;
+ int nleaf;
+ int nnode;
} bio·Tree;
+// clade functions
+error phylo·addchild(bio·Node* parent, bio·Node* child);
+
+error phylo·countnodes(bio·Node *node, int *n);
+error phylo·countleafs(bio·Node *node, int *n);
+
/* newick i/o */
-bio·Tree bio·readnewick(io·Peeker stream, void*, mem·Allocator heap, void*);
-error bio·writenewick(bio·Tree tree, io·Putter out, void*);
+error bio·readnewick(io·Peeker stream, void*, mem·Allocator heap, void*, bio·Tree* tree);
+error bio·writenewick(bio·Tree tree, io·Putter out, void*);
// -----------------------------------------------------------------------
// Sequences