* Copyright (c) 1983 Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of California at Berkeley. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
static char sccsid
[] = "@(#)tttermcap.c 3.8 (Berkeley) %G%";
register struct tt_str
*s
;
if ((str
= tgetstr(str
, &tt_strp
)) == 0)
if ((s
= (struct tt_str
*) malloc(sizeof *s
)) == 0)
s
->ts_n
= tt_strp
- s
->ts_str
- 1;
register struct tt_str
*s
;
if (tgetstr(str
, &bufp
) == 0)
if ((s
= (struct tt_str
*) malloc(sizeof *s
)) == 0)
s
->ts_n
= tt_strp
- s
->ts_str
;
register char *p
= s
->ts_str
;
ttputs(tgoto(p
, col
, row
));
for (p
+= s
->ts_n
; *--p
== 0;)
register struct tt_str
*a
, *b
;
if (r
= bcmp(a
->ts_str
, b
->ts_str
,
(n
= a
->ts_n
- b
->ts_n
) < 0 ? a
->ts_n
: b
->ts_n
))