From 5238f976bfc7c750cdc737a68079a89250cbd274 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 17 Mar 2016 23:01:09 +1300 Subject: Dynamic allocation of lines Massive refactor including implementing my own read_line function --- sort.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 sort.h (limited to 'sort.h') 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 +#include +#include + +#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 + -- cgit v1.2.3