* ttycap - routines for dealing with the teletype capability data base
* Bill Joy UCB September 25, 1977
char ttycap
[] "/etc/ttycap";
cap
= fopen(ttycap
, ibuf
);
for (cp
= bp
, c
= getc(ibuf
); c
!= -1; c
= getc(ibuf
)) {
if (cp
> bp
&& cp
[-1] == '\\'){
for (Bp
= tbuf
; *Bp
&& *Bp
!= ':'; Bp
++) {
for (Np
= np
; *Np
&& *Bp
!= '|' && *Bp
!= ':' && *Bp
== *Np
; Bp
++, Np
++)
if (*Np
== 0 && (*Bp
== '|' || *Bp
== ':' || *Bp
== 0))
while (*Bp
&& *Bp
!= ':' && *Bp
!= '|')
while (*bp
&& *bp
!= ':')
for (bp
= tskip(tbuf
, 3); *bp
!= 0; bp
= tskip(bp
, 1)) {
if (*bp
++ != id
[0] || *bp
== 0 || *bp
++ != id
[1])
while (*bp
>= '0' && *bp
<= '9')
i
=* base
, i
=+ *bp
++ - '0';
for (bp
= tskip(tbuf
, 3); *bp
; bp
= tskip(bp
, 1))
if (*bp
++ == id
[0] && *bp
!= 0 && *bp
== id
[1])
for (bp
= tskip(tbuf
, 3); *bp
!= 0; bp
= tskip(bp
, 1)) {
if (*bp
++ != id
[0] || *bp
== 0 || *bp
++ != id
[1])
return (tdecode(bp
, area
));
while ((c
= *str
++) && c
!= ':') {
if (*str
>= 'a' && *str
<= 'z')
if (*str
>= '0' && *str
<= '9') {
c
=<< 3, c
=| *str
++ - '0';
while (--i
&& *str
>= '0' && *str
<= '9');