home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_07_06
/
v7n6015a.txt
< prev
next >
Wrap
Text File
|
1989-07-25
|
1KB
|
41 lines
#define STRING_CONTROL 0
#define BACKSPACE_CONTROL 1
#define BOLD_STRING "\033B"
int printer_type; /* Type of printer (string or backspace) */
/* Set at initialization time */
print(attribute, string)
int attribute;
char *string;
{
int length;
switch(attribute)
{
case NORMAL_PRINT:
fprintf(printer,string);
break;
case BOLD_PRINT:
switch(printer_type)
{
case STRING_CONTROL:
fprintf(printer,BOLD_STRING);
fprintf(printer,string);
break;
case BACKSPACE_CONTROL:
length = strlen(string);
while (length--)
{
fprintf("%c",*string);
fprintf("\b");
fprintf("%c",*string);
string++;
}
}
break;
}
}