/* Copyright (C) 2008 Emmanuel Varoquaux This file is part of XOS. 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. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef TTY_STRUCT_H #define TTY_STRUCT_H #include "tty_queue_struct.h" #include #include #include struct tty_struct; struct winsize_struct { unsigned short height; unsigned short width; }; struct tty_vtbl_struct { void (*do_output)(struct tty_struct *tty, struct tty_queue_struct *tty_queue); void (*do_stop)(struct tty_struct *tty); void (*do_start)(struct tty_struct *tty); int (*do_ioctl)(struct tty_struct *tty, int request, void *fs_arg); }; struct tty_struct { const struct tty_vtbl_struct *vptr; /* parametres */ unsigned long iflags; /* modes d'entree */ unsigned long oflags; /* modes de sortie */ unsigned long lflags; /* modes locaux */ unsigned char cc[NCCS]; /* caracteres de controle */ int pgid; /* groupe d'avant-plan */ unsigned stopped : 1; unsigned int output_column; unsigned int read_lines; /* nombre de lignes entieres disponibles dans la file de lecture */ unsigned read_new_line : 1; /* ligne courante vierge */ unsigned int read_current_start; /* position du debut de la ligne courante dans la file de lecture */ unsigned read_timeout : 1; unsigned int echo_current_first_column; /* premiere colonne de l'echo de la ligne courante */ struct alarm_struct read_alarm; struct condition_struct started_condition; struct condition_struct read_condition; /* condition d'attente pour la lecture */ struct mutex_struct read_mutex; struct mutex_struct write_mutex; struct tty_queue_struct input_queue; struct tty_queue_struct read_queue; struct tty_queue_struct output_queue; }; #endif