w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

error_routines.c
Go to the documentation of this file.
1 /* error_routines.c: General error routines.
2 
3 This file is part of Omega,
4 which is based on the web2c distribution of TeX,
5 
6 Copyright 1994--2018 John Plaice and Yannis Haralambous
7 
8 Omega is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12 
13 Omega is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with Omega; if not, write to the Free Software Foundation, Inc.,
20 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
21 
22 */
23 
24 #include "cpascal.h"
25 #include "parser.h"
26 #include "error_routines.h"
27 
28 int num_errors = 0;
29 
30 /* Error routines:
31 
32 All of the routines in this file have the same general format.
33 They
34 
35 */
36 
37 void
39 {
40  fprintf(stderr, "line %d (lexing): ", line_number);
41  fprintf(stderr, fmt, item);
42  fprintf(stderr, "\n");
43 }
44 
45 void
47 {
48  fprintf(stderr, "line %d (lexing): ", line_number);
49  fprintf(stderr, fmt, item);
50  fprintf(stderr, "\n");
51 }
52 
53 void
55 {
56  fprintf(stderr, "line %d (lexing): ", line_number);
57  fprintf(stderr, fmt, item, item1);
58  fprintf(stderr, "\n");
59 }
60 
61 void
63 {
64  fprintf(stderr, "line %d (parsing): ", line_number);
65  fprintf(stderr, "%s", fmt);
66  fprintf(stderr, "\n");
67  num_errors++;
68 }
69 
70 
71 void
73 {
74  fprintf(stderr, "line %d (warning): ", line_number);
75  fprintf(stderr, "%s", fmt);
76  fprintf(stderr, "\n");
77 }
78 
79 void
81 {
82  fprintf(stderr, "line %d (warning): ", line_number);
83  fprintf(stderr, fmt, item);
84  fprintf(stderr, "\n");
85 }
86 
87 void
88 warning_2(const_string fmt, int item, int item2)
89 {
90  fprintf(stderr, "line %d (warning): ", line_number);
91  fprintf(stderr, fmt, item, item2);
92  fprintf(stderr, "\n");
93 }
94 
95 void
97 {
98  fprintf(stderr, "line %d (warning): ", line_number);
99  fprintf(stderr, fmt, item);
100  fprintf(stderr, "\n");
101 }
102 
103 void
105 {
106  fprintf(stderr, "line %d (warning): ", line_number);
107  fprintf(stderr, fmt, item, item1);
108  fprintf(stderr, "\n");
109 }
110 
111 void
113 {
114  fprintf(stderr, "line %d (warning): ", line_number);
115  fprintf(stderr, fmt, item, item1, item2);
116  fprintf(stderr, "\n");
117 }
118 
119 void
121 {
122  fprintf(stderr, "line %d (fatal): ", line_number);
123  fprintf(stderr, "%s", fmt);
124  fprintf(stderr, "\n");
125  exit(1);
126 }
127 
128 void
130 {
131  fprintf(stderr, "line %d (fatal): ", line_number);
132  fprintf(stderr, fmt, item);
133  fprintf(stderr, "\n");
134  exit(1);
135 }
136 
137 void
139 {
140  fprintf(stderr, "line %d (fatal): ", line_number);
141  fprintf(stderr, fmt, item, item2);
142  fprintf(stderr, "\n");
143  exit(1);
144 }
145 
146 void
148 {
149  fprintf(stderr, "line %d (fatal): ", line_number);
150  fprintf(stderr, fmt, item);
151  fprintf(stderr, "\n");
152  exit(1);
153 }
154 
155 void
157 {
158  fprintf(stderr, "line %d (internal): ", line_number);
159  fprintf(stderr, "%s", fmt);
160  fprintf(stderr, "\n");
161  exit(2);
162 }
163 
164 void
166 {
167  fprintf(stderr, "line %d (internal): ", line_number);
168  fprintf(stderr, fmt, item);
169  fprintf(stderr, "\n");
170  exit(2);
171 }
#define line_number
static int item
Definition: brushtopbm.c:66
void internal_error_0(const_string fmt)
void yyerror(const_string fmt)
void fatal_error_2(const_string fmt, int item, int item2)
void lex_error_1(const_string fmt, int item)
void warning_0(const_string fmt)
void fatal_error_0(const_string fmt)
void lex_error_s_1(const_string fmt, const_string item, int item1)
void internal_error_1(const_string fmt, int item)
void fatal_error_1(const_string fmt, int item)
void fatal_error_s(const_string fmt, const_string item)
void lex_error_s(const_string fmt, const_string item)
void warning_s_1(const_string fmt, const_string item, int item1)
void warning_2(const_string fmt, int item, int item2)
void warning_1(const_string fmt, int item)
void warning_s_2(const_string fmt, const_string item, int item1, int item2)
void warning_s(const_string fmt, const_string item)
int num_errors
void exit()
const char * const_string
Definition: simpletypes.h:59
#define fprintf
Definition: mendex.h:64
char fmt[256]
Definition: tex4ht.c:3925