[BACK]Return to tmux.h CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Annotation of src/usr.bin/tmux/tmux.h, Revision 1.611

1.611   ! nicm        1: /* $OpenBSD: tmux.h,v 1.610 2015/12/14 23:30:58 nicm Exp $ */
1.1       nicm        2:
                      3: /*
                      4:  * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
                      5:  *
                      6:  * Permission to use, copy, modify, and distribute this software for any
                      7:  * purpose with or without fee is hereby granted, provided that the above
                      8:  * copyright notice and this permission notice appear in all copies.
                      9:  *
                     10:  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
                     11:  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
                     12:  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
                     13:  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
                     14:  * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
                     15:  * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
                     16:  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
                     17:  */
                     18:
                     19: #ifndef TMUX_H
                     20: #define TMUX_H
                     21:
1.423     nicm       22: #define PROTOCOL_VERSION 8
1.1       nicm       23:
                     24: #include <sys/time.h>
                     25: #include <sys/queue.h>
                     26: #include <sys/tree.h>
                     27:
1.6       nicm       28: #include <bitstring.h>
1.159     nicm       29: #include <event.h>
1.1       nicm       30: #include <limits.h>
                     31: #include <stdarg.h>
                     32: #include <stdint.h>
                     33: #include <stdio.h>
                     34: #include <termios.h>
                     35:
1.583     nicm       36: #include "xmalloc.h"
                     37:
1.42      nicm       38: extern char    *__progname;
1.73      nicm       39: extern char   **environ;
1.1       nicm       40:
1.568     nicm       41: struct client;
                     42: struct environ;
                     43: struct input_ctx;
                     44: struct mouse_event;
                     45: struct options;
                     46: struct session;
                     47: struct tmuxpeer;
                     48: struct tmuxproc;
                     49:
1.409     nicm       50: /* Default global configuration file. */
                     51: #define TMUX_CONF "/etc/tmux.conf"
1.1       nicm       52:
1.195     nicm       53: /*
1.39      nicm       54:  * Minimum layout cell size, NOT including separator line. The scroll region
                     55:  * cannot be one line in height so this must be at least two.
                     56:  */
                     57: #define PANE_MINIMUM 2
1.1       nicm       58:
1.540     nicm       59: /* Automatic name refresh interval, in microseconds. Must be < 1 second. */
                     60: #define NAME_INTERVAL 500000
1.152     nicm       61:
1.55      nicm       62: /*
1.514     nicm       63:  * READ_SIZE is the maximum size of data to hold from a pty (the event high
                     64:  * watermark). READ_BACKOFF is the amount of data waiting to be output to a tty
                     65:  * before pty reads will be backed off. READ_TIME is how long to back off
                     66:  * before the next read (in microseconds) if a tty is above READ_BACKOFF.
                     67:  */
                     68: #define READ_SIZE 1024
                     69: #define READ_BACKOFF 512
                     70: #define READ_TIME 100
1.1       nicm       71:
                     72: /* Attribute to make gcc check printf-like arguments. */
1.476     nicm       73: #define printflike(a, b) __attribute__ ((format (printf, a, b)))
1.1       nicm       74:
                     75: /* Number of items in array. */
1.14      nicm       76: #ifndef nitems
1.1       nicm       77: #define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
1.14      nicm       78: #endif
1.335     nicm       79:
1.1       nicm       80: /* Bell option values. */
                     81: #define BELL_NONE 0
                     82: #define BELL_ANY 1
                     83: #define BELL_CURRENT 2
1.513     nicm       84: #define BELL_OTHER 3
1.1       nicm       85:
1.174     nicm       86: /* Special key codes. */
1.571     nicm       87: #define KEYC_NONE 0xffff00000000ULL
1.601     nicm       88: #define KEYC_UNKNOWN 0xfffe00000000ULL
1.571     nicm       89: #define KEYC_BASE 0x100000000000ULL
1.174     nicm       90:
                     91: /* Key modifier bits. */
1.571     nicm       92: #define KEYC_ESCAPE 0x200000000000ULL
                     93: #define KEYC_CTRL   0x400000000000ULL
                     94: #define KEYC_SHIFT  0x800000000000ULL
1.225     nicm       95:
1.275     nicm       96: /* Mask to obtain key w/o modifiers. */
1.493     nicm       97: #define KEYC_MASK_MOD (KEYC_ESCAPE|KEYC_CTRL|KEYC_SHIFT)
1.225     nicm       98: #define KEYC_MASK_KEY (~KEYC_MASK_MOD)
1.41      nicm       99:
1.492     nicm      100: /* Is this a mouse key? */
                    101: #define KEYC_IS_MOUSE(key) (((key) & KEYC_MASK_KEY) >= KEYC_MOUSE &&   \
                    102:     ((key) & KEYC_MASK_KEY) < KEYC_BSPACE)
                    103:
                    104: /* Mouse key codes. */
                    105: #define KEYC_MOUSE_KEY(name)                           \
                    106:        KEYC_ ## name ## _PANE,                         \
                    107:        KEYC_ ## name ## _STATUS,                       \
                    108:        KEYC_ ## name ## _BORDER
                    109: #define KEYC_MOUSE_STRING(name, s)                     \
                    110:        { #s "Pane", KEYC_ ## name ## _PANE },          \
                    111:        { #s "Status", KEYC_ ## name ## _STATUS },      \
                    112:        { #s "Border", KEYC_ ## name ## _BORDER }
                    113:
1.571     nicm      114: /*
                    115:  * A single key. This can be ASCII or Unicode or one of the keys starting at
                    116:  * KEYC_BASE.
                    117:  */
1.580     nicm      118: typedef unsigned long long key_code;
1.571     nicm      119:
1.492     nicm      120: /* Special key codes. */
1.571     nicm      121: enum {
1.492     nicm      122:        /* Focus events. */
                    123:        KEYC_FOCUS_IN = KEYC_BASE,
                    124:        KEYC_FOCUS_OUT,
                    125:
                    126:        /* Mouse keys. */
                    127:        KEYC_MOUSE, /* unclassified mouse event */
                    128:        KEYC_MOUSE_KEY(MOUSEDOWN1),
                    129:        KEYC_MOUSE_KEY(MOUSEDOWN2),
                    130:        KEYC_MOUSE_KEY(MOUSEDOWN3),
                    131:        KEYC_MOUSE_KEY(MOUSEUP1),
                    132:        KEYC_MOUSE_KEY(MOUSEUP2),
                    133:        KEYC_MOUSE_KEY(MOUSEUP3),
                    134:        KEYC_MOUSE_KEY(MOUSEDRAG1),
                    135:        KEYC_MOUSE_KEY(MOUSEDRAG2),
                    136:        KEYC_MOUSE_KEY(MOUSEDRAG3),
                    137:        KEYC_MOUSE_KEY(WHEELUP),
                    138:        KEYC_MOUSE_KEY(WHEELDOWN),
1.56      nicm      139:
                    140:        /* Backspace key. */
                    141:        KEYC_BSPACE,
1.41      nicm      142:
                    143:        /* Function keys. */
                    144:        KEYC_F1,
                    145:        KEYC_F2,
                    146:        KEYC_F3,
                    147:        KEYC_F4,
                    148:        KEYC_F5,
                    149:        KEYC_F6,
                    150:        KEYC_F7,
                    151:        KEYC_F8,
                    152:        KEYC_F9,
                    153:        KEYC_F10,
                    154:        KEYC_F11,
                    155:        KEYC_F12,
                    156:        KEYC_IC,
                    157:        KEYC_DC,
                    158:        KEYC_HOME,
                    159:        KEYC_END,
                    160:        KEYC_NPAGE,
                    161:        KEYC_PPAGE,
                    162:        KEYC_BTAB,
                    163:
                    164:        /* Arrow keys. */
                    165:        KEYC_UP,
                    166:        KEYC_DOWN,
                    167:        KEYC_LEFT,
                    168:        KEYC_RIGHT,
                    169:
1.148     nicm      170:        /* Numeric keypad. */
                    171:        KEYC_KP_SLASH,
                    172:        KEYC_KP_STAR,
                    173:        KEYC_KP_MINUS,
                    174:        KEYC_KP_SEVEN,
                    175:        KEYC_KP_EIGHT,
                    176:        KEYC_KP_NINE,
                    177:        KEYC_KP_PLUS,
                    178:        KEYC_KP_FOUR,
                    179:        KEYC_KP_FIVE,
                    180:        KEYC_KP_SIX,
                    181:        KEYC_KP_ONE,
                    182:        KEYC_KP_TWO,
                    183:        KEYC_KP_THREE,
                    184:        KEYC_KP_ENTER,
                    185:        KEYC_KP_ZERO,
                    186:        KEYC_KP_PERIOD,
1.41      nicm      187: };
1.1       nicm      188:
                    189: /* Termcap codes. */
                    190: enum tty_code_code {
                    191:        TTYC_AX = 0,
                    192:        TTYC_ACSC,      /* acs_chars, ac */
1.491     nicm      193:        TTYC_BCE,       /* back_color_erase, ut */
1.1       nicm      194:        TTYC_BEL,       /* bell, bl */
                    195:        TTYC_BLINK,     /* enter_blink_mode, mb */
                    196:        TTYC_BOLD,      /* enter_bold_mode, md */
                    197:        TTYC_CIVIS,     /* cursor_invisible, vi */
                    198:        TTYC_CLEAR,     /* clear_screen, cl */
                    199:        TTYC_CNORM,     /* cursor_normal, ve */
                    200:        TTYC_COLORS,    /* max_colors, Co */
1.287     nicm      201:        TTYC_CR,        /* restore cursor colour, Cr */
1.411     nicm      202:        TTYC_CS,        /* set cursor colour, Cs */
1.1       nicm      203:        TTYC_CSR,       /* change_scroll_region, cs */
1.135     nicm      204:        TTYC_CUB,       /* parm_left_cursor, LE */
                    205:        TTYC_CUB1,      /* cursor_left, le */
1.1       nicm      206:        TTYC_CUD,       /* parm_down_cursor, DO */
                    207:        TTYC_CUD1,      /* cursor_down, do */
1.135     nicm      208:        TTYC_CUF,       /* parm_right_cursor, RI */
                    209:        TTYC_CUF1,      /* cursor_right, nd */
1.1       nicm      210:        TTYC_CUP,       /* cursor_address, cm */
1.135     nicm      211:        TTYC_CUU,       /* parm_up_cursor, UP */
                    212:        TTYC_CUU1,      /* cursor_up, up */
1.485     nicm      213:        TTYC_CVVIS,     /* cursor_visible, vs */
1.1       nicm      214:        TTYC_DCH,       /* parm_dch, DC */
                    215:        TTYC_DCH1,      /* delete_character, dc */
                    216:        TTYC_DIM,       /* enter_dim_mode, mh */
                    217:        TTYC_DL,        /* parm_delete_line, DL */
                    218:        TTYC_DL1,       /* delete_line, dl */
1.297     nicm      219:        TTYC_E3,
1.371     nicm      220:        TTYC_ECH,       /* erase_chars, ec */
1.1       nicm      221:        TTYC_EL,        /* clr_eol, ce */
                    222:        TTYC_EL1,       /* clr_bol, cb */
                    223:        TTYC_ENACS,     /* ena_acs, eA */
1.283     nicm      224:        TTYC_FSL,       /* from_status_line, fsl */
1.135     nicm      225:        TTYC_HOME,      /* cursor_home, ho */
                    226:        TTYC_HPA,       /* column_address, ch */
1.1       nicm      227:        TTYC_ICH,       /* parm_ich, IC */
                    228:        TTYC_ICH1,      /* insert_character, ic */
                    229:        TTYC_IL,        /* parm_insert_line, IL */
                    230:        TTYC_IL1,       /* insert_line, il */
                    231:        TTYC_INVIS,     /* enter_secure_mode, mk */
                    232:        TTYC_IS1,       /* init_1string, i1 */
                    233:        TTYC_IS2,       /* init_2string, i2 */
                    234:        TTYC_IS3,       /* init_3string, i3 */
                    235:        TTYC_KCBT,      /* key_btab, kB */
                    236:        TTYC_KCUB1,     /* key_left, kl */
                    237:        TTYC_KCUD1,     /* key_down, kd */
                    238:        TTYC_KCUF1,     /* key_right, kr */
                    239:        TTYC_KCUU1,     /* key_up, ku */
1.149     nicm      240:        TTYC_KDC2,
                    241:        TTYC_KDC3,
                    242:        TTYC_KDC4,
                    243:        TTYC_KDC5,
                    244:        TTYC_KDC6,
                    245:        TTYC_KDC7,
1.1       nicm      246:        TTYC_KDCH1,     /* key_dc, kD */
1.149     nicm      247:        TTYC_KDN2,
                    248:        TTYC_KDN3,
                    249:        TTYC_KDN4,
                    250:        TTYC_KDN5,
                    251:        TTYC_KDN6,
                    252:        TTYC_KDN7,
1.1       nicm      253:        TTYC_KEND,      /* key_end, ke */
1.149     nicm      254:        TTYC_KEND2,
                    255:        TTYC_KEND3,
                    256:        TTYC_KEND4,
                    257:        TTYC_KEND5,
                    258:        TTYC_KEND6,
                    259:        TTYC_KEND7,
1.466     nicm      260:        TTYC_KF1,
                    261:        TTYC_KF10,
                    262:        TTYC_KF11,
                    263:        TTYC_KF12,
                    264:        TTYC_KF13,
                    265:        TTYC_KF14,
                    266:        TTYC_KF15,
                    267:        TTYC_KF16,
                    268:        TTYC_KF17,
                    269:        TTYC_KF18,
                    270:        TTYC_KF19,
                    271:        TTYC_KF2,
                    272:        TTYC_KF20,
                    273:        TTYC_KF21,
                    274:        TTYC_KF22,
                    275:        TTYC_KF23,
                    276:        TTYC_KF24,
                    277:        TTYC_KF25,
                    278:        TTYC_KF26,
                    279:        TTYC_KF27,
                    280:        TTYC_KF28,
                    281:        TTYC_KF29,
                    282:        TTYC_KF3,
                    283:        TTYC_KF30,
                    284:        TTYC_KF31,
                    285:        TTYC_KF32,
                    286:        TTYC_KF33,
                    287:        TTYC_KF34,
                    288:        TTYC_KF35,
                    289:        TTYC_KF36,
                    290:        TTYC_KF37,
                    291:        TTYC_KF38,
                    292:        TTYC_KF39,
                    293:        TTYC_KF4,
                    294:        TTYC_KF40,
                    295:        TTYC_KF41,
                    296:        TTYC_KF42,
                    297:        TTYC_KF43,
                    298:        TTYC_KF44,
                    299:        TTYC_KF45,
                    300:        TTYC_KF46,
                    301:        TTYC_KF47,
                    302:        TTYC_KF48,
                    303:        TTYC_KF49,
                    304:        TTYC_KF5,
                    305:        TTYC_KF50,
                    306:        TTYC_KF51,
                    307:        TTYC_KF52,
                    308:        TTYC_KF53,
                    309:        TTYC_KF54,
                    310:        TTYC_KF55,
                    311:        TTYC_KF56,
                    312:        TTYC_KF57,
                    313:        TTYC_KF58,
                    314:        TTYC_KF59,
                    315:        TTYC_KF6,
                    316:        TTYC_KF60,
                    317:        TTYC_KF61,
                    318:        TTYC_KF62,
                    319:        TTYC_KF63,
                    320:        TTYC_KF7,
                    321:        TTYC_KF8,
                    322:        TTYC_KF9,
1.149     nicm      323:        TTYC_KHOM2,
                    324:        TTYC_KHOM3,
                    325:        TTYC_KHOM4,
                    326:        TTYC_KHOM5,
                    327:        TTYC_KHOM6,
                    328:        TTYC_KHOM7,
1.1       nicm      329:        TTYC_KHOME,     /* key_home, kh */
1.149     nicm      330:        TTYC_KIC2,
                    331:        TTYC_KIC3,
                    332:        TTYC_KIC4,
                    333:        TTYC_KIC5,
                    334:        TTYC_KIC6,
                    335:        TTYC_KIC7,
1.1       nicm      336:        TTYC_KICH1,     /* key_ic, kI */
1.149     nicm      337:        TTYC_KLFT2,
                    338:        TTYC_KLFT3,
                    339:        TTYC_KLFT4,
                    340:        TTYC_KLFT5,
                    341:        TTYC_KLFT6,
                    342:        TTYC_KLFT7,
1.1       nicm      343:        TTYC_KMOUS,     /* key_mouse, Km */
                    344:        TTYC_KNP,       /* key_npage, kN */
1.149     nicm      345:        TTYC_KNXT2,
                    346:        TTYC_KNXT3,
                    347:        TTYC_KNXT4,
                    348:        TTYC_KNXT5,
                    349:        TTYC_KNXT6,
                    350:        TTYC_KNXT7,
1.1       nicm      351:        TTYC_KPP,       /* key_ppage, kP */
1.149     nicm      352:        TTYC_KPRV2,
                    353:        TTYC_KPRV3,
                    354:        TTYC_KPRV4,
                    355:        TTYC_KPRV5,
                    356:        TTYC_KPRV6,
                    357:        TTYC_KPRV7,
                    358:        TTYC_KRIT2,
                    359:        TTYC_KRIT3,
                    360:        TTYC_KRIT4,
                    361:        TTYC_KRIT5,
                    362:        TTYC_KRIT6,
                    363:        TTYC_KRIT7,
                    364:        TTYC_KUP2,
                    365:        TTYC_KUP3,
                    366:        TTYC_KUP4,
                    367:        TTYC_KUP5,
                    368:        TTYC_KUP6,
                    369:        TTYC_KUP7,
1.286     nicm      370:        TTYC_MS,        /* modify xterm(1) selection */
1.1       nicm      371:        TTYC_OP,        /* orig_pair, op */
                    372:        TTYC_REV,       /* enter_reverse_mode, mr */
                    373:        TTYC_RI,        /* scroll_reverse, sr */
                    374:        TTYC_RMACS,     /* exit_alt_charset_mode */
                    375:        TTYC_RMCUP,     /* exit_ca_mode, te */
                    376:        TTYC_RMKX,      /* keypad_local, ke */
1.411     nicm      377:        TTYC_SE,        /* reset cursor style, Se */
1.1       nicm      378:        TTYC_SETAB,     /* set_a_background, AB */
                    379:        TTYC_SETAF,     /* set_a_foreground, AF */
                    380:        TTYC_SGR0,      /* exit_attribute_mode, me */
1.283     nicm      381:        TTYC_SITM,      /* enter_italics_mode, it */
1.1       nicm      382:        TTYC_SMACS,     /* enter_alt_charset_mode, as */
                    383:        TTYC_SMCUP,     /* enter_ca_mode, ti */
                    384:        TTYC_SMKX,      /* keypad_xmit, ks */
                    385:        TTYC_SMSO,      /* enter_standout_mode, so */
                    386:        TTYC_SMUL,      /* enter_underline_mode, us */
1.411     nicm      387:        TTYC_SS,        /* set cursor style, Ss */
1.283     nicm      388:        TTYC_TSL,       /* to_status_line, tsl */
1.135     nicm      389:        TTYC_VPA,       /* row_address, cv */
1.1       nicm      390:        TTYC_XENL,      /* eat_newline_glitch, xn */
1.283     nicm      391:        TTYC_XT,        /* xterm(1)-compatible title, XT */
1.1       nicm      392: };
                    393:
                    394: /* Message codes. */
1.64      nicm      395: enum msgtype {
1.423     nicm      396:        MSG_VERSION = 12,
                    397:
                    398:        MSG_IDENTIFY_FLAGS = 100,
                    399:        MSG_IDENTIFY_TERM,
                    400:        MSG_IDENTIFY_TTYNAME,
1.563     nicm      401:        MSG_IDENTIFY_OLDCWD, /* unused */
1.423     nicm      402:        MSG_IDENTIFY_STDIN,
                    403:        MSG_IDENTIFY_ENVIRON,
                    404:        MSG_IDENTIFY_DONE,
1.523     nicm      405:        MSG_IDENTIFY_CLIENTPID,
1.563     nicm      406:        MSG_IDENTIFY_CWD,
1.423     nicm      407:
                    408:        MSG_COMMAND = 200,
1.1       nicm      409:        MSG_DETACH,
1.423     nicm      410:        MSG_DETACHKILL,
1.1       nicm      411:        MSG_EXIT,
                    412:        MSG_EXITED,
                    413:        MSG_EXITING,
1.423     nicm      414:        MSG_LOCK,
1.1       nicm      415:        MSG_READY,
                    416:        MSG_RESIZE,
1.423     nicm      417:        MSG_SHELL,
1.1       nicm      418:        MSG_SHUTDOWN,
1.423     nicm      419:        MSG_STDERR,
                    420:        MSG_STDIN,
                    421:        MSG_STDOUT,
1.1       nicm      422:        MSG_SUSPEND,
1.423     nicm      423:        MSG_UNLOCK,
1.1       nicm      424:        MSG_WAKEUP,
                    425: };
                    426:
1.55      nicm      427: /*
1.75      nicm      428:  * Message data.
1.55      nicm      429:  *
                    430:  * Don't forget to bump PROTOCOL_VERSION if any of these change!
                    431:  */
1.1       nicm      432: struct msg_command_data {
1.427     nicm      433:        int     argc;
                    434: }; /* followed by packed argv */
1.1       nicm      435:
1.332     nicm      436: struct msg_stdin_data {
                    437:        ssize_t size;
                    438:        char    data[BUFSIZ];
                    439: };
                    440:
                    441: struct msg_stdout_data {
                    442:        ssize_t size;
                    443:        char    data[BUFSIZ];
                    444: };
                    445:
                    446: struct msg_stderr_data {
                    447:        ssize_t size;
                    448:        char    data[BUFSIZ];
                    449: };
                    450:
1.62      nicm      451: /* Mode key commands. */
1.1       nicm      452: enum mode_key_cmd {
1.59      nicm      453:        MODEKEY_NONE,
                    454:        MODEKEY_OTHER,
                    455:
                    456:        /* Editing keys. */
                    457:        MODEKEYEDIT_BACKSPACE,
                    458:        MODEKEYEDIT_CANCEL,
                    459:        MODEKEYEDIT_COMPLETE,
                    460:        MODEKEYEDIT_CURSORLEFT,
                    461:        MODEKEYEDIT_CURSORRIGHT,
                    462:        MODEKEYEDIT_DELETE,
1.84      nicm      463:        MODEKEYEDIT_DELETELINE,
1.59      nicm      464:        MODEKEYEDIT_DELETETOENDOFLINE,
1.299     nicm      465:        MODEKEYEDIT_DELETEWORD,
1.59      nicm      466:        MODEKEYEDIT_ENDOFLINE,
                    467:        MODEKEYEDIT_ENTER,
                    468:        MODEKEYEDIT_HISTORYDOWN,
                    469:        MODEKEYEDIT_HISTORYUP,
1.302     nicm      470:        MODEKEYEDIT_NEXTSPACE,
                    471:        MODEKEYEDIT_NEXTSPACEEND,
1.299     nicm      472:        MODEKEYEDIT_NEXTWORD,
                    473:        MODEKEYEDIT_NEXTWORDEND,
1.59      nicm      474:        MODEKEYEDIT_PASTE,
1.302     nicm      475:        MODEKEYEDIT_PREVIOUSSPACE,
1.299     nicm      476:        MODEKEYEDIT_PREVIOUSWORD,
1.59      nicm      477:        MODEKEYEDIT_STARTOFLINE,
                    478:        MODEKEYEDIT_SWITCHMODE,
                    479:        MODEKEYEDIT_SWITCHMODEAPPEND,
1.318     nicm      480:        MODEKEYEDIT_SWITCHMODEAPPENDLINE,
                    481:        MODEKEYEDIT_SWITCHMODEBEGINLINE,
1.415     nicm      482:        MODEKEYEDIT_SWITCHMODECHANGELINE,
                    483:        MODEKEYEDIT_SWITCHMODESUBSTITUTE,
                    484:        MODEKEYEDIT_SWITCHMODESUBSTITUTELINE,
1.94      nicm      485:        MODEKEYEDIT_TRANSPOSECHARS,
1.192     nicm      486:
1.59      nicm      487:        /* Menu (choice) keys. */
1.350     nicm      488:        MODEKEYCHOICE_BACKSPACE,
1.439     nicm      489:        MODEKEYCHOICE_BOTTOMLINE,
1.59      nicm      490:        MODEKEYCHOICE_CANCEL,
                    491:        MODEKEYCHOICE_CHOOSE,
                    492:        MODEKEYCHOICE_DOWN,
1.439     nicm      493:        MODEKEYCHOICE_ENDOFLIST,
1.59      nicm      494:        MODEKEYCHOICE_PAGEDOWN,
                    495:        MODEKEYCHOICE_PAGEUP,
1.201     nicm      496:        MODEKEYCHOICE_SCROLLDOWN,
                    497:        MODEKEYCHOICE_SCROLLUP,
1.350     nicm      498:        MODEKEYCHOICE_STARTNUMBERPREFIX,
1.439     nicm      499:        MODEKEYCHOICE_STARTOFLIST,
                    500:        MODEKEYCHOICE_TOPLINE,
1.359     nicm      501:        MODEKEYCHOICE_TREE_COLLAPSE,
                    502:        MODEKEYCHOICE_TREE_COLLAPSE_ALL,
                    503:        MODEKEYCHOICE_TREE_EXPAND,
                    504:        MODEKEYCHOICE_TREE_EXPAND_ALL,
                    505:        MODEKEYCHOICE_TREE_TOGGLE,
1.59      nicm      506:        MODEKEYCHOICE_UP,
                    507:
                    508:        /* Copy keys. */
1.441     nicm      509:        MODEKEYCOPY_APPENDSELECTION,
1.82      nicm      510:        MODEKEYCOPY_BACKTOINDENTATION,
1.138     nicm      511:        MODEKEYCOPY_BOTTOMLINE,
1.59      nicm      512:        MODEKEYCOPY_CANCEL,
                    513:        MODEKEYCOPY_CLEARSELECTION,
1.389     nicm      514:        MODEKEYCOPY_COPYPIPE,
1.285     nicm      515:        MODEKEYCOPY_COPYLINE,
                    516:        MODEKEYCOPY_COPYENDOFLINE,
1.59      nicm      517:        MODEKEYCOPY_COPYSELECTION,
                    518:        MODEKEYCOPY_DOWN,
                    519:        MODEKEYCOPY_ENDOFLINE,
1.83      nicm      520:        MODEKEYCOPY_GOTOLINE,
1.82      nicm      521:        MODEKEYCOPY_HALFPAGEDOWN,
                    522:        MODEKEYCOPY_HALFPAGEUP,
1.199     nicm      523:        MODEKEYCOPY_HISTORYBOTTOM,
                    524:        MODEKEYCOPY_HISTORYTOP,
1.212     nicm      525:        MODEKEYCOPY_JUMP,
                    526:        MODEKEYCOPY_JUMPAGAIN,
                    527:        MODEKEYCOPY_JUMPREVERSE,
                    528:        MODEKEYCOPY_JUMPBACK,
1.300     nicm      529:        MODEKEYCOPY_JUMPTO,
                    530:        MODEKEYCOPY_JUMPTOBACK,
1.59      nicm      531:        MODEKEYCOPY_LEFT,
1.138     nicm      532:        MODEKEYCOPY_MIDDLELINE,
1.59      nicm      533:        MODEKEYCOPY_NEXTPAGE,
1.202     nicm      534:        MODEKEYCOPY_NEXTSPACE,
                    535:        MODEKEYCOPY_NEXTSPACEEND,
1.59      nicm      536:        MODEKEYCOPY_NEXTWORD,
1.200     nicm      537:        MODEKEYCOPY_NEXTWORDEND,
1.432     nicm      538:        MODEKEYCOPY_OTHEREND,
1.59      nicm      539:        MODEKEYCOPY_PREVIOUSPAGE,
1.202     nicm      540:        MODEKEYCOPY_PREVIOUSSPACE,
1.59      nicm      541:        MODEKEYCOPY_PREVIOUSWORD,
1.204     nicm      542:        MODEKEYCOPY_RECTANGLETOGGLE,
1.59      nicm      543:        MODEKEYCOPY_RIGHT,
1.120     nicm      544:        MODEKEYCOPY_SCROLLDOWN,
                    545:        MODEKEYCOPY_SCROLLUP,
1.83      nicm      546:        MODEKEYCOPY_SEARCHAGAIN,
                    547:        MODEKEYCOPY_SEARCHDOWN,
1.207     nicm      548:        MODEKEYCOPY_SEARCHREVERSE,
1.83      nicm      549:        MODEKEYCOPY_SEARCHUP,
1.285     nicm      550:        MODEKEYCOPY_SELECTLINE,
1.462     nicm      551:        MODEKEYCOPY_STARTNAMEDBUFFER,
1.209     nicm      552:        MODEKEYCOPY_STARTNUMBERPREFIX,
1.59      nicm      553:        MODEKEYCOPY_STARTOFLINE,
                    554:        MODEKEYCOPY_STARTSELECTION,
1.138     nicm      555:        MODEKEYCOPY_TOPLINE,
1.59      nicm      556:        MODEKEYCOPY_UP,
1.1       nicm      557: };
                    558:
1.62      nicm      559: /* Data required while mode keys are in use. */
1.1       nicm      560: struct mode_key_data {
1.62      nicm      561:        struct mode_key_tree   *tree;
                    562:        int                     mode;
1.1       nicm      563: };
                    564: #define MODEKEY_EMACS 0
                    565: #define MODEKEY_VI 1
                    566:
1.62      nicm      567: /* Binding between a key and a command. */
                    568: struct mode_key_binding {
1.571     nicm      569:        key_code                         key;
1.62      nicm      570:
1.389     nicm      571:        int                              mode;
                    572:        enum mode_key_cmd                cmd;
                    573:        const char                      *arg;
1.62      nicm      574:
1.389     nicm      575:        RB_ENTRY(mode_key_binding)       entry;
1.62      nicm      576: };
1.306     nicm      577: RB_HEAD(mode_key_tree, mode_key_binding);
1.62      nicm      578:
                    579: /* Command to string mapping. */
                    580: struct mode_key_cmdstr {
1.192     nicm      581:        enum mode_key_cmd        cmd;
1.62      nicm      582:        const char              *name;
                    583: };
                    584:
                    585: /* Named mode key table description. */
1.509     nicm      586: struct mode_key_entry;
1.62      nicm      587: struct mode_key_table {
1.261     nicm      588:        const char                      *name;
                    589:        const struct mode_key_cmdstr    *cmdstr;
                    590:        struct mode_key_tree            *tree;
                    591:        const struct mode_key_entry     *table; /* default entries */
1.62      nicm      592: };
                    593:
1.1       nicm      594: /* Modes. */
                    595: #define MODE_CURSOR 0x1
                    596: #define MODE_INSERT 0x2
                    597: #define MODE_KCURSOR 0x4
1.185     nicm      598: #define MODE_KKEYPAD 0x8       /* set = application, clear = number */
1.255     nicm      599: #define MODE_WRAP 0x10         /* whether lines wrap */
                    600: #define MODE_MOUSE_STANDARD 0x20
1.266     nicm      601: #define MODE_MOUSE_BUTTON 0x40
1.485     nicm      602: #define MODE_BLINKING 0x80
1.586     nicm      603: #define MODE_MOUSE_UTF8 0x100
1.384     nicm      604: #define MODE_MOUSE_SGR 0x200
                    605: #define MODE_BRACKETPASTE 0x400
1.393     nicm      606: #define MODE_FOCUSON 0x800
1.255     nicm      607:
1.467     nicm      608: #define ALL_MOUSE_MODES (MODE_MOUSE_STANDARD|MODE_MOUSE_BUTTON)
1.1       nicm      609:
1.580     nicm      610: /*
                    611:  * A single UTF-8 character. UTF8_SIZE must be big enough to hold at least one
                    612:  * combining character as well.
                    613: */
                    614: #define UTF8_SIZE 9
1.143     nicm      615: struct utf8_data {
                    616:        u_char  data[UTF8_SIZE];
                    617:
1.576     nicm      618:        u_char  have;
                    619:        u_char  size;
1.143     nicm      620:
1.578     nicm      621:        u_char  width;  /* 0xff if invalid */
1.576     nicm      622: } __packed;
1.579     nicm      623: enum utf8_state {
                    624:        UTF8_MORE,
                    625:        UTF8_DONE,
                    626:        UTF8_ERROR
                    627: };
1.1       nicm      628:
                    629: /* Grid attributes. */
                    630: #define GRID_ATTR_BRIGHT 0x1
                    631: #define GRID_ATTR_DIM 0x2
                    632: #define GRID_ATTR_UNDERSCORE 0x4
                    633: #define GRID_ATTR_BLINK 0x8
                    634: #define GRID_ATTR_REVERSE 0x10
                    635: #define GRID_ATTR_HIDDEN 0x20
                    636: #define GRID_ATTR_ITALICS 0x40
                    637: #define GRID_ATTR_CHARSET 0x80 /* alternative character set */
                    638:
                    639: /* Grid flags. */
                    640: #define GRID_FLAG_FG256 0x1
                    641: #define GRID_FLAG_BG256 0x2
                    642: #define GRID_FLAG_PADDING 0x4
1.576     nicm      643: #define GRID_FLAG_EXTENDED 0x8
1.1       nicm      644:
1.72      nicm      645: /* Grid line flags. */
                    646: #define GRID_LINE_WRAPPED 0x1
                    647:
1.1       nicm      648: /* Grid cell data. */
                    649: struct grid_cell {
1.576     nicm      650:        u_char                  flags;
                    651:        u_char                  attr;
                    652:        u_char                  fg;
                    653:        u_char                  bg;
                    654:        struct utf8_data        data;
                    655:
                    656: };
                    657: struct grid_cell_entry {
                    658:        u_char                  flags;
                    659:        union {
                    660:                u_int           offset;
                    661:                struct {
                    662:                        u_char  attr;
                    663:                        u_char  fg;
                    664:                        u_char  bg;
                    665:                        u_char  data;
                    666:                } data;
                    667:        };
1.1       nicm      668: } __packed;
                    669:
1.71      nicm      670: /* Grid line. */
                    671: struct grid_line {
1.576     nicm      672:        u_int                    cellsize;
                    673:        struct grid_cell_entry  *celldata;
                    674:
                    675:        u_int                    extdsize;
                    676:        struct grid_cell        *extddata;
1.71      nicm      677:
1.576     nicm      678:        int                      flags;
1.71      nicm      679: } __packed;
                    680:
1.1       nicm      681: /* Entire grid of cells. */
                    682: struct grid {
1.576     nicm      683:        int                      flags;
                    684: #define GRID_HISTORY 0x1 /* scroll lines into history */
1.25      nicm      685:
1.576     nicm      686:        u_int                    sx;
                    687:        u_int                    sy;
1.1       nicm      688:
1.576     nicm      689:        u_int                    hsize;
                    690:        u_int                    hlimit;
1.1       nicm      691:
1.576     nicm      692:        struct grid_line        *linedata;
1.1       nicm      693: };
                    694:
1.595     nicm      695: /* Hook data structures. */
                    696: struct hook {
1.596     nicm      697:        const char      *name;
                    698:
                    699:        struct cmd_q    *cmdq;
                    700:        struct cmd_list *cmdlist;
                    701:
                    702:        RB_ENTRY(hook)   entry;
1.595     nicm      703: };
                    704:
1.1       nicm      705: /* Option data structures. */
                    706: struct options_entry {
1.599     nicm      707:        const char              *name;
1.1       nicm      708:
                    709:        enum {
                    710:                OPTIONS_STRING,
                    711:                OPTIONS_NUMBER,
1.435     nicm      712:                OPTIONS_STYLE
1.1       nicm      713:        } type;
1.109     nicm      714:
1.435     nicm      715:        char                    *str;
1.511     nicm      716:        long long                num;
1.435     nicm      717:        struct grid_cell         style;
1.1       nicm      718:
1.306     nicm      719:        RB_ENTRY(options_entry) entry;
1.1       nicm      720: };
                    721:
1.126     nicm      722: /* Scheduled job. */
                    723: struct job {
1.525     nicm      724:        enum {
                    725:                JOB_RUNNING,
                    726:                JOB_DEAD,
                    727:                JOB_CLOSED
                    728:        } state;
                    729:
1.126     nicm      730:        char            *cmd;
                    731:        pid_t            pid;
1.130     nicm      732:        int              status;
1.126     nicm      733:
                    734:        int              fd;
1.160     nicm      735:        struct bufferevent *event;
1.126     nicm      736:
                    737:        void            (*callbackfn)(struct job *);
                    738:        void            (*freefn)(void *);
                    739:        void            *data;
1.130     nicm      740:
1.270     nicm      741:        LIST_ENTRY(job)  lentry;
1.126     nicm      742: };
1.270     nicm      743: LIST_HEAD(joblist, job);
1.126     nicm      744:
1.1       nicm      745: /* Screen selection. */
                    746: struct screen_sel {
                    747:        int              flag;
1.204     nicm      748:        int              rectflag;
1.480     nicm      749:        enum {
                    750:                LINE_SEL_NONE,
                    751:                LINE_SEL_LEFT_RIGHT,
                    752:                LINE_SEL_RIGHT_LEFT,
                    753:        } lineflag;
                    754:
1.469     nicm      755:        int              modekeys;
1.1       nicm      756:
                    757:        u_int            sx;
                    758:        u_int            sy;
                    759:
                    760:        u_int            ex;
                    761:        u_int            ey;
                    762:
                    763:        struct grid_cell cell;
                    764: };
                    765:
                    766: /* Virtual screen. */
                    767: struct screen {
                    768:        char            *title;
                    769:
1.192     nicm      770:        struct grid     *grid;          /* grid data */
1.1       nicm      771:
                    772:        u_int            cx;            /* cursor x */
                    773:        u_int            cy;            /* cursor y */
                    774:
1.288     nicm      775:        u_int            cstyle;        /* cursor style */
1.287     nicm      776:        char            *ccolour;       /* cursor colour string */
                    777:
1.1       nicm      778:        u_int            rupper;        /* scroll region top */
                    779:        u_int            rlower;        /* scroll region bottom */
                    780:
                    781:        int              mode;
                    782:
1.192     nicm      783:        bitstr_t        *tabs;
1.6       nicm      784:
1.1       nicm      785:        struct screen_sel sel;
                    786: };
                    787:
                    788: /* Screen write context. */
                    789: struct screen_write_ctx {
                    790:        struct window_pane *wp;
                    791:        struct screen   *s;
                    792: };
                    793:
                    794: /* Screen size. */
                    795: #define screen_size_x(s) ((s)->grid->sx)
                    796: #define screen_size_y(s) ((s)->grid->sy)
                    797: #define screen_hsize(s) ((s)->grid->hsize)
                    798: #define screen_hlimit(s) ((s)->grid->hlimit)
                    799:
                    800: /*
                    801:  * Window mode. Windows can be in several modes and this is used to call the
                    802:  * right function to handle input and output.
                    803:  */
                    804: struct window_mode {
                    805:        struct screen *(*init)(struct window_pane *);
                    806:        void    (*free)(struct window_pane *);
                    807:        void    (*resize)(struct window_pane *, u_int, u_int);
1.492     nicm      808:        void    (*key)(struct window_pane *, struct client *, struct session *,
1.571     nicm      809:                    key_code, struct mouse_event *);
1.1       nicm      810: };
                    811:
1.343     nicm      812: /* Structures for choose mode. */
                    813: struct window_choose_data {
1.375     nicm      814:        struct client           *start_client;
                    815:        struct session          *start_session;
                    816:
1.343     nicm      817:        u_int                    idx;
1.359     nicm      818:        int                      type;
1.375     nicm      819: #define TREE_OTHER 0x0
1.359     nicm      820: #define TREE_WINDOW 0x1
                    821: #define TREE_SESSION 0x2
1.375     nicm      822:
                    823:        struct session          *tree_session; /* session of items in tree */
                    824:
                    825:        struct winlink          *wl;
1.355     nicm      826:        int                      pane_id;
1.375     nicm      827:
1.511     nicm      828:        char                    *ft_template;
1.375     nicm      829:        struct format_tree      *ft;
                    830:
                    831:        char                    *command;
1.343     nicm      832: };
                    833:
1.1       nicm      834: /* Child window structure. */
                    835: struct window_pane {
1.274     nicm      836:        u_int            id;
1.458     nicm      837:        u_int            active_point;
1.274     nicm      838:
1.1       nicm      839:        struct window   *window;
1.398     nicm      840:
1.39      nicm      841:        struct layout_cell *layout_cell;
1.398     nicm      842:        struct layout_cell *saved_layout_cell;
1.1       nicm      843:
                    844:        u_int            sx;
                    845:        u_int            sy;
                    846:
                    847:        u_int            xoff;
                    848:        u_int            yoff;
                    849:
                    850:        int              flags;
1.28      nicm      851: #define PANE_REDRAW 0x1
1.325     nicm      852: #define PANE_DROP 0x2
1.393     nicm      853: #define PANE_FOCUSED 0x4
1.394     nicm      854: #define PANE_RESIZE 0x8
1.413     nicm      855: #define PANE_FOCUSPUSH 0x10
1.468     nicm      856: #define PANE_INPUTOFF 0x20
1.532     nicm      857: #define PANE_CHANGED 0x40
1.1       nicm      858:
1.463     nicm      859:        int              argc;
                    860:        char           **argv;
1.93      nicm      861:        char            *shell;
1.569     nicm      862:        const char      *cwd;
1.1       nicm      863:
                    864:        pid_t            pid;
1.159     nicm      865:        char             tty[TTY_NAME_MAX];
1.484     nicm      866:        int              status;
1.159     nicm      867:
1.1       nicm      868:        int              fd;
1.163     nicm      869:        struct bufferevent *event;
1.514     nicm      870:        struct event     timer;
1.1       nicm      871:
1.507     nicm      872:        struct input_ctx *ictx;
1.1       nicm      873:
1.491     nicm      874:        struct grid_cell colgc;
                    875:
1.131     nicm      876:        int              pipe_fd;
1.162     nicm      877:        struct bufferevent *pipe_event;
1.131     nicm      878:        size_t           pipe_off;
                    879:
1.1       nicm      880:        struct screen   *screen;
                    881:        struct screen    base;
                    882:
1.25      nicm      883:        /* Saved in alternative screen mode. */
1.192     nicm      884:        u_int            saved_cx;
                    885:        u_int            saved_cy;
1.25      nicm      886:        struct grid     *saved_grid;
1.69      nicm      887:        struct grid_cell saved_cell;
1.25      nicm      888:
1.1       nicm      889:        const struct window_mode *mode;
                    890:        void            *modedata;
                    891:
                    892:        TAILQ_ENTRY(window_pane) entry;
1.274     nicm      893:        RB_ENTRY(window_pane) tree_entry;
1.1       nicm      894: };
                    895: TAILQ_HEAD(window_panes, window_pane);
1.274     nicm      896: RB_HEAD(window_pane_tree, window_pane);
1.1       nicm      897:
                    898: /* Window structure. */
                    899: struct window {
1.309     nicm      900:        u_int            id;
1.540     nicm      901:
1.1       nicm      902:        char            *name;
1.540     nicm      903:        struct event     name_event;
                    904:        struct timeval   name_time;
                    905:
1.541     nicm      906:        struct event     alerts_timer;
                    907:
1.524     nicm      908:        struct timeval   activity_time;
1.1       nicm      909:
                    910:        struct window_pane *active;
1.244     nicm      911:        struct window_pane *last;
1.1       nicm      912:        struct window_panes panes;
1.39      nicm      913:
1.61      nicm      914:        int              lastlayout;
1.39      nicm      915:        struct layout_cell *layout_root;
1.398     nicm      916:        struct layout_cell *saved_layout_root;
1.503     nicm      917:        char            *old_layout;
1.1       nicm      918:
                    919:        u_int            sx;
                    920:        u_int            sy;
                    921:
                    922:        int              flags;
                    923: #define WINDOW_BELL 0x1
1.247     nicm      924: #define WINDOW_ACTIVITY 0x2
                    925: #define WINDOW_REDRAW 0x4
1.248     nicm      926: #define WINDOW_SILENCE 0x8
1.481     nicm      927: #define WINDOW_ZOOMED 0x1000
                    928: #define WINDOW_FORCEWIDTH 0x2000
                    929: #define WINDOW_FORCEHEIGHT 0x4000
1.418     nicm      930: #define WINDOW_ALERTFLAGS (WINDOW_BELL|WINDOW_ACTIVITY|WINDOW_SILENCE)
1.1       nicm      931:
1.567     nicm      932:        struct options  *options;
1.1       nicm      933:
                    934:        u_int            references;
1.496     nicm      935:
                    936:        RB_ENTRY(window) entry;
1.1       nicm      937: };
1.496     nicm      938: RB_HEAD(windows, window);
1.1       nicm      939:
                    940: /* Entry on local window list. */
                    941: struct winlink {
                    942:        int              idx;
                    943:        struct window   *window;
1.184     nicm      944:
                    945:        size_t           status_width;
                    946:        struct grid_cell status_cell;
                    947:        char            *status_text;
1.1       nicm      948:
1.511     nicm      949:        int              flags;
1.226     nicm      950: #define WINLINK_BELL 0x1
                    951: #define WINLINK_ACTIVITY 0x2
1.451     nicm      952: #define WINLINK_SILENCE 0x4
                    953: #define WINLINK_ALERTFLAGS (WINLINK_BELL|WINLINK_ACTIVITY|WINLINK_SILENCE)
1.226     nicm      954:
1.1       nicm      955:        RB_ENTRY(winlink) entry;
1.124     nicm      956:        TAILQ_ENTRY(winlink) sentry;
1.1       nicm      957: };
                    958: RB_HEAD(winlinks, winlink);
1.124     nicm      959: TAILQ_HEAD(winlink_stack, winlink);
1.1       nicm      960:
1.39      nicm      961: /* Layout direction. */
                    962: enum layout_type {
                    963:        LAYOUT_LEFTRIGHT,
                    964:        LAYOUT_TOPBOTTOM,
                    965:        LAYOUT_WINDOWPANE
                    966: };
                    967:
                    968: /* Layout cells queue. */
                    969: TAILQ_HEAD(layout_cells, layout_cell);
                    970:
                    971: /* Layout cell. */
                    972: struct layout_cell {
                    973:        enum layout_type type;
                    974:
                    975:        struct layout_cell *parent;
                    976:
                    977:        u_int            sx;
                    978:        u_int            sy;
                    979:
                    980:        u_int            xoff;
                    981:        u_int            yoff;
                    982:
                    983:        struct window_pane *wp;
                    984:        struct layout_cells cells;
                    985:
                    986:        TAILQ_ENTRY(layout_cell) entry;
                    987: };
                    988:
1.73      nicm      989: /* Environment variable. */
                    990: struct environ_entry {
                    991:        char            *name;
                    992:        char            *value;
                    993:
                    994:        RB_ENTRY(environ_entry) entry;
                    995: };
                    996:
1.1       nicm      997: /* Client session. */
1.124     nicm      998: struct session_group {
                    999:        TAILQ_HEAD(, session) sessions;
                   1000:
                   1001:        TAILQ_ENTRY(session_group) entry;
                   1002: };
                   1003: TAILQ_HEAD(session_groups, session_group);
                   1004:
1.1       nicm     1005: struct session {
1.402     nicm     1006:        u_int            id;
1.254     nicm     1007:
1.1       nicm     1008:        char            *name;
1.569     nicm     1009:        const char      *cwd;
1.156     nicm     1010:
                   1011:        struct timeval   creation_time;
1.555     nicm     1012:        struct timeval   last_attached_time;
1.156     nicm     1013:        struct timeval   activity_time;
1.370     nicm     1014:        struct timeval   last_activity_time;
1.537     nicm     1015:
                   1016:        struct event     lock_timer;
1.1       nicm     1017:
                   1018:        u_int            sx;
                   1019:        u_int            sy;
                   1020:
                   1021:        struct winlink  *curw;
                   1022:        struct winlink_stack lastw;
                   1023:        struct winlinks  windows;
                   1024:
1.595     nicm     1025:        struct hooks    *hooks;
1.567     nicm     1026:        struct options  *options;
1.1       nicm     1027:
                   1028: #define SESSION_UNATTACHED 0x1 /* not attached to any clients */
1.583     nicm     1029: #define SESSION_PASTING 0x2
1.1       nicm     1030:        int              flags;
1.440     nicm     1031:
1.511     nicm     1032:        u_int            attached;
1.73      nicm     1033:
1.105     nicm     1034:        struct termios  *tio;
1.80      nicm     1035:
1.568     nicm     1036:        struct environ  *environ;
1.101     nicm     1037:
                   1038:        int              references;
1.124     nicm     1039:
                   1040:        TAILQ_ENTRY(session) gentry;
1.254     nicm     1041:        RB_ENTRY(session)    entry;
1.1       nicm     1042: };
1.254     nicm     1043: RB_HEAD(sessions, session);
1.1       nicm     1044:
1.443     nicm     1045: /* Mouse button masks. */
                   1046: #define MOUSE_MASK_BUTTONS 3
                   1047: #define MOUSE_MASK_SHIFT 4
                   1048: #define MOUSE_MASK_META 8
                   1049: #define MOUSE_MASK_CTRL 16
                   1050: #define MOUSE_MASK_DRAG 32
                   1051: #define MOUSE_MASK_WHEEL 64
                   1052:
1.360     nicm     1053: /* Mouse wheel states. */
                   1054: #define MOUSE_WHEEL_UP 0
1.492     nicm     1055: #define MOUSE_WHEEL_DOWN 64
1.459     nicm     1056:
1.492     nicm     1057: /* Mouse helpers. */
                   1058: #define MOUSE_BUTTONS(b) ((b) & MOUSE_MASK_BUTTONS)
                   1059: #define MOUSE_WHEEL(b) ((b) & MOUSE_MASK_WHEEL)
                   1060: #define MOUSE_DRAG(b) ((b) & MOUSE_MASK_DRAG)
                   1061: #define MOUSE_RELEASE(b) (((b) & MOUSE_MASK_BUTTONS) == 3)
1.360     nicm     1062:
1.492     nicm     1063: /* Mouse input. */
                   1064: struct mouse_event {
1.571     nicm     1065:        int             valid;
1.360     nicm     1066:
1.571     nicm     1067:        key_code        key;
                   1068:        int             statusat;
1.360     nicm     1069:
1.571     nicm     1070:        u_int           x;
                   1071:        u_int           y;
                   1072:        u_int           b;
1.360     nicm     1073:
1.571     nicm     1074:        u_int           lx;
                   1075:        u_int           ly;
                   1076:        u_int           lb;
1.360     nicm     1077:
1.571     nicm     1078:        int             s;
                   1079:        int             w;
                   1080:        int             wp;
1.384     nicm     1081:
1.571     nicm     1082:        u_int           sgr_type;
                   1083:        u_int           sgr_b;
1.360     nicm     1084: };
                   1085:
1.511     nicm     1086: /* TTY information. */
                   1087: struct tty_key {
                   1088:        char             ch;
1.571     nicm     1089:        key_code         key;
1.511     nicm     1090:
                   1091:        struct tty_key  *left;
                   1092:        struct tty_key  *right;
                   1093:
                   1094:        struct tty_key  *next;
                   1095: };
                   1096:
1.530     nicm     1097: struct tty_code;
1.511     nicm     1098: struct tty_term {
                   1099:        char            *name;
                   1100:        u_int            references;
                   1101:
                   1102:        char             acs[UCHAR_MAX + 1][2];
                   1103:
1.530     nicm     1104:        struct tty_code *codes;
1.511     nicm     1105:
                   1106: #define TERM_256COLOURS 0x1
                   1107: #define TERM_EARLYWRAP 0x2
                   1108:        int              flags;
                   1109:
                   1110:        LIST_ENTRY(tty_term) entry;
                   1111: };
                   1112: LIST_HEAD(tty_terms, tty_term);
                   1113:
1.1       nicm     1114: struct tty {
1.337     nicm     1115:        struct client   *client;
1.1       nicm     1116:        char            *path;
                   1117:
1.192     nicm     1118:        u_int            sx;
                   1119:        u_int            sy;
1.1       nicm     1120:
                   1121:        u_int            cx;
                   1122:        u_int            cy;
1.288     nicm     1123:        u_int            cstyle;
1.287     nicm     1124:        char            *ccolour;
1.1       nicm     1125:
                   1126:        int              mode;
                   1127:
                   1128:        u_int            rlower;
                   1129:        u_int            rupper;
                   1130:
                   1131:        char            *termname;
                   1132:        struct tty_term *term;
                   1133:
                   1134:        int              fd;
1.161     nicm     1135:        struct bufferevent *event;
1.1       nicm     1136:
1.192     nicm     1137:        struct termios   tio;
1.1       nicm     1138:
                   1139:        struct grid_cell cell;
                   1140:
                   1141: #define TTY_NOCURSOR 0x1
                   1142: #define TTY_FREEZE 0x2
1.382     nicm     1143: #define TTY_TIMER 0x4
1.1       nicm     1144: #define TTY_UTF8 0x8
1.76      nicm     1145: #define TTY_STARTED 0x10
1.77      nicm     1146: #define TTY_OPENED 0x20
1.414     nicm     1147: #define TTY_FOCUS 0x40
1.192     nicm     1148:        int              flags;
1.1       nicm     1149:
                   1150:        int              term_flags;
                   1151:
1.337     nicm     1152:        struct mouse_event mouse;
1.492     nicm     1153:        int              mouse_drag_flag;
                   1154:        void            (*mouse_drag_update)(struct client *,
                   1155:                            struct mouse_event *);
                   1156:        void            (*mouse_drag_release)(struct client *,
1.511     nicm     1157:                            struct mouse_event *);
1.337     nicm     1158:
1.170     nicm     1159:        struct event     key_timer;
1.173     nicm     1160:        struct tty_key  *key_tree;
1.1       nicm     1161: };
                   1162:
1.583     nicm     1163: /* TTY command context. */
1.47      nicm     1164: struct tty_ctx {
                   1165:        struct window_pane *wp;
                   1166:
                   1167:        const struct grid_cell *cell;
                   1168:
1.49      nicm     1169:        u_int            num;
1.196     nicm     1170:        void            *ptr;
1.49      nicm     1171:
1.196     nicm     1172:        /*
1.49      nicm     1173:         * Cursor and region position before the screen was updated - this is
                   1174:         * where the command should be applied; the values in the screen have
                   1175:         * already been updated.
                   1176:         */
                   1177:        u_int            ocx;
                   1178:        u_int            ocy;
                   1179:
                   1180:        u_int            orupper;
                   1181:        u_int            orlower;
1.140     nicm     1182:
1.308     nicm     1183:        u_int            xoff;
                   1184:        u_int            yoff;
                   1185:
1.140     nicm     1186:        /* Saved last cell on line. */
                   1187:        struct grid_cell last_cell;
                   1188:        u_int            last_width;
1.47      nicm     1189: };
                   1190:
1.180     nicm     1191: /* Saved message entry. */
                   1192: struct message_entry {
1.509     nicm     1193:        char    *msg;
                   1194:        u_int    msg_num;
                   1195:        time_t   msg_time;
1.501     nicm     1196:        TAILQ_ENTRY(message_entry) entry;
1.180     nicm     1197: };
                   1198:
1.1       nicm     1199: /* Client connection. */
                   1200: struct client {
1.566     nicm     1201:        struct tmuxpeer *peer;
1.425     nicm     1202:
1.523     nicm     1203:        pid_t            pid;
1.428     nicm     1204:        int              fd;
1.159     nicm     1205:        struct event     event;
1.425     nicm     1206:        int              retval;
1.156     nicm     1207:
                   1208:        struct timeval   creation_time;
1.158     nicm     1209:        struct timeval   activity_time;
1.1       nicm     1210:
1.568     nicm     1211:        struct environ  *environ;
1.73      nicm     1212:
1.1       nicm     1213:        char            *title;
1.569     nicm     1214:        const char      *cwd;
1.1       nicm     1215:
1.428     nicm     1216:        char            *term;
                   1217:        char            *ttyname;
1.192     nicm     1218:        struct tty       tty;
1.236     nicm     1219:
1.332     nicm     1220:        void            (*stdin_callback)(struct client *, int, void *);
                   1221:        void            *stdin_callback_data;
                   1222:        struct evbuffer *stdin_data;
1.511     nicm     1223:        int              stdin_closed;
1.332     nicm     1224:        struct evbuffer *stdout_data;
                   1225:        struct evbuffer *stderr_data;
1.231     nicm     1226:
1.169     nicm     1227:        struct event     repeat_timer;
1.1       nicm     1228:
1.534     nicm     1229:        struct event     status_timer;
1.1       nicm     1230:        struct screen    status;
                   1231:
                   1232: #define CLIENT_TERMINAL 0x1
1.547     nicm     1233: #define CLIENT_LOGIN 0x2
1.236     nicm     1234: #define CLIENT_EXIT 0x4
1.1       nicm     1235: #define CLIENT_REDRAW 0x8
                   1236: #define CLIENT_STATUS 0x10
1.427     nicm     1237: #define CLIENT_REPEAT 0x20
1.1       nicm     1238: #define CLIENT_SUSPENDED 0x40
1.566     nicm     1239: /* 0x80 unused */
1.92      nicm     1240: #define CLIENT_IDENTIFY 0x100
1.101     nicm     1241: #define CLIENT_DEAD 0x200
1.197     nicm     1242: #define CLIENT_BORDERS 0x400
1.205     nicm     1243: #define CLIENT_READONLY 0x800
1.307     nicm     1244: #define CLIENT_REDRAWWINDOW 0x1000
1.342     nicm     1245: #define CLIENT_CONTROL 0x2000
1.424     nicm     1246: #define CLIENT_CONTROLCONTROL 0x4000
                   1247: #define CLIENT_FOCUSED 0x8000
                   1248: #define CLIENT_UTF8 0x10000
                   1249: #define CLIENT_256COLOURS 0x20000
                   1250: #define CLIENT_IDENTIFIED 0x40000
1.558     nicm     1251: #define CLIENT_STATUSFORCE 0x80000
1.1       nicm     1252:        int              flags;
1.493     nicm     1253:        struct key_table *keytable;
1.1       nicm     1254:
1.166     nicm     1255:        struct event     identify_timer;
1.92      nicm     1256:
1.1       nicm     1257:        char            *message_string;
1.166     nicm     1258:        struct event     message_timer;
1.501     nicm     1259:        u_int            message_next;
                   1260:        TAILQ_HEAD(, message_entry) message_log;
1.1       nicm     1261:
                   1262:        char            *prompt_string;
                   1263:        char            *prompt_buffer;
                   1264:        size_t           prompt_index;
1.33      nicm     1265:        int              (*prompt_callbackfn)(void *, const char *);
                   1266:        void             (*prompt_freefn)(void *);
1.1       nicm     1267:        void            *prompt_data;
1.511     nicm     1268:        u_int            prompt_hindex;
1.1       nicm     1269:
1.117     nicm     1270: #define PROMPT_SINGLE 0x1
1.1       nicm     1271:        int              prompt_flags;
                   1272:
                   1273:        struct mode_key_data prompt_mdata;
                   1274:
                   1275:        struct session  *session;
1.252     nicm     1276:        struct session  *last_session;
1.101     nicm     1277:
1.316     nicm     1278:        int              wlmouse;
1.284     nicm     1279:
1.397     nicm     1280:        struct cmd_q    *cmdq;
1.101     nicm     1281:        int              references;
1.499     nicm     1282:
                   1283:        TAILQ_ENTRY(client) entry;
1.1       nicm     1284: };
1.499     nicm     1285: TAILQ_HEAD(clients, client);
1.1       nicm     1286:
1.410     nicm     1287: /* Parsed arguments structures. */
1.544     nicm     1288: struct args_entry;
1.410     nicm     1289: RB_HEAD(args_tree, args_entry);
1.264     nicm     1290: struct args {
1.410     nicm     1291:        struct args_tree          tree;
1.511     nicm     1292:        int                       argc;
                   1293:        char                    **argv;
1.264     nicm     1294: };
                   1295:
1.606     nicm     1296: /* Command find structures. */
                   1297: enum cmd_find_type {
                   1298:        CMD_FIND_PANE,
                   1299:        CMD_FIND_WINDOW,
                   1300:        CMD_FIND_SESSION,
                   1301: };
                   1302: struct cmd_find_state {
                   1303:        struct cmd_q            *cmdq;
                   1304:        int                      flags;
                   1305:        struct cmd_find_state   *current;
                   1306:
                   1307:        struct session          *s;
                   1308:        struct winlink          *wl;
                   1309:        struct window           *w;
                   1310:        struct window_pane      *wp;
1.603     nicm     1311:        int                      idx;
1.606     nicm     1312: };
                   1313:
                   1314: /* Command find flags. */
                   1315: #define CMD_FIND_PREFER_UNATTACHED 0x1
                   1316: #define CMD_FIND_QUIET 0x2
                   1317: #define CMD_FIND_WINDOW_INDEX 0x4
                   1318: #define CMD_FIND_DEFAULT_MARKED 0x8
                   1319: #define CMD_FIND_EXACT_SESSION 0x10
                   1320: #define CMD_FIND_EXACT_WINDOW 0x20
1.603     nicm     1321:
1.606     nicm     1322: /* Context for command being executed. */
1.603     nicm     1323: struct cmd_state {
                   1324:        struct client           *c;
1.606     nicm     1325:        struct cmd_find_state    tflag;
                   1326:        struct cmd_find_state    sflag;
1.603     nicm     1327: };
                   1328:
1.397     nicm     1329: /* Command and list of commands. */
1.1       nicm     1330: struct cmd {
1.264     nicm     1331:        const struct cmd_entry  *entry;
                   1332:        struct args             *args;
1.1       nicm     1333:
1.397     nicm     1334:        char                    *file;
                   1335:        u_int                    line;
1.412     nicm     1336:
                   1337: #define CMD_CONTROL 0x1
                   1338:        int                      flags;
1.397     nicm     1339:
1.264     nicm     1340:        TAILQ_ENTRY(cmd)         qentry;
1.1       nicm     1341: };
1.509     nicm     1342:
1.229     nicm     1343: struct cmd_list {
1.511     nicm     1344:        int                      references;
                   1345:        TAILQ_HEAD(, cmd)        list;
1.229     nicm     1346: };
1.1       nicm     1347:
1.397     nicm     1348: /* Command return values. */
1.348     nicm     1349: enum cmd_retval {
                   1350:        CMD_RETURN_ERROR = -1,
                   1351:        CMD_RETURN_NORMAL = 0,
1.397     nicm     1352:        CMD_RETURN_WAIT,
                   1353:        CMD_RETURN_STOP
                   1354: };
                   1355:
                   1356: /* Command queue entry. */
                   1357: struct cmd_q_item {
                   1358:        struct cmd_list         *cmdlist;
1.492     nicm     1359:
                   1360:        struct mouse_event       mouse;
                   1361:
1.397     nicm     1362:        TAILQ_ENTRY(cmd_q_item)  qentry;
                   1363: };
                   1364: TAILQ_HEAD(cmd_q_items, cmd_q_item);
                   1365:
                   1366: /* Command queue. */
                   1367: struct cmd_q {
                   1368:        int                      references;
1.561     nicm     1369:        int                      flags;
                   1370: #define CMD_Q_DEAD 0x1
1.397     nicm     1371:
                   1372:        struct client           *client;
                   1373:        int                      client_exit;
                   1374:
                   1375:        struct cmd_q_items       queue;
                   1376:        struct cmd_q_item       *item;
                   1377:        struct cmd              *cmd;
                   1378:
1.603     nicm     1379:        struct cmd_state         state;
                   1380:
1.403     nicm     1381:        time_t                   time;
                   1382:        u_int                    number;
                   1383:
1.397     nicm     1384:        void                     (*emptyfn)(struct cmd_q *);
                   1385:        void                    *data;
                   1386:
1.511     nicm     1387:        TAILQ_ENTRY(cmd_q)       waitentry;
1.348     nicm     1388: };
                   1389:
1.609     nicm     1390: /* Command -c, -t or -s flags. */
                   1391: enum cmd_entry_flag {
                   1392:        CMD_NONE,
                   1393:
                   1394:        CMD_CLIENT,
                   1395:        CMD_CLIENT_CANFAIL,
                   1396:
                   1397:        CMD_SESSION,
                   1398:        CMD_SESSION_CANFAIL,
                   1399:        CMD_SESSION_PREFERUNATTACHED,
                   1400:        CMD_SESSION_WITHPANE,
                   1401:
                   1402:        CMD_WINDOW,
                   1403:        CMD_WINDOW_CANFAIL,
                   1404:        CMD_WINDOW_MARKED,
                   1405:        CMD_WINDOW_INDEX,
                   1406:
                   1407:        CMD_PANE,
                   1408:        CMD_PANE_CANFAIL,
                   1409:        CMD_PANE_MARKED,
                   1410:
                   1411:        CMD_MOVEW_R,
                   1412: };
                   1413:
1.397     nicm     1414: /* Command definition. */
1.1       nicm     1415: struct cmd_entry {
1.608     nicm     1416:        const char              *name;
                   1417:        const char              *alias;
1.264     nicm     1418:
1.608     nicm     1419:        struct {
                   1420:                const char      *template;
                   1421:                int              lower;
                   1422:                int              upper;
                   1423:        } args;
1.609     nicm     1424:        const char              *usage;
1.264     nicm     1425:
1.609     nicm     1426:        enum cmd_entry_flag      tflag;
                   1427:        enum cmd_entry_flag      sflag;
                   1428:        enum cmd_entry_flag      cflag;
1.1       nicm     1429:
                   1430: #define CMD_STARTSERVER 0x1
1.517     nicm     1431: #define CMD_READONLY 0x2
1.609     nicm     1432:        int              flags;
1.1       nicm     1433:
1.608     nicm     1434:        enum cmd_retval          (*exec)(struct cmd *, struct cmd_q *);
1.1       nicm     1435: };
1.604     nicm     1436:
1.493     nicm     1437: /* Key binding and key table. */
1.1       nicm     1438: struct key_binding {
1.571     nicm     1439:        key_code                 key;
1.493     nicm     1440:        struct cmd_list         *cmdlist;
                   1441:        int                      can_repeat;
1.1       nicm     1442:
1.493     nicm     1443:        RB_ENTRY(key_binding)    entry;
1.1       nicm     1444: };
1.306     nicm     1445: RB_HEAD(key_bindings, key_binding);
1.509     nicm     1446:
1.493     nicm     1447: struct key_table {
                   1448:        const char               *name;
                   1449:        struct key_bindings      key_bindings;
                   1450:
                   1451:        u_int                    references;
                   1452:
                   1453:        RB_ENTRY(key_table)      entry;
                   1454: };
                   1455: RB_HEAD(key_tables, key_table);
1.1       nicm     1456:
1.262     nicm     1457: /*
                   1458:  * Option table entries. The option table is the user-visible part of the
                   1459:  * option, as opposed to the internal options (struct option) which are just
                   1460:  * number or string.
                   1461:  */
                   1462: enum options_table_type {
                   1463:        OPTIONS_TABLE_STRING,
                   1464:        OPTIONS_TABLE_NUMBER,
1.305     nicm     1465:        OPTIONS_TABLE_KEY,
1.262     nicm     1466:        OPTIONS_TABLE_COLOUR,
                   1467:        OPTIONS_TABLE_ATTRIBUTES,
                   1468:        OPTIONS_TABLE_FLAG,
1.435     nicm     1469:        OPTIONS_TABLE_CHOICE,
                   1470:        OPTIONS_TABLE_STYLE
1.262     nicm     1471: };
1.584     nicm     1472: enum options_table_scope {
1.587     nicm     1473:        OPTIONS_TABLE_NONE,
1.584     nicm     1474:        OPTIONS_TABLE_SERVER,
                   1475:        OPTIONS_TABLE_SESSION,
                   1476:        OPTIONS_TABLE_WINDOW,
                   1477: };
1.262     nicm     1478:
                   1479: struct options_table_entry {
1.584     nicm     1480:        const char               *name;
                   1481:        enum options_table_type   type;
                   1482:        enum options_table_scope  scope;
1.1       nicm     1483:
1.584     nicm     1484:        u_int                     minimum;
                   1485:        u_int                     maximum;
                   1486:        const char              **choices;
1.1       nicm     1487:
1.584     nicm     1488:        const char               *default_str;
                   1489:        long long                 default_num;
1.435     nicm     1490:
1.584     nicm     1491:        const char               *style;
1.1       nicm     1492: };
                   1493:
1.264     nicm     1494: /* Common command usages. */
                   1495: #define CMD_TARGET_PANE_USAGE "[-t target-pane]"
                   1496: #define CMD_TARGET_WINDOW_USAGE "[-t target-window]"
                   1497: #define CMD_TARGET_SESSION_USAGE "[-t target-session]"
                   1498: #define CMD_TARGET_CLIENT_USAGE "[-t target-client]"
                   1499: #define CMD_SRCDST_PANE_USAGE "[-s src-pane] [-t dst-pane]"
                   1500: #define CMD_SRCDST_WINDOW_USAGE "[-s src-window] [-t dst-window]"
                   1501: #define CMD_SRCDST_SESSION_USAGE "[-s src-session] [-t dst-session]"
                   1502: #define CMD_SRCDST_CLIENT_USAGE "[-s src-client] [-t dst-client]"
1.461     nicm     1503: #define CMD_BUFFER_USAGE "[-b buffer-name]"
1.264     nicm     1504:
1.1       nicm     1505: /* tmux.c */
1.595     nicm     1506: extern struct hooks    *global_hooks;
                   1507: extern struct options  *global_options;
                   1508: extern struct options  *global_s_options;
                   1509: extern struct options  *global_w_options;
                   1510: extern struct environ  *global_environ;
1.589     nicm     1511: extern struct timeval   start_time;
1.590     nicm     1512: extern const char      *socket_path;
1.93      nicm     1513: const char     *getshell(void);
                   1514: int             checkshell(const char *);
                   1515: int             areshell(const char *);
1.265     nicm     1516: void            setblocking(int, int);
1.529     nicm     1517: const char     *find_home(void);
1.1       nicm     1518:
1.566     nicm     1519: /* proc.c */
                   1520: struct imsg;
                   1521: int    proc_send(struct tmuxpeer *, enum msgtype, int, const void *, size_t);
                   1522: int    proc_send_s(struct tmuxpeer *, enum msgtype, const char *);
                   1523: struct tmuxproc *proc_start(const char *, struct event_base *, int,
                   1524:            void (*)(int));
                   1525: void   proc_loop(struct tmuxproc *, int (*)(void));
                   1526: void   proc_exit(struct tmuxproc *);
                   1527: struct tmuxpeer *proc_add_peer(struct tmuxproc *, int,
                   1528:            void (*)(struct imsg *, void *), void *);
                   1529: void   proc_remove_peer(struct tmuxpeer *);
                   1530: void   proc_kill_peer(struct tmuxpeer *);
                   1531:
1.1       nicm     1532: /* cfg.c */
1.397     nicm     1533: extern int cfg_finished;
                   1534: extern int cfg_references;
1.431     nicm     1535: extern struct client *cfg_client;
1.550     nicm     1536: void            start_cfg(void);
1.397     nicm     1537: int             load_cfg(const char *, struct cmd_q *, char **);
1.551     nicm     1538: void            set_cfg_file(const char *);
1.479     nicm     1539: void            cfg_add_cause(const char *, ...);
                   1540: void            cfg_print_causes(struct cmd_q *);
1.397     nicm     1541: void            cfg_show_causes(struct session *);
1.294     nicm     1542:
1.542     nicm     1543: /* paste.c */
                   1544: struct paste_buffer;
                   1545: const char     *paste_buffer_name(struct paste_buffer *);
                   1546: const char     *paste_buffer_data(struct paste_buffer *, size_t *);
                   1547: struct paste_buffer *paste_walk(struct paste_buffer *);
                   1548: struct paste_buffer *paste_get_top(const char **);
                   1549: struct paste_buffer *paste_get_name(const char *);
1.556     nicm     1550: void            paste_free(struct paste_buffer *);
1.542     nicm     1551: void            paste_add(char *, size_t);
                   1552: int             paste_rename(const char *, const char *, char **);
                   1553: int             paste_set(char *, size_t, const char *, char **);
1.572     nicm     1554: char           *paste_make_sample(struct paste_buffer *);
1.542     nicm     1555:
1.294     nicm     1556: /* format.c */
1.558     nicm     1557: #define FORMAT_STATUS 0x1
                   1558: #define FORMAT_FORCE 0x2
1.483     nicm     1559: struct format_tree;
1.598     nicm     1560: struct format_tree *format_create(struct cmd_q *, int);
1.294     nicm     1561: void            format_free(struct format_tree *);
1.476     nicm     1562: void printflike(3, 4) format_add(struct format_tree *, const char *,
                   1563:                     const char *, ...);
1.489     nicm     1564: char           *format_expand_time(struct format_tree *, const char *, time_t);
1.294     nicm     1565: char           *format_expand(struct format_tree *, const char *);
1.488     nicm     1566: void            format_defaults(struct format_tree *, struct client *,
                   1567:                     struct session *, struct winlink *, struct window_pane *);
                   1568: void            format_defaults_window(struct format_tree *, struct window *);
                   1569: void            format_defaults_pane(struct format_tree *,
1.417     nicm     1570:                     struct window_pane *);
1.488     nicm     1571: void            format_defaults_paste_buffer(struct format_tree *,
1.572     nicm     1572:                     struct paste_buffer *);
1.1       nicm     1573:
1.595     nicm     1574: /* hooks.c */
                   1575: struct hook;
                   1576: struct hooks   *hooks_create(struct hooks *);
                   1577: void            hooks_free(struct hooks *);
                   1578: struct hook    *hooks_first(struct hooks *);
                   1579: struct hook    *hooks_next(struct hook *);
                   1580: void            hooks_add(struct hooks *, const char *, struct cmd_list *);
                   1581: void            hooks_copy(struct hooks *, struct hooks *);
1.599     nicm     1582: void            hooks_remove(struct hooks *, const char *);
1.595     nicm     1583: struct hook    *hooks_find(struct hooks *, const char *);
                   1584: void            hooks_run(struct hooks *, const char *, struct client *);
                   1585:
1.1       nicm     1586: /* mode-key.c */
1.62      nicm     1587: extern const struct mode_key_table mode_key_tables[];
                   1588: extern struct mode_key_tree mode_key_tree_vi_edit;
                   1589: extern struct mode_key_tree mode_key_tree_vi_choice;
                   1590: extern struct mode_key_tree mode_key_tree_vi_copy;
                   1591: extern struct mode_key_tree mode_key_tree_emacs_edit;
                   1592: extern struct mode_key_tree mode_key_tree_emacs_choice;
                   1593: extern struct mode_key_tree mode_key_tree_emacs_copy;
                   1594: int    mode_key_cmp(struct mode_key_binding *, struct mode_key_binding *);
1.306     nicm     1595: RB_PROTOTYPE(mode_key_tree, mode_key_binding, entry, mode_key_cmp);
1.261     nicm     1596: const char *mode_key_tostring(const struct mode_key_cmdstr *,
                   1597:            enum mode_key_cmd);
                   1598: enum mode_key_cmd mode_key_fromstring(const struct mode_key_cmdstr *,
                   1599:            const char *);
1.63      nicm     1600: const struct mode_key_table *mode_key_findtable(const char *);
1.62      nicm     1601: void   mode_key_init_trees(void);
                   1602: void   mode_key_init(struct mode_key_data *, struct mode_key_tree *);
1.571     nicm     1603: enum mode_key_cmd mode_key_lookup(struct mode_key_data *, key_code,
                   1604:            const char **);
1.323     nicm     1605:
                   1606: /* notify.c */
1.349     nicm     1607: void   notify_enable(void);
                   1608: void   notify_disable(void);
1.358     nicm     1609: void   notify_input(struct window_pane *, struct evbuffer *);
1.323     nicm     1610: void   notify_window_layout_changed(struct window *);
                   1611: void   notify_window_unlinked(struct session *, struct window *);
                   1612: void   notify_window_linked(struct session *, struct window *);
                   1613: void   notify_window_renamed(struct window *);
                   1614: void   notify_attached_session_changed(struct client *);
                   1615: void   notify_session_renamed(struct session *);
                   1616: void   notify_session_created(struct session *);
                   1617: void   notify_session_closed(struct session *);
1.1       nicm     1618:
                   1619: /* options.c */
1.567     nicm     1620: struct options *options_create(struct options *);
1.1       nicm     1621: void   options_free(struct options *);
1.567     nicm     1622: struct options_entry *options_first(struct options *);
                   1623: struct options_entry *options_next(struct options_entry *);
1.1       nicm     1624: struct options_entry *options_find1(struct options *, const char *);
                   1625: struct options_entry *options_find(struct options *, const char *);
1.44      nicm     1626: void   options_remove(struct options *, const char *);
1.476     nicm     1627: struct options_entry *printflike(3, 4) options_set_string(struct options *,
1.435     nicm     1628:            const char *, const char *, ...);
1.1       nicm     1629: char   *options_get_string(struct options *, const char *);
1.435     nicm     1630: struct options_entry *options_set_number(struct options *, const char *,
                   1631:            long long);
1.1       nicm     1632: long long options_get_number(struct options *, const char *);
1.435     nicm     1633: struct options_entry *options_set_style(struct options *, const char *,
                   1634:            const char *, int);
                   1635: struct grid_cell *options_get_style(struct options *, const char *);
1.1       nicm     1636:
1.262     nicm     1637: /* options-table.c */
1.584     nicm     1638: extern const struct options_table_entry options_table[];
                   1639: void   options_table_populate_tree(enum options_table_scope, struct options *);
1.379     nicm     1640: const char *options_table_print_entry(const struct options_table_entry *,
                   1641:            struct options_entry *, int);
1.584     nicm     1642: int    options_table_find(const char *, const struct options_table_entry **);
1.262     nicm     1643:
1.126     nicm     1644: /* job.c */
1.128     nicm     1645: extern struct joblist all_jobs;
1.569     nicm     1646: struct job *job_run(const char *, struct session *, const char *,
1.405     nicm     1647:            void (*)(struct job *), void (*)(void *), void *);
1.126     nicm     1648: void   job_free(struct job *);
1.160     nicm     1649: void   job_died(struct job *, int);
1.126     nicm     1650:
1.73      nicm     1651: /* environ.c */
1.568     nicm     1652: struct environ *environ_create(void);
1.73      nicm     1653: void   environ_free(struct environ *);
1.568     nicm     1654: struct environ_entry *environ_first(struct environ *);
                   1655: struct environ_entry *environ_next(struct environ_entry *);
1.73      nicm     1656: void   environ_copy(struct environ *, struct environ *);
                   1657: struct environ_entry *environ_find(struct environ *, const char *);
1.592     nicm     1658: void printflike(3, 4) environ_set(struct environ *, const char *, const char *,
                   1659:            ...);
                   1660: void   environ_clear(struct environ *, const char *);
1.73      nicm     1661: void   environ_put(struct environ *, const char *);
                   1662: void   environ_unset(struct environ *, const char *);
1.192     nicm     1663: void   environ_update(const char *, struct environ *, struct environ *);
1.215     nicm     1664: void   environ_push(struct environ *);
1.73      nicm     1665:
1.1       nicm     1666: /* tty.c */
1.570     nicm     1667: void   tty_create_log(void);
1.322     nicm     1668: void   tty_init_termios(int, struct termios *, struct bufferevent *);
1.115     nicm     1669: void   tty_raw(struct tty *, const char *);
1.491     nicm     1670: void   tty_attributes(struct tty *, const struct grid_cell *,
                   1671:            const struct window_pane *);
1.47      nicm     1672: void   tty_reset(struct tty *);
1.132     nicm     1673: void   tty_region_pane(struct tty *, const struct tty_ctx *, u_int, u_int);
1.133     nicm     1674: void   tty_region(struct tty *, u_int, u_int);
1.134     nicm     1675: void   tty_cursor_pane(struct tty *, const struct tty_ctx *, u_int, u_int);
                   1676: void   tty_cursor(struct tty *, u_int, u_int);
1.47      nicm     1677: void   tty_putcode(struct tty *, enum tty_code_code);
                   1678: void   tty_putcode1(struct tty *, enum tty_code_code, int);
                   1679: void   tty_putcode2(struct tty *, enum tty_code_code, int, int);
1.287     nicm     1680: void   tty_putcode_ptr1(struct tty *, enum tty_code_code, const void *);
1.373     nicm     1681: void   tty_putcode_ptr2(struct tty *, enum tty_code_code, const void *,
                   1682:            const void *);
1.47      nicm     1683: void   tty_puts(struct tty *, const char *);
                   1684: void   tty_putc(struct tty *, u_char);
1.373     nicm     1685: void   tty_putn(struct tty *, const void *, size_t, u_int);
1.528     nicm     1686: int    tty_init(struct tty *, struct client *, int, char *);
1.224     nicm     1687: int    tty_resize(struct tty *);
1.324     nicm     1688: int    tty_set_size(struct tty *, u_int, u_int);
1.47      nicm     1689: void   tty_start_tty(struct tty *);
                   1690: void   tty_stop_tty(struct tty *);
                   1691: void   tty_set_title(struct tty *, const char *);
1.287     nicm     1692: void   tty_update_mode(struct tty *, int, struct screen *);
                   1693: void   tty_force_cursor_colour(struct tty *, const char *);
1.491     nicm     1694: void   tty_draw_pane(struct tty *, const struct window_pane *, u_int, u_int,
                   1695:            u_int);
                   1696: void   tty_draw_line(struct tty *, const struct window_pane *, struct screen *,
                   1697:            u_int, u_int, u_int);
1.437     nicm     1698: int    tty_open(struct tty *, char **);
1.76      nicm     1699: void   tty_close(struct tty *);
                   1700: void   tty_free(struct tty *);
1.514     nicm     1701: void   tty_write(void (*)(struct tty *, const struct tty_ctx *),
                   1702:            struct tty_ctx *);
                   1703: int    tty_client_ready(struct client *, struct window_pane *wp);
1.79      nicm     1704: void   tty_cmd_alignmenttest(struct tty *, const struct tty_ctx *);
                   1705: void   tty_cmd_cell(struct tty *, const struct tty_ctx *);
                   1706: void   tty_cmd_clearendofline(struct tty *, const struct tty_ctx *);
                   1707: void   tty_cmd_clearendofscreen(struct tty *, const struct tty_ctx *);
                   1708: void   tty_cmd_clearline(struct tty *, const struct tty_ctx *);
                   1709: void   tty_cmd_clearscreen(struct tty *, const struct tty_ctx *);
                   1710: void   tty_cmd_clearstartofline(struct tty *, const struct tty_ctx *);
                   1711: void   tty_cmd_clearstartofscreen(struct tty *, const struct tty_ctx *);
                   1712: void   tty_cmd_deletecharacter(struct tty *, const struct tty_ctx *);
1.371     nicm     1713: void   tty_cmd_clearcharacter(struct tty *, const struct tty_ctx *);
1.79      nicm     1714: void   tty_cmd_deleteline(struct tty *, const struct tty_ctx *);
1.282     nicm     1715: void   tty_cmd_erasecharacter(struct tty *, const struct tty_ctx *);
1.79      nicm     1716: void   tty_cmd_insertcharacter(struct tty *, const struct tty_ctx *);
                   1717: void   tty_cmd_insertline(struct tty *, const struct tty_ctx *);
                   1718: void   tty_cmd_linefeed(struct tty *, const struct tty_ctx *);
                   1719: void   tty_cmd_utf8character(struct tty *, const struct tty_ctx *);
                   1720: void   tty_cmd_reverseindex(struct tty *, const struct tty_ctx *);
1.286     nicm     1721: void   tty_cmd_setselection(struct tty *, const struct tty_ctx *);
1.273     nicm     1722: void   tty_cmd_rawstring(struct tty *, const struct tty_ctx *);
1.1       nicm     1723:
                   1724: /* tty-term.c */
                   1725: extern struct tty_terms tty_terms;
1.530     nicm     1726: u_int           tty_term_ncodes(void);
1.437     nicm     1727: struct tty_term *tty_term_find(char *, int, char **);
1.192     nicm     1728: void            tty_term_free(struct tty_term *);
1.1       nicm     1729: int             tty_term_has(struct tty_term *, enum tty_code_code);
                   1730: const char     *tty_term_string(struct tty_term *, enum tty_code_code);
                   1731: const char     *tty_term_string1(struct tty_term *, enum tty_code_code, int);
1.600     nicm     1732: const char     *tty_term_string2(struct tty_term *, enum tty_code_code, int,
                   1733:                     int);
                   1734: const char     *tty_term_ptr1(struct tty_term *, enum tty_code_code,
                   1735:                     const void *);
1.367     nicm     1736: const char     *tty_term_ptr2(struct tty_term *, enum tty_code_code,
                   1737:                     const void *, const void *);
1.1       nicm     1738: int             tty_term_number(struct tty_term *, enum tty_code_code);
                   1739: int             tty_term_flag(struct tty_term *, enum tty_code_code);
1.530     nicm     1740: const char     *tty_term_describe(struct tty_term *, enum tty_code_code);
1.240     nicm     1741:
                   1742: /* tty-acs.c */
                   1743: const char     *tty_acs_get(struct tty *, u_char);
1.1       nicm     1744:
                   1745: /* tty-keys.c */
1.571     nicm     1746: void           tty_keys_build(struct tty *);
                   1747: void           tty_keys_free(struct tty *);
                   1748: key_code       tty_keys_next(struct tty *);
1.1       nicm     1749:
1.264     nicm     1750: /* arguments.c */
1.410     nicm     1751: int             args_cmp(struct args_entry *, struct args_entry *);
                   1752: RB_PROTOTYPE(args_tree, args_entry, entry, args_cmp);
1.264     nicm     1753: struct args    *args_create(int, ...);
                   1754: struct args    *args_parse(const char *, int, char **);
                   1755: void            args_free(struct args *);
1.593     nicm     1756: char           *args_print(struct args *);
1.264     nicm     1757: int             args_has(struct args *, u_char);
                   1758: void            args_set(struct args *, u_char, const char *);
                   1759: const char     *args_get(struct args *, u_char);
1.502     nicm     1760: long long       args_strtonum(struct args *, u_char, long long, long long,
                   1761:                     char **);
                   1762:
                   1763: /* cmd-find.c */
1.605     nicm     1764: int             cmd_find_target(struct cmd_find_state *, struct cmd_q *,
                   1765:                     const char *, enum cmd_find_type, int);
1.502     nicm     1766: struct client  *cmd_find_client(struct cmd_q *, const char *, int);
1.610     nicm     1767: void            cmd_find_clear_state(struct cmd_find_state *, struct cmd_q *,
                   1768:                     int);
1.611   ! nicm     1769: int             cmd_find_valid_state(struct cmd_find_state *);
        !          1770: void            cmd_find_copy_state(struct cmd_find_state *,
        !          1771:                     struct cmd_find_state *);
1.610     nicm     1772: void            cmd_find_log_state(const char *, struct cmd_find_state *);
1.264     nicm     1773:
1.1       nicm     1774: /* cmd.c */
1.55      nicm     1775: int             cmd_pack_argv(int, char **, char *, size_t);
                   1776: int             cmd_unpack_argv(char *, size_t, int, char ***);
1.460     nicm     1777: char          **cmd_copy_argv(int, char **);
1.55      nicm     1778: void            cmd_free_argv(int, char **);
1.463     nicm     1779: char           *cmd_stringify_argv(int, char **);
1.397     nicm     1780: struct cmd     *cmd_parse(int, char **, const char *, u_int, char **);
1.603     nicm     1781: int             cmd_prepare_state(struct cmd *, struct cmd_q *);
1.593     nicm     1782: char           *cmd_print(struct cmd *);
1.492     nicm     1783: int             cmd_mouse_at(struct window_pane *, struct mouse_event *,
                   1784:                     u_int *, u_int *, int);
                   1785: struct winlink *cmd_mouse_window(struct mouse_event *, struct session **);
                   1786: struct window_pane *cmd_mouse_pane(struct mouse_event *, struct session **,
                   1787:                     struct winlink **);
1.380     nicm     1788: char           *cmd_template_replace(const char *, const char *, int);
1.1       nicm     1789: extern const struct cmd_entry *cmd_table[];
1.399     nicm     1790:
                   1791: /* cmd-attach-session.c */
1.603     nicm     1792: enum cmd_retval         cmd_attach_session(struct cmd_q *, int, int, const char *,
                   1793:     int);
1.1       nicm     1794:
                   1795: /* cmd-list.c */
1.397     nicm     1796: struct cmd_list        *cmd_list_parse(int, char **, const char *, u_int, char **);
1.1       nicm     1797: void            cmd_list_free(struct cmd_list *);
1.593     nicm     1798: char           *cmd_list_print(struct cmd_list *);
1.1       nicm     1799:
1.397     nicm     1800: /* cmd-queue.c */
                   1801: struct cmd_q   *cmdq_new(struct client *);
                   1802: int             cmdq_free(struct cmd_q *);
1.476     nicm     1803: void printflike(2, 3) cmdq_print(struct cmd_q *, const char *, ...);
                   1804: void printflike(2, 3) cmdq_error(struct cmd_q *, const char *, ...);
1.487     nicm     1805: void            cmdq_guard(struct cmd_q *, const char *, int);
1.492     nicm     1806: void            cmdq_run(struct cmd_q *, struct cmd_list *,
1.511     nicm     1807:                     struct mouse_event *);
1.492     nicm     1808: void            cmdq_append(struct cmd_q *, struct cmd_list *,
                   1809:                     struct mouse_event *);
1.397     nicm     1810: int             cmdq_continue(struct cmd_q *);
                   1811: void            cmdq_flush(struct cmd_q *);
                   1812:
1.1       nicm     1813: /* cmd-string.c */
1.397     nicm     1814: int    cmd_string_parse(const char *, struct cmd_list **, const char *,
                   1815:            u_int, char **);
1.471     nicm     1816:
                   1817: /* cmd-wait-for.c */
                   1818: void   cmd_wait_for_flush(void);
1.1       nicm     1819:
                   1820: /* client.c */
1.591     nicm     1821: int    client_main(struct event_base *, int, char **, int, const char *);
1.1       nicm     1822:
                   1823: /* key-bindings.c */
1.493     nicm     1824: RB_PROTOTYPE(key_bindings, key_binding, entry, key_bindings_cmp);
                   1825: RB_PROTOTYPE(key_tables, key_table, entry, key_table_cmp);
                   1826: extern struct key_tables key_tables;
                   1827: int     key_table_cmp(struct key_table *, struct key_table *);
1.1       nicm     1828: int     key_bindings_cmp(struct key_binding *, struct key_binding *);
1.592     nicm     1829: struct key_table *key_bindings_get_table(const char *, int);
1.511     nicm     1830: void    key_bindings_unref_table(struct key_table *);
1.571     nicm     1831: void    key_bindings_add(const char *, key_code, int, struct cmd_list *);
                   1832: void    key_bindings_remove(const char *, key_code);
1.493     nicm     1833: void    key_bindings_remove_table(const char *);
1.1       nicm     1834: void    key_bindings_init(void);
1.492     nicm     1835: void    key_bindings_dispatch(struct key_binding *, struct client *,
                   1836:             struct mouse_event *);
1.1       nicm     1837:
                   1838: /* key-string.c */
1.571     nicm     1839: key_code        key_string_lookup_string(const char *);
                   1840: const char     *key_string_lookup_key(key_code);
1.1       nicm     1841:
1.541     nicm     1842: /* alerts.c */
                   1843: void   alerts_reset_all(void);
                   1844: void   alerts_queue(struct window *, int);
1.594     nicm     1845: void   alerts_check_session(struct session *);
1.541     nicm     1846:
1.1       nicm     1847: /* server.c */
1.566     nicm     1848: extern struct tmuxproc *server_proc;
1.1       nicm     1849: extern struct clients clients;
1.611   ! nicm     1850: extern struct cmd_find_state marked_pane;
1.516     nicm     1851: void    server_set_marked(struct session *, struct winlink *,
                   1852:             struct window_pane *);
                   1853: void    server_clear_marked(void);
                   1854: int     server_is_marked(struct session *, struct winlink *,
                   1855:             struct window_pane *);
                   1856: int     server_check_marked(void);
1.546     nicm     1857: int     server_start(struct event_base *, int, char *);
1.175     nicm     1858: void    server_update_socket(void);
1.328     nicm     1859: void    server_add_accept(int);
1.1       nicm     1860:
1.146     nicm     1861: /* server-client.c */
1.602     nicm     1862: void    server_client_set_key_table(struct client *, const char *);
                   1863: const char *server_client_get_key_table(struct client *);
1.517     nicm     1864: int     server_client_check_nested(struct client *);
1.571     nicm     1865: void    server_client_handle_key(struct client *, key_code);
1.146     nicm     1866: void    server_client_create(int);
1.511     nicm     1867: int     server_client_open(struct client *, char **);
1.519     nicm     1868: void    server_client_unref(struct client *);
1.146     nicm     1869: void    server_client_lost(struct client *);
1.595     nicm     1870: void    server_client_detach(struct client *, enum msgtype);
1.146     nicm     1871: void    server_client_loop(void);
1.577     nicm     1872: void    server_client_push_stdout(struct client *);
                   1873: void    server_client_push_stderr(struct client *);
1.146     nicm     1874:
1.1       nicm     1875: /* server-fn.c */
1.73      nicm     1876: void    server_fill_environ(struct session *, struct environ *);
1.1       nicm     1877: void    server_redraw_client(struct client *);
                   1878: void    server_status_client(struct client *);
                   1879: void    server_redraw_session(struct session *);
1.124     nicm     1880: void    server_redraw_session_group(struct session *);
1.1       nicm     1881: void    server_status_session(struct session *);
1.124     nicm     1882: void    server_status_session_group(struct session *);
1.1       nicm     1883: void    server_redraw_window(struct window *);
1.197     nicm     1884: void    server_redraw_window_borders(struct window *);
1.1       nicm     1885: void    server_status_window(struct window *);
                   1886: void    server_lock(void);
1.118     nicm     1887: void    server_lock_session(struct session *);
                   1888: void    server_lock_client(struct client *);
1.37      nicm     1889: void    server_kill_window(struct window *);
1.124     nicm     1890: int     server_link_window(struct session *,
1.106     nicm     1891:             struct winlink *, struct session *, int, int, int, char **);
                   1892: void    server_unlink_window(struct session *, struct winlink *);
1.177     nicm     1893: void    server_destroy_pane(struct window_pane *);
1.124     nicm     1894: void    server_destroy_session_group(struct session *);
1.103     nicm     1895: void    server_destroy_session(struct session *);
1.367     nicm     1896: void    server_check_unattached(void);
1.92      nicm     1897: void    server_set_identify(struct client *);
                   1898: void    server_clear_identify(struct client *);
1.332     nicm     1899: int     server_set_stdin_callback(struct client *, void (*)(struct client *,
                   1900:             int, void *), void *, char **);
1.398     nicm     1901: void    server_unzoom_window(struct window *);
1.1       nicm     1902:
                   1903: /* status.c */
1.534     nicm     1904: void    status_timer_start(struct client *);
                   1905: void    status_timer_start_all(void);
1.308     nicm     1906: int     status_at_line(struct client *);
1.492     nicm     1907: struct window *status_get_window_at(struct client *, u_int);
1.1       nicm     1908: int     status_redraw(struct client *);
1.476     nicm     1909: void printflike(2, 3) status_message_set(struct client *, const char *, ...);
1.1       nicm     1910: void    status_message_clear(struct client *);
                   1911: int     status_message_redraw(struct client *);
1.292     nicm     1912: void    status_prompt_set(struct client *, const char *, const char *,
1.192     nicm     1913:             int (*)(void *, const char *), void (*)(void *), void *, int);
1.1       nicm     1914: void    status_prompt_clear(struct client *);
                   1915: int     status_prompt_redraw(struct client *);
1.571     nicm     1916: void    status_prompt_key(struct client *, key_code);
1.292     nicm     1917: void    status_prompt_update(struct client *, const char *, const char *);
1.529     nicm     1918: void    status_prompt_load_history(void);
                   1919: void    status_prompt_save_history(void);
1.1       nicm     1920:
                   1921: /* resize.c */
                   1922: void    recalculate_sizes(void);
                   1923:
                   1924: /* input.c */
                   1925: void    input_init(struct window_pane *);
                   1926: void    input_free(struct window_pane *);
1.507     nicm     1927: void    input_reset(struct window_pane *);
                   1928: struct evbuffer *input_pending(struct window_pane *);
1.1       nicm     1929: void    input_parse(struct window_pane *);
                   1930:
                   1931: /* input-key.c */
1.571     nicm     1932: void    input_key(struct window_pane *, key_code, struct mouse_event *);
1.150     nicm     1933:
                   1934: /* xterm-keys.c */
1.571     nicm     1935: char   *xterm_keys_lookup(key_code);
                   1936: int     xterm_keys_find(const char *, size_t, size_t *, key_code *);
1.1       nicm     1937:
                   1938: /* colour.c */
1.521     nicm     1939: int     colour_find_rgb(u_char, u_char, u_char);
1.102     nicm     1940: void    colour_set_fg(struct grid_cell *, int);
                   1941: void    colour_set_bg(struct grid_cell *, int);
                   1942: const char *colour_tostring(int);
1.1       nicm     1943: int     colour_fromstring(const char *);
                   1944: u_char  colour_256to16(u_char);
                   1945:
                   1946: /* attributes.c */
                   1947: const char *attributes_tostring(u_char);
                   1948: int     attributes_fromstring(const char *);
                   1949:
                   1950: /* grid.c */
                   1951: extern const struct grid_cell grid_default_cell;
                   1952: struct grid *grid_create(u_int, u_int, u_int);
                   1953: void    grid_destroy(struct grid *);
                   1954: int     grid_compare(struct grid *, struct grid *);
1.139     nicm     1955: void    grid_collect_history(struct grid *);
                   1956: void    grid_scroll_history(struct grid *);
                   1957: void    grid_scroll_history_region(struct grid *, u_int, u_int);
1.562     nicm     1958: void    grid_clear_history(struct grid *);
1.1       nicm     1959: void    grid_expand_line(struct grid *, u_int, u_int);
1.391     nicm     1960: const struct grid_line *grid_peek_line(struct grid *, u_int);
1.576     nicm     1961: void    grid_get_cell(struct grid *, u_int, u_int, struct grid_cell *);
1.1       nicm     1962: void    grid_set_cell(struct grid *, u_int, u_int, const struct grid_cell *);
                   1963: void    grid_clear(struct grid *, u_int, u_int, u_int, u_int);
                   1964: void    grid_clear_lines(struct grid *, u_int, u_int);
                   1965: void    grid_move_lines(struct grid *, u_int, u_int, u_int);
                   1966: void    grid_move_cells(struct grid *, u_int, u_int, u_int, u_int);
1.388     nicm     1967: char   *grid_string_cells(struct grid *, u_int, u_int, u_int,
1.400     nicm     1968:             struct grid_cell **, int, int, int);
1.600     nicm     1969: void    grid_duplicate_lines(struct grid *, u_int, struct grid *, u_int,
                   1970:             u_int);
1.378     nicm     1971: u_int   grid_reflow(struct grid *, struct grid *, u_int);
1.181     nicm     1972:
1.1       nicm     1973: /* grid-view.c */
1.576     nicm     1974: void    grid_view_get_cell(struct grid *, u_int, u_int, struct grid_cell *);
                   1975: void    grid_view_set_cell(struct grid *, u_int, u_int,
                   1976:             const struct grid_cell *);
1.269     nicm     1977: void    grid_view_clear_history(struct grid *);
1.1       nicm     1978: void    grid_view_clear(struct grid *, u_int, u_int, u_int, u_int);
                   1979: void    grid_view_scroll_region_up(struct grid *, u_int, u_int);
                   1980: void    grid_view_scroll_region_down(struct grid *, u_int, u_int);
                   1981: void    grid_view_insert_lines(struct grid *, u_int, u_int);
1.18      nicm     1982: void    grid_view_insert_lines_region(struct grid *, u_int, u_int, u_int);
1.1       nicm     1983: void    grid_view_delete_lines(struct grid *, u_int, u_int);
1.18      nicm     1984: void    grid_view_delete_lines_region(struct grid *, u_int, u_int, u_int);
1.1       nicm     1985: void    grid_view_insert_cells(struct grid *, u_int, u_int, u_int);
                   1986: void    grid_view_delete_cells(struct grid *, u_int, u_int, u_int);
1.9       nicm     1987: char   *grid_view_string_cells(struct grid *, u_int, u_int, u_int);
1.1       nicm     1988:
                   1989: /* screen-write.c */
1.572     nicm     1990: void    screen_write_start(struct screen_write_ctx *, struct window_pane *,
                   1991:             struct screen *);
1.1       nicm     1992: void    screen_write_stop(struct screen_write_ctx *);
1.304     nicm     1993: void    screen_write_reset(struct screen_write_ctx *);
1.572     nicm     1994: size_t printflike(1, 2) screen_write_cstrlen(const char *, ...);
                   1995: void printflike(4, 5) screen_write_cnputs(struct screen_write_ctx *,
                   1996:             ssize_t, struct grid_cell *, const char *, ...);
                   1997: size_t printflike(1, 2) screen_write_strlen(const char *, ...);
1.476     nicm     1998: void printflike(3, 4) screen_write_puts(struct screen_write_ctx *,
1.192     nicm     1999:             struct grid_cell *, const char *, ...);
1.572     nicm     2000: void printflike(4, 5) screen_write_nputs(struct screen_write_ctx *,
                   2001:             ssize_t, struct grid_cell *, const char *, ...);
                   2002: void    screen_write_vnputs(struct screen_write_ctx *, ssize_t,
                   2003:             struct grid_cell *, const char *, va_list);
                   2004: void    screen_write_putc(struct screen_write_ctx *, struct grid_cell *,
                   2005:             u_char);
                   2006: void    screen_write_copy(struct screen_write_ctx *, struct screen *, u_int,
                   2007:             u_int, u_int, u_int);
1.136     nicm     2008: void    screen_write_backspace(struct screen_write_ctx *);
1.383     nicm     2009: void    screen_write_mode_set(struct screen_write_ctx *, int);
                   2010: void    screen_write_mode_clear(struct screen_write_ctx *, int);
1.1       nicm     2011: void    screen_write_cursorup(struct screen_write_ctx *, u_int);
                   2012: void    screen_write_cursordown(struct screen_write_ctx *, u_int);
                   2013: void    screen_write_cursorright(struct screen_write_ctx *, u_int);
                   2014: void    screen_write_cursorleft(struct screen_write_ctx *, u_int);
1.5       nicm     2015: void    screen_write_alignmenttest(struct screen_write_ctx *);
1.1       nicm     2016: void    screen_write_insertcharacter(struct screen_write_ctx *, u_int);
                   2017: void    screen_write_deletecharacter(struct screen_write_ctx *, u_int);
1.371     nicm     2018: void    screen_write_clearcharacter(struct screen_write_ctx *, u_int);
1.1       nicm     2019: void    screen_write_insertline(struct screen_write_ctx *, u_int);
                   2020: void    screen_write_deleteline(struct screen_write_ctx *, u_int);
                   2021: void    screen_write_clearline(struct screen_write_ctx *);
                   2022: void    screen_write_clearendofline(struct screen_write_ctx *);
                   2023: void    screen_write_clearstartofline(struct screen_write_ctx *);
                   2024: void    screen_write_cursormove(struct screen_write_ctx *, u_int, u_int);
                   2025: void    screen_write_reverseindex(struct screen_write_ctx *);
                   2026: void    screen_write_scrollregion(struct screen_write_ctx *, u_int, u_int);
1.72      nicm     2027: void    screen_write_linefeed(struct screen_write_ctx *, int);
1.1       nicm     2028: void    screen_write_carriagereturn(struct screen_write_ctx *);
                   2029: void    screen_write_clearendofscreen(struct screen_write_ctx *);
                   2030: void    screen_write_clearstartofscreen(struct screen_write_ctx *);
                   2031: void    screen_write_clearscreen(struct screen_write_ctx *);
1.297     nicm     2032: void    screen_write_clearhistory(struct screen_write_ctx *);
1.373     nicm     2033: void    screen_write_cell(struct screen_write_ctx *, const struct grid_cell *);
1.286     nicm     2034: void    screen_write_setselection(struct screen_write_ctx *, u_char *, u_int);
1.273     nicm     2035: void    screen_write_rawstring(struct screen_write_ctx *, u_char *, u_int);
1.1       nicm     2036:
                   2037: /* screen-redraw.c */
1.436     nicm     2038: void    screen_redraw_screen(struct client *, int, int, int);
1.1       nicm     2039: void    screen_redraw_pane(struct client *, struct window_pane *);
                   2040:
                   2041: /* screen.c */
                   2042: void    screen_init(struct screen *, u_int, u_int, u_int);
                   2043: void    screen_reinit(struct screen *);
                   2044: void    screen_free(struct screen *);
1.6       nicm     2045: void    screen_reset_tabs(struct screen *);
1.288     nicm     2046: void    screen_set_cursor_style(struct screen *, u_int);
1.287     nicm     2047: void    screen_set_cursor_colour(struct screen *, const char *);
1.1       nicm     2048: void    screen_set_title(struct screen *, const char *);
1.374     nicm     2049: void    screen_resize(struct screen *, u_int, u_int, int);
1.204     nicm     2050: void    screen_set_selection(struct screen *,
                   2051:             u_int, u_int, u_int, u_int, u_int, struct grid_cell *);
1.1       nicm     2052: void    screen_clear_selection(struct screen *);
                   2053: int     screen_check_selection(struct screen *, u_int, u_int);
1.374     nicm     2054: void    screen_reflow(struct screen *, u_int);
1.1       nicm     2055:
                   2056: /* window.c */
                   2057: extern struct windows windows;
1.274     nicm     2058: extern struct window_pane_tree all_window_panes;
1.496     nicm     2059: int             window_cmp(struct window *, struct window *);
                   2060: RB_PROTOTYPE(windows, window, entry, window_cmp);
1.1       nicm     2061: int             winlink_cmp(struct winlink *, struct winlink *);
                   2062: RB_PROTOTYPE(winlinks, winlink, entry, winlink_cmp);
1.274     nicm     2063: int             window_pane_cmp(struct window_pane *, struct window_pane *);
                   2064: RB_PROTOTYPE(window_pane_tree, window_pane, tree_entry, window_pane_cmp);
1.1       nicm     2065: struct winlink *winlink_find_by_index(struct winlinks *, int);
1.192     nicm     2066: struct winlink *winlink_find_by_window(struct winlinks *, struct window *);
1.309     nicm     2067: struct winlink *winlink_find_by_window_id(struct winlinks *, u_int);
1.81      nicm     2068: int             winlink_next_index(struct winlinks *, int);
1.1       nicm     2069: u_int           winlink_count(struct winlinks *);
1.268     nicm     2070: struct winlink *winlink_add(struct winlinks *, int);
                   2071: void            winlink_set_window(struct winlink *, struct window *);
1.1       nicm     2072: void            winlink_remove(struct winlinks *, struct winlink *);
1.186     nicm     2073: struct winlink *winlink_next(struct winlink *);
                   2074: struct winlink *winlink_previous(struct winlink *);
1.235     nicm     2075: struct winlink *winlink_next_by_number(struct winlink *, struct session *,
                   2076:                     int);
                   2077: struct winlink *winlink_previous_by_number(struct winlink *, struct session *,
                   2078:                     int);
1.1       nicm     2079: void            winlink_stack_push(struct winlink_stack *, struct winlink *);
                   2080: void            winlink_stack_remove(struct winlink_stack *, struct winlink *);
1.500     nicm     2081: struct window  *window_find_by_id_str(const char *);
1.309     nicm     2082: struct window  *window_find_by_id(u_int);
1.541     nicm     2083: void            window_update_activity(struct window *);
1.1       nicm     2084: struct window  *window_create1(u_int, u_int);
1.463     nicm     2085: struct window  *window_create(const char *, int, char **, const char *,
1.569     nicm     2086:                     const char *, const char *, struct environ *,
                   2087:                     struct termios *, u_int, u_int, u_int, char **);
1.1       nicm     2088: void            window_destroy(struct window *);
1.289     nicm     2089: struct window_pane *window_get_active_at(struct window *, u_int, u_int);
                   2090: struct window_pane *window_find_string(struct window *, const char *);
1.492     nicm     2091: int             window_has_pane(struct window *, struct window_pane *);
1.477     nicm     2092: int             window_set_active_pane(struct window *, struct window_pane *);
1.559     nicm     2093: void            window_redraw_active_switch(struct window *,
                   2094:                     struct window_pane *);
1.51      nicm     2095: struct window_pane *window_add_pane(struct window *, u_int);
1.44      nicm     2096: void            window_resize(struct window *, u_int, u_int);
1.398     nicm     2097: int             window_zoom(struct window_pane *);
                   2098: int             window_unzoom(struct window *);
1.453     nicm     2099: void            window_lost_pane(struct window *, struct window_pane *);
1.1       nicm     2100: void            window_remove_pane(struct window *, struct window_pane *);
                   2101: struct window_pane *window_pane_at_index(struct window *, u_int);
1.235     nicm     2102: struct window_pane *window_pane_next_by_number(struct window *,
1.511     nicm     2103:                        struct window_pane *, u_int);
1.235     nicm     2104: struct window_pane *window_pane_previous_by_number(struct window *,
1.511     nicm     2105:                        struct window_pane *, u_int);
1.298     nicm     2106: int             window_pane_index(struct window_pane *, u_int *);
1.1       nicm     2107: u_int           window_count_panes(struct window *);
                   2108: void            window_destroy_panes(struct window *);
1.500     nicm     2109: struct window_pane *window_pane_find_by_id_str(const char *);
1.274     nicm     2110: struct window_pane *window_pane_find_by_id(u_int);
1.1       nicm     2111: struct window_pane *window_pane_create(struct window *, u_int, u_int, u_int);
                   2112: void            window_pane_destroy(struct window_pane *);
1.463     nicm     2113: int             window_pane_spawn(struct window_pane *, int, char **,
1.569     nicm     2114:                     const char *, const char *, const char *, struct environ *,
1.455     nicm     2115:                     struct termios *, char **);
1.44      nicm     2116: void            window_pane_resize(struct window_pane *, u_int, u_int);
1.366     nicm     2117: void            window_pane_alternate_on(struct window_pane *,
                   2118:                     struct grid_cell *, int);
                   2119: void            window_pane_alternate_off(struct window_pane *,
                   2120:                     struct grid_cell *, int);
1.600     nicm     2121: int             window_pane_set_mode(struct window_pane *,
                   2122:                     const struct window_mode *);
1.1       nicm     2123: void            window_pane_reset_mode(struct window_pane *);
1.492     nicm     2124: void            window_pane_key(struct window_pane *, struct client *,
1.571     nicm     2125:                     struct session *, key_code, struct mouse_event *);
1.28      nicm     2126: int             window_pane_visible(struct window_pane *);
1.600     nicm     2127: char           *window_pane_search(struct window_pane *, const char *,
                   2128:                     u_int *);
1.256     nicm     2129: char           *window_printable_flags(struct session *, struct winlink *);
1.211     nicm     2130: struct window_pane *window_pane_find_up(struct window_pane *);
                   2131: struct window_pane *window_pane_find_down(struct window_pane *);
                   2132: struct window_pane *window_pane_find_left(struct window_pane *);
                   2133: struct window_pane *window_pane_find_right(struct window_pane *);
1.311     nicm     2134: void            window_set_name(struct window *, const char *);
1.352     nicm     2135: void            window_remove_ref(struct window *);
1.345     nicm     2136: void            winlink_clear_flags(struct winlink *);
1.526     nicm     2137: int             winlink_shuffle_up(struct session *, struct winlink *);
1.1       nicm     2138:
                   2139: /* layout.c */
1.232     nicm     2140: u_int           layout_count_cells(struct layout_cell *);
1.39      nicm     2141: struct layout_cell *layout_create_cell(struct layout_cell *);
                   2142: void            layout_free_cell(struct layout_cell *);
                   2143: void            layout_print_cell(struct layout_cell *, const char *, u_int);
1.600     nicm     2144: void            layout_destroy_cell(struct layout_cell *,
                   2145:                     struct layout_cell **);
                   2146: void            layout_set_size(struct layout_cell *, u_int, u_int, u_int,
                   2147:                     u_int);
                   2148: void            layout_make_leaf(struct layout_cell *, struct window_pane *);
1.39      nicm     2149: void            layout_make_node(struct layout_cell *, enum layout_type);
                   2150: void            layout_fix_offsets(struct layout_cell *);
                   2151: void            layout_fix_panes(struct window *, u_int, u_int);
                   2152: u_int           layout_resize_check(struct layout_cell *, enum layout_type);
1.600     nicm     2153: void            layout_resize_adjust(struct layout_cell *, enum layout_type,
                   2154:                     int);
1.398     nicm     2155: void            layout_init(struct window *, struct window_pane *);
1.39      nicm     2156: void            layout_free(struct window *);
                   2157: void            layout_resize(struct window *, u_int, u_int);
1.385     nicm     2158: void            layout_resize_pane(struct window_pane *, enum layout_type,
                   2159:                     int);
                   2160: void            layout_resize_pane_to(struct window_pane *, enum layout_type,
                   2161:                     u_int);
1.198     nicm     2162: void            layout_assign_pane(struct layout_cell *, struct window_pane *);
1.600     nicm     2163: struct layout_cell *layout_split_pane(struct window_pane *, enum layout_type,
                   2164:                     int, int);
1.39      nicm     2165: void            layout_close_pane(struct window_pane *);
                   2166:
1.232     nicm     2167: /* layout-custom.c */
1.494     nicm     2168: char           *layout_dump(struct layout_cell *);
1.232     nicm     2169: int             layout_parse(struct window *, const char *);
                   2170:
1.39      nicm     2171: /* layout-set.c */
                   2172: int             layout_set_lookup(const char *);
                   2173: u_int           layout_set_select(struct window *, u_int);
                   2174: u_int           layout_set_next(struct window *);
                   2175: u_int           layout_set_previous(struct window *);
1.1       nicm     2176:
                   2177: /* window-clock.c */
                   2178: extern const struct window_mode window_clock_mode;
1.438     nicm     2179: extern const char window_clock_table[14][5][5];
1.1       nicm     2180:
                   2181: /* window-copy.c */
                   2182: extern const struct window_mode window_copy_mode;
1.560     nicm     2183: void            window_copy_init_from_pane(struct window_pane *, int);
1.216     nicm     2184: void            window_copy_init_for_output(struct window_pane *);
1.476     nicm     2185: void printflike(2, 3) window_copy_add(struct window_pane *, const char *, ...);
1.216     nicm     2186: void            window_copy_vadd(struct window_pane *, const char *, va_list);
1.192     nicm     2187: void            window_copy_pageup(struct window_pane *);
1.492     nicm     2188: void            window_copy_start_drag(struct client *, struct mouse_event *);
1.564     nicm     2189: int             window_copy_scroll_position(struct window_pane *);
1.1       nicm     2190:
                   2191: /* window-choose.c */
                   2192: extern const struct window_mode window_choose_mode;
1.343     nicm     2193: void            window_choose_add(struct window_pane *,
                   2194:                         struct window_choose_data *);
1.1       nicm     2195: void            window_choose_ready(struct window_pane *,
1.376     nicm     2196:                     u_int, void (*)(struct window_choose_data *));
1.375     nicm     2197: struct window_choose_data      *window_choose_data_create (int,
                   2198:                     struct client *, struct session *);
                   2199: void   window_choose_data_free(struct window_choose_data *);
                   2200: void   window_choose_data_run(struct window_choose_data *);
1.344     nicm     2201: struct window_choose_data      *window_choose_add_window(struct window_pane *,
1.377     nicm     2202:                        struct client *, struct session *, struct winlink *,
1.380     nicm     2203:                        const char *, const char *, u_int);
1.344     nicm     2204: struct window_choose_data      *window_choose_add_session(struct window_pane *,
1.377     nicm     2205:                        struct client *, struct session *, const char *,
1.380     nicm     2206:                        const char *, u_int);
1.369     nicm     2207: void   window_choose_expand_all(struct window_pane *);
1.408     nicm     2208: void   window_choose_collapse_all(struct window_pane *);
                   2209: void   window_choose_set_current(struct window_pane *, u_int);
1.1       nicm     2210:
                   2211: /* names.c */
1.540     nicm     2212: void    check_window_name(struct window *);
1.417     nicm     2213: char   *default_window_name(struct window *);
                   2214: char   *format_window_name(struct window *);
                   2215: char   *parse_window_name(const char *);
1.219     nicm     2216:
                   2217: /* signal.c */
1.566     nicm     2218: void   set_signals(void(*)(int, short, void *), void *);
1.349     nicm     2219: void   clear_signals(int);
1.342     nicm     2220:
                   2221: /* control.c */
1.470     nicm     2222: void   control_callback(struct client *, int, void *);
1.476     nicm     2223: void printflike(2, 3) control_write(struct client *, const char *, ...);
1.357     nicm     2224: void   control_write_buffer(struct client *, struct evbuffer *);
1.353     nicm     2225:
                   2226: /* control-notify.c */
1.358     nicm     2227: void   control_notify_input(struct client *, struct window_pane *,
                   2228:            struct evbuffer *);
1.353     nicm     2229: void   control_notify_window_layout_changed(struct window *);
                   2230: void   control_notify_window_unlinked(struct session *, struct window *);
                   2231: void   control_notify_window_linked(struct session *, struct window *);
                   2232: void   control_notify_window_renamed(struct window *);
                   2233: void   control_notify_attached_session_changed(struct client *);
                   2234: void   control_notify_session_renamed(struct session *);
                   2235: void   control_notify_session_created(struct session *);
                   2236: void   control_notify_session_close(struct session *);
1.1       nicm     2237:
                   2238: /* session.c */
                   2239: extern struct sessions sessions;
1.124     nicm     2240: extern struct session_groups session_groups;
1.254     nicm     2241: int    session_cmp(struct session *, struct session *);
                   2242: RB_PROTOTYPE(sessions, session, entry, session_cmp);
1.251     nicm     2243: int             session_alive(struct session *);
1.1       nicm     2244: struct session *session_find(const char *);
1.500     nicm     2245: struct session *session_find_by_id_str(const char *);
1.402     nicm     2246: struct session *session_find_by_id(u_int);
1.463     nicm     2247: struct session *session_create(const char *, int, char **, const char *,
1.569     nicm     2248:                     const char *, struct environ *, struct termios *, int,
                   2249:                     u_int, u_int, char **);
1.192     nicm     2250: void            session_destroy(struct session *);
1.520     nicm     2251: void            session_unref(struct session *);
1.279     nicm     2252: int             session_check_name(const char *);
1.536     nicm     2253: void            session_update_activity(struct session *, struct timeval *);
1.239     nicm     2254: struct session *session_next_session(struct session *);
                   2255: struct session *session_previous_session(struct session *);
1.463     nicm     2256: struct winlink *session_new(struct session *, const char *, int, char **,
1.569     nicm     2257:                     const char *, const char *, int, char **);
1.463     nicm     2258: struct winlink *session_attach(struct session *, struct window *, int,
                   2259:                     char **);
1.1       nicm     2260: int             session_detach(struct session *, struct winlink *);
1.497     nicm     2261: int             session_has(struct session *, struct window *);
1.504     nicm     2262: int             session_is_linked(struct session *, struct window *);
1.1       nicm     2263: int             session_next(struct session *, int);
                   2264: int             session_previous(struct session *, int);
                   2265: int             session_select(struct session *, int);
                   2266: int             session_last(struct session *);
1.392     nicm     2267: int             session_set_current(struct session *, struct winlink *);
1.124     nicm     2268: struct session_group *session_group_find(struct session *);
                   2269: u_int           session_group_index(struct session_group *);
                   2270: void            session_group_add(struct session *, struct session *);
                   2271: void            session_group_remove(struct session *);
1.478     nicm     2272: u_int           session_group_count(struct session_group *);
1.124     nicm     2273: void            session_group_synchronize_to(struct session *);
                   2274: void            session_group_synchronize_from(struct session *);
                   2275: void            session_group_synchronize1(struct session *, struct session *);
1.330     nicm     2276: void            session_renumber_windows(struct session *);
1.1       nicm     2277:
                   2278: /* utf8.c */
1.574     nicm     2279: u_int           utf8_width(u_int);
1.456     nicm     2280: void            utf8_set(struct utf8_data *, u_char);
1.576     nicm     2281: void            utf8_copy(struct utf8_data *, const struct utf8_data *);
1.579     nicm     2282: enum utf8_state         utf8_open(struct utf8_data *, u_char);
                   2283: enum utf8_state         utf8_append(struct utf8_data *, u_char);
1.456     nicm     2284: u_int           utf8_combine(const struct utf8_data *);
1.579     nicm     2285: enum utf8_state         utf8_split(u_int, struct utf8_data *);
1.456     nicm     2286: u_int           utf8_split2(u_int, u_char *);
                   2287: int             utf8_strvis(char *, const char *, size_t, int);
1.573     nicm     2288: char           *utf8_sanitize(const char *);
1.456     nicm     2289: struct utf8_data *utf8_fromcstr(const char *);
                   2290: char           *utf8_tocstr(struct utf8_data *);
                   2291: u_int           utf8_cstrwidth(const char *);
                   2292: char           *utf8_trimcstr(const char *, u_int);
1.575     nicm     2293: char           *utf8_padcstr(const char *, u_int);
1.1       nicm     2294:
                   2295: /* procname.c */
                   2296: char   *get_proc_name(int, char *);
                   2297:
                   2298: /* log.c */
1.588     nicm     2299: void   log_add_level(void);
                   2300: int    log_get_level(void);
                   2301: void   log_open(const char *);
                   2302: void   log_close(void);
1.476     nicm     2303: void printflike(1, 2) log_debug(const char *, ...);
1.581     nicm     2304: __dead void printflike(1, 2) fatal(const char *, ...);
                   2305: __dead void printflike(1, 2) fatalx(const char *, ...);
1.435     nicm     2306:
                   2307: /* style.c */
                   2308: int             style_parse(const struct grid_cell *,
                   2309:                     struct grid_cell *, const char *);
                   2310: const char     *style_tostring(struct grid_cell *);
                   2311: void            style_update_new(struct options *, const char *, const char *);
                   2312: void            style_update_old(struct options *, const char *,
                   2313:                     struct grid_cell *);
1.450     nicm     2314: void            style_apply(struct grid_cell *, struct options *,
                   2315:                     const char *);
                   2316: void            style_apply_update(struct grid_cell *, struct options *,
                   2317:                     const char *);
1.559     nicm     2318: int             style_equal(const struct grid_cell *,
                   2319:                     const struct grid_cell *);
1.1       nicm     2320:
                   2321: #endif /* TMUX_H */