diff options
author | Mitchell Horne <mhorne@FreeBSD.org> | 2022-06-30 15:58:22 +0000 |
---|---|---|
committer | Mitchell Horne <mhorne@FreeBSD.org> | 2022-07-05 14:56:42 +0000 |
commit | 7ce58d4e8c0cfcb42ec404aed6185b5eb7eef8a8 (patch) | |
tree | 1fd5ba9e30dc40e02c114c2ca94ca35f59263cc6 /sys/ddb | |
parent | 8a0994823365740f4d92842c2d6f7f524310ba64 (diff) | |
download | src-7ce58d4e8c0cfcb42ec404aed6185b5eb7eef8a8.tar.gz src-7ce58d4e8c0cfcb42ec404aed6185b5eb7eef8a8.zip |
ddb: add _FLAGS command variants
Provide _FLAGS variants of the various command definition macros, in
anticipation of adding a new flag. This can also be used for some
existing commands which require special flag values.
Reviewed by: markj
MFC after: 3 days
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35581
Diffstat (limited to 'sys/ddb')
-rw-r--r-- | sys/ddb/ddb.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sys/ddb/ddb.h b/sys/ddb/ddb.h index 1ae278965dde..4e63907a6ed0 100644 --- a/sys/ddb/ddb.h +++ b/sys/ddb/ddb.h @@ -164,14 +164,22 @@ _func(db_expr_t addr, bool have_addr, db_expr_t count, char *modif) #define DB_FUNC(_name, _func, list, _flag, _more) \ _DB_FUNC(_cmd, _name, _func, list, _flag, _more) +#define DB_COMMAND_FLAGS(cmd_name, func_name, flags) \ + _DB_FUNC(_cmd, cmd_name, func_name, db_cmd_table, flags, NULL) #define DB_COMMAND(cmd_name, func_name) \ - _DB_FUNC(_cmd, cmd_name, func_name, db_cmd_table, 0, NULL) + DB_COMMAND_FLAGS(cmd_name, func_name, 0) +#define DB_ALIAS_FLAGS(alias_name, func_name, flags) \ + _DB_SET(_cmd, alias_name, func_name, db_cmd_table, flags, NULL) #define DB_ALIAS(alias_name, func_name) \ - _DB_SET(_cmd, alias_name, func_name, db_cmd_table, 0, NULL) + DB_ALIAS_FLAGS(alias_name, func_name, 0) +#define DB_SHOW_COMMAND_FLAGS(cmd_name, func_name, flags) \ + _DB_FUNC(_show, cmd_name, func_name, db_show_table, flags, NULL) #define DB_SHOW_COMMAND(cmd_name, func_name) \ - _DB_FUNC(_show, cmd_name, func_name, db_show_table, 0, NULL) + DB_SHOW_COMMAND_FLAGS(cmd_name, func_name, 0) +#define DB_SHOW_ALIAS_FLAGS(alias_name, func_name, flags) \ + _DB_SET(_show, alias_name, func_name, db_show_table, flags, NULL) #define DB_SHOW_ALIAS(alias_name, func_name) \ - _DB_SET(_show, alias_name, func_name, db_show_table, 0, NULL) + DB_SHOW_ALIAS_FLAGS(alias_name, func_name, 0) #define DB_SHOW_ALL_COMMAND(cmd_name, func_name) \ _DB_FUNC(_show_all, cmd_name, func_name, db_show_all_table, 0, NULL) #define DB_SHOW_ALL_ALIAS(alias_name, func_name) \ |