[MPlayer-cvslog] CVS: main/osdep getch2.c, 1.20, 1.21 getch2.h, 1.1.1.1, 1.2

Oded Shimon CVS syncmail at mplayerhq.hu
Sun Dec 25 19:26:37 CET 2005


CVS change done by Oded Shimon CVS

Update of /cvsroot/mplayer/main/osdep
In directory mail:/var2/tmp/cvs-serv12747/osdep

Modified Files:
	getch2.c getch2.h 
Log Message:
Use termcap "erase to end of line" character code instead of using spaces
to end of screen.


Index: getch2.c
===================================================================
RCS file: /cvsroot/mplayer/main/osdep/getch2.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- getch2.c	14 Nov 2005 00:28:03 -0000	1.20
+++ getch2.c	25 Dec 2005 18:26:35 -0000	1.21
@@ -40,6 +40,7 @@
 
 int screen_width=80;
 int screen_height=24;
+char * erase_to_end_of_line = "\033[J";
 
 typedef struct {
   int len;
@@ -78,6 +79,7 @@
 static int success=0;
 
 int load_termcap(char *termtype){
+  char * p;
   if(!termtype) termtype=getenv("TERM");
   if(!termtype) termtype="unknown";
   success=tgetent(term_buffer, termtype);
@@ -88,6 +90,7 @@
   screen_height=tgetnum("li");
   if(screen_width<1 || screen_width>255) screen_width=80;
   if(screen_height<1 || screen_height>255) screen_height=24;
+  if ((p = tgetstr("cd",&term_p))) erase_to_end_of_line=p;
 
   termcap_add("kP",KEY_PGUP);
   termcap_add("kN",KEY_PGDWN);

Index: getch2.h
===================================================================
RCS file: /cvsroot/mplayer/main/osdep/getch2.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- getch2.h	24 Feb 2001 20:30:12 -0000	1.1.1.1
+++ getch2.h	25 Dec 2005 18:26:35 -0000	1.2
@@ -5,6 +5,9 @@
 extern int screen_width;
 extern int screen_height;
 
+/* Termcap code to erase to end of line */
+extern char * erase_to_end_of_line;
+
 /* Get screen-size using IOCTL call. */
 extern void get_screen_size();
 




More information about the MPlayer-cvslog mailing list