home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_08_01 / 8n01091a < prev    next >
Text File  |  1990-02-19  |  841b  |  30 lines

  1. Listing 1
  2.  
  3. ------------------------------------------------------------
  4. puttext_write(x,y,xsize,ysize,string,attr,buffer)
  5. int x,y,xsize,ysize;
  6. char *string, attr, *buffer;
  7. {
  8. char *maxbuffer;
  9.  
  10. if (x >= xsize || y >= ysize)           /* Range Errors  */
  11.    return;
  12.  
  13. maxbuffer = buffer+(xsize*ysize*2)-1;
  14. /* maxbuffer points to the attribute of the last character */
  15.  
  16. buffer += (((y*xsize)+x)*2);
  17. /* buffer points to the first character to write */
  18.                                              
  19. /* While buffer is not overrun and there are characters left
  20.  * to print.
  21.  */
  22. while ((buffer < maxbuffer) && (*string != '\0')) {
  23.    *buffer++ = *string++;               /* Do character  */
  24.    *buffer++ = attr;                    /* Do attribute  */
  25.    }
  26. }
  27. ------------------------------------------------------------
  28.  
  29.  
  30.