diff options
Diffstat (limited to 'cmd-list.c')
-rw-r--r-- | cmd-list.c | 37 |
1 files changed, 1 insertions, 36 deletions
@@ -1,4 +1,4 @@ -/* $Id: cmd-list.c,v 1.5 2009-05-04 17:58:26 nicm Exp $ */ +/* $Id: cmd-list.c,v 1.6 2009-07-28 22:12:16 tcunha Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -87,41 +87,6 @@ cmd_list_exec(struct cmd_list *cmdlist, struct cmd_ctx *ctx) } void -cmd_list_send(struct cmd_list *cmdlist, struct buffer *b) -{ - struct cmd *cmd; - u_int n; - - n = 0; - TAILQ_FOREACH(cmd, cmdlist, qentry) - n++; - - buffer_write(b, &n, sizeof n); - TAILQ_FOREACH(cmd, cmdlist, qentry) - cmd_send(cmd, b); -} - -struct cmd_list * -cmd_list_recv(struct buffer *b) -{ - struct cmd_list *cmdlist; - struct cmd *cmd; - u_int n; - - buffer_read(b, &n, sizeof n); - - cmdlist = xmalloc(sizeof *cmdlist); - TAILQ_INIT(cmdlist); - - while (n-- > 0) { - cmd = cmd_recv(b); - TAILQ_INSERT_TAIL(cmdlist, cmd, qentry); - } - - return (cmdlist); -} - -void cmd_list_free(struct cmd_list *cmdlist) { struct cmd *cmd; |