/* -------------------------------------------------------------------- * Character I/O Routines and Basic Screen Handeling (18_Jan_84) * ------------------------------------------------------------- */ # include "su2hdr.h" /* Character output routines * ------------------------- */ put (a) { cputs (a); } cputs (a) register char *a; { for (; *a; a++) cputc (*a); } cputc (a) char a; { cpm (CPUTC, a); } prs (a) char *a; { cpm (CPRS, a); } prn (a) { put (itoa (a)); } char * itoa (a) { static char buf [8]; buf [itob (buf, a, 16)] = NULL; return buf; } /* Character Input Routines * ------------------------ */ cgetc () { char c; for (;;) { c = cpm (6, -1); /* direct console input */ if (c) break; } if (c == 3) exit (); c = tolower (c); return c; } /* -------------------------------------------------------------------- * Position the Cursor * ------------------- */ char spot [][2] = { 0,0, /* HEADING */ 3,0, /* PARAGRAPH */ 8,0, 9,8, /* CBAUD */ 11,0, 12,8, /* PTYPE */ 8,35, 9,43, /* PBAUD */ 11,35, 12,43, /* PROTOCOL */ 14,16, /* immediate */ 15,16, /* permanent */ 16,14, /* quit */ 19,0, /* select */ }; /* Clear the Screen * ---------------- */ clear () { prs ("\32$"); } /* Set the Cursor Position * ----------------------- */ set_cursor (a) { prs ("\33=$"); cputc (spot[a][0] + ' '); cputc (spot[a][1] + ' '); }