diff options
Diffstat (limited to 'src/parser.c')
| -rw-r--r-- | src/parser.c | 20 |
1 files changed, 20 insertions, 0 deletions
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 |
