aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolden Rohrer <hr@hrhr.dev>2020-05-22 01:17:51 -0400
committerHolden Rohrer <hr@hrhr.dev>2020-05-22 01:17:51 -0400
commitd627ea35adfb6a14ad1d074271ebc19c58983e98 (patch)
tree295e91f4681caae3050b712b376511b8a8507fea
parent064af7268d29bbbd66b47c379a5dcf77a13aa2ee (diff)
fixed some header/typedef stuff and made more types opaque
-rw-r--r--strbst.c6
-rw-r--r--strbst.h10
2 files changed, 8 insertions, 8 deletions
diff --git a/strbst.c b/strbst.c
index e4494ab..ff7f1b7 100644
--- a/strbst.c
+++ b/strbst.c
@@ -9,7 +9,7 @@
typedef char height;
-typedef struct strbstnode{
+typedef struct strbstnode {
char* ind;
void* data;
struct strbstnode* left;
@@ -17,6 +17,10 @@ typedef struct strbstnode{
int ht;
} strbstnode;
+struct strbst {
+ strbstnode* head;
+};
+
strbst* newbst(void) {
strbst* out = malloc(sizeof(strbst));
out->head = NULL;
diff --git a/strbst.h b/strbst.h
index d1a07bf..4605bcf 100644
--- a/strbst.h
+++ b/strbst.h
@@ -1,11 +1,7 @@
-#ifndef _STRBST_
-#define _STRBST_
+#ifndef __STRBST_H__
+#define __STRBST_H__
-typedef struct strbstnode strbstnode;
-
-typedef struct {
- strbstnode* head;
-} strbst;
+typedef struct strbst strbst;
strbst* newbst(void);