summaryrefslogtreecommitdiffstats
path: root/api/src/gfapi.map
diff options
context:
space:
mode:
Diffstat (limited to 'api/src/gfapi.map')
0 files changed, 0 insertions, 0 deletions
*token) { return (struct cli_cmd_word *)cli_getunamb (token, (void **)word->nextwords, sel_cmd_word); } struct cli_cmd_word * cli_cmd_newword (struct cli_cmd_word *word, const char *token) { struct cli_cmd_word **nextwords = NULL; struct cli_cmd_word *nextword = NULL; nextwords = realloc (word->nextwords, (word->nextwords_cnt + 2) * sizeof (*nextwords)); if (!nextwords) return NULL; word->nextwords = nextwords; nextword = calloc (1, sizeof (*nextword)); if (!nextword) return NULL; nextword->word = strdup (token); if (!nextword->word) { free (nextword); return NULL; } nextword->tree = word->tree; nextwords[word->nextwords_cnt++] = nextword; nextwords[word->nextwords_cnt] = NULL; return nextword; } int cli_cmd_ingest (struct cli_cmd_tree *tree, char **tokens, cli_cmd_cbk_t *cbkfn, const char *desc, const char *pattern) { int ret = 0; char **tokenp = NULL; char *token = NULL; struct cli_cmd_word *word = NULL; struct cli_cmd_word *next = NULL; word = &tree->root; for (tokenp = tokens; (token = *tokenp); tokenp++) { if (!__is_word (token)) break; next = cli_cmd_nextword (word, token); if (!next) next = cli_cmd_newword (word, token); word = next; if (!word)