LF OS
Hobby operating system for amd64 with high ambitions
Loading...
Searching...
No Matches
vterm-ctrl.c File Reference

(475a4fe LLVM update: finally on 18.x!)

#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <termios.h>
+ Include dependency graph for vterm-ctrl.c:

Go to the source code of this file.

Macros

#define _XOPEN_SOURCE   600 /* strdup */
 
#define streq(a, b)   (strcmp(a,b)==0)
 

Enumerations

enum  BoolQuery { OFF , ON , QUERY }
 

Functions

static char * getvalue (int *argip, int argc, char *argv[])
 
static int getchoice (int *argip, int argc, char *argv[], const char *options[])
 
static BoolQuery getboolq (int *argip, int argc, char *argv[])
 
static bool seticanon (bool icanon, bool echo)
 
static void await_c1 (unsigned char c1)
 
static char * read_csi (void)
 
static char * read_dcs (void)
 
static void usage (int exitcode)
 
static bool query_dec_mode (int mode)
 
static void do_dec_mode (int mode, BoolQuery val, const char *name)
 
static int query_rqss_numeric (char *cmd)
 
void restoreicanon (void)
 
int main (int argc, char *argv[])
 

Variables

static char * helptext []
 
bool wasicanon
 

Macro Definition Documentation

◆ _XOPEN_SOURCE

#define _XOPEN_SOURCE   600 /* strdup */

Definition at line 1 of file vterm-ctrl.c.

◆ streq

#define streq (   a,
 
)    (strcmp(a,b)==0)

Definition at line 7 of file vterm-ctrl.c.

Enumeration Type Documentation

◆ BoolQuery

enum BoolQuery
Enumerator
OFF 
ON 
QUERY 

Definition at line 34 of file vterm-ctrl.c.

Function Documentation

◆ await_c1()

static void await_c1 ( unsigned char  c1)
static

Definition at line 82 of file vterm-ctrl.c.

+ Here is the caller graph for this function:

◆ do_dec_mode()

static void do_dec_mode ( int  mode,
BoolQuery  val,
const char *  name 
)
static

Definition at line 195 of file vterm-ctrl.c.

References name, OFF, ON, QUERY, and query_dec_mode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getboolq()

static BoolQuery getboolq ( int *  argip,
int  argc,
char *  argv[] 
)
static

Definition at line 40 of file vterm-ctrl.c.

References getchoice().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getchoice()

static int getchoice ( int *  argip,
int  argc,
char *  argv[],
const char *  options[] 
)
static

Definition at line 21 of file vterm-ctrl.c.

References getvalue(), and streq.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getvalue()

static char * getvalue ( int *  argip,
int  argc,
char *  argv[] 
)
static

Definition at line 11 of file vterm-ctrl.c.

+ Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 249 of file vterm-ctrl.c.

References do_dec_mode(), getboolq(), getchoice(), getvalue(), query_rqss_numeric(), restoreicanon(), seticanon(), streq, usage(), and wasicanon.

+ Here is the call graph for this function:

◆ query_dec_mode()

static bool query_dec_mode ( int  mode)
static

Definition at line 157 of file vterm-ctrl.c.

References free(), and read_csi().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ query_rqss_numeric()

static int query_rqss_numeric ( char *  cmd)
static

Definition at line 212 of file vterm-ctrl.c.

References free(), num, read_dcs(), strcmp(), and strlen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_csi()

static char * read_csi ( void  )
static

Definition at line 100 of file vterm-ctrl.c.

References await_c1().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_dcs()

static char * read_dcs ( void  )
static

Definition at line 120 of file vterm-ctrl.c.

References await_c1().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ restoreicanon()

void restoreicanon ( void  )

Definition at line 244 of file vterm-ctrl.c.

References seticanon(), and wasicanon.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ seticanon()

static bool seticanon ( bool  icanon,
bool  echo 
)
static

Definition at line 63 of file vterm-ctrl.c.

+ Here is the caller graph for this function:

◆ usage()

static void usage ( int  exitcode)
static

Definition at line 145 of file vterm-ctrl.c.

References helptext.

+ Here is the caller graph for this function:

Variable Documentation

◆ helptext

char* helptext[]
static
Initial value:
= {
"reset",
"s8c1t [off|on]",
"keypad [app|num]",
"screen [off|on|query]",
"cursor [off|on|query]",
"curblink [off|on|query]",
"curshape [block|under|bar|query]",
"mouse [off|click|clickdrag|motion]",
"reportfocus [off|on|query]",
"altscreen [off|on|query]",
"bracketpaste [off|on|query]",
"icontitle [STR]",
"icon [STR]",
"title [STR]",
NULL
}

Definition at line 45 of file vterm-ctrl.c.

◆ wasicanon

bool wasicanon

Definition at line 242 of file vterm-ctrl.c.