summaryrefslogtreecommitdiff
path: root/include/uci/internals/command.h
blob: 2994b04f6961d0507a722566865a175f5ecb52fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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