mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
vt: add vt_param_get() - returns the specified parameter's value
This commit is contained in:
parent
3ab68c575b
commit
9df691e1af
1 changed files with 11 additions and 0 deletions
11
vt.h
11
vt.h
|
|
@ -6,3 +6,14 @@
|
||||||
#include "terminal.h"
|
#include "terminal.h"
|
||||||
|
|
||||||
void vt_from_slave(struct terminal *term, const uint8_t *data, size_t len);
|
void vt_from_slave(struct terminal *term, const uint8_t *data, size_t len);
|
||||||
|
|
||||||
|
static inline int
|
||||||
|
vt_param_get(const struct terminal *term, size_t idx, int default_value)
|
||||||
|
{
|
||||||
|
if (term->vt.params.idx > idx) {
|
||||||
|
int value = term->vt.params.v[idx].value;
|
||||||
|
return value != 0 ? value : default_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return default_value;
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue