home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / printer / dvi2pcl.lha / diagnostics.c < prev    next >
C/C++ Source or Header  |  1992-11-25  |  3KB  |  75 lines

  1. /* $Log:    diagnostics.c,v $
  2.  * Revision 0.8  92/11/23  19:46:39  19:46:39  bt (Bo Thide')
  3.  * Fixed resolution bug. Portable downloading. Added/changed options. PJXL color support
  4.  * 
  5.  * Revision 0.7  92/11/13  02:41:23  02:41:23  bt (Bo Thide')
  6.  * More bug fixes and improvements. Support for PaintJet XL
  7.  * 
  8.  * Revision 0.6  92/11/10  21:47:39  21:47:39  bt (Bo Thide')
  9.  * Bug fixes. Added -R option. Better font handling.
  10.  * 
  11.  * Revision 0.5  92/11/09  16:25:26  16:25:26  bt (Bo Thide')
  12.  * Rewrite of dospecial.c. Extended \special support
  13.  * 
  14.  * Revision 0.4  92/11/08  02:45:41  02:45:41  bt (Bo Thide')
  15.  * Changed to portable bit manipulations. Replaced strrstr for non-POSIX compliant C. Fixed numerous bugs. Added support for more \special's.
  16.  * 
  17.  * Revision 0.3  92/08/24  12:43:18  12:43:18  bt (Bo Thide')
  18.  * Fixed 8 bit (dc font) support.
  19.  * 
  20.  * Revision 0.2  92/08/23  17:28:55  17:28:55  bt (Bo Thide')
  21.  * Source cleaned up.  Changed certain function calls.  Removed globals.
  22.  * 
  23.  * Revision 0.1  92/08/22  23:58:47  23:58:47  bt (Bo Thide')
  24.  * First Release.
  25.  *  */
  26.  
  27. #include <stdio.h>
  28. #include "globals.h"
  29.  
  30. static char rcsid[] = "$Header: diagnostics.c,v 0.8 92/11/23 19:46:39 bt Exp $";
  31.  
  32. /*
  33.  * This procedure is included for debugging and monitoring purposes. It prints
  34.  * out memory usage if the debug option was chosen. It also creates a font
  35.  * usage file 'filname.usg' that contains the font->use_count table for each
  36.  * font, used in the document.
  37.  */
  38. void diagnostics(usgfile)
  39. FILE *usgfile;
  40. {
  41.     int    i,j;
  42.     int    n;
  43.     char   *p;
  44.  
  45.     fprintf(usgfile,"Font use count table:\n");
  46.     n = 0;
  47.     for(i = 0 ; i < MAXFONTS ; i++)
  48.         if(font = fontptr[i]) {
  49.             n++;
  50.             p = names + font->name;
  51.             if(*p)
  52.                 fprintf(usgfile,"%s:\n",p);
  53.             while(*p++);
  54.             fprintf(usgfile,"%s\n",p);
  55.             cbase = font->chr;
  56.             for(j = 0 ; j < 256 ; j++)
  57.         if((cbase+j)->use_count)
  58.                     fprintf(usgfile,"%3d %ld\n", j, (cbase+j)->use_count);
  59.         }
  60.     fprintf(usgfile,"Number of pages processed:    %d\n", actualpagecount);
  61.     fprintf(usgfile,"Name string pool usage:        %d out of %d bytes\n",
  62.         nextnamesfree - names, NAMESIZE);
  63.     fprintf(usgfile,"Font description information:    %d bytes\n" , 1564*n);
  64.     fprintf(usgfile,"Printer memory used for fonts:    %ld out of %ld bytes\n",
  65.         printermem_used, printer.mem);
  66.     fclose(usgfile);
  67.  
  68.     fprintf(stderr,"Number of pages processed:    %d\n", actualpagecount);
  69.     fprintf(stderr,"Name string pool usage:        %d out of %d bytes\n",
  70.         nextnamesfree - names, NAMESIZE);
  71.     fprintf(stderr,"Font description information:    %d bytes\n" , 1564*n);
  72.     fprintf(stderr,"Printer memory used for fonts:    %ld out of %ld bytes\n",
  73.         printermem_used, printer.mem);
  74. }
  75.