bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Termcap changes


From: Gary Wong
Subject: Termcap changes
Date: Mon, 25 Feb 2002 13:20:08 -0500
User-agent: Mutt/1.2.5i

Hi,

I have a couple of patches to recommend for inclusion in termcap.c and
tparam.c.  They only change parts of the files in `#ifndef emacs'
sections, so they shouldn't affect Emacs at all; their only purpose is
to keep the copies of these files within Emacs and in the standalone
termcap library identical.  I intend to make a bug-fix release of
termcap with these new files soon, so please let me know if you
think there are any problems.

Here are diffs against the Emacs CVS head revisions:


--- /home/gtw/src/emacs/src/termcap.c   Mon May 28 07:58:27 2001
+++ /home/gtw/src/termcap-1.3.1/termcap.c       Mon Feb 25 12:59:21 2002
@@ -289,12 +289,14 @@
 
 /* Outputting a string with padding.  */
 
+#ifndef emacs
+short ospeed;
 /* If OSPEED is 0, we use this as the actual baud rate.  */
 int tputs_baud_rate;
+#endif
 char PC;
 
-#if 0 /* Doesn't seem to be used anymore.  */
-
+#ifndef emacs
 /* Actual baud rate if positive;
    - baud rate / 100 if negative.  */
 
@@ -309,7 +311,7 @@
 #endif /* not VMS */
   };
 
-#endif /* 0  */
+#endif /* not emacs */
 
 void
 tputs (str, nlines, outfun)
@@ -320,13 +322,20 @@
   register int padcount = 0;
   register int speed;
 
+#ifdef emacs
   extern int baud_rate;
   speed = baud_rate;
   /* For quite high speeds, convert to the smaller
      units to avoid overflow.  */
   if (speed > 10000)
     speed = - speed / 100;
-
+#else
+  if (ospeed == 0)
+    speed = tputs_baud_rate;
+  else
+    speed = speeds[ospeed];
+#endif
+  
   if (!str)
     return;
--- /home/gtw/src/emacs/src/tparam.c    Fri Dec  8 04:58:48 2000
+++ /home/gtw/src/termcap-1.3.1/tparam.c        Mon Feb 25 12:37:24 2002
@@ -24,9 +24,6 @@
 #ifdef emacs
 #include "lisp.h"              /* for xmalloc */
 #else
-#if defined(HAVE_STRING_H) || defined(STDC_HEADERS)
-#define bcopy(s, d, n) memcpy ((d), (s), (n))
-#endif
 
 #ifdef STDC_HEADERS
 #include <stdlib.h>
@@ -34,6 +31,11 @@
 #else
 char *malloc ();
 char *realloc ();
+#endif
+
+/* Do this after the include, in case string.h prototypes bcopy.  */
+#if (defined(HAVE_STRING_H) || defined(STDC_HEADERS)) && !defined(bcopy)
+#define bcopy(s, d, n) memcpy ((d), (s), (n))
 #endif
 
 #endif /* not emacs */
 


and here is a ChangeLog entry:


2002-02-25  Gary Wong  <address@hidden>

     * termcap.c [!emacs]: Replace ospeed for building standalone
     libtermcap, for binary compatibility.

     * tparam.c [!emacs]: Move #define of bcopy to after
     #include <string.h>.  Reported by Oleg Kornilov and Iyer Viswanathan.


Cheers,
Gary.
-- 
   Gary Wong           address@hidden           http://www.cs.arizona.edu/~gary/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]