1 /** \file terminal.h
2 * \brief Header: terminal emulation logic.
3 */
4
5 #ifndef MC_TERMINAL_H
6 #define MC_TERMINAL_H
7
8 #include <sys/types.h>
9 #include <inttypes.h> // uint32_t
10
11 #include "lib/global.h" // include <glib.h>
12
13 /*** typedefs(not structures) and defined constants **********************************************/
14
15 /*** enums ***************************************************************************************/
16
17 /*** structures declarations (and typedefs of structures)*****************************************/
18
19 typedef struct
20 {
21 char private_mode;
22 uint32_t params[16][4];
23 size_t param_count;
24 } csi_command_t;
25
26 /*** global variables defined in .c file *********************************************************/
27
28 /*** declarations of public functions ************************************************************/
29
30 gboolean parse_csi (csi_command_t *out, const char **sptr, const char *end);
31
32 char *strip_ctrl_codes (char *s);
33
34 /* Replaces "\\E" and "\\e" with "\033". Replaces "^" + [a-z] with
35 * ((char) 1 + (c - 'a')). The same goes for "^" + [A-Z].
36 * Returns a newly allocated string. */
37 char *convert_controls (const char *s);
38
39 /*** inline functions ****************************************************************************/
40
41 #endif