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 >
Text File  |  1989-07-25  |  1KB  |  41 lines

  1.  
  2.    #define STRING_CONTROL  0
  3.    #define BACKSPACE_CONTROL 1
  4.    #define BOLD_STRING "\033B"
  5.    
  6.    int printer_type;   /* Type of printer  (string or backspace) */   
  7.                        /* Set at initialization time */
  8.  
  9.    print(attribute, string)
  10.    int attribute;
  11.    char *string;
  12.        {
  13.        int length;
  14.        switch(attribute)
  15.            {
  16.        case NORMAL_PRINT:
  17.            fprintf(printer,string);
  18.            break;
  19.        case BOLD_PRINT:
  20.            switch(printer_type)
  21.                {
  22.            case STRING_CONTROL:
  23.                fprintf(printer,BOLD_STRING);
  24.                fprintf(printer,string);
  25.                break;
  26.            case BACKSPACE_CONTROL:
  27.                length = strlen(string);
  28.                while (length--)
  29.                    {
  30.                    fprintf("%c",*string);
  31.                    fprintf("\b");
  32.                    fprintf("%c",*string);
  33.                    string++;
  34.                    }
  35.                }
  36.            break;
  37.            }
  38.        }
  39.    
  40.  
  41.