home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / s / stex2-18.zip / SeeTeX / libtex / gripes0.c < prev    next >
C/C++ Source or Header  |  1990-07-10  |  2KB  |  99 lines

  1. /*
  2.  * Copyright (c) 1987, 1989 University of Maryland
  3.  * Department of Computer Science.  All rights reserved.
  4.  * Permission to copy for any purpose is hereby granted
  5.  * so long as this copyright notice remains intact.
  6.  */
  7.  
  8. #ifndef lint
  9. static char rcsid[] = "$Header: /usr/src/local/tex/local/mctex/lib/RCS/gripes0.c,v 2.5 89/09/01 13:52:38 chris Exp $";
  10. #endif
  11.  
  12. /*
  13.  * Common errors (`gripes').
  14.  */
  15.  
  16. #include <stdio.h>
  17. #include "types.h"
  18. #include "error.h"
  19. #include "gripes.h"
  20.  
  21. extern    errno;
  22.  
  23. /*
  24.  * Cannot allocate memory.
  25.  */
  26. void
  27. GripeOutOfMemory(n, why)
  28.     int n;
  29.     char *why;
  30. {
  31.  
  32.     error(1, -1, "ran out of memory allocating %d bytes for %s", n, why);
  33.     /* NOTREACHED */
  34. }
  35.  
  36. /*
  37.  * Cannot get a font.
  38.  * RETURNS TO CALLER
  39.  */
  40. void
  41. GripeCannotGetFont(name, mag, dsz, dev, fullname)
  42.     char *name;
  43.     i32 mag, dsz;
  44.     char *dev, *fullname;
  45. {
  46.     int e = errno;
  47.     char scale[40];
  48.  
  49.     if (mag == dsz)        /* no scaling */
  50.         scale[0] = 0;
  51.     else
  52.         (void) sprintf(scale, " scaled %d",
  53.             (int) ((double) mag / (double) dsz * 1000.0 + .5));
  54.  
  55.     error(0, e, "no font for %s%s", name, scale);
  56.     if (fullname)
  57.         error(0, 0, "(wanted, e.g., \"%s\")", fullname);
  58.     else {
  59.         if (dev)
  60.             error(1, 0, "(there are no fonts for the %s engine!)",
  61.                 dev);
  62.         else
  63.             error(1, 0, "(I cannot find any fonts!)");
  64.         /* NOTREACHED */
  65.     }
  66. }
  67.  
  68. /*
  69.  * Font checksums do not match.
  70.  * RETURNS TO CALLER
  71.  */
  72. void
  73. GripeDifferentChecksums(font, tfmsum, fontsum)
  74.     char *font;
  75.     i32 tfmsum, fontsum;
  76. {
  77.  
  78.     error(0, 0, "\
  79. WARNING: TeX and I have different checksums for font\n\
  80. \t\"%s\"\n\
  81. \tPlease notify your TeX maintainer\n\
  82. \t(TFM checksum = 0%lo, my checksum = 0%lo)",
  83.         font, (long)tfmsum, (long)fontsum);
  84. }
  85.  
  86. /*
  87.  * A font, or several fonts, are missing, so no output.
  88.  */
  89. void
  90. GripeMissingFontsPreventOutput(n)
  91.     int n;
  92. {
  93.     static char s[2] = {'s', 0};
  94.  
  95.     error(1, 0, "%d missing font%s prevent%s output (sorry)", n,
  96.         n > 1 ? s : &s[1], n == 1 ? s : &s[1]);
  97.     /* NOTREACHED */
  98. }
  99.