* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
static char sccsid
[] = "@(#)tc3.c 5.1 (Berkeley) %G%";
* Dummy program to test out termlib.
* Input two numbers and it prints out the tgoto string generated.
char *getenv(), *tgetstr();
main(argc
, argv
) char **argv
; {
printf("UP = %x = ", UP
); pr(UP
); printf("\n");
printf("CM = "); pr(CM
); printf("\n");
if (scanf("%d %d", &row
, &col
) < 2)
tgout
= tgoto(CM
, row
, col
);
printf("%s", rdchar(*p
));
* rdchar: returns a readable representation of an ASCII char, using ^ notation.
* Due to a bug in isprint, this prints spaces as ^`, but this is OK
* because we want something to show up on the screen.
ret
[0] = ((c
&0377) > 0177) ? '\'' : ' ';
ret
[1] = isprint(c
) ? ' ' : '^';
ret
[2] = isprint(c
) ? c
: c
^0100;
for (p
=ret
; *p
==' '; p
++)