summaryrefslogtreecommitdiffstats
path: root/linux
diff options
context:
space:
mode:
authornick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-20 07:55:34 +0000
committernick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-20 07:55:34 +0000
commit62c4bc90cc6a6ccf8f5e6f646574d7ba47ba2df7 (patch)
treeb5ba53db046a00e799f5d36d6048180983ab7c8a /linux
parent109caf6b90051cbd1db0ea76099a7bfa55cde846 (diff)
downloadmpv-62c4bc90cc6a6ccf8f5e6f646574d7ba47ba2df7.tar.bz2
mpv-62c4bc90cc6a6ccf8f5e6f646574d7ba47ba2df7.tar.xz
Hide terminal's output and text-mode cursor for LCD and DFP
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3017 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'linux')
-rw-r--r--linux/vbelib.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/linux/vbelib.c b/linux/vbelib.c
index 409db15372..eda229834b 100644
--- a/linux/vbelib.c
+++ b/linux/vbelib.c
@@ -89,6 +89,27 @@ static inline int VBE_LRMI_int(int int_no, struct LRMI_regs *r)
#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 @@ int vbeInit( void )
&& 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;
}