summaryrefslogtreecommitdiff
path: root/src/dged/command.h
diff options
context:
space:
mode:
authorAlbert Cervin <albert@acervin.com>2023-05-24 23:28:09 +0200
committerAlbert Cervin <albert@acervin.com>2023-05-24 23:28:09 +0200
commitf2614efe03e04575e1b9ded663a553557452c7ae (patch)
treede8d8a538cec3595fcb716d413fa3bf4f68e173c /src/dged/command.h
parent4f3b576db6b01c8c88076985478e2a7fa37be340 (diff)
downloaddged-f2614efe03e04575e1b9ded663a553557452c7ae.tar.gz
dged-f2614efe03e04575e1b9ded663a553557452c7ae.tar.xz
dged-f2614efe03e04575e1b9ded663a553557452c7ae.zip
Formatting changes
Diffstat (limited to 'src/dged/command.h')
-rw-r--r--src/dged/command.h10
1 files changed, 10 insertions, 0 deletions
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
@@ -77,6 +77,16 @@ struct command {
};
/**
+ * 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
*/
HASHMAP_ENTRY_TYPE(command_entry, struct command);