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)  

compat.h File Reference
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/uio.h>
#include <fnmatch.h>
#include <limits.h>
#include <stdio.h>
#include <termios.h>
#include <wchar.h>
#include <event.h>
#include <inttypes.h>
#include "compat/queue.h"
#include "compat/tree.h"
#include "compat/bitstring.h"
#include "compat/vis.h"
#include "compat/imsg.h"
Include dependency graph for compat.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define __attribute__(a)
 
#define __unused   __attribute__ ((__unused__))
 
#define __dead   __attribute__ ((__noreturn__))
 
#define __packed   __attribute__ ((__packed__))
 
#define __weak   __attribute__ ((__weak__))
 
#define ECHOPRT   0
 
#define ACCESSPERMS   (S_IRWXU|S_IRWXG|S_IRWXO)
 
#define _PATH_BSHELL   "/bin/sh"
 
#define _PATH_TMP   "/tmp/"
 
#define _PATH_DEVNULL   "/dev/null"
 
#define _PATH_TTY   "/dev/tty"
 
#define _PATH_DEV   "/dev/"
 
#define _PATH_DEFPATH   "/usr/bin:/bin"
 
#define _PATH_VI   "/usr/bin/vi"
 
#define pledge(s, p)   (0)
 
#define IMAXBEL   0
 
#define CMSG_ALIGN(len)   (((len) + sizeof(long) - 1) & ~(sizeof(long) - 1))
 
#define CMSG_SPACE(len)   (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len))
 
#define CMSG_LEN(len)   (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
 
#define O_DIRECTORY   0
 
#define FNM_CASEFOLD   0
 
#define INFTIM   -1
 
#define WAIT_ANY   -1
 
#define SUN_LEN(sun)   (sizeof (sun)->sun_path)
 
#define timercmp(tvp, uvp, cmp)
 
#define timeradd(tvp, uvp, vvp)
 
#define timersub(tvp, uvp, vvp)
 
#define TTY_NAME_MAX   32
 
#define HOST_NAME_MAX   255
 
#define CLOCK_REALTIME   0
 
#define CLOCK_MONOTONIC   CLOCK_REALTIME
 
#define LOCK_SH   0
 
#define LOCK_EX   0
 
#define LOCK_NB   0
 
#define flock(fd, op)   (0)
 
#define getopt(ac, av, o)   BSDgetopt(ac, av, o)
 
#define opterr   BSDopterr
 
#define optind   BSDoptind
 
#define optopt   BSDoptopt
 
#define optreset   BSDoptreset
 
#define optarg   BSDoptarg
 

Functions

void err (int, const char *,...)
 
void errx (int, const char *,...)
 
void warn (const char *,...)
 
void warnx (const char *,...)
 
void explicit_bzero (void *, size_t)
 
int getdtablecount (void)
 
void closefrom (int)
 
char * strcasestr (const char *, const char *)
 
char * strsep (char **, const char *)
 
long long strtonum (const char *, long long, long long, const char **)
 
size_t strlcpy (char *, const char *, size_t)
 
size_t strlcat (char *, const char *, size_t)
 
size_t strnlen (const char *, size_t)
 
char * strndup (const char *, size_t)
 
void * memmem (const void *, size_t, const void *, size_t)
 
int daemon (int, int)
 
const char * getprogname (void)
 
void setproctitle (const char *,...)
 
int clock_gettime (int, struct timespec *)
 
int b64_ntop (const char *, size_t, char *, size_t)
 
int b64_pton (const char *, u_char *, size_t)
 
int getptmfd (void)
 
pid_t fdforkpty (int, int *, char *, struct termios *, struct winsize *)
 
pid_t forkpty (int *, char *, struct termios *, struct winsize *)
 
int asprintf (char **, const char *,...)
 
int vasprintf (char **, const char *, va_list)
 
char * fgetln (FILE *, size_t *)
 
ssize_t getline (char **, size_t *, FILE *)
 
int setenv (const char *, const char *, int)
 
int unsetenv (const char *)
 
void cfmakeraw (struct termios *)
 
void freezero (void *, size_t)
 
void * reallocarray (void *, size_t, size_t)
 
void * recallocarray (void *, size_t, size_t, size_t)
 
int BSDgetopt (int, char *const *, const char *)
 

Variables

int BSDopterr
 
int BSDoptind
 
int BSDoptopt
 
int BSDoptreset
 
char * BSDoptarg
 

Macro Definition Documentation

◆ __attribute__

#define __attribute__ (   a)

Definition at line 52 of file compat.h.

◆ __dead

#define __dead   __attribute__ ((__noreturn__))

Definition at line 63 of file compat.h.

◆ __packed

#define __packed   __attribute__ ((__packed__))

Definition at line 66 of file compat.h.

◆ __unused

#define __unused   __attribute__ ((__unused__))

Definition at line 60 of file compat.h.

◆ __weak

#define __weak   __attribute__ ((__weak__))

Definition at line 69 of file compat.h.

◆ _PATH_BSHELL

#define _PATH_BSHELL   "/bin/sh"

Definition at line 98 of file compat.h.

◆ _PATH_DEFPATH

#define _PATH_DEFPATH   "/usr/bin:/bin"

Definition at line 118 of file compat.h.

◆ _PATH_DEV

#define _PATH_DEV   "/dev/"

Definition at line 114 of file compat.h.

◆ _PATH_DEVNULL

#define _PATH_DEVNULL   "/dev/null"

Definition at line 106 of file compat.h.

◆ _PATH_TMP

#define _PATH_TMP   "/tmp/"

Definition at line 102 of file compat.h.

◆ _PATH_TTY

#define _PATH_TTY   "/dev/tty"

Definition at line 110 of file compat.h.

◆ _PATH_VI

#define _PATH_VI   "/usr/bin/vi"

Definition at line 122 of file compat.h.

◆ ACCESSPERMS

#define ACCESSPERMS   (S_IRWXU|S_IRWXG|S_IRWXO)

Definition at line 77 of file compat.h.

◆ CLOCK_MONOTONIC

#define CLOCK_MONOTONIC   CLOCK_REALTIME

Definition at line 272 of file compat.h.

◆ CLOCK_REALTIME

#define CLOCK_REALTIME   0

Definition at line 269 of file compat.h.

◆ CMSG_ALIGN

#define CMSG_ALIGN (   len)    (((len) + sizeof(long) - 1) & ~(sizeof(long) - 1))

Definition at line 193 of file compat.h.

◆ CMSG_LEN

#define CMSG_LEN (   len)    (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))

Definition at line 202 of file compat.h.

◆ CMSG_SPACE

#define CMSG_SPACE (   len)    (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len))

Definition at line 198 of file compat.h.

◆ ECHOPRT

#define ECHOPRT   0

Definition at line 73 of file compat.h.

◆ flock

#define flock (   fd,
  op 
)    (0)

Definition at line 279 of file compat.h.

◆ FNM_CASEFOLD

#define FNM_CASEFOLD   0

Definition at line 213 of file compat.h.

◆ getopt

#define getopt (   ac,
  av,
 
)    BSDgetopt(ac, av, o)

Definition at line 438 of file compat.h.

◆ HOST_NAME_MAX

#define HOST_NAME_MAX   255

Definition at line 265 of file compat.h.

◆ IMAXBEL

#define IMAXBEL   0

Definition at line 130 of file compat.h.

◆ INFTIM

#define INFTIM   -1

Definition at line 218 of file compat.h.

◆ LOCK_EX

#define LOCK_EX   0

Definition at line 277 of file compat.h.

◆ LOCK_NB

#define LOCK_NB   0

Definition at line 278 of file compat.h.

◆ LOCK_SH

#define LOCK_SH   0

Definition at line 276 of file compat.h.

◆ O_DIRECTORY

#define O_DIRECTORY   0

Definition at line 206 of file compat.h.

◆ optarg

#define optarg   BSDoptarg

Definition at line 443 of file compat.h.

◆ opterr

#define opterr   BSDopterr

Definition at line 439 of file compat.h.

◆ optind

#define optind   BSDoptind

Definition at line 440 of file compat.h.

◆ optopt

#define optopt   BSDoptopt

Definition at line 441 of file compat.h.

◆ optreset

#define optreset   BSDoptreset

Definition at line 442 of file compat.h.

◆ pledge

#define pledge (   s,
 
)    (0)

Definition at line 126 of file compat.h.

◆ SUN_LEN

#define SUN_LEN (   sun)    (sizeof (sun)->sun_path)

Definition at line 226 of file compat.h.

◆ timeradd

#define timeradd (   tvp,
  uvp,
  vvp 
)
Value:
do { \
(vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \
(vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \
if ((vvp)->tv_usec >= 1000000) { \
(vvp)->tv_sec++; \
(vvp)->tv_usec -= 1000000; \
} \
} while (0)

Definition at line 237 of file compat.h.

◆ timercmp

#define timercmp (   tvp,
  uvp,
  cmp 
)
Value:
(((tvp)->tv_sec == (uvp)->tv_sec) ? \
((tvp)->tv_usec cmp (uvp)->tv_usec) : \
((tvp)->tv_sec cmp (uvp)->tv_sec))

Definition at line 230 of file compat.h.

◆ timersub

#define timersub (   tvp,
  uvp,
  vvp 
)
Value:
do { \
(vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
(vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
if ((vvp)->tv_usec < 0) { \
(vvp)->tv_sec--; \
(vvp)->tv_usec += 1000000; \
} \
} while (0)

Definition at line 249 of file compat.h.

◆ TTY_NAME_MAX

#define TTY_NAME_MAX   32

Definition at line 261 of file compat.h.

◆ WAIT_ANY

#define WAIT_ANY   -1

Definition at line 222 of file compat.h.

Function Documentation

◆ asprintf()

int asprintf ( char **  ,
const char *  ,
  ... 
)

Referenced by fatal(), and fatalx().

◆ b64_ntop()

int b64_ntop ( const char *  ,
size_t  ,
char *  ,
size_t   
)

Referenced by input_osc_52(), and tty_set_selection().

◆ b64_pton()

int b64_pton ( const char *  ,
u_char *  ,
size_t   
)

Referenced by input_osc_52(), and tty_keys_clipboard().

◆ BSDgetopt()

int BSDgetopt ( int  ,
char *const *  ,
const char *   
)

◆ cfmakeraw()

void cfmakeraw ( struct termios *  )

Referenced by client_main().

◆ clock_gettime()

int clock_gettime ( int  ,
struct timespec *   
)

Referenced by get_timer().

◆ closefrom()

void closefrom ( int  )

Referenced by client_exec(), and spawn_pane().

◆ daemon()

int daemon ( int  ,
int   
)

Referenced by proc_fork_and_daemon().

◆ err()

void err ( int  ,
const char *  ,
  ... 
)

Referenced by main().

◆ errx()

void errx ( int  ,
const char *  ,
  ... 
)

Referenced by LLVMFuzzerTestOneInput(), and main().

◆ explicit_bzero()

void explicit_bzero ( void *  ,
size_t   
)

◆ fdforkpty()

pid_t fdforkpty ( int  ,
int *  ,
char *  ,
struct termios *  ,
struct winsize *   
)

Referenced by spawn_pane().

◆ fgetln()

char* fgetln ( FILE *  ,
size_t *   
)

◆ forkpty()

pid_t forkpty ( int *  ,
char *  ,
struct termios *  ,
struct winsize *   
)

◆ freezero()

void freezero ( void *  ,
size_t   
)

◆ getdtablecount()

int getdtablecount ( void  )

◆ getline()

ssize_t getline ( char **  ,
size_t *  ,
FILE *   
)

Referenced by client_main().

◆ getprogname()

const char* getprogname ( void  )

Referenced by areshell(), main(), and usage().

◆ getptmfd()

int getptmfd ( void  )

Referenced by main().

◆ memmem()

void* memmem ( const void *  ,
size_t  ,
const void *  ,
size_t   
)

Referenced by window_buffer_search().

◆ reallocarray()

void* reallocarray ( void *  ,
size_t  ,
size_t   
)

Referenced by xreallocarray().

◆ recallocarray()

void* recallocarray ( void *  ,
size_t  ,
size_t  ,
size_t   
)

Referenced by xrecallocarray().

◆ setenv()

int setenv ( const char *  ,
const char *  ,
int   
)

◆ setproctitle()

void setproctitle ( const char *  ,
  ... 
)

Referenced by proc_start().

◆ strcasestr()

char* strcasestr ( const char *  ,
const char *   
)

Referenced by main().

◆ strlcat()

◆ strlcpy()

size_t strlcpy ( char *  ,
const char *  ,
size_t   
)

◆ strndup()

char* strndup ( const char *  ,
size_t   
)

Referenced by xstrndup().

◆ strnlen()

size_t strnlen ( const char *  ,
size_t   
)

◆ strsep()

◆ strtonum()

◆ unsetenv()

int unsetenv ( const char *  )

Referenced by osdep_event_init().

◆ vasprintf()

int vasprintf ( char **  ,
const char *  ,
va_list   
)

Referenced by environ_log(), log_vwrite(), and xvasprintf().

◆ warn()

void warn ( const char *  ,
  ... 
)

◆ warnx()

void warnx ( const char *  ,
  ... 
)

Variable Documentation

◆ BSDoptarg

char* BSDoptarg
extern

◆ BSDopterr

int BSDopterr
extern

◆ BSDoptind

int BSDoptind
extern

◆ BSDoptopt

int BSDoptopt
extern

◆ BSDoptreset

int BSDoptreset
extern