rough framework
[lemu] / command.h
1 #ifndef COMMAND_H
2 #define COMMAND_H
3
4 #include "server.h"
5
6 typedef uint_fast8_t command_flags_t;
7 enum command_flags {
8 COMMAND_FLAG_EVENT_CONNECT = (1<<0),
9 COMMAND_FLAG_EVENT_DISCONNECT = (1<<1),
10 };
11
12 struct command {
13 unsigned char *command;
14 size_t command_len;
15 command_flags_t flags;
16 STAILQ_ENTRY(command) stailq_entry;
17 };
18
19 struct command * command_new(unsigned char *command, size_t command_len, command_flags_t flags);
20 void command_free(struct command *command);
21
22 void command_parse(struct connection *c, struct server_worker_context *ctx, size_t thread_id, struct command *command);
23
24 #endif /* COMMAND_H */