version 1.74, 2009/08/11 12:53:37 |
version 1.75, 2009/08/11 17:18:35 |
|
|
#ifndef TMUX_H |
#ifndef TMUX_H |
#define TMUX_H |
#define TMUX_H |
|
|
#define PROTOCOL_VERSION -15 |
#define PROTOCOL_VERSION 1 |
|
|
#include <sys/param.h> |
#include <sys/param.h> |
#include <sys/time.h> |
#include <sys/time.h> |
#include <sys/queue.h> |
#include <sys/queue.h> |
#include <sys/tree.h> |
#include <sys/tree.h> |
|
#include <sys/uio.h> |
|
|
#include <bitstring.h> |
#include <bitstring.h> |
#include <getopt.h> |
#include <getopt.h> |
|
|
#include <termios.h> |
#include <termios.h> |
|
|
#include "array.h" |
#include "array.h" |
|
#include "imsg.h" |
|
|
extern char *__progname; |
extern char *__progname; |
extern char **environ; |
extern char **environ; |
|
|
MSG_SHUTDOWN, |
MSG_SHUTDOWN, |
MSG_SUSPEND, |
MSG_SUSPEND, |
MSG_UNLOCK, |
MSG_UNLOCK, |
|
MSG_VERSION, |
MSG_WAKEUP, |
MSG_WAKEUP, |
MSG_ENVIRON |
MSG_ENVIRON |
}; |
}; |
|
|
/* |
/* |
* Message header and data. |
* Message data. |
* |
* |
* Don't forget to bump PROTOCOL_VERSION if any of these change! |
* Don't forget to bump PROTOCOL_VERSION if any of these change! |
* |
|
* Changing sizeof (struct hdr) or sizeof (struct msg_identify_data) will make |
|
* the tmux client hang even if the protocol version is bumped. |
|
*/ |
*/ |
struct hdr { |
|
enum msgtype type; |
|
size_t size; |
|
}; |
|
|
|
struct msg_print_data { |
struct msg_print_data { |
char msg[PRINT_LENGTH]; |
char msg[PRINT_LENGTH]; |
}; |
}; |
|
|
|
|
struct msg_identify_data { |
struct msg_identify_data { |
char tty[TTY_NAME_MAX]; |
char tty[TTY_NAME_MAX]; |
int version; |
|
|
|
char cwd[MAXPATHLEN]; |
char cwd[MAXPATHLEN]; |
|
|
|
|
|
|
/* Client connection. */ |
/* Client connection. */ |
struct client { |
struct client { |
int fd; |
struct imsgbuf ibuf; |
struct buffer *in; |
|
struct buffer *out; |
|
|
|
struct environ environ; |
struct environ environ; |
|
|
|
|
|
|
/* Client context. */ |
/* Client context. */ |
struct client_ctx { |
struct client_ctx { |
int srv_fd; |
struct imsgbuf ibuf; |
struct buffer *srv_in; |
|
struct buffer *srv_out; |
|
|
|
enum { |
enum { |
CCTX_DETACH, |
CCTX_DETACH, |