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 >
Wrap
Text File
|
1990-02-19
|
841b
|
30 lines
Listing 1
------------------------------------------------------------
puttext_write(x,y,xsize,ysize,string,attr,buffer)
int x,y,xsize,ysize;
char *string, attr, *buffer;
{
char *maxbuffer;
if (x >= xsize || y >= ysize) /* Range Errors */
return;
maxbuffer = buffer+(xsize*ysize*2)-1;
/* maxbuffer points to the attribute of the last character */
buffer += (((y*xsize)+x)*2);
/* buffer points to the first character to write */
/* While buffer is not overrun and there are characters left
* to print.
*/
while ((buffer < maxbuffer) && (*string != '\0')) {
*buffer++ = *string++; /* Do character */
*buffer++ = attr; /* Do attribute */
}
}
------------------------------------------------------------