diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-12-06 09:46:23 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-12-06 09:46:23 +0000 |
commit | 103748d6adfe1b2d706cb0a1e1a128be5366d655 (patch) | |
tree | b9d4feef5012083d9c0ba96693322286645a27a3 /server-msg.c | |
parent | 6f142e9ac61783e79c27e56ed6aa2fc7ff13683d (diff) |
Major reorganisation of screen handling.
Diffstat (limited to 'server-msg.c')
-rw-r--r-- | server-msg.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/server-msg.c b/server-msg.c index a9f77bc2..fec44099 100644 --- a/server-msg.c +++ b/server-msg.c @@ -1,5 +1,5 @@ -/* $Id: server-msg.c,v 1.39 2007-11-27 20:01:30 nicm Exp $ */ +/* $Id: server-msg.c,v 1.40 2007-12-06 09:46:23 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -38,7 +38,7 @@ void printflike2 server_msg_fn_command_print( struct server_msg { enum hdrtype type; - + int (*fn)(struct hdr *, struct client *); }; const struct server_msg server_msg_table[] = { @@ -64,7 +64,7 @@ server_msg_dispatch(struct client *c) if (BUFFER_USED(c->in) < (sizeof hdr) + hdr.size) return (0); buffer_remove(c->in, sizeof hdr); - + for (i = 0; i < NSERVERMSG; i++) { msg = server_msg_table + i; if (msg->type == hdr.type) { @@ -72,7 +72,7 @@ server_msg_dispatch(struct client *c) return (n); break; } - } + } if (i == NSERVERMSG) fatalx("unexpected message"); } @@ -120,7 +120,7 @@ server_msg_fn_command(struct hdr *hdr, struct client *c) if (hdr->size < sizeof data) fatalx("bad MSG_COMMAND size"); buffer_read(c->in, &data, sizeof data); - name = cmd_recv_string(c->in); + name = cmd_recv_string(c->in); client = cmd_recv_string(c->in); cmd = cmd_recv(c->in); @@ -147,7 +147,7 @@ server_msg_fn_command(struct hdr *hdr, struct client *c) } } else { if (client == NULL) { - server_msg_fn_command_error(&ctx, + server_msg_fn_command_error(&ctx, "%s: must specify a client", cmd->entry->name); goto out; } @@ -167,7 +167,7 @@ server_msg_fn_command(struct hdr *hdr, struct client *c) ctx.session = NULL; if (cmd->entry->flags & CMD_NOSESSION) { if (name != NULL) { - server_msg_fn_command_error(&ctx, + server_msg_fn_command_error(&ctx, "%s: cannot specify a session", cmd->entry->name); goto out; } @@ -179,7 +179,7 @@ server_msg_fn_command(struct hdr *hdr, struct client *c) xfree(cause); goto out; } - } + } cmd_exec(cmd, &ctx); cmd_free(cmd); |