mirror of
				https://github.com/tmux/tmux.git
				synced 2025-10-26 12:27:15 +00:00 
			
		
		
		
	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.
This commit is contained in:
		
							
								
								
									
										7
									
								
								tmux.h
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								tmux.h
									
									
									
									
									
								
							@@ -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]"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user