diff options
| author | Gerd Moellmann | 2000-11-19 14:36:01 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-11-19 14:36:01 +0000 |
| commit | 5bdd7bdd78bd1ca0f1ee531a4815c61a15e6e2de (patch) | |
| tree | d8aa424339522f357594f40fba85fffd243552cc /src | |
| parent | 20ee9f081e043b15b6654bc2228a1c935989d8b2 (diff) | |
| download | emacs-5bdd7bdd78bd1ca0f1ee531a4815c61a15e6e2de.tar.gz emacs-5bdd7bdd78bd1ca0f1ee531a4815c61a15e6e2de.zip | |
(emacs_ospeed): New variable.
(toplevel): Don't declare ospeed extern.
(init_baud_rate): Use emacs_ospeed instead of ospeed.
Diffstat (limited to 'src')
| -rw-r--r-- | src/sysdep.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index 189c814eaa8..2a457313a1c 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | /* Interfaces to system-dependent kernel and library entries. | 1 | /* Interfaces to system-dependent kernel and library entries. |
| 2 | Copyright (C) 1985, 86,87,88,93,94,95, 1999 Free Software Foundation, Inc. | 2 | Copyright (C) 1985, 86,87,88,93,94,95, 1999, 2000 |
| 3 | Free Software Foundation, Inc. | ||
| 3 | 4 | ||
| 4 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 5 | 6 | ||
| @@ -234,22 +235,17 @@ static int baud_convert[] = | |||
| 234 | 235 | ||
| 235 | #ifdef HAVE_SPEED_T | 236 | #ifdef HAVE_SPEED_T |
| 236 | #include <termios.h> | 237 | #include <termios.h> |
| 237 | extern speed_t ospeed; | ||
| 238 | #else | 238 | #else |
| 239 | #if defined (HAVE_LIBNCURSES) && ! defined (NCURSES_OSPEED_T) | 239 | #if defined (HAVE_LIBNCURSES) && ! defined (NCURSES_OSPEED_T) |
| 240 | extern short ospeed; | ||
| 241 | #else | 240 | #else |
| 242 | #if defined (HAVE_TERMIOS_H) && defined (LINUX) | 241 | #if defined (HAVE_TERMIOS_H) && defined (LINUX) |
| 243 | #include <termios.h> | 242 | #include <termios.h> |
| 244 | /* HJL's version of libc is said to need this on the Alpha. | ||
| 245 | On the other hand, DEC OSF1 on the Alpha needs ospeed to be a short. */ | ||
| 246 | extern speed_t ospeed; | ||
| 247 | #else | ||
| 248 | extern short ospeed; | ||
| 249 | #endif | 243 | #endif |
| 250 | #endif | 244 | #endif |
| 251 | #endif | 245 | #endif |
| 252 | 246 | ||
| 247 | int emacs_ospeed; | ||
| 248 | |||
| 253 | /* The file descriptor for Emacs's input terminal. | 249 | /* The file descriptor for Emacs's input terminal. |
| 254 | Under Unix, this is normally zero except when using X; | 250 | Under Unix, this is normally zero except when using X; |
| 255 | under VMS, we place the input channel number here. */ | 251 | under VMS, we place the input channel number here. */ |
| @@ -342,32 +338,32 @@ void | |||
| 342 | init_baud_rate () | 338 | init_baud_rate () |
| 343 | { | 339 | { |
| 344 | if (noninteractive) | 340 | if (noninteractive) |
| 345 | ospeed = 0; | 341 | emacs_ospeed = 0; |
| 346 | else | 342 | else |
| 347 | { | 343 | { |
| 348 | #ifdef INIT_BAUD_RATE | 344 | #ifdef INIT_BAUD_RATE |
| 349 | INIT_BAUD_RATE (); | 345 | INIT_BAUD_RATE (); |
| 350 | #else | 346 | #else |
| 351 | #ifdef DOS_NT | 347 | #ifdef DOS_NT |
| 352 | ospeed = 15; | 348 | emacs_ospeed = 15; |
| 353 | #else /* not DOS_NT */ | 349 | #else /* not DOS_NT */ |
| 354 | #ifdef VMS | 350 | #ifdef VMS |
| 355 | struct sensemode sg; | 351 | struct sensemode sg; |
| 356 | 352 | ||
| 357 | SYS$QIOW (0, input_fd, IO$_SENSEMODE, &sg, 0, 0, | 353 | SYS$QIOW (0, input_fd, IO$_SENSEMODE, &sg, 0, 0, |
| 358 | &sg.class, 12, 0, 0, 0, 0 ); | 354 | &sg.class, 12, 0, 0, 0, 0 ); |
| 359 | ospeed = sg.xmit_baud; | 355 | emacs_ospeed = sg.xmit_baud; |
| 360 | #else /* not VMS */ | 356 | #else /* not VMS */ |
| 361 | #ifdef HAVE_TERMIOS | 357 | #ifdef HAVE_TERMIOS |
| 362 | struct termios sg; | 358 | struct termios sg; |
| 363 | 359 | ||
| 364 | sg.c_cflag = B9600; | 360 | sg.c_cflag = B9600; |
| 365 | tcgetattr (input_fd, &sg); | 361 | tcgetattr (input_fd, &sg); |
| 366 | ospeed = cfgetospeed (&sg); | 362 | emacs_ospeed = cfgetospeed (&sg); |
| 367 | #if defined (USE_GETOBAUD) && defined (getobaud) | 363 | #if defined (USE_GETOBAUD) && defined (getobaud) |
| 368 | /* m88k-motorola-sysv3 needs this (ghazi@noc.rutgers.edu) 9/1/94. */ | 364 | /* m88k-motorola-sysv3 needs this (ghazi@noc.rutgers.edu) 9/1/94. */ |
| 369 | if (ospeed == 0) | 365 | if (emacs_ospeed == 0) |
| 370 | ospeed = getobaud (sg.c_cflag); | 366 | emacs_ospeed = getobaud (sg.c_cflag); |
| 371 | #endif | 367 | #endif |
| 372 | #else /* neither VMS nor TERMIOS */ | 368 | #else /* neither VMS nor TERMIOS */ |
| 373 | #ifdef HAVE_TERMIO | 369 | #ifdef HAVE_TERMIO |
| @@ -379,14 +375,14 @@ init_baud_rate () | |||
| 379 | #else | 375 | #else |
| 380 | ioctl (input_fd, TCGETA, &sg); | 376 | ioctl (input_fd, TCGETA, &sg); |
| 381 | #endif | 377 | #endif |
| 382 | ospeed = sg.c_cflag & CBAUD; | 378 | emacs_ospeed = sg.c_cflag & CBAUD; |
| 383 | #else /* neither VMS nor TERMIOS nor TERMIO */ | 379 | #else /* neither VMS nor TERMIOS nor TERMIO */ |
| 384 | struct sgttyb sg; | 380 | struct sgttyb sg; |
| 385 | 381 | ||
| 386 | sg.sg_ospeed = B9600; | 382 | sg.sg_ospeed = B9600; |
| 387 | if (ioctl (input_fd, TIOCGETP, &sg) < 0) | 383 | if (ioctl (input_fd, TIOCGETP, &sg) < 0) |
| 388 | abort (); | 384 | abort (); |
| 389 | ospeed = sg.sg_ospeed; | 385 | emacs_ospeed = sg.sg_ospeed; |
| 390 | #endif /* not HAVE_TERMIO */ | 386 | #endif /* not HAVE_TERMIO */ |
| 391 | #endif /* not HAVE_TERMIOS */ | 387 | #endif /* not HAVE_TERMIOS */ |
| 392 | #endif /* not VMS */ | 388 | #endif /* not VMS */ |
| @@ -394,8 +390,8 @@ init_baud_rate () | |||
| 394 | #endif /* not INIT_BAUD_RATE */ | 390 | #endif /* not INIT_BAUD_RATE */ |
| 395 | } | 391 | } |
| 396 | 392 | ||
| 397 | baud_rate = (ospeed < sizeof baud_convert / sizeof baud_convert[0] | 393 | baud_rate = (emacs_ospeed < sizeof baud_convert / sizeof baud_convert[0] |
| 398 | ? baud_convert[ospeed] : 9600); | 394 | ? baud_convert[emacs_ospeed] : 9600); |
| 399 | if (baud_rate == 0) | 395 | if (baud_rate == 0) |
| 400 | baud_rate = 1200; | 396 | baud_rate = 1200; |
| 401 | } | 397 | } |