From e35f5b35bd9a6a85eb314bfb642998267b2d475d Mon Sep 17 00:00:00 2001 From: Tiago Cunha Date: Sat, 14 Nov 2009 17:56:39 +0000 Subject: Sync OpenBSD patchset 539: 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. --- tmux.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'tmux.h') diff --git a/tmux.h b/tmux.h index 496a2a43..8c7cf5b9 100644 --- a/tmux.h +++ b/tmux.h @@ -1,4 +1,4 @@ -/* $Id: tmux.h,v 1.515 2009-11-14 17:48:39 tcunha Exp $ */ +/* $Id: tmux.h,v 1.516 2009-11-14 17:56:39 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -1149,10 +1149,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 **); @@ -1501,6 +1498,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]" -- cgit