aboutsummaryrefslogtreecommitdiff
path: root/src/parser.c
diff options
context:
space:
mode:
authorSoikk2022-05-05 18:45:45 +0200
committerSoikk2022-05-05 18:45:45 +0200
commit39c0dfbc9c4279e519841afae5c7413b1bdf56d8 (patch)
tree8fbe479baf22778911b75ec3d06f05de584b6bce /src/parser.c
parent6afe3cc8ec6c009a43950bdbe138cbc2d7a88a4d (diff)
downloadsoikk-DB-39c0dfbc9c4279e519841afae5c7413b1bdf56d8.tar.xz
soikk-DB-39c0dfbc9c4279e519841afae5c7413b1bdf56d8.tar.zst
More quality of life changes
Diffstat (limited to 'src/parser.c')
-rw-r--r--src/parser.c20
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