mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Rename struct hdrtype to msgtype which is a better name and can be used even
when struct hdr disappears.
This commit is contained in:
		@@ -63,7 +63,7 @@ client_fill_session(struct msg_command_data *data)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
client_write_server(
 | 
					client_write_server(
 | 
				
			||||||
    struct client_ctx *cctx, enum hdrtype type, void *buf, size_t len)
 | 
					    struct client_ctx *cctx, enum msgtype type, void *buf, size_t len)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct hdr	hdr;
 | 
						struct hdr	hdr;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -33,7 +33,7 @@ int	client_msg_fn_exited(struct hdr *, struct client_ctx *);
 | 
				
			|||||||
int	client_msg_fn_suspend(struct hdr *, struct client_ctx *);
 | 
					int	client_msg_fn_suspend(struct hdr *, struct client_ctx *);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct client_msg {
 | 
					struct client_msg {
 | 
				
			||||||
	enum hdrtype   type;
 | 
						enum msgtype   type;
 | 
				
			||||||
	int	       (*fn)(struct hdr *, struct client_ctx *);
 | 
						int	       (*fn)(struct hdr *, struct client_ctx *);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
struct client_msg client_msg_table[] = {
 | 
					struct client_msg client_msg_table[] = {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -58,7 +58,7 @@ server_write_error(struct client *c, const char *msg)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
server_write_client(
 | 
					server_write_client(
 | 
				
			||||||
    struct client *c, enum hdrtype type, const void *buf, size_t len)
 | 
					    struct client *c, enum msgtype type, const void *buf, size_t len)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct hdr	 hdr;
 | 
						struct hdr	 hdr;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -74,7 +74,7 @@ server_write_client(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
server_write_session(
 | 
					server_write_session(
 | 
				
			||||||
    struct session *s, enum hdrtype type, const void *buf, size_t len)
 | 
					    struct session *s, enum msgtype type, const void *buf, size_t len)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct client	*c;
 | 
						struct client	*c;
 | 
				
			||||||
	u_int		 i;
 | 
						u_int		 i;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -41,7 +41,7 @@ void printflike2 server_msg_fn_command_info(
 | 
				
			|||||||
    	    struct cmd_ctx *, const char *, ...);
 | 
					    	    struct cmd_ctx *, const char *, ...);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct server_msg {
 | 
					struct server_msg {
 | 
				
			||||||
	enum hdrtype	type;
 | 
						enum msgtype	type;
 | 
				
			||||||
	void	        (*fn)(struct hdr *, struct client *);
 | 
						void	        (*fn)(struct hdr *, struct client *);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
const struct server_msg server_msg_table[] = {
 | 
					const struct server_msg server_msg_table[] = {
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										10
									
								
								tmux.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								tmux.c
									
									
									
									
									
								
							@@ -57,8 +57,8 @@ char		*socket_path;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
__dead void	 usage(void);
 | 
					__dead void	 usage(void);
 | 
				
			||||||
char 		*makesockpath(const char *);
 | 
					char 		*makesockpath(const char *);
 | 
				
			||||||
int		 prepare_unlock(enum hdrtype *, void **, size_t *, int);
 | 
					int		 prepare_unlock(enum msgtype *, void **, size_t *, int);
 | 
				
			||||||
int		 prepare_cmd(enum hdrtype *, void **, size_t *, int, char **);
 | 
					int		 prepare_cmd(enum msgtype *, void **, size_t *, int, char **);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
__dead void
 | 
					__dead void
 | 
				
			||||||
usage(void)
 | 
					usage(void)
 | 
				
			||||||
@@ -203,7 +203,7 @@ makesockpath(const char *label)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int
 | 
					int
 | 
				
			||||||
prepare_unlock(enum hdrtype *msg, void **buf, size_t *len, int argc)
 | 
					prepare_unlock(enum msgtype *msg, void **buf, size_t *len, int argc)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	static struct msg_unlock_data	 unlockdata;
 | 
						static struct msg_unlock_data	 unlockdata;
 | 
				
			||||||
	char				*pass;
 | 
						char				*pass;
 | 
				
			||||||
@@ -232,7 +232,7 @@ prepare_unlock(enum hdrtype *msg, void **buf, size_t *len, int argc)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int
 | 
					int
 | 
				
			||||||
prepare_cmd(enum hdrtype *msg, void **buf, size_t *len, int argc, char **argv)
 | 
					prepare_cmd(enum msgtype *msg, void **buf, size_t *len, int argc, char **argv)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	static struct msg_command_data	 cmddata;
 | 
						static struct msg_command_data	 cmddata;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -258,7 +258,7 @@ main(int argc, char **argv)
 | 
				
			|||||||
	struct cmd_list		*cmdlist;
 | 
						struct cmd_list		*cmdlist;
 | 
				
			||||||
 	struct cmd		*cmd;
 | 
					 	struct cmd		*cmd;
 | 
				
			||||||
	struct pollfd	 	 pfd;
 | 
						struct pollfd	 	 pfd;
 | 
				
			||||||
	enum hdrtype		 msg;
 | 
						enum msgtype		 msg;
 | 
				
			||||||
	struct hdr	 	 hdr;
 | 
						struct hdr	 	 hdr;
 | 
				
			||||||
	struct passwd		*pw;
 | 
						struct passwd		*pw;
 | 
				
			||||||
	struct msg_print_data	 printdata;
 | 
						struct msg_print_data	 printdata;
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										10
									
								
								tmux.h
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								tmux.h
									
									
									
									
									
								
							@@ -287,7 +287,7 @@ struct tty_term_code_entry {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Message codes. */
 | 
					/* Message codes. */
 | 
				
			||||||
enum hdrtype {
 | 
					enum msgtype {
 | 
				
			||||||
	MSG_COMMAND,
 | 
						MSG_COMMAND,
 | 
				
			||||||
	MSG_DETACH,
 | 
						MSG_DETACH,
 | 
				
			||||||
	MSG_ERROR,
 | 
						MSG_ERROR,
 | 
				
			||||||
@@ -313,7 +313,7 @@ enum hdrtype {
 | 
				
			|||||||
 * the tmux client hang even if the protocol version is bumped.
 | 
					 * the tmux client hang even if the protocol version is bumped.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
struct hdr {
 | 
					struct hdr {
 | 
				
			||||||
	enum hdrtype	type;
 | 
						enum msgtype	type;
 | 
				
			||||||
	size_t		size;
 | 
						size_t		size;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1351,7 +1351,7 @@ int	 client_main(struct client_ctx *);
 | 
				
			|||||||
int	 client_msg_dispatch(struct client_ctx *);
 | 
					int	 client_msg_dispatch(struct client_ctx *);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* client-fn.c */
 | 
					/* client-fn.c */
 | 
				
			||||||
void	 client_write_server(struct client_ctx *, enum hdrtype, void *, size_t);
 | 
					void	 client_write_server(struct client_ctx *, enum msgtype, void *, size_t);
 | 
				
			||||||
void	 client_fill_session(struct msg_command_data *);
 | 
					void	 client_fill_session(struct msg_command_data *);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* key-bindings.c */
 | 
					/* key-bindings.c */
 | 
				
			||||||
@@ -1385,9 +1385,9 @@ int	 server_msg_dispatch(struct client *);
 | 
				
			|||||||
const char **server_fill_environ(struct session *);
 | 
					const char **server_fill_environ(struct session *);
 | 
				
			||||||
void	 server_write_error(struct client *, const char *);
 | 
					void	 server_write_error(struct client *, const char *);
 | 
				
			||||||
void	 server_write_client(
 | 
					void	 server_write_client(
 | 
				
			||||||
             struct client *, enum hdrtype, const void *, size_t);
 | 
					             struct client *, enum msgtype, const void *, size_t);
 | 
				
			||||||
void	 server_write_session(
 | 
					void	 server_write_session(
 | 
				
			||||||
             struct session *, enum hdrtype, const void *, size_t);
 | 
					             struct session *, enum msgtype, const void *, size_t);
 | 
				
			||||||
void	 server_redraw_client(struct client *);
 | 
					void	 server_redraw_client(struct client *);
 | 
				
			||||||
void	 server_status_client(struct client *);
 | 
					void	 server_status_client(struct client *);
 | 
				
			||||||
void	 server_redraw_session(struct session *);
 | 
					void	 server_redraw_session(struct session *);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user