root/morphix/trunk/fbmngplay-0.5a/fbmngplay-0.5a/console.c

Revision 2, 0.8 kB (checked in by nextime, 2 years ago)

Initial import, branching from morphix svn

Line 
1 /*
2  *      fbmngplay - framebuffer console MNG player.
3  *      (c) 2001-2002 by Stefan Reinauer, <stepan@suse.de>
4  *   
5  *      This program is based on mngplay, part of libmng, written and (C) by
6  *      Ralph Giles <giles@ashlu.bc.ca>
7  *
8  *      This program my be redistributed under the terms of the
9  *      GNU General Public Licence, version 2, or at your preference,
10  *      any later version.
11  */
12
13 #include <stdio.h>
14 #include <stdlib.h>
15 #include <unistd.h>
16 #include <fcntl.h>
17 #include <errno.h>
18 #include <linux/kd.h>
19 #include <linux/vt.h>
20 #include <sys/ioctl.h>
21
22 #include "console.h"
23
24 int start_console = 0;
25 int fd;
26
27 int current_console(void)
28 {
29         int  result=0;
30         char twelve=12;
31
32         result = ioctl(fd, TIOCLINUX, &twelve);
33
34         return result;
35 }
36
37 void init_consoles(void)
38 {
39         fd=open("/dev/tty0", O_RDWR|O_NDELAY);
40         if (fd<0) {
41                 fprintf(stderr, "Could not open virtual terminal.\n");
42                 exit (1);
43         }
44 }
45
Note: See TracBrowser for help on using the browser.