diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-02 18:08:17 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2008-06-02 18:08:17 +0000 |
commit | c7243b73cb3baaf6993d8a9dfb16c054c3978040 (patch) | |
tree | 1d67ee4c5cf764dc83245c79d27da52857b4a89d /cmd-refresh-client.c | |
parent | 11ee55e755af67dc9155e956b4569c8fdeb11848 (diff) | |
download | rtmux-c7243b73cb3baaf6993d8a9dfb16c054c3978040.tar.gz rtmux-c7243b73cb3baaf6993d8a9dfb16c054c3978040.tar.bz2 rtmux-c7243b73cb3baaf6993d8a9dfb16c054c3978040.zip |
Move -s and -c down a level so handling them is the responsibility of the command (with some helper functions), rather than the top-level. This changes the action command syntax so that -s and -c must be after the command rather than before.
Diffstat (limited to 'cmd-refresh-client.c')
-rw-r--r-- | cmd-refresh-client.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/cmd-refresh-client.c b/cmd-refresh-client.c index ba2ce5bf..4c1e6327 100644 --- a/cmd-refresh-client.c +++ b/cmd-refresh-client.c @@ -1,4 +1,4 @@ -/* $Id: cmd-refresh-client.c,v 1.1 2007-11-16 21:12:31 nicm Exp $ */ +/* $Id: cmd-refresh-client.c,v 1.2 2008-06-02 18:08:16 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -29,19 +29,25 @@ void cmd_refresh_client_exec(void *, struct cmd_ctx *); const struct cmd_entry cmd_refresh_client_entry = { - "refresh-client", "refresh", "", + "refresh-client", "refresh", + CMD_CLIENTONLY_USAGE, 0, - NULL, + cmd_clientonly_parse, cmd_refresh_client_exec, - NULL, - NULL, - NULL + cmd_clientonly_send, + cmd_clientonly_recv, + cmd_clientonly_free }; void -cmd_refresh_client_exec(unused void *ptr, struct cmd_ctx *ctx) +cmd_refresh_client_exec(void *ptr, struct cmd_ctx *ctx) { - server_redraw_client(ctx->client); + struct client *c; + + if ((c = cmd_clientonly_get(ptr, ctx)) == NULL) + return; + + server_redraw_client(c); if (ctx->cmdclient != NULL) server_write_client(ctx->cmdclient, MSG_EXIT, NULL, 0); |