diff --git a/include/picrin.h b/include/picrin.h new file mode 100644 index 00000000..83663fa7 --- /dev/null +++ b/include/picrin.h @@ -0,0 +1,10 @@ +#ifndef PICRIN_H__ +#define PICRIN_H__ + +typedef struct { +} pic_state; + +pic_state *pic_open(); +void pic_close(pic_state *pic); + +#endif diff --git a/src/main.c b/src/main.c index 5d239ab2..ae8bf8c7 100644 --- a/src/main.c +++ b/src/main.c @@ -1,13 +1,18 @@ #include +#include "picrin.h" + #define LINE_MAX_LENGTH 256 int main() { + pic_state *pic; char line[LINE_MAX_LENGTH], last_char; int char_index; + pic = pic_open(); + while (1) { printf("> "); @@ -36,5 +41,7 @@ main() goto exit; exit: + pic_close(pic); + return 0; } diff --git a/src/state.c b/src/state.c new file mode 100644 index 00000000..a830608e --- /dev/null +++ b/src/state.c @@ -0,0 +1,19 @@ +#include + +#include "picrin.h" + +pic_state * +pic_open() +{ + pic_state *pic; + + pic = (pic_state *)calloc(sizeof(pic_state)); + + return pic; +} + +void +pic_close(pic_state *pic) +{ + free(pic); +}