home *** CD-ROM | disk | FTP | other *** search
- /*
- * wy50.c
- */
-
- #include <stdio.h>
-
- /* Define as 1 to restore original cursor position at end. */
- #define RESTORE_POS 0
-
- /* Row and column to return to when finished. */
- static int saver,
- savec;
-
- /*
- * Save the initial cursor position.
- */
- wy50_savepos()
- {
- #if RESTORE_POS
- /* Transmit "send the cursor address" code. */
- printf("\033?");
- if (fflush(stdout) == EOF) {
- fprintf(stderr, "Transmission error\n");
- (void) cleanup();
- return -1;
- }
- saver = getchar();
- savec = getchar();
- /* Discard CR. */
- (void) getchar();
- #else
- /* Place cursor on bottom line (row) for neatness. */
- saver = 24 + 31;
- savec = 1 + 31;
- #endif
- }
-
- /*
- * Restore the initial cursor position.
- */
- wy50_restorepos()
- {
- printf("\033=%c%c", saver, savec);
- }
-
- /*
- * Tell the terminal to transmit a line.
- */
- wy50_transline(line)
- int line;
- {
- /* Locate cursor at end of next line (row n, column 80). */
- printf("\033=%c%c", line + 31, 80 + 31);
- /*
- * Send "transmit line" code. This will send the whole line, padding to
- * 80 columns with spaces. Due to graphics and special mode codes, which
- * will be sent as well, it could end up being well over 80 characters
- * long.
- */
- printf("\033");
- printf("6");
- }
-