diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2019-03-05 12:42:35 -0500 |
---|---|---|
committer | KevinOConnor <kevin@koconnor.net> | 2019-03-17 19:38:18 -0400 |
commit | db6e2d4c9ef1e2f8f231821f7506252a406ea2f0 (patch) | |
tree | 0fae3dcee5f60078f0abb8ba83c4016d940385bb /src | |
parent | 7d73a35805a61a40f49d0840741434ab9548d638 (diff) | |
download | kutter-db6e2d4c9ef1e2f8f231821f7506252a406ea2f0.tar.gz kutter-db6e2d4c9ef1e2f8f231821f7506252a406ea2f0.tar.xz kutter-db6e2d4c9ef1e2f8f231821f7506252a406ea2f0.zip |
msgproto: Convert static strings to a more generic enumeration system
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/command.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/command.h b/src/command.h index e0911733..6cf2ca6b 100644 --- a/src/command.h +++ b/src/command.h @@ -21,6 +21,13 @@ #define DECL_CONSTANT_STR(NAME, VALUE) \ DECL_CTR("_DECL_CONSTANT_STR " NAME " " VALUE) +// Declare an enumeration +#define DECL_ENUMERATION(ENUM, NAME, VALUE) \ + DECL_CTR_INT("_DECL_ENUMERATION " ENUM " " NAME, (VALUE)) +#define DECL_ENUMERATION_RANGE(ENUM, NAME, VALUE, COUNT) \ + DECL_CTR_INT("_DECL_ENUMERATION_RANGE " ENUM " " NAME \ + " " __stringify(COUNT), (VALUE)) + // Send an output message (and declare a static message type for it) #define output(FMT, args...) \ command_sendf(_DECL_OUTPUT(FMT) , ##args ) |