home *** CD-ROM | disk | FTP | other *** search
- /***( pokep.c )*****************************************************************
- * *
- * Written: Brent Faulkner - June 15, 1989 *
- * Updated: Brent Faulkner - June 15, 1989 *
- * *
- ********************************************************************************
- * *
- * Contents: poke_p() - put a character and attribute into the buffers *
- * rephoriz_p() - repeat a character and attribute horizontally *
- * repvert_p() - repeat a character and attribute vertically *
- * *
- *******************************************************************************/
- /* include files */
- #include <stdio.h>
- #include <bench.h>
- #include "prt.h"
-
- /*
- * put a character and attribute into the page buffer
- */
- void poke_p(line, col, attr, ch)
- int line;
- int col;
- int attr;
- int ch;
- {
- /* return if the character is off the page */
- if (line < 1 || col < 1 || line > (unsigned char)*prtdef[NUM_LINES] || col > (unsigned char)*prtdef[NUM_COLS])
- {
- #ifdef PDEBUG
- fprintf(stderr,
- "POKE_P(%d, %d, %4X, %2X) on page with %d lines and %d columns.\n",
- line, col, attr, ch, *prtdef[NUM_LINES], *prtdef[NUM_COLS]);
- #endif
- return;
- }
-
- /* put the character and it's attribute into the page buffers */
- pagebuff[line - 1][col - 1] = (char) ch;
- attrbuff[line - 1][col - 1] = attr;
- }
-
- /*
- * Repeatedly poke_p a character and attribute horizontally into the buffers
- */
- void rephoriz_p(line, col, attr, len, ch)
- int line;
- register int col;
- int attr;
- register int len;
- int ch;
- {
- while(len--)
- poke_p(line, col++, attr, ch);
- }
-
- /*
- * Repeatedly poke_p a character and attribute vertically into the buffers
- */
- void repvert_p(line, col, attr, len, ch)
- register int line;
- int col;
- int attr;
- register int len;
- int ch;
- {
- while(len--)
- poke_p(line++, col, attr, ch);
- }
-