/* bits/termios.h: Terminal control definitions. */

#ifndef _BITS_TERMIOS_H
#define _BITS_TERMIOS_H

#include <bits/fixed-size-types.h>

typedef long tcflag_t;
typedef char cc_t;

#define NCCS 4

#define VEOF 0
#define VERASE 1
#define VINTR 2
#define VQUIT 3

// VERY incomplete termios structure.
struct termios
{
    tcflag_t c_lflag;
    cc_t c_cc[NCCS];
};

struct winsize
{
    __u16_t ws_row;
    __u16_t ws_col;
    __u16_t ws_xpixel;
    __u16_t ws_ypixel;
};

// Values for c_lflag.
#define ECHO 1
#define TOSTOP 2
#define ECHOCTL 4
#define ISIG 8
#define ICANON 16
#define ECHOE 32
#define NOFLSH 64

// termios ioctl() requests.
#define TCGETS 0
#define TCSETS 1
#define TIOCSPGRP 2
#define TIOCGPGRP 3
#define TIOCGWINSZ 4

#endif