TacOS  0.2
 Tout Structures de données Fichiers Fonctions Variables Définitions de type Énumérations Macros
Macros | Fonctions | Variables
Référence du fichier tty.c
#include <fs/devfs.h>
#include <kfcntl.h>
#include <klibc/string.h>
#include <klog.h>
#include <kmalloc.h>
#include <kprocess.h>
#include <ksem.h>
#include <ksignal.h>
#include <scheduler.h>
#include <tty.h>
Graphe des dépendances par inclusion de tty.c:

Macros

#define EOF   (-1)
 
#define I_ECHO(tty)   (tty->termios.c_lflag & ECHO)
 
#define I_CANON(tty)   (tty->termios.c_lflag & ICANON)
 
#define I_IGNCR(tty)   (tty->termios.c_iflag & IGNCR)
 
#define I_ICRNL(tty)   (tty->termios.c_iflag & ICRNL)
 
#define I_INLCR(tty)   (tty->termios.c_iflag & INLCR)
 
#define L_ISIG(tty)   (tty->termios.c_lflag & ISIG)
 
#define L_ECHOE(tty)   (tty->termios.c_lflag & ECHOE)
 
#define L_ECHOCTL(tty)   (tty->termios.c_lflag & ECHOCTL)
 
#define QUIT_CHAR(tty)   ((tty)->termios.c_cc[VQUIT])
 
#define INTR_CHAR(tty)   ((tty)->termios.c_cc[VINTR])
 
#define SUSP_CHAR(tty)   ((tty)->termios.c_cc[VSUSP])
 
#define ERASE_CHAR(tty)   ((tty)->termios.c_cc[VERASE])
 
#define ERASE_WORD(tty)   ((tty)->termios.c_cc[VWERASE])
 
#define EOF_CHAR(tty)   ((tty)->termios.c_cc[VEOF])
 
#define PREV_CHAR_INDEX(tty)   ((tty->p_end + MAX_INPUT - 1) % MAX_INPUT)
 
#define NEXT_CHAR_INDEX(tty)   ((tty->p_end + 1) % MAX_INPUT)
 

Fonctions

void tty_init ()
 Initialisation du système de terminaux.
 
void tty_insert_flip_char (tty_struct_t *tty, unsigned char c)
 
tty_driver_talloc_tty_driver (int lines)
 
int tty_register_driver (tty_driver_t *driver)
 

Variables

struct termios tty_std_termios
 

Description détaillée

Auteur
TacOS developers

LICENSE

Copyright (C) 2010-2014 TacOS developers.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details at http://www.gnu.org/copyleft/gpl.html

You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses.

DESCRIPTION

Gestion des terminaux tty.

Documentation des macros

#define EOF_CHAR (   tty)    ((tty)->termios.c_cc[VEOF])

EOF char

#define ERASE_CHAR (   tty)    ((tty)->termios.c_cc[VERASE])

Erase char

#define ERASE_WORD (   tty)    ((tty)->termios.c_cc[VWERASE])

Erase char

#define I_CANON (   tty)    (tty->termios.c_lflag & ICANON)

Mode canonique ?

#define I_ECHO (   tty)    (tty->termios.c_lflag & ECHO)

Echo activé ?

#define I_ICRNL (   tty)    (tty->termios.c_iflag & ICRNL)

CR => NL ?

#define I_IGNCR (   tty)    (tty->termios.c_iflag & IGNCR)

Ignore CR ?

#define I_INLCR (   tty)    (tty->termios.c_iflag & INLCR)

NL => CR ?

#define INTR_CHAR (   tty)    ((tty)->termios.c_cc[VINTR])

Interrupt char

#define L_ECHOCTL (   tty)    (tty->termios.c_lflag & ECHOCTL)

Echo Ctrl ?

#define L_ECHOE (   tty)    (tty->termios.c_lflag & ECHOE)

Echo erase ?

#define L_ISIG (   tty)    (tty->termios.c_lflag & ISIG)

Signals enabled ?

#define PREV_CHAR_INDEX (   tty)    ((tty->p_end + MAX_INPUT - 1) % MAX_INPUT)

Indice du charactère precedent.

#define QUIT_CHAR (   tty)    ((tty)->termios.c_cc[VQUIT])

Quit char

#define SUSP_CHAR (   tty)    ((tty)->termios.c_cc[VSUSP])

Suspend char

Documentation des fonctions

tty_driver_t* alloc_tty_driver ( int  lines)

Allocation d'un driver de terminal.

Paramètres
linesNombre de terminaux géré par ce driver.
Renvoie
le driver alloué.

Voici le graphe d'appel pour cette fonction :

Voici le graphe des appelants de cette fonction :

void tty_insert_flip_char ( tty_struct_t tty,
unsigned char  ch 
)

Ajoute un caractère dans le butter du tty.

Paramètres
ttyle tty qui nous intéresse.
chle caractère à ajouter.

Voici le graphe d'appel pour cette fonction :

Voici le graphe des appelants de cette fonction :

int tty_register_driver ( tty_driver_t driver)

Enregistre en tant que char device un driver alloué et configuré.

Paramètres
driverLe driver à enregistrer.
Renvoie
0 en cas de succès (mais ne détecte pas encore les erreurs...).

Voici le graphe d'appel pour cette fonction :

Voici le graphe des appelants de cette fonction :

Documentation des variables

struct termios tty_std_termios
Valeur initiale :
= {
.c_iflag = ICRNL | IXON,
.c_oflag = OPOST | ONLCR,
.c_cflag = CS8 | CREAD | HUPCL,
.c_lflag = ISIG | ICANON | ECHO | ECHOE | ECHOK |
.c_cc = INIT_C_CC,
.c_ispeed = 38400,
}
#define CREAD
Definition: termios_types.h:74
#define ONLCR
Definition: termios_types.h:53
#define ISIG
Definition: termios_types.h:59
#define ICRNL
Definition: termios_types.h:47
#define OPOST
Definition: termios_types.h:52
#define ECHO
Definition: termios_types.h:61
#define CS8
Definition: termios_types.h:72
#define IXON
Definition: termios_types.h:48
#define HUPCL
Definition: termios_types.h:77
#define ECHOE
Definition: termios_types.h:62
#define ECHOKE
Definition: termios_types.h:65
#define ICANON
Definition: termios_types.h:60
#define ECHOK
Definition: termios_types.h:63
#define ECHOCTL
Definition: termios_types.h:64