45 unsigned int function,
int count,
50 for ( handler = handlers ; handler->
function ; handler++ ) {
51 if ( handler->
function ==
function ) {
76 if (
ctx->count == 0 ) {
90 }
else if ( (
c >=
'0' ) && (
c <=
'9' ) ) {
96 }
else if (
c ==
';' ) {
99 if (
ctx->count > ( sizeof (
ctx->params ) /
100 sizeof (
ctx->params[0] ) ) ) {
103 DBG (
"Too many parameters in ANSI escape " 106 }
else if ( ( (
c >= 0x20 ) && (
c <= 0x2f ) ) ||
A handler for an escape sequence.
static __always_inline void off_t int c
void(* handle)(struct ansiesc_context *ctx, unsigned int count, int params[])
Handle escape sequence.
unsigned int function
The control function identifier.
ANSI escape sequence context.
struct golan_eq_context ctx
int ansiesc_process(struct ansiesc_context *ctx, int c)
Process character that may be part of ANSI escape sequence.
uint16_t count
Number of entries.
#define ESC
Escape character.
struct hv_monitor_parameter param[4][32]
Parameters.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
#define DBG(...)
Print a debugging message.
static void ansiesc_call_handler(struct ansiesc_context *ctx, unsigned int function, int count, int params[])
Call ANSI escape sequence handler.
void * memset(void *dest, int character, size_t len) __nonnull