tmux  3.2a
About: tmux is a terminal multiplexer that lets you switch easily between several programs in one terminal.
  Fossies Dox: tmux-3.2a.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

server.c File Reference
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/un.h>
#include <sys/wait.h>
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <termios.h>
#include <time.h>
#include <unistd.h>
#include "tmux.h"
Include dependency graph for server.c:

Go to the source code of this file.

Functions

static int server_loop (void)
 
static void server_send_exit (void)
 
static void server_accept (int, short, void *)
 
static void server_signal (int)
 
static void server_child_signal (void)
 
static void server_child_exited (pid_t, int)
 
static void server_child_stopped (pid_t, int)
 
void server_set_marked (struct session *s, struct winlink *wl, struct window_pane *wp)
 
void server_clear_marked (void)
 
int server_is_marked (struct session *s, struct winlink *wl, struct window_pane *wp)
 
int server_check_marked (void)
 
static int server_create_socket (int flags, char **cause)
 
static void server_tidy_event (int fd, short events, void *data)
 
int server_start (struct tmuxproc *client, int flags, struct event_base *base, int lockfd, char *lockfile)
 
void server_update_socket (void)
 
void server_add_accept (int timeout)
 
void server_add_message (const char *fmt,...)
 

Variables

struct clients clients
 
struct tmuxprocserver_proc
 
static int server_fd = -1
 
static uint64_t server_client_flags
 
static int server_exit
 
static struct event server_ev_accept
 
static struct event server_ev_tidy
 
struct cmd_find_state marked_pane
 
static u_int message_next
 
struct message_list message_log
 

Function Documentation

◆ server_accept()

static void server_accept ( int  fd,
short  events,
void *  data 
)
static

Definition at line 356 of file server.c.

References fatal(), server_add_accept(), server_client_create(), and server_exit.

Referenced by server_add_accept().

◆ server_add_accept()

void server_add_accept ( int  timeout)

Definition at line 389 of file server.c.

References server_accept(), server_ev_accept, and server_fd.

Referenced by server_accept(), server_client_lost(), server_signal(), and server_start().

◆ server_add_message()

void server_add_message ( const char *  fmt,
  ... 
)

◆ server_check_marked()

◆ server_child_exited()

static void server_child_exited ( pid_t  pid,
int  status 
)
static

◆ server_child_signal()

static void server_child_signal ( void  )
static

Definition at line 444 of file server.c.

References fatal(), server_child_exited(), server_child_stopped(), and WAIT_ANY.

Referenced by server_signal().

◆ server_child_stopped()

static void server_child_stopped ( pid_t  pid,
int  status 
)
static

Definition at line 492 of file server.c.

References job_check_died(), window::panes, window_pane::pid, window_pane::status, and windows.

Referenced by server_child_signal().

◆ server_clear_marked()

void server_clear_marked ( void  )

Definition at line 77 of file server.c.

References cmd_find_clear_state(), and marked_pane.

Referenced by window_lost_pane().

◆ server_create_socket()

static int server_create_socket ( int  flags,
char **  cause 
)
static

Definition at line 104 of file server.c.

References CLIENT_DEFAULTSOCKET, setblocking(), socket_path, strlcpy(), and xasprintf().

Referenced by server_signal(), and server_start().

◆ server_is_marked()

int server_is_marked ( struct session s,
struct winlink wl,
struct window_pane wp 
)

◆ server_loop()

◆ server_send_exit()

static void server_send_exit ( void  )
static

◆ server_set_marked()

void server_set_marked ( struct session s,
struct winlink wl,
struct window_pane wp 
)

◆ server_signal()

◆ server_start()

◆ server_tidy_event()

static void server_tidy_event ( int  fd,
short  events,
void *  data 
)
static

Definition at line 155 of file server.c.

References format_tidy_jobs(), get_timer(), log_debug(), and server_ev_tidy.

Referenced by server_start().

◆ server_update_socket()

void server_update_socket ( void  )

Definition at line 320 of file server.c.

References ACCESSPERMS, session::attached, sessions, and socket_path.

Referenced by server_client_lost(), server_signal(), and server_start().

Variable Documentation

◆ clients

struct clients clients

Definition at line 1 of file server.c.

Referenced by alerts_set_message(), clients_calculate_size(), clients_with_window(), cmd_find_best_client(), cmd_find_client(), cmd_select_pane_exec(), control_notify_client_detached(), control_notify_client_session_changed(), control_notify_pane_mode_changed(), control_notify_session_closed(), control_notify_session_created(), control_notify_session_renamed(), control_notify_session_window_changed(), control_notify_window_layout_changed(), control_notify_window_linked(), control_notify_window_pane_changed(), control_notify_window_renamed(), control_notify_window_unlinked(), format_cb_session_attached_list(), format_cb_session_group_attached_list(), format_cb_window_active_clients(), format_cb_window_active_clients_list(), format_tidy_jobs(), ignore_client_size(), key_bindings_remove_table(), options_push_changes(), recalculate_sizes_now(), server_client_attached_lost(), server_client_check_pane_buffer(), server_client_check_pane_focus(), server_client_create(), server_client_dispatch_identify(), server_client_how_many(), server_client_loop(), server_client_lost(), server_client_remove_pane(), server_destroy_session(), server_lock(), server_lock_session(), server_loop(), server_redraw_session(), server_redraw_window(), server_redraw_window_borders(), server_send_exit(), server_start(), server_status_session(), start_cfg(), status_timer_start_all(), tty_update_window_offset(), tty_write(), window_client_build(), and window_pane_read_callback().

◆ marked_pane

◆ message_log

struct message_list message_log

Definition at line 53 of file server.c.

Referenced by server_add_message(), and server_start().

◆ message_next

u_int message_next
static

Definition at line 53 of file server.c.

Referenced by server_add_message().

◆ server_client_flags

uint64_t server_client_flags
static

Definition at line 46 of file server.c.

Referenced by server_signal(), and server_start().

◆ server_ev_accept

struct event server_ev_accept
static

Definition at line 47 of file server.c.

Referenced by server_add_accept(), and server_signal().

◆ server_ev_tidy

struct event server_ev_tidy
static

Definition at line 47 of file server.c.

Referenced by server_start(), and server_tidy_event().

◆ server_exit

int server_exit
static

Definition at line 47 of file server.c.

Referenced by server_accept(), server_loop(), and server_signal().

◆ server_fd

int server_fd = -1
static

Definition at line 45 of file server.c.

Referenced by server_add_accept(), server_signal(), and server_start().

◆ server_proc

struct tmuxproc* server_proc

Definition at line 44 of file server.c.

Referenced by server_client_create(), server_signal(), server_start(), and spawn_pane().