home *** CD-ROM | disk | FTP | other *** search
-
- void gotoxy(col, line)
- int col, line;
-
- /*
- ---------------------------------------------------------------------------
-
- Last revision -
- 29 March 1984 - GWS
-
-
- NAME
- gotoxy - move the cursor to the requested position
-
- SYNOPSIS
- void gotoxy(col, line)
- int col, line;
-
- DESCRIPTION
- Uses termcap(3x) routines to move cursor. The columns and
- lines are numbered starting with 1.
-
- SEE ALSO
- termcap(3)
-
- DIAGNOSTICS
- If the cursor doesn't move, it didn't work.
-
- AUTHOR
- George W. Sherouse
- 29 March 1984
-
- ---------------------------------------------------------------------------
- */
-
- {
- static called = 0;
- static char id[] = "cm", cm_str[20];
- static char *point = cm_str, **point2 = &point;
- extern char bp[1024];
- int tgetent();
- int tputs();
- int putchar();
- char *tgoto();
- char str[20];
- int loop;
-
- if (!called)
- {
- tgetstr(id, point2);
- called++;
- }
-
- for (loop = 0; loop < 20; loop++)
- str[loop] = cm_str[loop];
-
-
- (void) tputs(tgoto(str, col - 1, line - 1), 1, putchar);
- return;
- }
-