home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c070 / 4.ddi / TOOLS.4 / TCTSRC1.EXE / SCATTRIB.C < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-31  |  1.3 KB  |  53 lines

  1. /**
  2. *
  3. * Name        scattrib -- Write copies of a character on the current
  4. *            display page with the specified display attribute.
  5. *
  6. * Synopsis    iret = scattrib(fore,back,ch,cnt);
  7. *
  8. *        int iret      Return value is always 0
  9. *        int fore      Foreground display attribute
  10. *        int back      Background display attribute
  11. *        char ch       Character to be displayed
  12. *        unsigned cnt      Number of copies of ch to be
  13. *                  displayed.
  14. *
  15. * Description    This function displays cnt copies of the character ch
  16. *        starting at the current cursor position.  The cursor is
  17. *        not moved.  The copies are displayed with attributes
  18. *        (fore, back) on the current page (b_curpage).
  19. *
  20. *        Unexpected results may occur if you write beyond the end
  21. *        of the screen, or if (in graphics mode) you write beyond
  22. *        the current text row.  This function will not scroll the
  23. *        screen.
  24. *
  25. * Version    6.00 (C)Copyright Blaise Computing Inc.  1983,1987,1989
  26. *
  27. **/
  28.  
  29. #include <dos.h>
  30.  
  31. #include <bscreens.h>
  32.  
  33. int scattrib(fore,back,ch,cnt)
  34. int     fore;
  35. int     back;
  36. char     ch;
  37. unsigned cnt;
  38. {
  39.     union REGS inregs,outregs;
  40.  
  41.     if (cnt)
  42.     {
  43.     inregs.h.ah = 9;
  44.     inregs.h.al = ch;
  45.     inregs.h.bh = (unsigned char) b_curpage;
  46.     inregs.h.bl = (unsigned char) utnybbyt(back,fore);
  47.     inregs.x.cx = cnt;
  48.     int86(16,&inregs,&outregs);
  49.     }
  50.  
  51.     return(0);
  52. }
  53.