-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathterminal.h
More file actions
33 lines (26 loc) · 704 Bytes
/
terminal.h
File metadata and controls
33 lines (26 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef TERMINAL_H
#define TERMINAL_H
#include <stddef.h>
#include "color.h"
#include "screen.h"
#include "vtparse/vtparse.h"
typedef struct terminal {
int feedback_fd;
#ifdef DEBUG_DUMP
int debug_fd;
#endif
screen_t *screen;
vtparse_t parser;
enum keypad { KEYPAD_NORMAL = 0, KEYPAD_DECPAM = 1 } keypad;
int lnm; // automatic new line
char last_printed; // last printed char
pt_t saved_cursor;
size_t osc_buffer_len;
char osc_buffer[1024];
uint32_t color_list[COLORS];
uint32_t accumulator;
int pending_bytes;
} terminal_t;
void terminal_init(terminal_t *terminal, screen_t *screen, int feedback_fd);
void terminal_feed(terminal_t *terminal, unsigned char *data, int size);
#endif