advent-of-c-ode/libs/buffered_reader.h

22 lines
396 B
C

#ifndef buffred_reader
#define buffred_reader
#define STARTING_SIZE 16
#include <stdlib.h>
typedef struct {
size_t size;
size_t capacity;
char** lines;
}filelines;
filelines* flines(const char* filename);
void initFileLines(filelines** flines_ptr);
void insert(filelines* flines_ptr, char* str);
char* get(filelines* flines_ptr, int index);
void freeLines(filelines* flines_ptr);
#endif