home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / prof_c / 05oslib / bios / putstr.c < prev    next >
Encoding:
Text File  |  1988-08-11  |  372 b   |  22 lines

  1. /*
  2.  *    putstr -- display a character string in the
  3.  *    prevailing video attribute and return number
  4.  *    characters displayed
  5.  */
  6.  
  7. int
  8. putstr(s, pg)
  9. register char *s;
  10. unsigned int pg;
  11. {
  12.     unsigned int r, c, c0;
  13.  
  14.     readcur(&r, &c, pg);
  15.     for (c0 = c; *s != '\0'; ++s, ++c) {
  16.         putcur(r, c, pg);
  17.         writec(*s, 1, pg);
  18.     }
  19.     putcur(r, c, pg);
  20.     return (c - c0);
  21. }
  22.