rough framework
[lemu] / command.h
diff --git a/command.h b/command.h
new file mode 100644 (file)
index 0000000..b789927
--- /dev/null
+++ b/command.h
@@ -0,0 +1,24 @@
+#ifndef COMMAND_H
+#define COMMAND_H
+
+#include "server.h"
+
+typedef uint_fast8_t command_flags_t;
+enum command_flags {
+       COMMAND_FLAG_EVENT_CONNECT = (1<<0),
+       COMMAND_FLAG_EVENT_DISCONNECT = (1<<1),
+};
+
+struct command {
+       unsigned char *command;
+       size_t command_len;
+       command_flags_t flags;
+       STAILQ_ENTRY(command) stailq_entry;
+};
+
+struct command * command_new(unsigned char *command, size_t command_len, command_flags_t flags);
+void command_free(struct command *command);
+
+void command_parse(struct connection *c, struct server_worker_context *ctx, size_t thread_id, struct command *command);
+
+#endif /* COMMAND_H */
\ No newline at end of file