summaryrefslogtreecommitdiff
path: root/include/uci/internals/command.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/uci/internals/command.h')
-rw-r--r--include/uci/internals/command.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/uci/internals/command.h b/include/uci/internals/command.h
new file mode 100644
index 0000000..2994b04
--- /dev/null
+++ b/include/uci/internals/command.h
@@ -0,0 +1,21 @@
+#ifndef UCI_COMMAND_H
+#define UCI_COMMAND_H
+
+#define MAX_TOKEN_SIZE 32
+
+typedef struct {
+ char root[MAX_TOKEN_SIZE];
+ int args_count;
+ int args_capacity;
+ char* args;
+ bool empty;
+} uci_cmd_t;
+
+uci_cmd_t uci_cmd_init();
+void uci_cmd_add(uci_cmd_t *cmd, const char *token);
+void uci_cmd_set_root(uci_cmd_t *cmd, const char *token);
+void uci_cmd_append_arg(uci_cmd_t *cmd, const char *token);
+char *uci_cmd_get_arg(uci_cmd_t cmd, int i);
+void uci_cmd_deinit(uci_cmd_t cmd);
+
+#endif // UCI_COMMAND_H