PatchworkOS
Loading...
Searching...
No Matches

ANSI. More...

Data Structures

struct  ansi_receiving_t
 ANSI receiving structure. More...
 
struct  ansi_sending_t
 ANSI sending structure. More...
 

Macros

#define ANSI_MAX_LENGTH   8
 The size we use for buffers when parsing ANSI sequences.
 

Functions

static void ansi_kbd_to_receiving (ansi_receiving_t *ansi, const event_kbd_t *kbd)
 Convert a keycode to an ANSI receiving sequence.
 
static void ansi_sending_init (ansi_sending_t *ansi)
 Initialize an ANSI sending structure.
 
static bool ansi_sending_parse (ansi_sending_t *ansi, char chr)
 Parse a character for ANSI sending.
 

Detailed Description

ANSI.

Macro Definition Documentation

◆ ANSI_MAX_LENGTH

#define ANSI_MAX_LENGTH   8

The size we use for buffers when parsing ANSI sequences.

Definition at line 20 of file ansi.h.

Function Documentation

◆ ansi_kbd_to_receiving()

static void ansi_kbd_to_receiving ( ansi_receiving_t ansi,
const event_kbd_t kbd 
)
inlinestatic

Convert a keycode to an ANSI receiving sequence.

A receiving sequence is a sequence sent from the terminal and received by processes running in the terminal.

Parameters
ansiThe receiving structure to store the sequence in.
kbdThe keyboard event to convert.

Definition at line 40 of file ansi.h.

References ansi_receiving_t::buffer, kbd, KBD_BACKSPACE, KBD_C, KBD_DELETE, KBD_DOWN, KBD_END, KBD_ENTER, KBD_HOME, KBD_LEFT, KBD_MOD_CTRL, KBD_PAGE_DOWN, KBD_PAGE_UP, KBD_RIGHT, KBD_TAB, KBD_UP, ansi_receiving_t::length, and kbd_t::mods.

Referenced by terminal_handle_input().

◆ ansi_sending_init()

static void ansi_sending_init ( ansi_sending_t ansi)
inlinestatic

Initialize an ANSI sending structure.

Parameters
ansiThe sending structure to initialize.

Definition at line 153 of file ansi.h.

References ansi_sending_t::ascii, ansi_sending_t::buffer, ansi_sending_t::command, ansi_sending_t::length, memset(), ansi_sending_t::paramCount, and ansi_sending_t::parameters.

Referenced by ansi_sending_parse(), and terminal_procedure().

◆ ansi_sending_parse()

static bool ansi_sending_parse ( ansi_sending_t ansi,
char  chr 
)
inlinestatic

Parse a character for ANSI sending.

Parameters
ansiThe sending structure.
chrThe character to parse.
Returns
Whether the sequence is complete or still parsing.

Definition at line 170 of file ansi.h.

References ANSI_MAX_LENGTH, ansi_sending_init(), ansi_sending_t::ascii, ansi_sending_t::buffer, ansi_sending_t::command, isdigit(), ansi_sending_t::length, ansi_sending_t::paramCount, and ansi_sending_t::parameters.

Referenced by terminal_handle_output().