Lines Matching defs:commands
61 * to the top-level commands (char*) that a program supports.
62 * count reflects the number of commands cmd holds. Memory must
65 void get_commands(ss_commands *commands) {
71 commands->count = 0;
73 info = ss_info(commands->sci_idx);
79 if (commands->cmd != NULL)
80 commands->cmd[commands->count] = *cmd;
81 commands->count++;
94 ss_commands *commands = data;
106 if (ss_parse(commands->sci_idx, l, &argc, &argv, 1)) {
116 for (i = 0; i < commands->count; i++) {
117 if (strncmp(commands->cmd[i], line + ws, len) == 0) {
119 word_end, commands->cmd[i] + len, "", " ");
144 ss_commands commands;
169 commands.sci_idx = sci_idx;
170 commands.cmd = NULL;
172 /* Find out how many commands there are */
173 get_commands(&commands);
176 commands.cmd = malloc(sizeof (char *) * commands.count);
177 if (commands.cmd == NULL) {
183 /* Fill-in commands.cmd */
184 get_commands(&commands);
186 if (gl_customize_completion(gl, &commands, cmdmatch) != 0 ) {
189 free(commands.cmd);
304 free(commands.cmd);