aboutsummaryrefslogtreecommitdiff
path: root/sort.h
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-03-17 23:01:09 +1300
committerTom Ryder <tom@sanctum.geek.nz>2016-03-17 23:22:20 +1300
commit5238f976bfc7c750cdc737a68079a89250cbd274 (patch)
tree1e18d668b2efe49f7659174b20e2af170f7c871e /sort.h
parentGot line vector working properly (diff)
downloadtunics-5238f976bfc7c750cdc737a68079a89250cbd274.tar.gz
tunics-5238f976bfc7c750cdc737a68079a89250cbd274.zip
Dynamic allocation of lines
Massive refactor including implementing my own read_line function
Diffstat (limited to 'sort.h')
-rw-r--r--sort.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/sort.h b/sort.h
new file mode 100644
index 0000000..9b499c8
--- /dev/null
+++ b/sort.h
@@ -0,0 +1,22 @@
+#ifndef __SORT_H
+#define __SORT_H
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define VEC_SIZE 64
+#define BUF_SIZE 64
+
+typedef struct {
+ unsigned long count, size;
+ char **data;
+} vec;
+
+char *read_line(FILE* stream);
+vec *vec_init(void);
+void vec_add(vec *v, char *s);
+static int qsort_strcmp(const void *p1, const void *p2);
+
+#endif
+