Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
a2607559
Commit
a2607559
authored
26 years ago
by
dtc
Browse files
Options
Downloads
Patches
Plain Diff
Rework get-terminal-attributes to use the termios interface to get the
speed on FreeBSD.
parent
8194ecc5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hemlock/tty-disp-rt.lisp
+18
-10
18 additions, 10 deletions
hemlock/tty-disp-rt.lisp
with
18 additions
and
10 deletions
hemlock/tty-disp-rt.lisp
+
18
−
10
View file @
a2607559
...
...
@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/hemlock/tty-disp-rt.lisp,v 1.
4
1998/
06/16 06:58:58
dtc Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/hemlock/tty-disp-rt.lisp,v 1.
5
1998/
10/04 08:28:33
dtc Exp $"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -48,7 +48,7 @@
;;;; Get terminal attributes:
(
defvar
*terminal-baud-rate*
nil
)
(
declaim
(
type
(
or
(
unsigned-byte
16
)
null
)
*terminal-baud-rate*
))
(
declaim
(
type
(
or
(
unsigned-byte
24
)
null
)
*terminal-baud-rate*
))
;;; GET-TERMINAL-ATTRIBUTES -- Interface
;;;
...
...
@@ -61,13 +61,17 @@
;;;
(
defun
get-terminal-attributes
(
&optional
(
fd
1
))
(
alien:with-alien
((
winsize
(
alien:struct
unix:winsize
))
#-
glibc2
(
sgtty
(
alien:struct
unix:sgttyb
)))
#-
(
or
glibc2
freebsd
)
(
sgtty
(
alien:struct
unix:sgttyb
))
#+
freebsd
; termios
(
tios
(
alien:struct
unix:termios
)))
(
let
((
size-win
(
unix:unix-ioctl
fd
unix:TIOCGWINSZ
(
alien:alien-sap
winsize
)))
#-
glibc2
#-
(
or
glibc2
freebsd
)
(
speed-win
(
unix:unix-ioctl
fd
unix:TIOCGETP
(
alien:alien-sap
sgtty
))))
(
alien:alien-sap
sgtty
)))
#+
freebsd
(
speed-win
(
unix:unix-tcgetattr
fd
(
alien:alien-sap
tios
))))
(
flet
((
frob
(
val
)
(
if
(
and
size-win
(
not
(
zerop
val
)))
val
...
...
@@ -75,13 +79,17 @@
(
values
(
frob
(
alien:slot
winsize
'unix:ws-row
))
(
frob
(
alien:slot
winsize
'unix:ws-col
))
#+
glibc2
4800
#-
glibc2
#-
(
or
glibc2
freebsd
)
(
and
speed-win
(
setq
*terminal-baud-rate*
(
svref
unix:terminal-speeds
(
alien:slot
sgtty
'unix:sg-ospeed
)))))))))
(
alien:slot
sgtty
'unix:sg-ospeed
))))
#+
freebsd
(
and
speed-win
(
setq
*terminal-baud-rate*
(
unix:unix-cfgetospeed
tios
)))
#+
glibc2
4800
)))))
;;;; Output routines and buffering.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment