123456789101112131415161718192021222324252627282930313233343536 |
- #ifndef COMMANDS_HPP
- #define COMMANDS_HPP
- #include <cstring>
- #include <cctype>
- #define COMMANDLEN 10
- #define sizeofarr(a) (sizeof(a) / sizeof(a[0]))
- typedef enum {
- CMD_HELP,
- CMD_CONNECT,
- CMD_DISCONNECT,
- CMD_PUT,
- CMD_REMOVE,
- CMD_GET,
- CMD_STATUS,
- CMD_SETUP,
- CMD_LOG,
- CMD_UNKNOWN
- } COMMANDID;
- typedef struct {
- COMMANDID cmd;
- const char *name;
- const char *desc;
- } CMD;
- extern CMD commands[];
- COMMANDID getCmdIdFromString(const char *str);
- const char *getCmdStringFromId(COMMANDID id);
- // TODO
- void printCmds(void);
- #endif
|