From f6df8471931faeac7be76b8cdedc6daa48ab961d Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Mon, 7 Mar 2022 10:12:05 +0100 Subject: Set up for adding freemem command --- src/commands.c | 22 ++++++++++++++++++++++ src/shell.c | 2 ++ 2 files changed, 24 insertions(+) (limited to 'src') diff --git a/src/commands.c b/src/commands.c index 6bfc7b7..1396b69 100644 --- a/src/commands.c +++ b/src/commands.c @@ -18,6 +18,7 @@ static void solve_exec(CommandArgs *args); static void scramble_exec(CommandArgs *args); static void steps_exec(CommandArgs *args); static void commands_exec(CommandArgs *args); +static void freemem_exec(CommandArgs *args); static void print_exec(CommandArgs *args); static void twophase_exec(CommandArgs *args); static void help_exec(CommandArgs *args); @@ -87,6 +88,15 @@ commands_cmd = { .exec = commands_exec }; +Command +freemem_cmd = { + .name = "freemem", + .usage = "freemem", + .description = "free large tables from RAM", + .parse_args = parse_no_arg, + .exec = freemem_exec, +}; + Command print_cmd = { .name = "print", @@ -534,6 +544,18 @@ commands_exec(CommandArgs *args) } +static void +freemem_exec(CommandArgs *args) +{ +/* TODO: implement these functions + free_allpd(); + free_allsd(); + free_invtables(); + free_ttables(); + free_mtables(); +*/ +} + static void print_exec(CommandArgs *args) { diff --git a/src/shell.c b/src/shell.c index 31dde0e..420dc1c 100644 --- a/src/shell.c +++ b/src/shell.c @@ -163,5 +163,7 @@ main(int argc, char *argv[]) launch(false); } + /* TODO: exec freemem */ + return 0; } -- cgit v1.3