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)  

cmd-queue.c File Reference
#include <sys/types.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "tmux.h"
Include dependency graph for cmd-queue.c:

Go to the source code of this file.

Data Structures

struct  cmdq_item
struct  cmdq_state
struct  cmdq_list


#define CMDQ_FIRED   0x1
#define CMDQ_WAITING   0x2


enum  cmdq_type { CMDQ_COMMAND , CMDQ_CALLBACK }


 TAILQ_HEAD (cmdq_item_list, cmdq_item)
static const char * cmdq_name (struct client *c)
static struct cmdq_listcmdq_get (struct client *c)
struct cmdq_listcmdq_new (void)
void cmdq_free (struct cmdq_list *queue)
const char * cmdq_get_name (struct cmdq_item *item)
struct clientcmdq_get_client (struct cmdq_item *item)
struct clientcmdq_get_target_client (struct cmdq_item *item)
struct cmdq_statecmdq_get_state (struct cmdq_item *item)
struct cmd_find_statecmdq_get_target (struct cmdq_item *item)
struct cmd_find_statecmdq_get_source (struct cmdq_item *item)
struct key_eventcmdq_get_event (struct cmdq_item *item)
struct cmd_find_statecmdq_get_current (struct cmdq_item *item)
int cmdq_get_flags (struct cmdq_item *item)
struct cmdq_statecmdq_new_state (struct cmd_find_state *current, struct key_event *event, int flags)
struct cmdq_statecmdq_link_state (struct cmdq_state *state)
struct cmdq_statecmdq_copy_state (struct cmdq_state *state)
void cmdq_free_state (struct cmdq_state *state)
void cmdq_add_format (struct cmdq_state *state, const char *key, const char *fmt,...)
void cmdq_merge_formats (struct cmdq_item *item, struct format_tree *ft)
struct cmdq_itemcmdq_append (struct client *c, struct cmdq_item *item)
struct cmdq_itemcmdq_insert_after (struct cmdq_item *after, struct cmdq_item *item)
void cmdq_insert_hook (struct session *s, struct cmdq_item *item, struct cmd_find_state *current, const char *fmt,...)
void cmdq_continue (struct cmdq_item *item)
static void cmdq_remove (struct cmdq_item *item)
static void cmdq_remove_group (struct cmdq_item *item)
struct cmdq_itemcmdq_get_command (struct cmd_list *cmdlist, struct cmdq_state *state)
static enum cmd_retval cmdq_find_flag (struct cmdq_item *item, struct cmd_find_state *fs, const struct cmd_entry_flag *flag)
static void cmdq_add_message (struct cmdq_item *item)
static enum cmd_retval cmdq_fire_command (struct cmdq_item *item)
struct cmdq_itemcmdq_get_callback1 (const char *name, cmdq_cb cb, void *data)
static enum cmd_retval cmdq_error_callback (struct cmdq_item *item, void *data)
struct cmdq_itemcmdq_get_error (const char *error)
static enum cmd_retval cmdq_fire_callback (struct cmdq_item *item)
u_int cmdq_next (struct client *c)
struct cmdq_itemcmdq_running (struct client *c)
void cmdq_guard (struct cmdq_item *item, const char *guard, int flags)
void cmdq_print (struct cmdq_item *item, const char *fmt,...)
void cmdq_error (struct cmdq_item *item, const char *fmt,...)

Macro Definition Documentation


#define CMDQ_FIRED   0x1

Definition at line 29 of file cmd-queue.c.


#define CMDQ_WAITING   0x2

Definition at line 30 of file cmd-queue.c.

Enumeration Type Documentation

◆ cmdq_type

enum cmdq_type

Definition at line 33 of file cmd-queue.c.

Function Documentation

◆ cmdq_add_format()

void cmdq_add_format ( struct cmdq_state state,
const char *  key,
const char *  fmt,

◆ cmdq_add_message()

◆ cmdq_append()

◆ cmdq_continue()

◆ cmdq_copy_state()

struct cmdq_state* cmdq_copy_state ( struct cmdq_state state)

◆ cmdq_error()

◆ cmdq_error_callback()

static enum cmd_retval cmdq_error_callback ( struct cmdq_item item,
void *  data 

◆ cmdq_find_flag()

◆ cmdq_fire_callback()

static enum cmd_retval cmdq_fire_callback ( struct cmdq_item item)

Definition at line 671 of file cmd-queue.c.

References cmdq_error_callback(), cmdq_get_callback, and xstrdup().

Referenced by cmdq_next().

◆ cmdq_fire_command()

static enum cmd_retval cmdq_fire_command ( struct cmdq_item item)

Definition at line 539 of file cmd-queue.c.

Referenced by cmdq_next().

◆ cmdq_free()

void cmdq_free ( struct cmdq_list queue)

Definition at line 134 of file cmd-queue.c.

References fatalx(), and cmdq_list::list.

Referenced by server_client_free().

◆ cmdq_free_state()

◆ cmdq_get()

static struct cmdq_list* cmdq_get ( struct client c)

Definition at line 109 of file cmd-queue.c.

References cmdq_new(), and client::queue.

Referenced by cmdq_append(), cmdq_next(), and cmdq_running().

◆ cmdq_get_callback1()

struct cmdq_item* cmdq_get_callback1 ( const char *  name,
cmdq_cb  cb,
void *  data 

Definition at line 640 of file cmd-queue.c.

◆ cmdq_get_client()

◆ cmdq_get_command()

◆ cmdq_get_current()

struct cmd_find_state* cmdq_get_current ( struct cmdq_item item)

Definition at line 192 of file cmd-queue.c.

References cmdq_state::current, and cmdq_item::state.

Referenced by cmd_find_target().

◆ cmdq_get_error()

◆ cmdq_get_event()

struct key_event* cmdq_get_event ( struct cmdq_item item)

◆ cmdq_get_flags()

int cmdq_get_flags ( struct cmdq_item item)

Definition at line 199 of file cmd-queue.c.

References cmdq_state::flags, and cmdq_item::state.

Referenced by notify_add().

◆ cmdq_get_name()

const char* cmdq_get_name ( struct cmdq_item item)

Definition at line 143 of file cmd-queue.c.

References cmdq_list::item, and cmdq_item::name.

Referenced by spawn_log().

◆ cmdq_get_source()

struct cmd_find_state* cmdq_get_source ( struct cmdq_item item)

Definition at line 178 of file cmd-queue.c.

References cmdq_item::source.

◆ cmdq_get_state()

struct cmdq_state* cmdq_get_state ( struct cmdq_item item)

◆ cmdq_get_target()

◆ cmdq_get_target_client()

struct client* cmdq_get_target_client ( struct cmdq_item item)

◆ cmdq_guard()

void cmdq_guard ( struct cmdq_item item,
const char *  guard,
int  flags 

◆ cmdq_insert_after()

◆ cmdq_insert_hook()

◆ cmdq_link_state()

struct cmdq_state* cmdq_link_state ( struct cmdq_state state)

Definition at line 229 of file cmd-queue.c.

References cmdq_state::references.

Referenced by cmdq_find_flag().

◆ cmdq_merge_formats()

void cmdq_merge_formats ( struct cmdq_item item,
struct format_tree ft 

◆ cmdq_name()

static const char* cmdq_name ( struct client c)

Definition at line 94 of file cmd-queue.c.

References client::name, and xsnprintf().

Referenced by cmdq_append(), cmdq_insert_after(), and cmdq_next().

◆ cmdq_new()

struct cmdq_list* cmdq_new ( void  )

Definition at line 123 of file cmd-queue.c.

References cmdq_list::list, and xcalloc().

Referenced by cmdq_get(), and server_client_create().

◆ cmdq_new_state()

◆ cmdq_next()

◆ cmdq_print()

◆ cmdq_remove()

static void cmdq_remove ( struct cmdq_item item)

◆ cmdq_remove_group()

static void cmdq_remove_group ( struct cmdq_item item)

Definition at line 457 of file cmd-queue.c.

References cmdq_remove(), cmdq_item::group, and cmdq_item::next.

Referenced by cmdq_next().

◆ cmdq_running()

struct cmdq_item* cmdq_running ( struct client c)

Definition at line 767 of file cmd-queue.c.

References cmdq_get(), CMDQ_WAITING, cmdq_item::flags, and cmdq_list::item.

Referenced by notify_add().


TAILQ_HEAD ( cmdq_item_list  ,