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)  

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

Go to the source code of this file.

Data Structures

struct  args_value
 
struct  args_entry
 

Functions

 TAILQ_HEAD (args_values, args_value)
 
static struct args_entryargs_find (struct args *, u_char)
 
static int args_cmp (struct args_entry *, struct args_entry *)
 
 RB_GENERATE_STATIC (args_tree, args_entry, entry, args_cmp)
 
struct argsargs_parse (const char *template, int argc, char **argv)
 
void args_free (struct args *args)
 
static void args_print_add (char **buf, size_t *len, const char *fmt,...)
 
static void args_print_add_value (char **buf, size_t *len, struct args_entry *entry, struct args_value *value)
 
static void args_print_add_argument (char **buf, size_t *len, const char *argument)
 
char * args_print (struct args *args)
 
char * args_escape (const char *s)
 
int args_has (struct args *args, u_char flag)
 
void args_set (struct args *args, u_char flag, const char *s)
 
const char * args_get (struct args *args, u_char flag)
 
u_char args_first (struct args *args, struct args_entry **entry)
 
u_char args_next (struct args_entry **entry)
 
const char * args_first_value (struct args *args, u_char flag, struct args_value **value)
 
const char * args_next_value (struct args_value **value)
 
long long args_strtonum (struct args *args, u_char flag, long long minval, long long maxval, char **cause)
 
long long args_percentage (struct args *args, u_char flag, long long minval, long long maxval, long long curval, char **cause)
 
long long args_string_percentage (const char *value, long long minval, long long maxval, long long curval, char **cause)
 

Function Documentation

◆ args_cmp()

static int args_cmp ( struct args_entry a1,
struct args_entry a2 
)
static

Definition at line 51 of file arguments.c.

References args_entry::flag.

◆ args_escape()

char* args_escape ( const char *  s)

◆ args_find()

static struct args_entry * args_find ( struct args args,
u_char  flag 
)
static

Definition at line 58 of file arguments.c.

References args_entry::flag, and args::tree.

Referenced by args_first_value(), args_get(), args_has(), args_percentage(), args_set(), and args_strtonum().

◆ args_first()

u_char args_first ( struct args args,
struct args_entry **  entry 
)

Definition at line 308 of file arguments.c.

References args::tree.

Referenced by cmdq_insert_hook().

◆ args_first_value()

const char* args_first_value ( struct args args,
u_char  flag,
struct args_value **  value 
)

Definition at line 328 of file arguments.c.

References args_find(), args_entry::flag, and args_entry::values.

Referenced by cmdq_insert_hook().

◆ args_free()

void args_free ( struct args args)

◆ args_get()

◆ args_has()

◆ args_next()

u_char args_next ( struct args_entry **  entry)

Definition at line 318 of file arguments.c.

References args::tree.

Referenced by cmdq_insert_hook().

◆ args_next_value()

const char* args_next_value ( struct args_value **  value)

Definition at line 343 of file arguments.c.

Referenced by cmdq_insert_hook().

◆ args_parse()

struct args* args_parse ( const char *  template,
int  argc,
char **  argv 
)

Definition at line 68 of file arguments.c.

References args::argc, args_free(), args_set(), args::argv, cmd_copy_argv(), getopt, optarg, optind, optreset, and xcalloc().

Referenced by cmd_parse().

◆ args_percentage()

long long args_percentage ( struct args args,
u_char  flag,
long long  minval,
long long  maxval,
long long  curval,
char **  cause 
)

◆ args_print()

◆ args_print_add()

static void args_print_add ( char **  buf,
size_t *  len,
const char *  fmt,
  ... 
)
static

Definition at line 124 of file arguments.c.

References strlcat(), xrealloc(), and xvasprintf().

Referenced by args_print(), args_print_add_argument(), and args_print_add_value().

◆ args_print_add_argument()

static void args_print_add_argument ( char **  buf,
size_t *  len,
const char *  argument 
)
static

Definition at line 160 of file arguments.c.

References args_escape(), and args_print_add().

Referenced by args_print().

◆ args_print_add_value()

static void args_print_add_value ( char **  buf,
size_t *  len,
struct args_entry entry,
struct args_value value 
)
static

Definition at line 143 of file arguments.c.

References args_escape(), args_print_add(), args_entry::flag, and args_value::value.

Referenced by args_print().

◆ args_set()

void args_set ( struct args args,
u_char  flag,
const char *  s 
)

◆ args_string_percentage()

long long args_string_percentage ( const char *  value,
long long  minval,
long long  maxval,
long long  curval,
char **  cause 
)

Definition at line 397 of file arguments.c.

References strtonum(), and xstrdup().

Referenced by args_percentage(), layout_set_main_h(), and layout_set_main_v().

◆ args_strtonum()

long long args_strtonum ( struct args args,
u_char  flag,
long long  minval,
long long  maxval,
char **  cause 
)

Definition at line 355 of file arguments.c.

References args_find(), strtonum(), args_value::value, args_entry::values, and xstrdup().

Referenced by cmd_capture_pane_exec().

◆ RB_GENERATE_STATIC()

RB_GENERATE_STATIC ( args_tree  ,
args_entry  ,
entry  ,
args_cmp   
)

◆ TAILQ_HEAD()

TAILQ_HEAD ( args_values  ,
args_value   
)