mirror of
https://github.com/tmux/tmux.git
synced 2026-10-11 21:14:21 +00:00
Stub out all users of old API.
This commit is contained in:
28
arguments.c
28
arguments.c
@@ -774,8 +774,6 @@ args_make_commands_prepare(struct cmd *self, struct cmdq_item *item, u_int idx,
|
|||||||
const char *default_command, int wait, int expand)
|
const char *default_command, int wait, int expand)
|
||||||
{
|
{
|
||||||
struct args *args = cmd_get_args(self);
|
struct args *args = cmd_get_args(self);
|
||||||
struct cmd_find_state *target = cmdq_get_target(item);
|
|
||||||
struct client *tc = cmdq_get_target_client(item);
|
|
||||||
struct args_value *value;
|
struct args_value *value;
|
||||||
struct args_command_state *state;
|
struct args_command_state *state;
|
||||||
const char *cmd;
|
const char *cmd;
|
||||||
@@ -804,15 +802,22 @@ args_make_commands_prepare(struct cmd *self, struct cmdq_item *item, u_int idx,
|
|||||||
state->cmd = xstrdup(cmd);
|
state->cmd = xstrdup(cmd);
|
||||||
log_debug("%s: %s", __func__, state->cmd);
|
log_debug("%s: %s", __func__, state->cmd);
|
||||||
|
|
||||||
|
#if 0 /* XXX: command parser conversion */
|
||||||
if (wait)
|
if (wait)
|
||||||
state->pi.item = item;
|
state->pi.item = item;
|
||||||
cmd_get_source(self, &file, &state->pi.line);
|
cmd_get_source(self, &file, &state->pi.line);
|
||||||
if (file != NULL)
|
if (file != NULL)
|
||||||
state->pi.file = xstrdup(file);
|
state->pi.file = xstrdup(file);
|
||||||
state->pi.c = tc;
|
state->pi.c = cmdq_get_target_client(item);
|
||||||
if (state->pi.c != NULL)
|
if (state->pi.c != NULL)
|
||||||
state->pi.c->references++;
|
state->pi.c->references++;
|
||||||
cmd_find_copy_state(&state->pi.fs, target);
|
cmd_find_copy_state(&state->pi.fs, cmdq_get_target(item));
|
||||||
|
#else
|
||||||
|
(void)wait;
|
||||||
|
cmd_get_source(self, &file, &state->pi.line);
|
||||||
|
if (file != NULL)
|
||||||
|
state->pi.file = xstrdup(file);
|
||||||
|
#endif
|
||||||
|
|
||||||
return (state);
|
return (state);
|
||||||
}
|
}
|
||||||
@@ -822,16 +827,17 @@ struct cmd_list *
|
|||||||
args_make_commands(struct args_command_state *state, int argc, char **argv,
|
args_make_commands(struct args_command_state *state, int argc, char **argv,
|
||||||
char **error)
|
char **error)
|
||||||
{
|
{
|
||||||
struct cmd_parse_result *pr;
|
|
||||||
char *cmd, *new_cmd;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
if (state->cmdlist != NULL) {
|
if (state->cmdlist != NULL) {
|
||||||
if (argc == 0)
|
if (argc == 0)
|
||||||
return (state->cmdlist);
|
return (state->cmdlist);
|
||||||
return (cmd_list_copy(state->cmdlist, argc, argv));
|
return (cmd_list_copy(state->cmdlist, argc, argv));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0 /* XXX: command parser conversion */
|
||||||
|
struct cmd_parse_result *pr;
|
||||||
|
char *cmd, *new_cmd;
|
||||||
|
int i;
|
||||||
|
|
||||||
cmd = xstrdup(state->cmd);
|
cmd = xstrdup(state->cmd);
|
||||||
log_debug("%s: %s", __func__, cmd);
|
log_debug("%s: %s", __func__, cmd);
|
||||||
cmd_log_argv(argc, argv, __func__);
|
cmd_log_argv(argc, argv, __func__);
|
||||||
@@ -853,6 +859,10 @@ args_make_commands(struct args_command_state *state, int argc, char **argv,
|
|||||||
return (pr->cmdlist);
|
return (pr->cmdlist);
|
||||||
}
|
}
|
||||||
fatalx("invalid parse return state");
|
fatalx("invalid parse return state");
|
||||||
|
#else
|
||||||
|
(void)error;
|
||||||
|
fatalx("XXX: command parser conversion not done for ARGS_COMMANDS");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free commands state. */
|
/* Free commands state. */
|
||||||
@@ -861,8 +871,10 @@ args_make_commands_free(struct args_command_state *state)
|
|||||||
{
|
{
|
||||||
if (state->cmdlist != NULL)
|
if (state->cmdlist != NULL)
|
||||||
cmd_list_free(state->cmdlist);
|
cmd_list_free(state->cmdlist);
|
||||||
|
#if 0 /* XXX: command parser conversion */
|
||||||
if (state->pi.c != NULL)
|
if (state->pi.c != NULL)
|
||||||
server_client_unref(state->pi.c);
|
server_client_unref(state->pi.c);
|
||||||
|
#endif
|
||||||
free((void *)state->pi.file);
|
free((void *)state->pi.file);
|
||||||
free(state->cmd);
|
free(state->cmd);
|
||||||
free(state);
|
free(state);
|
||||||
|
|||||||
42
cfg.c
42
cfg.c
@@ -98,9 +98,10 @@ load_cfg(const char *path, struct client *c, struct cmdq_item *item,
|
|||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
struct cmd_parse_input pi;
|
struct cmd_parse_input pi;
|
||||||
struct cmd_parse_result *pr;
|
struct cmd_parse_tree *tree;
|
||||||
struct cmdq_item *new_item0;
|
struct cmdq_item *new_item0;
|
||||||
struct cmdq_state *state;
|
struct cmdq_state *state;
|
||||||
|
char *cause = NULL;
|
||||||
|
|
||||||
if (new_item != NULL)
|
if (new_item != NULL)
|
||||||
*new_item = NULL;
|
*new_item = NULL;
|
||||||
@@ -117,18 +118,16 @@ load_cfg(const char *path, struct client *c, struct cmdq_item *item,
|
|||||||
pi.flags = flags;
|
pi.flags = flags;
|
||||||
pi.file = path;
|
pi.file = path;
|
||||||
pi.line = 1;
|
pi.line = 1;
|
||||||
pi.item = item;
|
tree = cmd_parse_from_file(f, &pi, &cause);
|
||||||
pi.c = c;
|
|
||||||
|
|
||||||
pr = cmd_parse_from_file(f, &pi);
|
|
||||||
fclose(f);
|
fclose(f);
|
||||||
if (pr->status == CMD_PARSE_ERROR) {
|
if (tree == NULL) {
|
||||||
cfg_add_cause("%s", pr->error);
|
cfg_add_cause("%s", cause);
|
||||||
free(pr->error);
|
free(cause);
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
cmd_parse_log(__func__, tree);
|
||||||
if (flags & CMD_PARSE_PARSEONLY) {
|
if (flags & CMD_PARSE_PARSEONLY) {
|
||||||
cmd_list_free(pr->cmdlist);
|
cmd_parse_free(tree);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,12 +137,12 @@ load_cfg(const char *path, struct client *c, struct cmdq_item *item,
|
|||||||
state = cmdq_new_state(NULL, NULL, 0);
|
state = cmdq_new_state(NULL, NULL, 0);
|
||||||
cmdq_add_format(state, "current_file", "%s", pi.file);
|
cmdq_add_format(state, "current_file", "%s", pi.file);
|
||||||
|
|
||||||
new_item0 = cmdq_get_command(pr->cmdlist, state);
|
new_item0 = cmd_invoke_get(tree, state, 0, NULL);
|
||||||
if (item != NULL)
|
if (item != NULL)
|
||||||
new_item0 = cmdq_insert_after(item, new_item0);
|
new_item0 = cmdq_insert_after(item, new_item0);
|
||||||
else
|
else
|
||||||
new_item0 = cmdq_append(NULL, new_item0);
|
new_item0 = cmdq_append(NULL, new_item0);
|
||||||
cmd_list_free(pr->cmdlist);
|
cmd_parse_free(tree);
|
||||||
cmdq_free_state(state);
|
cmdq_free_state(state);
|
||||||
|
|
||||||
if (new_item != NULL)
|
if (new_item != NULL)
|
||||||
@@ -157,9 +156,10 @@ load_cfg_from_buffer(const void *buf, size_t len, const char *path,
|
|||||||
int flags, struct cmdq_item **new_item)
|
int flags, struct cmdq_item **new_item)
|
||||||
{
|
{
|
||||||
struct cmd_parse_input pi;
|
struct cmd_parse_input pi;
|
||||||
struct cmd_parse_result *pr;
|
struct cmd_parse_tree *tree;
|
||||||
struct cmdq_item *new_item0;
|
struct cmdq_item *new_item0;
|
||||||
struct cmdq_state *state;
|
struct cmdq_state *state;
|
||||||
|
char *cause = NULL;
|
||||||
|
|
||||||
if (new_item != NULL)
|
if (new_item != NULL)
|
||||||
*new_item = NULL;
|
*new_item = NULL;
|
||||||
@@ -170,17 +170,15 @@ load_cfg_from_buffer(const void *buf, size_t len, const char *path,
|
|||||||
pi.flags = flags;
|
pi.flags = flags;
|
||||||
pi.file = path;
|
pi.file = path;
|
||||||
pi.line = 1;
|
pi.line = 1;
|
||||||
pi.item = item;
|
tree = cmd_parse_from_buffer(buf, len, &pi, &cause);
|
||||||
pi.c = c;
|
if (tree == NULL) {
|
||||||
|
cfg_add_cause("%s", cause);
|
||||||
pr = cmd_parse_from_buffer(buf, len, &pi);
|
free(cause);
|
||||||
if (pr->status == CMD_PARSE_ERROR) {
|
|
||||||
cfg_add_cause("%s", pr->error);
|
|
||||||
free(pr->error);
|
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
cmd_parse_log(__func__, tree);
|
||||||
if (flags & CMD_PARSE_PARSEONLY) {
|
if (flags & CMD_PARSE_PARSEONLY) {
|
||||||
cmd_list_free(pr->cmdlist);
|
cmd_parse_free(tree);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,12 +188,12 @@ load_cfg_from_buffer(const void *buf, size_t len, const char *path,
|
|||||||
state = cmdq_new_state(NULL, NULL, 0);
|
state = cmdq_new_state(NULL, NULL, 0);
|
||||||
cmdq_add_format(state, "current_file", "%s", pi.file);
|
cmdq_add_format(state, "current_file", "%s", pi.file);
|
||||||
|
|
||||||
new_item0 = cmdq_get_command(pr->cmdlist, state);
|
new_item0 = cmd_invoke_get(tree, state, 0, NULL);
|
||||||
if (item != NULL)
|
if (item != NULL)
|
||||||
new_item0 = cmdq_insert_after(item, new_item0);
|
new_item0 = cmdq_insert_after(item, new_item0);
|
||||||
else
|
else
|
||||||
new_item0 = cmdq_append(NULL, new_item0);
|
new_item0 = cmdq_append(NULL, new_item0);
|
||||||
cmd_list_free(pr->cmdlist);
|
cmd_parse_free(tree);
|
||||||
cmdq_free_state(state);
|
cmdq_free_state(state);
|
||||||
|
|
||||||
if (new_item != NULL)
|
if (new_item != NULL)
|
||||||
|
|||||||
13
client.c
13
client.c
@@ -232,7 +232,6 @@ int
|
|||||||
client_main(struct event_base *base, int argc, char **argv, uint64_t flags,
|
client_main(struct event_base *base, int argc, char **argv, uint64_t flags,
|
||||||
int feat)
|
int feat)
|
||||||
{
|
{
|
||||||
struct cmd_parse_result *pr;
|
|
||||||
struct msg_command *data;
|
struct msg_command *data;
|
||||||
int fd, i;
|
int fd, i;
|
||||||
const char *ttynam, *termname, *cwd;
|
const char *ttynam, *termname, *cwd;
|
||||||
@@ -243,7 +242,6 @@ client_main(struct event_base *base, int argc, char **argv, uint64_t flags,
|
|||||||
ssize_t linelen;
|
ssize_t linelen;
|
||||||
char *line = NULL, **caps = NULL, *cause;
|
char *line = NULL, **caps = NULL, *cause;
|
||||||
u_int ncaps = 0;
|
u_int ncaps = 0;
|
||||||
struct args_value *values;
|
|
||||||
|
|
||||||
/* Set up the initial command. */
|
/* Set up the initial command. */
|
||||||
if (shell_command != NULL) {
|
if (shell_command != NULL) {
|
||||||
@@ -255,6 +253,10 @@ client_main(struct event_base *base, int argc, char **argv, uint64_t flags,
|
|||||||
} else {
|
} else {
|
||||||
msg = MSG_COMMAND;
|
msg = MSG_COMMAND;
|
||||||
|
|
||||||
|
#if 0 /* XXX: command parser conversion */
|
||||||
|
struct cmd_parse_result *pr;
|
||||||
|
struct args_value *values;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* It's annoying parsing the command string twice (in client
|
* It's annoying parsing the command string twice (in client
|
||||||
* and later in server) but it is necessary to get the start
|
* and later in server) but it is necessary to get the start
|
||||||
@@ -270,6 +272,13 @@ client_main(struct event_base *base, int argc, char **argv, uint64_t flags,
|
|||||||
free(pr->error);
|
free(pr->error);
|
||||||
args_free_values(values, argc);
|
args_free_values(values, argc);
|
||||||
free(values);
|
free(values);
|
||||||
|
#else
|
||||||
|
/*
|
||||||
|
* XXX: command parser conversion. The old parser was used only
|
||||||
|
* to detect CMD_STARTSERVER here.
|
||||||
|
*/
|
||||||
|
flags |= CLIENT_STARTSERVER;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create client process structure (starts logging). */
|
/* Create client process structure (starts logging). */
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ cmd_bind_key_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
struct args *args = cmd_get_args(self);
|
struct args *args = cmd_get_args(self);
|
||||||
key_code key;
|
key_code key;
|
||||||
const char *tablename, *note = args_get(args, 'N');
|
const char *tablename, *note = args_get(args, 'N');
|
||||||
struct cmd_parse_result *pr;
|
|
||||||
int repeat;
|
int repeat;
|
||||||
struct args_value *value;
|
struct args_value *value;
|
||||||
u_int count = args_count(args);
|
u_int count = args_count(args);
|
||||||
@@ -88,6 +87,9 @@ cmd_bind_key_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
return (CMD_RETURN_NORMAL);
|
return (CMD_RETURN_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0 /* XXX: command parser conversion */
|
||||||
|
struct cmd_parse_result *pr;
|
||||||
|
|
||||||
if (count == 2)
|
if (count == 2)
|
||||||
pr = cmd_parse_from_string(args_string(args, 1), NULL);
|
pr = cmd_parse_from_string(args_string(args, 1), NULL);
|
||||||
else {
|
else {
|
||||||
@@ -104,4 +106,7 @@ cmd_bind_key_exec(struct cmd *self, struct cmdq_item *item)
|
|||||||
}
|
}
|
||||||
key_bindings_add(tablename, key, note, repeat, pr->cmdlist);
|
key_bindings_add(tablename, key, note, repeat, pr->cmdlist);
|
||||||
return (CMD_RETURN_NORMAL);
|
return (CMD_RETURN_NORMAL);
|
||||||
|
#else
|
||||||
|
fatalx("XXX: command parser conversion not done for bind-key");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
12
cmd-invoke.c
12
cmd-invoke.c
@@ -328,7 +328,11 @@ cmd_invoke_build_command(struct cmdq_item *item, struct cmd_invoke_state *is,
|
|||||||
break;
|
break;
|
||||||
case CMD_PARSE_COMMANDS:
|
case CMD_PARSE_COMMANDS:
|
||||||
values[count].type = ARGS_COMMANDS;
|
values[count].type = ARGS_COMMANDS;
|
||||||
|
#if 0 /* XXX: command parser conversion */
|
||||||
values[count].cmdparse = child;
|
values[count].cmdparse = child;
|
||||||
|
#else
|
||||||
|
fatalx("XXX: command parser conversion not done for ARGS_COMMANDS");
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fatalx("unexpected node type in command");
|
fatalx("unexpected node type in command");
|
||||||
@@ -373,7 +377,8 @@ cmd_invoke_get(struct cmd_parse_tree *tree, struct cmdq_state *state, int argc,
|
|||||||
is = xcalloc(1, sizeof *is);
|
is = xcalloc(1, sizeof *is);
|
||||||
is->references = 1;
|
is->references = 1;
|
||||||
is->tree = cmd_parse_add_ref(tree);
|
is->tree = cmd_parse_add_ref(tree);
|
||||||
cmd_parse_log(tree);
|
log_debug("%s: tree %p", __func__, tree);
|
||||||
|
cmd_parse_log(__func__, tree);
|
||||||
|
|
||||||
is->argc = argc;
|
is->argc = argc;
|
||||||
if (argc != 0) {
|
if (argc != 0) {
|
||||||
@@ -445,7 +450,9 @@ cmd_invoke_fire(struct cmdq_item *item, struct cmd_invoke_state *is)
|
|||||||
node = cmd_invoke_next(is);
|
node = cmd_invoke_next(is);
|
||||||
if (node == NULL)
|
if (node == NULL)
|
||||||
return (CMD_RETURN_NORMAL);
|
return (CMD_RETURN_NORMAL);
|
||||||
cmd_parse_log_node(node);
|
log_debug("%s: node %s", __func__,
|
||||||
|
cmd_parse_node_type_string(cmd_parse_node_type(node)));
|
||||||
|
cmd_parse_log_node(__func__, node);
|
||||||
|
|
||||||
switch (cmd_parse_node_type(node)) {
|
switch (cmd_parse_node_type(node)) {
|
||||||
case CMD_PARSE_ROOT:
|
case CMD_PARSE_ROOT:
|
||||||
@@ -470,6 +477,7 @@ cmd_invoke_fire(struct cmdq_item *item, struct cmd_invoke_state *is)
|
|||||||
case CMD_PARSE_ELSE:
|
case CMD_PARSE_ELSE:
|
||||||
break;
|
break;
|
||||||
case CMD_PARSE_COMMAND:
|
case CMD_PARSE_COMMAND:
|
||||||
|
fatalx("XXX: command execution not implemented yet");
|
||||||
cmd = cmd_invoke_build_command(item, is, node);
|
cmd = cmd_invoke_build_command(item, is, node);
|
||||||
if (cmd == NULL) {
|
if (cmd == NULL) {
|
||||||
cmd_invoke_skip_sequence(is);
|
cmd_invoke_skip_sequence(is);
|
||||||
|
|||||||
@@ -557,7 +557,9 @@ control_read_callback(__unused struct bufferevent *bufev, void *data)
|
|||||||
struct evbuffer *buffer = cs->read_event->input;
|
struct evbuffer *buffer = cs->read_event->input;
|
||||||
char *line, *error;
|
char *line, *error;
|
||||||
struct cmdq_state *state;
|
struct cmdq_state *state;
|
||||||
|
#if 0 /* XXX: command parser conversion */
|
||||||
enum cmd_parse_status status;
|
enum cmd_parse_status status;
|
||||||
|
#endif
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
line = evbuffer_readln(buffer, NULL, EVBUFFER_EOL_LF);
|
line = evbuffer_readln(buffer, NULL, EVBUFFER_EOL_LF);
|
||||||
@@ -570,11 +572,18 @@ control_read_callback(__unused struct bufferevent *bufev, void *data)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0 /* XXX: command parser conversion */
|
||||||
state = cmdq_new_state(NULL, NULL, CMDQ_STATE_CONTROL);
|
state = cmdq_new_state(NULL, NULL, CMDQ_STATE_CONTROL);
|
||||||
status = cmd_parse_and_append(line, NULL, c, state, &error);
|
status = cmd_parse_and_append(line, NULL, c, state, &error);
|
||||||
if (status == CMD_PARSE_ERROR)
|
if (status == CMD_PARSE_ERROR)
|
||||||
cmdq_append(c, cmdq_get_callback(control_error, error));
|
cmdq_append(c, cmdq_get_callback(control_error, error));
|
||||||
cmdq_free_state(state);
|
cmdq_free_state(state);
|
||||||
|
#else
|
||||||
|
state = cmdq_new_state(NULL, NULL, CMDQ_STATE_CONTROL);
|
||||||
|
error = xstrdup("XXX: command parser conversion not done for control mode");
|
||||||
|
cmdq_append(c, cmdq_get_callback(control_error, error));
|
||||||
|
cmdq_free_state(state);
|
||||||
|
#endif
|
||||||
|
|
||||||
free(line);
|
free(line);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -672,6 +672,8 @@ key_bindings_init(void)
|
|||||||
"bind -Tcopy-mode-vi C-Up { send -X scroll-up }",
|
"bind -Tcopy-mode-vi C-Up { send -X scroll-up }",
|
||||||
"bind -Tcopy-mode-vi C-Down { send -X scroll-down }",
|
"bind -Tcopy-mode-vi C-Down { send -X scroll-down }",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if 0 /* XXX: command parser conversion */
|
||||||
u_int i;
|
u_int i;
|
||||||
struct cmd_parse_result *pr;
|
struct cmd_parse_result *pr;
|
||||||
|
|
||||||
@@ -684,6 +686,10 @@ key_bindings_init(void)
|
|||||||
cmdq_append(NULL, cmdq_get_command(pr->cmdlist, NULL));
|
cmdq_append(NULL, cmdq_get_command(pr->cmdlist, NULL));
|
||||||
cmd_list_free(pr->cmdlist);
|
cmd_list_free(pr->cmdlist);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
log_debug("XXX: command parser conversion not done for %u default keys",
|
||||||
|
(u_int)nitems(defaults));
|
||||||
|
#endif
|
||||||
cmdq_append(NULL, cmdq_get_callback(key_bindings_init_done, NULL));
|
cmdq_append(NULL, cmdq_get_callback(key_bindings_init_done, NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
8
menu.c
8
menu.c
@@ -316,7 +316,9 @@ menu_key_cb(struct client *c, void *data, struct key_event *event)
|
|||||||
const char *name = NULL;
|
const char *name = NULL;
|
||||||
const struct menu_item *item;
|
const struct menu_item *item;
|
||||||
struct cmdq_state *state;
|
struct cmdq_state *state;
|
||||||
|
#if 0 /* XXX: command parser conversion */
|
||||||
enum cmd_parse_status status;
|
enum cmd_parse_status status;
|
||||||
|
#endif
|
||||||
char *error;
|
char *error;
|
||||||
|
|
||||||
if (KEYC_IS_MOUSE(event->key)) {
|
if (KEYC_IS_MOUSE(event->key)) {
|
||||||
@@ -497,11 +499,17 @@ chosen:
|
|||||||
event = NULL;
|
event = NULL;
|
||||||
state = cmdq_new_state(&md->fs, event, 0);
|
state = cmdq_new_state(&md->fs, event, 0);
|
||||||
|
|
||||||
|
#if 0 /* XXX: command parser conversion */
|
||||||
status = cmd_parse_and_append(item->command, NULL, c, state, &error);
|
status = cmd_parse_and_append(item->command, NULL, c, state, &error);
|
||||||
if (status == CMD_PARSE_ERROR) {
|
if (status == CMD_PARSE_ERROR) {
|
||||||
cmdq_append(c, cmdq_get_error(error));
|
cmdq_append(c, cmdq_get_error(error));
|
||||||
free(error);
|
free(error);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
error = xstrdup("XXX: command parser conversion not done for menu");
|
||||||
|
cmdq_append(c, cmdq_get_error(error));
|
||||||
|
free(error);
|
||||||
|
#endif
|
||||||
cmdq_free_state(state);
|
cmdq_free_state(state);
|
||||||
|
|
||||||
return (1);
|
return (1);
|
||||||
|
|||||||
11
mode-tree.c
11
mode-tree.c
@@ -1816,11 +1816,14 @@ mode_tree_run_command(struct client *c, struct cmd_find_state *fs,
|
|||||||
{
|
{
|
||||||
struct cmdq_state *state;
|
struct cmdq_state *state;
|
||||||
char *command, *error;
|
char *command, *error;
|
||||||
|
#if 0 /* XXX: command parser conversion */
|
||||||
enum cmd_parse_status status;
|
enum cmd_parse_status status;
|
||||||
|
#endif
|
||||||
|
|
||||||
command = cmd_template_replace(template, name, 1);
|
command = cmd_template_replace(template, name, 1);
|
||||||
if (command != NULL && *command != '\0') {
|
if (command != NULL && *command != '\0') {
|
||||||
state = cmdq_new_state(fs, NULL, 0);
|
state = cmdq_new_state(fs, NULL, 0);
|
||||||
|
#if 0 /* XXX: command parser conversion */
|
||||||
status = cmd_parse_and_append(command, NULL, c, state, &error);
|
status = cmd_parse_and_append(command, NULL, c, state, &error);
|
||||||
if (status == CMD_PARSE_ERROR) {
|
if (status == CMD_PARSE_ERROR) {
|
||||||
if (c != NULL) {
|
if (c != NULL) {
|
||||||
@@ -1829,6 +1832,14 @@ mode_tree_run_command(struct client *c, struct cmd_find_state *fs,
|
|||||||
}
|
}
|
||||||
free(error);
|
free(error);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
error = xstrdup("XXX: command parser conversion not done for mode tree");
|
||||||
|
if (c != NULL) {
|
||||||
|
*error = toupper((u_char)*error);
|
||||||
|
status_message_set(c, -1, 1, 0, 0, "%s", error);
|
||||||
|
}
|
||||||
|
free(error);
|
||||||
|
#endif
|
||||||
cmdq_free_state(state);
|
cmdq_free_state(state);
|
||||||
}
|
}
|
||||||
free(command);
|
free(command);
|
||||||
|
|||||||
10
notify.c
10
notify.c
@@ -62,8 +62,6 @@ notify_insert_hook(struct cmdq_item *item, struct notify_entry *ne)
|
|||||||
struct options_entry *o;
|
struct options_entry *o;
|
||||||
struct options_array_item *a;
|
struct options_array_item *a;
|
||||||
struct cmd_list *cmdlist;
|
struct cmd_list *cmdlist;
|
||||||
const char *value;
|
|
||||||
struct cmd_parse_result *pr;
|
|
||||||
|
|
||||||
log_debug("%s: inserting hook %s", __func__, ne->name);
|
log_debug("%s: inserting hook %s", __func__, ne->name);
|
||||||
|
|
||||||
@@ -95,6 +93,10 @@ notify_insert_hook(struct cmdq_item *item, struct notify_entry *ne)
|
|||||||
cmdq_add_formats(state, ne->formats);
|
cmdq_add_formats(state, ne->formats);
|
||||||
|
|
||||||
if (*ne->name == '@') {
|
if (*ne->name == '@') {
|
||||||
|
#if 0 /* XXX: command parser conversion */
|
||||||
|
struct cmd_parse_result *pr;
|
||||||
|
const char *value;
|
||||||
|
|
||||||
value = options_get_string(oo, ne->name);
|
value = options_get_string(oo, ne->name);
|
||||||
pr = cmd_parse_from_string(value, NULL);
|
pr = cmd_parse_from_string(value, NULL);
|
||||||
switch (pr->status) {
|
switch (pr->status) {
|
||||||
@@ -107,6 +109,10 @@ notify_insert_hook(struct cmdq_item *item, struct notify_entry *ne)
|
|||||||
notify_insert_one_hook(item, ne, pr->cmdlist, state);
|
notify_insert_one_hook(item, ne, pr->cmdlist, state);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
log_debug("%s: command parser conversion not done for hook %s",
|
||||||
|
__func__, ne->name);
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
a = options_array_first(o);
|
a = options_array_first(o);
|
||||||
while (a != NULL) {
|
while (a != NULL) {
|
||||||
|
|||||||
28
options.c
28
options.c
@@ -260,7 +260,6 @@ options_default(struct options *oo, const struct options_table_entry *oe)
|
|||||||
struct options_entry *o;
|
struct options_entry *o;
|
||||||
union options_value *ov;
|
union options_value *ov;
|
||||||
u_int i;
|
u_int i;
|
||||||
struct cmd_parse_result *pr;
|
|
||||||
|
|
||||||
o = options_empty(oo, oe);
|
o = options_empty(oo, oe);
|
||||||
ov = &o->value;
|
ov = &o->value;
|
||||||
@@ -280,6 +279,9 @@ options_default(struct options *oo, const struct options_table_entry *oe)
|
|||||||
ov->string = xstrdup(oe->default_str);
|
ov->string = xstrdup(oe->default_str);
|
||||||
break;
|
break;
|
||||||
case OPTIONS_TABLE_COMMAND:
|
case OPTIONS_TABLE_COMMAND:
|
||||||
|
#if 0 /* XXX: command parser conversion */
|
||||||
|
struct cmd_parse_result *pr;
|
||||||
|
|
||||||
pr = cmd_parse_from_string(oe->default_str, NULL);
|
pr = cmd_parse_from_string(oe->default_str, NULL);
|
||||||
switch (pr->status) {
|
switch (pr->status) {
|
||||||
case CMD_PARSE_ERROR:
|
case CMD_PARSE_ERROR:
|
||||||
@@ -289,6 +291,10 @@ options_default(struct options *oo, const struct options_table_entry *oe)
|
|||||||
ov->cmdlist = pr->cmdlist;
|
ov->cmdlist = pr->cmdlist;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
log_debug("XXX: command parser conversion not done for command option default %s",
|
||||||
|
oe->name);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ov->number = oe->default_num;
|
ov->number = oe->default_num;
|
||||||
@@ -436,7 +442,6 @@ options_array_set(struct options_entry *o, u_int idx, const char *value,
|
|||||||
{
|
{
|
||||||
struct options_array_item *a;
|
struct options_array_item *a;
|
||||||
char *new;
|
char *new;
|
||||||
struct cmd_parse_result *pr;
|
|
||||||
long long number;
|
long long number;
|
||||||
|
|
||||||
if (!OPTIONS_IS_ARRAY(o)) {
|
if (!OPTIONS_IS_ARRAY(o)) {
|
||||||
@@ -453,6 +458,9 @@ options_array_set(struct options_entry *o, u_int idx, const char *value,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (OPTIONS_IS_COMMAND(o)) {
|
if (OPTIONS_IS_COMMAND(o)) {
|
||||||
|
#if 0 /* XXX: command parser conversion */
|
||||||
|
struct cmd_parse_result *pr;
|
||||||
|
|
||||||
pr = cmd_parse_from_string(value, NULL);
|
pr = cmd_parse_from_string(value, NULL);
|
||||||
switch (pr->status) {
|
switch (pr->status) {
|
||||||
case CMD_PARSE_ERROR:
|
case CMD_PARSE_ERROR:
|
||||||
@@ -472,6 +480,13 @@ options_array_set(struct options_entry *o, u_int idx, const char *value,
|
|||||||
options_value_free(o, &a->value);
|
options_value_free(o, &a->value);
|
||||||
a->value.cmdlist = pr->cmdlist;
|
a->value.cmdlist = pr->cmdlist;
|
||||||
return (0);
|
return (0);
|
||||||
|
#else
|
||||||
|
if (cause != NULL) {
|
||||||
|
xasprintf(cause,
|
||||||
|
"XXX: command parser conversion not done for command option array");
|
||||||
|
}
|
||||||
|
return (-1);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OPTIONS_IS_STRING(o)) {
|
if (OPTIONS_IS_STRING(o)) {
|
||||||
@@ -1131,7 +1146,6 @@ options_from_string(struct options *oo, const struct options_table_entry *oe,
|
|||||||
const char *errstr, *new;
|
const char *errstr, *new;
|
||||||
char *old;
|
char *old;
|
||||||
key_code key;
|
key_code key;
|
||||||
struct cmd_parse_result *pr;
|
|
||||||
|
|
||||||
if (oe != NULL) {
|
if (oe != NULL) {
|
||||||
if (value == NULL &&
|
if (value == NULL &&
|
||||||
@@ -1190,6 +1204,9 @@ options_from_string(struct options *oo, const struct options_table_entry *oe,
|
|||||||
case OPTIONS_TABLE_CHOICE:
|
case OPTIONS_TABLE_CHOICE:
|
||||||
return (options_from_string_choice(oe, oo, name, value, cause));
|
return (options_from_string_choice(oe, oo, name, value, cause));
|
||||||
case OPTIONS_TABLE_COMMAND:
|
case OPTIONS_TABLE_COMMAND:
|
||||||
|
#if 0 /* XXX: command parser conversion */
|
||||||
|
struct cmd_parse_result *pr;
|
||||||
|
|
||||||
pr = cmd_parse_from_string(value, NULL);
|
pr = cmd_parse_from_string(value, NULL);
|
||||||
switch (pr->status) {
|
switch (pr->status) {
|
||||||
case CMD_PARSE_ERROR:
|
case CMD_PARSE_ERROR:
|
||||||
@@ -1200,6 +1217,11 @@ options_from_string(struct options *oo, const struct options_table_entry *oe,
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#else
|
||||||
|
xasprintf(cause,
|
||||||
|
"XXX: command parser conversion not done for command option");
|
||||||
|
return (-1);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2578,8 +2578,6 @@ server_client_dispatch_command(struct client *c, struct imsg *imsg)
|
|||||||
size_t len;
|
size_t len;
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
char **argv, *cause;
|
char **argv, *cause;
|
||||||
struct cmd_parse_result *pr;
|
|
||||||
struct args_value *values;
|
|
||||||
struct cmdq_item *new_item;
|
struct cmdq_item *new_item;
|
||||||
|
|
||||||
if (c->flags & CLIENT_EXIT)
|
if (c->flags & CLIENT_EXIT)
|
||||||
@@ -2604,6 +2602,10 @@ server_client_dispatch_command(struct client *c, struct imsg *imsg)
|
|||||||
new_item = cmdq_get_callback(server_client_default_command,
|
new_item = cmdq_get_callback(server_client_default_command,
|
||||||
NULL);
|
NULL);
|
||||||
} else {
|
} else {
|
||||||
|
#if 0 /* XXX: command parser conversion */
|
||||||
|
struct cmd_parse_result *pr;
|
||||||
|
struct args_value *values;
|
||||||
|
|
||||||
values = args_from_vector(argc, argv);
|
values = args_from_vector(argc, argv);
|
||||||
pr = cmd_parse_from_arguments(values, argc, NULL);
|
pr = cmd_parse_from_arguments(values, argc, NULL);
|
||||||
switch (pr->status) {
|
switch (pr->status) {
|
||||||
@@ -2623,6 +2625,11 @@ server_client_dispatch_command(struct client *c, struct imsg *imsg)
|
|||||||
} else
|
} else
|
||||||
new_item = cmdq_get_command(pr->cmdlist, NULL);
|
new_item = cmdq_get_command(pr->cmdlist, NULL);
|
||||||
cmd_list_free(pr->cmdlist);
|
cmd_list_free(pr->cmdlist);
|
||||||
|
#else
|
||||||
|
cause = xstrdup(
|
||||||
|
"XXX: command parser conversion not done for client commands");
|
||||||
|
goto error;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
cmdq_append(c, new_item);
|
cmdq_append(c, new_item);
|
||||||
cmdq_append(c, cmdq_get_callback(server_client_command_done, NULL));
|
cmdq_append(c, cmdq_get_callback(server_client_command_done, NULL));
|
||||||
|
|||||||
@@ -1218,7 +1218,6 @@ window_customize_set_command_callback(struct client *c, void *itemdata,
|
|||||||
struct window_customize_itemdata *item = itemdata;
|
struct window_customize_itemdata *item = itemdata;
|
||||||
struct window_customize_modedata *data = item->data;
|
struct window_customize_modedata *data = item->data;
|
||||||
struct key_binding *bd;
|
struct key_binding *bd;
|
||||||
struct cmd_parse_result *pr;
|
|
||||||
char *error;
|
char *error;
|
||||||
|
|
||||||
if (s == NULL || *s == '\0' || data->dead)
|
if (s == NULL || *s == '\0' || data->dead)
|
||||||
@@ -1226,6 +1225,9 @@ window_customize_set_command_callback(struct client *c, void *itemdata,
|
|||||||
if (item == NULL || !window_customize_get_key(item, NULL, &bd))
|
if (item == NULL || !window_customize_get_key(item, NULL, &bd))
|
||||||
return (PROMPT_CLOSE);
|
return (PROMPT_CLOSE);
|
||||||
|
|
||||||
|
#if 0 /* XXX: command parser conversion */
|
||||||
|
struct cmd_parse_result *pr;
|
||||||
|
|
||||||
pr = cmd_parse_from_string(s, NULL);
|
pr = cmd_parse_from_string(s, NULL);
|
||||||
switch (pr->status) {
|
switch (pr->status) {
|
||||||
case CMD_PARSE_ERROR:
|
case CMD_PARSE_ERROR:
|
||||||
@@ -1240,6 +1242,10 @@ window_customize_set_command_callback(struct client *c, void *itemdata,
|
|||||||
mode_tree_build(data->data);
|
mode_tree_build(data->data);
|
||||||
mode_tree_draw(data->data);
|
mode_tree_draw(data->data);
|
||||||
data->wp->flags |= PANE_REDRAW;
|
data->wp->flags |= PANE_REDRAW;
|
||||||
|
#else
|
||||||
|
error = xstrdup("XXX: command parser conversion not done for customize");
|
||||||
|
goto fail;
|
||||||
|
#endif
|
||||||
|
|
||||||
return (PROMPT_CLOSE);
|
return (PROMPT_CLOSE);
|
||||||
|
|
||||||
|
|||||||
@@ -434,7 +434,9 @@ window_switch_run_command(struct window_switch_modedata *data, struct client *c)
|
|||||||
char *target = NULL;
|
char *target = NULL;
|
||||||
struct cmdq_state *state;
|
struct cmdq_state *state;
|
||||||
char *command, *error;
|
char *command, *error;
|
||||||
|
#if 0 /* XXX: command parser conversion */
|
||||||
enum cmd_parse_status status;
|
enum cmd_parse_status status;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (data->matches_size == 0)
|
if (data->matches_size == 0)
|
||||||
return (0);
|
return (0);
|
||||||
@@ -466,6 +468,7 @@ window_switch_run_command(struct window_switch_modedata *data, struct client *c)
|
|||||||
command = cmd_template_replace(data->command, target, 1);
|
command = cmd_template_replace(data->command, target, 1);
|
||||||
if (command != NULL && *command != '\0') {
|
if (command != NULL && *command != '\0') {
|
||||||
state = cmdq_new_state(&fs, NULL, 0);
|
state = cmdq_new_state(&fs, NULL, 0);
|
||||||
|
#if 0 /* XXX: command parser conversion */
|
||||||
status = cmd_parse_and_append(command, NULL, c, state, &error);
|
status = cmd_parse_and_append(command, NULL, c, state, &error);
|
||||||
if (status == CMD_PARSE_ERROR) {
|
if (status == CMD_PARSE_ERROR) {
|
||||||
if (c != NULL) {
|
if (c != NULL) {
|
||||||
@@ -474,6 +477,14 @@ window_switch_run_command(struct window_switch_modedata *data, struct client *c)
|
|||||||
}
|
}
|
||||||
free(error);
|
free(error);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
error = xstrdup("XXX: command parser conversion not done for window switch");
|
||||||
|
if (c != NULL) {
|
||||||
|
*error = toupper((u_char)*error);
|
||||||
|
status_message_set(c, -1, 1, 0, 0, "%s", error);
|
||||||
|
}
|
||||||
|
free(error);
|
||||||
|
#endif
|
||||||
cmdq_free_state(state);
|
cmdq_free_state(state);
|
||||||
}
|
}
|
||||||
free(command);
|
free(command);
|
||||||
|
|||||||
Reference in New Issue
Block a user