From 39c0dfbc9c4279e519841afae5c7413b1bdf56d8 Mon Sep 17 00:00:00 2001 From: Soikk Date: Thu, 5 May 2022 18:45:45 +0200 Subject: More quality of life changes --- src/parser.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/parser.c (limited to 'src/parser.c') diff --git a/src/parser.c b/src/parser.c new file mode 100644 index 0000000..f26a0cb --- /dev/null +++ b/src/parser.c @@ -0,0 +1,20 @@ +#include "db.h" + + +int handleMetaCommand(inputBuffer *in){ + if(sameStr(in->buffer, ".exit")){ + freeInputBuffer(in); + printf("EXIT M'NIGGA\n"); + exit(EXIT_SUCCESS); + }else{ + return META_COMMAND_FAIL; + } +} + +int handleInput(inputBuffer *in){ + if(in->buffer[0] == '.'){ + return handleMetaCommand(in); + }else{ + printf("normal command\n"); + } +} \ No newline at end of file -- cgit v1.2.3