-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.h
85 lines (73 loc) · 2.13 KB
/
main.h
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//
// Created by colten on 05/07/17.
//
#ifndef STTYL_MAIN_H
#define STTYL_MAIN_H
#include <stdlib.h>
#include <termios.h>
#include <stdio.h>
#include <memory.h>
#include <unistd.h>
struct flaginfo {int fl_value; char *fl_name;};
struct flaginfo iflags[] = {
//{IGNBRK , "ignbrk"},
//{BRKINT , "brkint"},
//{IGNPAR , "ignpar"},
//{PARMRK , "parmrk"},
//{INPCK , "inpck"},
//{ISTRIP , "istrip"},
//{INLCR , "inlcr"},
//{IGNCR , "igncr"},
//{IUCLC , "iuclc"},
//{IXON , "ixon"},
//{IXANY , "ixany"},
//{IXOFF , "ixoff"},
//{IMAXBEL , "imaxbel"},
{ICRNL , "icrnl"},
{0 , NULL}
};
struct flaginfo oflags[] = {
//{OPOST , "opost"},
//{OCRNL , "ocrnl"},
//{ONLRET , "onlret"},
//{OFILL , "ofill"},
//{OFDEL , "ofdel"},
{ONLCR , "onlcr"},
{OLCUC , "olcuc"},
{0 , NULL}
};
struct flaginfo lflags[] = {
//{ECHOK , "echok"},
//{ECHOKE , "echoke"},
//{ECHOCTL , "echoctl"},
//{ECHONL , "echonl"},
//{NOFLSH , "noflsh"},
//{TOSTOP , "tostop"},
//{FLUSHO , "flusho"},
{ISIG , "isig"},
{ICANON , "icanon"},
{ECHOE , "echoe"},
{ECHO , "echo"},
{0 , NULL}
};
struct flaginfo cflags[] = {
{CRTSCTS , "crtscts"},
{0 , NULL}
};
struct flaginfo c_cc[] = {
{VINTR , "intr"},
{VQUIT , "quit"},
{VERASE , "erase"},
{VKILL , "kill"},
{VMIN , "min"},
{VTIME , "time"},
{0 , NULL}
};
struct termios;
void show_baud(int);
void show_keys(struct termios *);
void show_flags(struct termios *);
void show_flagset(int, struct flaginfo[]);
int normalize_key(int);
void set_flag(int, int, int, struct termios *);
#endif //STTYL_MAIN_H