From f2614efe03e04575e1b9ded663a553557452c7ae Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Wed, 24 May 2023 23:28:09 +0200 Subject: Formatting changes --- src/dged/command.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/dged/command.h') diff --git a/src/dged/command.h b/src/dged/command.h index bbc57f2..956c10a 100644 --- a/src/dged/command.h +++ b/src/dged/command.h @@ -76,6 +76,16 @@ struct command { void *userdata; }; +/** + * Convenience macro for creating a command from a function. + */ +#define COMMAND_FN(name_, command_name, function, userdata_) \ + static struct command command_name##_command = { \ + .fn = function, \ + .name = #name_, \ + .userdata = userdata_, \ + }; + /** * A command registry */ -- cgit v1.2.3