This way the array of completers goes into the rodata section.
struct task *task;
};
-static struct i9e_completer audiod_completers[];
+static const struct i9e_completer audiod_completers[];
I9E_DUMMY_COMPLETER(cycle);
I9E_DUMMY_COMPLETER(off);
i9e_complete_option(opts, ci, cr);
}
-static struct i9e_completer audiod_completers[] = {
+static const struct i9e_completer audiod_completers[] = {
#define LSG_AUDIOD_CMD_CMD(_name) {.name = #_name, \
.completer = _name ## _completer}
LSG_AUDIOD_CMD_SUBCOMMANDS
I9E_DUMMY_COMPLETER(addatt);
I9E_DUMMY_COMPLETER(init);
-static struct i9e_completer completers[];
+static const struct i9e_completer completers[];
static void ll_completer(struct i9e_completion_info *ci,
struct i9e_completion_result *cr)
return 1;
}
-static struct i9e_completer completers[] = {
+static const struct i9e_completer completers[] = {
#define LSG_SERVER_CMD_CMD(_name) {.name = #_name, \
.completer = _name ## _completer}
LSG_SERVER_CMD_SUBCOMMANDS
}
static void create_matches(struct i9e_completion_info *ci,
- struct i9e_completer *completers,
+ const struct i9e_completer *completers,
struct i9e_completion_result *cr)
{
int i, ret;
{
static int list_index;
static char **argv, **matches;
- struct i9e_completer *completers = i9ep->ici->completers;
+ const struct i9e_completer *completers = i9ep->ici->completers;
struct i9e_completion_info ci = {
.word = (char *)word,
.point = rl_point,
*
* \return See \ref i9e_extract_completions().
*/
-char **i9e_complete_commands(const char *word, struct i9e_completer *completers)
+char **i9e_complete_commands(const char *word, const struct i9e_completer *completers)
{
char **matches;
const char *cmd;
*
* \return Standard.
*/
-int i9e_print_completions(struct i9e_completer *completers)
+int i9e_print_completions(const struct i9e_completer *completers)
{
struct i9e_completion_result cr;
struct i9e_completion_info ci;
* completing the first word (the command) and for calling the right
* completer if the cursor is not on the first word.
*/
- struct i9e_completer *completers;
+ const struct i9e_completer *completers;
/**
* If non-NULL, this node is attached immediately to the stdout btr
* node of the i9e subsystem.
int i9e_poll(struct pollfd *fds, nfds_t nfds, int timeout);
int i9e_extract_completions(const char *word, char **string_list,
char ***result);
-char **i9e_complete_commands(const char *word, struct i9e_completer *completers);
+char **i9e_complete_commands(const char *word, const struct i9e_completer *completers);
void i9e_complete_option(char **opts, struct i9e_completion_info *ci,
struct i9e_completion_result *cr);
-int i9e_print_completions(struct i9e_completer *completers);
+int i9e_print_completions(const struct i9e_completer *completers);
int i9e_get_error(void);
void i9e_ll_completer(struct i9e_completion_info *ci,
struct i9e_completion_result *cr);
return result;
}
-static struct i9e_completer pp_completers[];
+static const struct i9e_completer pp_completers[];
I9E_DUMMY_COMPLETER(jmp);
I9E_DUMMY_COMPLETER(next);
cr->matches = i9e_complete_commands(ci->word, pp_completers);
}
-static struct i9e_completer pp_completers[] = {
+static const struct i9e_completer pp_completers[] = {
#define LSG_PLAY_CMD_CMD(_name) {.name = #_name, \
.completer = _name ## _completer}
LSG_PLAY_CMD_SUBCOMMANDS