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 / gripes1.c < prev    next >
C/C++ Source or Header  |  1990-07-10  |  3KB  |  162 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/gripes1.c,v 1.1 89/08/22 21:54:19 chris Exp $";
  10. #endif
  11.  
  12. /*
  13.  * Gripes having to do with DVI files.
  14.  */
  15.  
  16. #include <stdio.h>
  17. #include "types.h"
  18. #include "error.h"
  19. #include "font.h"
  20. #include "gripes.h"
  21.  
  22. extern char *DVIFileName;
  23.  
  24. static char *
  25. dfn()
  26. {
  27.  
  28.     return (DVIFileName ? DVIFileName : "the input");
  29. }
  30.  
  31. /*
  32.  * Save string space by declaring these here.
  33.  */
  34. #if __STDC__ >= 1
  35. static const char dfl[] = "DVI file";
  36. static const char areyousure[] = "(are you sure %s is a %s?)";
  37. #else
  38. static char dfl[] = "DVI file";
  39. static char areyousure[] = "(are you sure %s is a %s?)";
  40. #endif
  41.  
  42. /*
  43.  * DVI file requests a font it never defined.
  44.  */
  45. void
  46. GripeNoSuchFont(n)
  47.     i32 n;
  48. {
  49.  
  50.     error(0, 0, "%s wants font %ld, which it never defined", dfl, (long)n);
  51.     error(1, 0, areyousure, dfn(), dfl);
  52.     /* NOTREACHED */
  53. }
  54.  
  55. /*
  56.  * DVI file redefines a font.
  57.  */
  58. void
  59. GripeFontAlreadyDefined(n)
  60.     i32 n;
  61. {
  62.  
  63.     error(0, 0, "%s redefines font %ld", dfl, n);
  64.     error(1, 0, areyousure, dfn(), dfl);
  65.     /* NOTREACHED */
  66. }
  67.  
  68. /*
  69.  * Unexpected end of DVI file.
  70.  */
  71. void
  72. GripeUnexpectedDVIEOF()
  73. {
  74.  
  75.     GripeUnexpectedOp("end of file");
  76.     /* NOTREACHED */
  77. }
  78.  
  79. /*
  80.  * Unexpected DVI opcode.
  81.  */
  82. void
  83. GripeUnexpectedOp(s)
  84.     char *s;
  85. {
  86.  
  87.     error(0, 0, "unexpected %s in %s", s, dfl);
  88.     error(1, 0, areyousure, dfn(), dfl);
  89.     /* NOTREACHED */
  90. }
  91.  
  92. /*
  93.  * Missing DVI opcode.
  94.  */
  95. void
  96. GripeMissingOp(s)
  97.     char *s;
  98. {
  99.  
  100.     error(0, 0, "missing %s in %s", s, dfl);
  101.     error(1, 0, areyousure, dfn(), dfl);
  102.     /* NOTREACHED */
  103. }
  104.  
  105. /*
  106.  * Cannot find DVI postamble.
  107.  */
  108. void
  109. GripeCannotFindPostamble()
  110. {
  111.  
  112.     error(0, 0, "cannot find postamble");
  113.     error(1, 0, areyousure, dfn(), dfl);
  114.     /* NOTREACHED */
  115. }
  116.  
  117. /*
  118.  * Inconsistent DVI value.
  119.  */
  120. void
  121. GripeMismatchedValue(s)
  122.     char *s;
  123. {
  124.  
  125.     error(0, 0, "mismatched %s in %s", s, dfl);
  126.     error(1, 0, areyousure, dfn(), dfl);
  127.     /* NOTREACHED */
  128. }
  129.  
  130. /*
  131.  * Undefined DVI opcode.
  132.  */
  133. void
  134. GripeUndefinedOp(n)
  135.     int n;
  136. {
  137.  
  138.     error(0, 0, "undefined DVI opcode %d", n);
  139.     error(1, 0, areyousure, dfn(), dfl);
  140.     /* NOTREACHED */
  141. }
  142.  
  143. /*
  144.  * DVI file requests glyph that is not in some font, or
  145.  * when no font is set for this page.
  146.  *
  147.  * RETURNS TO CALLER
  148.  */
  149. void
  150. GripeBadGlyph(c, f)
  151.     i32 c;
  152.     struct font *f;
  153. {
  154.  
  155.     if (f->f_path == NULL) {
  156.         error(0, 0, "bad %s: char without setfont", dfl);
  157.         error(1, 0, "(try checking %s with dvitype)", dfn());
  158.         /* NOTREACHED */
  159.     }
  160.     error(0, 0, "there is no character %ld in %s!", (long)c, f->f_path);
  161. }
  162.