summaryrefslogtreecommitdiffstats
path: root/src/c_init.h
blob: 1d298c46353b66aba45c0440db575a26d73f9279 (plain)
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
/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   u_init.h                                           :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: rbousset <marvin@42.fr>                    +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2020/02/14 17:19:27 by rbousset          #+#    #+#             */
/*   Updated: 2020/02/14 17:19:29 by rbousset         ###   ########lyon.fr   */
/*                                                                            */
/* ************************************************************************** */

#ifndef U_INIT_H
#define U_INIT_H

#include <termios.h>
#include <sys/ioctl.h>

#include "s_struct.h"

typedef struct s_caps {
    struct termios tios;
    struct winsize ws;
    uint8_t cpos;  /*cursor position (column)*/
    char  *cm_str; /*cursor mobility*/
    char  *nl;     /*newline, returned by tgoto()*/
    char  *ks;     /*indicate that keys transmit from now on*/
    char  *ke;     /*indicate that keys transmit from now on*/
    char  *kl;     /*Key Left Key Right*/
    char  *kr;
    char  *pc;     /*padding char --> do not touch (default 0)*/
    char  *bc;     /*left  one char*/
    char  *le;     /*left  one char*/
    char  *up;     /*up one line*/
    char  *DO;     /*down one line*/
    char  *nd;     /*right one char*/
    char  *cl;     /*line clear*/
} t_caps;

int16_t c_init_tcaps(t_msh *msh);
int16_t c_set_term_raw(uint8_t mode);

#endif

    /* tcaps.cl = tgetstr("cl", &term); */
    /* tcaps.ks = tgetstr("ks", &term); */
    /* tcaps.kl = tgetstr("kl", &term); */
    /* tcaps.ke = tgetstr("ke", &term); */
    /* tcaps.kr = tgetstr("kr", &term); */
    /* tcaps.pc = tgetstr("pc", &term); */
    /* tcaps.bc = tgetstr("bc", &term); */
    /* tcaps.up = tgetstr("up", &term); */
    /* tcaps.nd = tgetstr("nd", &term); */
    /* tcaps.le = tgetstr("le", &term); */
    /* tcaps.DO = tgetstr("do", &term); */