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

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

#include "vterm_internal.h"
#include <stdio.h>
#include <string.h>
+ Include dependency graph for parser.c:

Go to the source code of this file.

Macros

#define ENTER_STATE(st)   do { vt->parser.state = st; string_start = NULL; } while(0)
 
#define ENTER_NORMAL_STATE()   ENTER_STATE(NORMAL)
 
#define IS_STRING_STATE()   (vt->parser.state >= OSC_COMMAND)
 

Functions

static bool is_intermed (unsigned char c)
 
static void do_control (VTerm *vt, unsigned char control)
 
static void do_csi (VTerm *vt, char command)
 
static void do_escape (VTerm *vt, char command)
 
static void string_fragment (VTerm *vt, const char *str, size_t len, bool final)
 
size_t vterm_input_write (VTerm *vt, const char *bytes, size_t len)
 
void vterm_parser_set_callbacks (VTerm *vt, const VTermParserCallbacks *callbacks, void *user)
 
void * vterm_parser_get_cbdata (VTerm *vt)
 
void vterm_parser_set_emit_nul (VTerm *vt, bool emit)
 

Macro Definition Documentation

◆ ENTER_NORMAL_STATE

#define ENTER_NORMAL_STATE ( )    ENTER_STATE(NORMAL)

◆ ENTER_STATE

#define ENTER_STATE (   st)    do { vt->parser.state = st; string_start = NULL; } while(0)

◆ IS_STRING_STATE

#define IS_STRING_STATE ( )    (vt->parser.state >= OSC_COMMAND)

Function Documentation

◆ do_control()

static void do_control ( VTerm vt,
unsigned char  control 
)
static

Definition at line 13 of file parser.c.

References DEBUG_LOG, VTerm::parser, and vt.

+ Here is the caller graph for this function:

◆ do_csi()

static void do_csi ( VTerm vt,
char  command 
)
static

Definition at line 22 of file parser.c.

References CSI_ARG, CSI_ARG_HAS_MORE, DEBUG_LOG, VTerm::parser, and vt.

+ Here is the caller graph for this function:

◆ do_escape()

static void do_escape ( VTerm vt,
char  command 
)
static

Definition at line 48 of file parser.c.

References DEBUG_LOG, INTERMED_MAX, VTerm::parser, strncpy(), and vt.

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

◆ is_intermed()

static bool is_intermed ( unsigned char  c)
static

Definition at line 8 of file parser.c.

+ Here is the caller graph for this function:

◆ string_fragment()

static void string_fragment ( VTerm vt,
const char *  str,
size_t  len,
bool  final 
)
static

Definition at line 64 of file parser.c.

References VTerm::parser, VTerm::state, VTermStringFragment::str, and vt.

+ Here is the caller graph for this function:

◆ vterm_input_write()

size_t vterm_input_write ( VTerm vt,
const char *  bytes,
size_t  len 
)

Definition at line 111 of file parser.c.

References CSI_ARG_FLAG_MORE, CSI_ARG_MISSING, CSI_LEADER_MAX, DEBUG_LOG, do_control(), do_csi(), do_escape(), ENTER_NORMAL_STATE, ENTER_STATE, INTERMED_MAX, is_intermed(), IS_STRING_STATE, VTerm::mode, VTerm::parser, VTerm::state, string_fragment(), and vt.

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

◆ vterm_parser_get_cbdata()

void * vterm_parser_get_cbdata ( VTerm vt)

Definition at line 394 of file parser.c.

References VTerm::parser, and vt.

◆ vterm_parser_set_callbacks()

void vterm_parser_set_callbacks ( VTerm vt,
const VTermParserCallbacks callbacks,
void *  user 
)

Definition at line 388 of file parser.c.

References VTerm::parser, and vt.

+ Here is the caller graph for this function:

◆ vterm_parser_set_emit_nul()

void vterm_parser_set_emit_nul ( VTerm vt,
bool  emit 
)

Definition at line 399 of file parser.c.

References VTerm::parser, and vt.

+ Here is the caller graph for this function: