cmd: itera entre os comandos.
authorThadeu Lima de Souza Cascardo <cascardo@cascardo.eti.br>
Sun, 11 Dec 2016 13:41:21 +0000 (11:41 -0200)
committerThadeu Lima de Souza Cascardo <cascardo@cascardo.eti.br>
Sun, 11 Dec 2016 13:43:44 +0000 (11:43 -0200)
lib/cmd.c
lib/cmd.h

index ad186a2..96697b2 100644 (file)
--- 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);
+}
index 24ff5e0..f795d45 100644 (file)
--- 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