aboutsummaryrefslogtreecommitdiffstats
path: root/src/termcap.c
diff options
context:
space:
mode:
authorStefan Monnier2010-10-15 17:55:33 -0400
committerStefan Monnier2010-10-15 17:55:33 -0400
commit0c747cb143fa227e78f350ac353d703f489209df (patch)
tree5b434055c797bd75eaa1e3d9d0773e586d44daee /src/termcap.c
parenta01a7932080e8a6e7bc8472c58cefabcc2c37df3 (diff)
parentaa095b2db98ae149737f8de00ee733b1d257ed33 (diff)
downloademacs-0c747cb143fa227e78f350ac353d703f489209df.tar.gz
emacs-0c747cb143fa227e78f350ac353d703f489209df.zip
Merge from trunk
Diffstat (limited to 'src/termcap.c')
-rw-r--r--src/termcap.c35
1 files changed, 2 insertions, 33 deletions
diff --git a/src/termcap.c b/src/termcap.c
index ea4ef244f64..4ad0cee6264 100644
--- a/src/termcap.c
+++ b/src/termcap.c
@@ -20,24 +20,18 @@ Boston, MA 02110-1301, USA. */
20/* Emacs config.h may rename various library functions such as malloc. */ 20/* Emacs config.h may rename various library functions such as malloc. */
21#include <config.h> 21#include <config.h>
22#include <setjmp.h> 22#include <setjmp.h>
23#include <lisp.h> /* xmalloc is here */
24/* Get the O_* definitions for open et al. */
25#include <sys/file.h> 23#include <sys/file.h>
26#ifdef HAVE_FCNTL_H
27#include <fcntl.h> 24#include <fcntl.h>
28#endif
29#ifdef HAVE_UNISTD_H 25#ifdef HAVE_UNISTD_H
30#include <unistd.h> 26#include <unistd.h>
31#endif 27#endif
32 28
29#include "lisp.h"
30
33#ifndef NULL 31#ifndef NULL
34#define NULL (char *) 0 32#define NULL (char *) 0
35#endif 33#endif
36 34
37#ifndef O_RDONLY
38#define O_RDONLY 0
39#endif
40
41/* BUFSIZE is the initial size allocated for the buffer 35/* BUFSIZE is the initial size allocated for the buffer
42 for reading the termcap file. 36 for reading the termcap file.
43 It is not a limit. 37 It is not a limit.
@@ -268,45 +262,20 @@ tgetst1 (char *ptr, char **area)
268 262
269/* Outputting a string with padding. */ 263/* Outputting a string with padding. */
270 264
271#ifndef emacs
272short ospeed;
273/* If OSPEED is 0, we use this as the actual baud rate. */
274int tputs_baud_rate;
275#endif
276
277char PC; 265char PC;
278 266
279#ifndef emacs
280/* Actual baud rate if positive;
281 - baud rate / 100 if negative. */
282
283static const int speeds[] =
284 {
285 0, 50, 75, 110, 135, 150, -2, -3, -6, -12,
286 -18, -24, -48, -96, -192, -288, -384, -576, -1152
287 };
288
289#endif /* not emacs */
290
291void 267void
292tputs (register char *str, int nlines, register int (*outfun) (/* ??? */)) 268tputs (register char *str, int nlines, register int (*outfun) (/* ??? */))
293{ 269{
294 register int padcount = 0; 270 register int padcount = 0;
295 register int speed; 271 register int speed;
296 272
297#ifdef emacs
298 extern EMACS_INT baud_rate; 273 extern EMACS_INT baud_rate;
299 speed = baud_rate; 274 speed = baud_rate;
300 /* For quite high speeds, convert to the smaller 275 /* For quite high speeds, convert to the smaller
301 units to avoid overflow. */ 276 units to avoid overflow. */
302 if (speed > 10000) 277 if (speed > 10000)
303 speed = - speed / 100; 278 speed = - speed / 100;
304#else
305 if (ospeed == 0)
306 speed = tputs_baud_rate;
307 else
308 speed = speeds[ospeed];
309#endif
310 279
311 if (!str) 280 if (!str)
312 return; 281 return;