aboutsummaryrefslogtreecommitdiff
path: root/include/parser.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/parser.h')
-rw-r--r--include/parser.h26
1 files changed, 23 insertions, 3 deletions
diff --git a/include/parser.h b/include/parser.h
index 2e46967..6b68b48 100644
--- a/include/parser.h
+++ b/include/parser.h
@@ -4,14 +4,34 @@
#include "db.h"
-typedef enum {
+#define NKEYWORDS 16
+#define EXIT_CODE 1
+
+typedef enum{
+ COMMAND_EXIT, COMMAND_DEBUG,
+ COMMAND_CREATE, COMMAND_DELETE, COMMAND_OPEN, COMMAND_SAVE, COMMAND_CLOSE,
+ COMMAND_ADDF, COMMAND_ADDT, COMMAND_DELETEF, COMMAND_DELETET,
+ COMMAND_TAG, COMMAND_REMOVE,
+ COMMAND_SHOW, COMMAND_SHOWT, COMMAND_SHOWF,
+} COMMANDS;
+
+typedef enum{
META_COMMAND_SUCCESS,
META_COMMAND_FAIL,
} metaCommandStatus;
+typedef struct{
+ uint64_t argc;
+ char **argv;
+} argList;
+
+
+argList *newArgList(void);
+
+argList *splitInput(inputBuffer *in);
int handleMetaCommand(inputBuffer *in);
-int handleInput(inputBuffer *in);
+int handleInput(argList *args, database **db);
-#endif \ No newline at end of file
+#endif