diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-05 16:35:32 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-05 16:35:32 +0000 |
commit | 642c0b00ab43079cd251ec9616963b8a806b3464 (patch) | |
tree | 40f2bcf2f39d93feb21481a8547f267166f627f0 /cmd-link-window.c | |
parent | 7325fea37dd75ac89828c6cfdfbcbd8d54548241 (diff) |
Easy bits of arg printing for list-keys.
Diffstat (limited to 'cmd-link-window.c')
-rw-r--r-- | cmd-link-window.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/cmd-link-window.c b/cmd-link-window.c index e43c9ad9..9888d389 100644 --- a/cmd-link-window.c +++ b/cmd-link-window.c @@ -1,4 +1,4 @@ -/* $Id: cmd-link-window.c,v 1.16 2008-06-04 16:46:23 nicm Exp $ */ +/* $Id: cmd-link-window.c,v 1.17 2008-06-05 16:35:31 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -27,11 +27,11 @@ * Link a window into another session. */ -int cmd_link_window_parse(struct cmd *, void **, int, char **, char **); -void cmd_link_window_exec(void *, struct cmd_ctx *); -void cmd_link_window_send(void *, struct buffer *); -void cmd_link_window_recv(void **, struct buffer *); -void cmd_link_window_free(void *); +int cmd_link_window_parse(struct cmd *, int, char **, char **); +void cmd_link_window_exec(struct cmd *, struct cmd_ctx *); +void cmd_link_window_send(struct cmd *, struct buffer *); +void cmd_link_window_recv(struct cmd *, struct buffer *); +void cmd_link_window_free(struct cmd *); struct cmd_link_window_data { char *cname; @@ -52,18 +52,18 @@ const struct cmd_entry cmd_link_window_entry = { cmd_link_window_send, cmd_link_window_recv, cmd_link_window_free, + NULL, NULL }; int -cmd_link_window_parse( - struct cmd *self, void **ptr, int argc, char **argv, char **cause) +cmd_link_window_parse(struct cmd *self, int argc, char **argv, char **cause) { struct cmd_link_window_data *data; const char *errstr; int opt; - *ptr = data = xmalloc(sizeof *data); + self->data = data = xmalloc(sizeof *data); data->cname = NULL; data->sname = NULL; data->flag_detached = 0; @@ -121,14 +121,14 @@ usage: xasprintf(cause, "usage: %s %s", self->entry->name, self->entry->usage); error: - cmd_link_window_free(data); + self->entry->free(self); return (-1); } void -cmd_link_window_exec(void *ptr, struct cmd_ctx *ctx) +cmd_link_window_exec(struct cmd *self, struct cmd_ctx *ctx) { - struct cmd_link_window_data *data = ptr; + struct cmd_link_window_data *data = self->data; struct session *s, *src; struct winlink *wl, *wl2; @@ -202,9 +202,9 @@ cmd_link_window_exec(void *ptr, struct cmd_ctx *ctx) } void -cmd_link_window_send(void *ptr, struct buffer *b) +cmd_link_window_send(struct cmd *self, struct buffer *b) { - struct cmd_link_window_data *data = ptr; + struct cmd_link_window_data *data = self->data; buffer_write(b, data, sizeof *data); cmd_send_string(b, data->cname); @@ -213,11 +213,11 @@ cmd_link_window_send(void *ptr, struct buffer *b) } void -cmd_link_window_recv(void **ptr, struct buffer *b) +cmd_link_window_recv(struct cmd *self, struct buffer *b) { struct cmd_link_window_data *data; - *ptr = data = xmalloc(sizeof *data); + self->data = data = xmalloc(sizeof *data); buffer_read(b, data, sizeof *data); data->cname = cmd_recv_string(b); data->sname = cmd_recv_string(b); @@ -225,9 +225,9 @@ cmd_link_window_recv(void **ptr, struct buffer *b) } void -cmd_link_window_free(void *ptr) +cmd_link_window_free(struct cmd *self) { - struct cmd_link_window_data *data = ptr; + struct cmd_link_window_data *data = self->data; if (data->cname != NULL) xfree(data->cname); |