From fd5cc1bd7cf4b01b70796c3132af2ba823bb33f7 Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Sun, 11 Dec 2016 11:41:21 -0200 Subject: [PATCH] cmd: itera entre os comandos. --- lib/cmd.c | 5 +++++ lib/cmd.h | 1 + 2 files changed, 6 insertions(+) diff --git a/lib/cmd.c b/lib/cmd.c index ad186a2..96697b2 100644 --- a/lib/cmd.c +++ b/lib/cmd.c @@ -55,3 +55,8 @@ int cmd_run(struct declaracao *dec, char *line) tokens_free(args); return r; } + +struct cmd * cmd_next(void **iter) +{ + return pmhash_next(cmds, iter); +} diff --git a/lib/cmd.h b/lib/cmd.h index 24ff5e0..f795d45 100644 --- a/lib/cmd.h +++ b/lib/cmd.h @@ -29,5 +29,6 @@ struct cmd { int cmd_init(void); int cmd_add(struct cmd *cmd); int cmd_run(struct declaracao *dec, char *line); +struct cmd * cmd_next(void **iter); #endif -- 2.20.1