diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-11-13 19:53:28 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-11-13 19:53:28 +0000 |
commit | 76ef8770cd983e7ece581fbcfb3a7ad5e115aae5 (patch) | |
tree | 0b0d7847f179c9963b58488f8c1724e64176266e /tmux.h | |
parent | dafa0f022c573513f949c7c66ae83d063fa9a2ab (diff) | |
download | rtmux-76ef8770cd983e7ece581fbcfb3a7ad5e115aae5.tar.gz rtmux-76ef8770cd983e7ece581fbcfb3a7ad5e115aae5.tar.bz2 rtmux-76ef8770cd983e7ece581fbcfb3a7ad5e115aae5.zip |
Get rid of the ugly CMD_CHFLAG macro and use a const string (eg "dDU") in the
command entry structs and a couple of functions to check/set the flags.
Diffstat (limited to 'tmux.h')
-rw-r--r-- | tmux.h | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -1150,10 +1150,7 @@ struct cmd_entry { #define CMD_ARG12 0x40 int flags; -#define CMD_CHFLAG(flag) \ - ((flag) >= 'a' && (flag) <= 'z' ? 1ULL << ((flag) - 'a') : \ - (flag) >= 'A' && (flag) <= 'Z' ? 1ULL << (26 + (flag) - 'A') : 0) - uint64_t chflags; + const char *chflags; void (*init)(struct cmd *, int); int (*parse)(struct cmd *, int, char **, char **); @@ -1502,6 +1499,8 @@ int cmd_string_parse(const char *, struct cmd_list **, char **); /* cmd-generic.c */ size_t cmd_prarg(char *, size_t, const char *, char *); +int cmd_check_flag(uint64_t, int); +void cmd_set_flag(uint64_t *, int); #define CMD_TARGET_PANE_USAGE "[-t target-pane]" #define CMD_TARGET_WINDOW_USAGE "[-t target-window]" #define CMD_TARGET_SESSION_USAGE "[-t target-session]" |