Skip to content

Commit 097849b

Browse files
committed
Remove use of 'compl'. Fixes #9.
1 parent f64d4a1 commit 097849b

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

include/tcli.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
typedef void (*tcli_out_fn_t)(void *arg, const char *str);
7171
typedef int (*tcli_exec_fn_t)(void *arg, int argc, const char **argv);
7272
typedef void (*tcli_compl_fn_t)(void *arg, int argc, const char **argv,
73-
const char ** compl, size_t max_count,
73+
const char ** completions, size_t max_count,
7474
size_t *count);
7575
typedef void (*tcli_sigint_fn_t)(void *arg);
7676

source/tclie.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,14 @@ static inline void tclie_print_cmd(tclie_t *const tclie,
125125
static void tclie_complete(const tclie_t *const tclie,
126126
const tclie_cmd_t *const cmds,
127127
const size_t cmd_count, const char *const match,
128-
const size_t match_len, const char **const compl,
128+
const size_t match_len, const char **const completions,
129129
const size_t max_count, size_t *const count)
130130
{
131131
assert(tclie);
132132
assert(cmds);
133133
assert(match);
134134
assert(match_len > 0);
135-
assert(compl );
135+
assert(completions);
136136
assert(count);
137137

138138
for (size_t i = 0; i < cmd_count && *count < max_count; i++) {
@@ -152,19 +152,19 @@ static void tclie_complete(const tclie_t *const tclie,
152152
if (cmd_len == match_len)
153153
return;
154154

155-
compl [(*count)++] = cmd->name;
155+
completions[(*count)++] = cmd->name;
156156
}
157157
}
158158

159159
static void tcli_complete(void *const arg, const int argc,
160160
const char **const argv,
161-
const char **const compl, const size_t max_count,
161+
const char **const completions, const size_t max_count,
162162
size_t *const count)
163163
{
164164
assert(arg);
165165
assert(argc > 0);
166166
assert(argv);
167-
assert(compl );
167+
assert(completions);
168168
assert(count);
169169

170170
if (max_count == 0 || argc > 1)
@@ -183,9 +183,9 @@ static void tcli_complete(void *const arg, const int argc,
183183

184184
tclie_complete(tclie, tclie_internal_cmds,
185185
TCLIE_ARRAY_SIZE(tclie_internal_cmds), match, match_len,
186-
compl, max_count, count);
186+
completions, max_count, count);
187187
tclie_complete(tclie, tclie->cmd.cmds, tclie->cmd.count, match, match_len,
188-
compl, max_count, count);
188+
completions, max_count, count);
189189
}
190190

191191
static bool tclie_exec(tclie_t *const tclie, const tclie_cmd_t *const cmds,

0 commit comments

Comments
 (0)