websrv makefile updated; added support for more web pages to websrv; ZDE improvement...
[ZeXOS.git] / kernel / include / tty.h
blob879555264ee1aee15f5a6ee370b714b767e4d5c9
1 /*
2 * ZeX/OS
3 * Copyright (C) 2007 Tomas 'ZeXx86' Jedrzejek (zexx86@gmail.com)
4 * Copyright (C) 2008 Tomas 'ZeXx86' Jedrzejek (zexx86@gmail.com)
5 * Copyright (C) 2009 Tomas 'ZeXx86' Jedrzejek (zexx86@gmail.com)
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #ifndef _TTY_H
23 #define _TTY_H
25 #include <task.h>
26 #include <user.h>
27 #include <mytypes.h>
29 #define FD_TERM 0x2000
31 #define TTY_CON_BUF 16000
32 #define TTY_COUNT_MAX 1024
33 #define TTY_SCREEN_RES_VGA 4000
34 #define TTY_SCREEN_RES_VESA 4000
36 /* font type, size */
37 typedef struct {
38 unsigned char *c;
39 unsigned char x;
40 unsigned char y;
41 } tty_font_t;
43 /* character array resolution - 80x25 */
44 typedef struct {
45 unsigned short x;
46 unsigned short y;
47 } tty_char_t;
49 /* log for read () op purposes */
50 typedef struct {
51 char *buf;
52 unsigned short len;
53 } tty_log_t;
55 /* Device structure */
56 typedef struct tty_context {
57 struct tty_context *next, *prev;
59 task_t *task;
60 char *name;
61 char *screen;
62 unsigned char screen_x;
63 unsigned char screen_y;
64 user_t *user;
65 char shell[64];
66 unsigned shell_len;
67 bool logged;
68 char pwd[64];
69 bool active;
70 tty_log_t *log;
71 } tty_t;
73 /* externs */
74 extern tty_font_t tty_font; /* global font settings */
75 extern tty_char_t tty_char; /* global character array settings */
77 extern unsigned int init_tty ();
78 extern bool tty_write (tty_t *tty, char *str, unsigned len);
79 extern bool tty_putch (char c);
80 extern bool tty_putnch (tty_t *tty, char c);
81 extern bool tty_change (tty_t *tty);
82 extern tty_t *tty_find (char *name);
83 extern tty_t *tty_findbytask (task_t *task);
84 extern tty_t *gtty_init ();
85 extern tty_t *tty_create ();
86 extern void tty_listview ();
88 #endif