3 * Copyright (C) 2007 Tomas 'ZeXx86' Jedrzejek (zexx86@gmail.com)
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
34 #define VERSION "0.0.5"
36 int cursor_x
, cursor_y
;
41 void cursor_refresh ()
43 gotoxy (cursor_x
, cursor_y
+3);
46 unsigned key_handler ()
48 int scancode
= getkey ();
77 gotoxy (cursor_x
, cursor_y
+3);
79 write (fd
, buffer_cache
, 512);
88 int main (int argc
, char **argv
) // like main in a normal C program
99 for (p
= 1; p
< 79; p
++)
108 for (p
= 1; p
< 79; p
++)
116 for (p
= 1; p
< 79; p
++)
123 buffer_cache
= (char *) malloc (sizeof (char) * 512);
129 fd
= open (argv
[1], O_RDONLY
);
132 puts ("error -> file '");
134 puts ("' not found\n");
138 if (!read (fd
, buffer_cache
, 512)) {
139 puts ("error -> something was wrong !\n");
148 puts ("Text editor v" VERSION
);
160 unsigned char key
= 0;
171 } else if (key
== '\b') {
195 //buffer_cache[cursor_x + (cursor_y * 80)] = key;