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)  

file.c File Reference
#include <sys/types.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "tmux.h"
Include dependency graph for file.c:

Go to the source code of this file.

Functions

 RB_GENERATE (client_files, client_file, entry, file_cmp)
 
static char * file_get_path (struct client *c, const char *file)
 
int file_cmp (struct client_file *cf1, struct client_file *cf2)
 
struct client_filefile_create_with_peer (struct tmuxpeer *peer, struct client_files *files, int stream, client_file_cb cb, void *cbdata)
 
struct client_filefile_create_with_client (struct client *c, int stream, client_file_cb cb, void *cbdata)
 
void file_free (struct client_file *cf)
 
static void file_fire_done_cb (int fd, short events, void *arg)
 
void file_fire_done (struct client_file *cf)
 
void file_fire_read (struct client_file *cf)
 
int file_can_print (struct client *c)
 
void file_print (struct client *c, const char *fmt,...)
 
void file_vprint (struct client *c, const char *fmt, va_list ap)
 
void file_print_buffer (struct client *c, void *data, size_t size)
 
void file_error (struct client *c, const char *fmt,...)
 
void file_write (struct client *c, const char *path, int flags, const void *bdata, size_t bsize, client_file_cb cb, void *cbdata)
 
void file_read (struct client *c, const char *path, client_file_cb cb, void *cbdata)
 
static void file_push_cb (int fd, short events, void *arg)
 
void file_push (struct client_file *cf)
 
int file_write_left (struct client_files *files)
 
static void file_write_error_callback (struct bufferevent *bev, short what, void *arg)
 
static void file_write_callback (struct bufferevent *bev, void *arg)
 
void file_write_open (struct client_files *files, struct tmuxpeer *peer, struct imsg *imsg, int allow_streams, int close_received, client_file_cb cb, void *cbdata)
 
void file_write_data (struct client_files *files, struct imsg *imsg)
 
void file_write_close (struct client_files *files, struct imsg *imsg)
 
static void file_read_error_callback (struct bufferevent *bev, short what, void *arg)
 
static void file_read_callback (struct bufferevent *bev, void *arg)
 
void file_read_open (struct client_files *files, struct tmuxpeer *peer, struct imsg *imsg, int allow_streams, int close_received, client_file_cb cb, void *cbdata)
 
void file_write_ready (struct client_files *files, struct imsg *imsg)
 
void file_read_data (struct client_files *files, struct imsg *imsg)
 
void file_read_done (struct client_files *files, struct imsg *imsg)
 

Variables

static int file_next_stream = 3
 

Function Documentation

◆ file_can_print()

int file_can_print ( struct client c)

Definition at line 174 of file file.c.

References CLIENT_CONTROL, client::flags, and client::session.

Referenced by file_error(), file_print_buffer(), and file_vprint().

◆ file_cmp()

int file_cmp ( struct client_file cf1,
struct client_file cf2 
)

Definition at line 55 of file file.c.

References client_file::stream.

◆ file_create_with_client()

◆ file_create_with_peer()

struct client_file* file_create_with_peer ( struct tmuxpeer peer,
struct client_files files,
int  stream,
client_file_cb  cb,
void *  cbdata 
)

◆ file_error()

◆ file_fire_done()

void file_fire_done ( struct client_file cf)

◆ file_fire_done_cb()

static void file_fire_done_cb ( int  fd,
short  events,
void *  arg 
)
static

◆ file_fire_read()

void file_fire_read ( struct client_file cf)

◆ file_free()

◆ file_get_path()

static char* file_get_path ( struct client c,
const char *  file 
)
static

Definition at line 42 of file file.c.

References server_client_get_cwd(), xasprintf(), and xstrdup().

Referenced by file_read(), and file_write().

◆ file_print()

void file_print ( struct client c,
const char *  fmt,
  ... 
)

Definition at line 185 of file file.c.

References file_vprint().

Referenced by cmdq_print().

◆ file_print_buffer()

◆ file_push()

◆ file_push_cb()

static void file_push_cb ( int  fd,
short  events,
void *  arg 
)
static

Definition at line 431 of file file.c.

References client_file::c, CLIENT_DEAD, file_free(), file_push(), and client::flags.

Referenced by file_push().

◆ file_read()

◆ file_read_callback()

static void file_read_callback ( struct bufferevent *  bev,
void *  arg 
)
static

◆ file_read_data()

void file_read_data ( struct client_files files,
struct imsg *  imsg 
)

◆ file_read_done()

void file_read_done ( struct client_files files,
struct imsg *  imsg 
)

◆ file_read_error_callback()

static void file_read_error_callback ( struct bufferevent *  bev,
short  what,
void *  arg 
)
static

◆ file_read_open()

◆ file_vprint()

◆ file_write()

◆ file_write_callback()

static void file_write_callback ( struct bufferevent *  bev,
void *  arg 
)
static

◆ file_write_close()

void file_write_close ( struct client_files files,
struct imsg *  imsg 
)

◆ file_write_data()

void file_write_data ( struct client_files files,
struct imsg *  imsg 
)

◆ file_write_error_callback()

static void file_write_error_callback ( struct bufferevent *  bev,
short  what,
void *  arg 
)
static

◆ file_write_left()

int file_write_left ( struct client_files files)

Definition at line 479 of file file.c.

References client_files, client_file::event, log_debug(), and client_file::stream.

Referenced by client_exit().

◆ file_write_open()

◆ file_write_ready()

void file_write_ready ( struct client_files files,
struct imsg *  imsg 
)

◆ RB_GENERATE()

RB_GENERATE ( client_files  ,
client_file  ,
entry  ,
file_cmp   
)

Variable Documentation

◆ file_next_stream

int file_next_stream = 3
static

Definition at line 36 of file file.c.

Referenced by file_read(), and file_write().