[Mplayer-cvslog] CVS: main/linux vbelib.c,1.17,1.18

Nick Kurshev nick at mplayer.dev.hu
Tue Nov 20 08:55:37 CET 2001


Update of /cvsroot/mplayer/main/linux
In directory mplayer:/var/tmp.root/cvs-serv28494/main/linux

Modified Files:
	vbelib.c 
Log Message:
Hide terminal's output and text-mode cursor for LCD and DFP

Index: vbelib.c
===================================================================
RCS file: /cvsroot/mplayer/main/linux/vbelib.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- vbelib.c	15 Nov 2001 16:44:43 -0000	1.17
+++ vbelib.c	20 Nov 2001 07:55:34 -0000	1.18
@@ -89,6 +89,27 @@
 #define VBE_LRMI_int(int_no,regs) (VBE_LRMI_int(int_no,regs))
 #endif
 
+static FILE *my_stdin;
+static FILE *my_stdout;
+static FILE *my_stderr;
+
+static void __set_cursor_type(FILE *stdout_fd,int cursor_on)
+{
+  fprintf(stdout_fd,"\033[?25%c",cursor_on?'h':'l');
+}
+
+/* TODO: do it only on LCD or DFP. We should extract such info from DDC */
+static void hide_terminal_output( void )
+{
+  my_stdin  = fopen(ttyname(fileno(stdin )),"r");
+  my_stdout = fopen(ttyname(fileno(stdout)),"w");
+  my_stderr = fopen(ttyname(fileno(stderr)),"w");
+  __set_cursor_type(stdout,0);
+/*if(isatty(fileno(stdin ))) stdin =freopen("/dev/null","r",stdin );*/
+  if(isatty(fileno(stdout))) stdout=freopen("/dev/null","w",stdout);
+  if(isatty(fileno(stderr))) stderr=freopen("/dev/null","w",stderr);
+}
+
 static unsigned hh_int_10_seg;
 static int fd_mem;
 int vbeInit( void )
@@ -115,11 +136,13 @@
 	 && vbe_pm_info.iopl_ports[i++] > 1023) ioperm(iopl_port,1,1);
    iopl(3);
    fd_mem = open("/dev/mem",O_RDWR);
+   hide_terminal_output();
    return VBE_OK;
 }
 
 int vbeDestroy( void ) 
 {
+  __set_cursor_type(my_stdout,1);
   close(fd_mem);
   return VBE_OK;
 }




More information about the MPlayer-cvslog mailing list