1 /***************************************************************/
2 /*                                                             */
3 /*  ERR.H                                                      */
4 /*                                                             */
5 /*  Error definitions.                                         */
6 /*                                                             */
7 /*  This file is part of REMIND.                               */
8 /*  Copyright (C) 1992-2021 by Dianne Skoll                    */
9 /*                                                             */
10 /***************************************************************/
11 
12 /* Note that not all of the "errors" are really errors - some are just
13    messages for information purposes.  Constants beginning with M_ should
14    never be returned as error indicators - they should only be used to
15    index the ErrMsg array. */
16 
17 #define OK                    0
18 #define E_MISS_END            1
19 #define E_MISS_QUOTE          2
20 #define E_OP_STK_OVER         3
21 #define E_VA_STK_OVER         4
22 #define E_MISS_RIGHT_PAREN    5
23 #define E_UNDEF_FUNC          6
24 #define E_ILLEGAL_CHAR        7
25 #define E_EXPECTING_BINOP     8
26 #define E_NO_MEM              9
27 #define E_BAD_NUMBER         10
28 #define E_OP_STK_UNDER       11
29 #define E_VA_STK_UNDER       12
30 #define E_CANT_COERCE        13
31 #define E_BAD_TYPE           14
32 #define E_DATE_OVER          15
33 #define E_STACK_ERR          16
34 #define E_DIV_ZERO           17
35 #define E_NOSUCH_VAR         18
36 #define E_EOLN		     19
37 #define E_EOF		     20
38 #define E_IO_ERR             21
39 #define E_LINE_2_LONG        22
40 #define E_SWERR		     23
41 #define E_BAD_DATE           24
42 #define E_2FEW_ARGS	     25
43 #define E_2MANY_ARGS	     26
44 #define E_BAD_TIME	     27
45 #define E_2HIGH		     28
46 #define E_2LOW 		     29
47 #define E_CANT_OPEN          30
48 #define E_NESTED_INCLUDE     31
49 #define E_PARSE_ERR          32
50 #define E_CANT_TRIG          33
51 #define E_NESTED_IF          34
52 #define E_ELSE_NO_IF         35
53 #define E_ENDIF_NO_IF        36
54 #define E_2MANY_LOCALOMIT    37
55 #define E_EXTRANEOUS_TOKEN   38
56 #define E_POP_NO_PUSH        39
57 #define E_RUN_DISABLED       40
58 #define E_DOMAIN_ERR         41
59 #define E_BAD_ID             42
60 #define E_RECURSIVE          43
61 #define E_PARSE_AS_REM       44 /* Not really an error - just returned by
62                                    DoOmit to indicate line should be executed
63                                    as a REM statement, also. */
64 #define E_CANT_MODIFY        45
65 #define E_MKTIME_PROBLEM     46
66 #define E_REDEF_FUNC	     47
67 #define E_CANTNEST_FDEF      48
68 #define E_REP_FULSPEC        49
69 #define E_YR_TWICE	     50
70 #define E_MON_TWICE	     51
71 #define E_DAY_TWICE	     52
72 #define E_UNKNOWN_TOKEN	     53
73 #define E_SPEC_MON_DAY	     54
74 #define E_2MANY_PART	     55
75 #define E_2MANY_FULL	     56
76 #define E_PUSH_NOPOP	     57
77 #define E_ERR_READING	     58
78 #define E_EXPECTING_EOL	     59
79 #define E_BAD_HEBDATE	     60
80 #define E_IIF_ODD	     61
81 #define E_MISS_ENDIF	     62
82 #define E_EXPECT_COMMA	     63
83 #define E_WD_TWICE	     64
84 #define E_SKIP_ERR	     65
85 #define E_CANT_NEST_RTYPE    66
86 #define E_REP_TWICE	     67
87 #define E_DELTA_TWICE	     68
88 #define E_BACK_TWICE	     69
89 #define E_ONCE_TWICE	     70
90 #define E_EXPECT_TIME	     71
91 #define E_UNTIL_TWICE	     72
92 #define E_INCOMPLETE	     73
93 #define E_SCAN_TWICE	     74
94 #define E_VAR		     75
95 #define E_VAL		     76
96 #define E_UNDEF		     77
97 #define E_ENTER_FUN	     78
98 #define E_LEAVE_FUN	     79
99 #define E_EXPIRED	     80
100 #define E_CANTFORK	     81
101 #define E_CANTACCESS	     82
102 #define M_BAD_SYS_DATE	     83
103 #define M_BAD_DB_FLAG	     84
104 #define M_BAD_OPTION	     85
105 #define M_BAD_USER	     86
106 #define M_NO_CHG_GID	     87
107 #define M_NO_CHG_UID	     88
108 #define M_NOMEM_ENV	     89
109 #define E_MISS_EQ	     90
110 #define E_MISS_VAR	     91
111 #define E_MISS_EXPR	     92
112 #define M_CANTSET_ACCESS     93
113 #define M_I_OPTION	     94
114 #define E_NOREMINDERS	     95
115 #define M_QUEUED	     96
116 #define E_EXPECTING_NUMBER   97
117 #define M_BAD_WARN_FUNC      98
118 #define E_CANT_CONVERT_TZ    99
119 #define E_NO_MATCHING_REMS  100
120 #define E_STRING_TOO_LONG   101
121 #define E_TIME_TWICE        102
122 #define E_DURATION_NO_AT    103
123 #ifdef MK_GLOBALS
124 #undef EXTERN
125 #define EXTERN
126 #else
127 #undef EXTERN
128 #define EXTERN extern
129 #endif
130 
131 #ifndef L_ERR_OVERRIDE
132 EXTERN char *ErrMsg[]
133 
134 #ifdef MK_GLOBALS
135 = {
136     "Ok",
137     "Missing ']'",
138     "Missing quote",
139     "Expression too complex - too many operators",
140     "Expression too complex - too many operands",
141     "Missing ')'",
142     "Undefined function",
143     "Illegal character",
144     "Expecting binary operator",
145     "Out of memory",
146     "Ill-formed number",
147     "Op stack underflow - internal error",
148     "Va stack underflow - internal error",
149     "Can't coerce",
150     "Type mismatch",
151     "Date overflow",
152     "Stack error - internal error",
153     "Division by zero",
154     "Undefined variable",
155     "Unexpected end of line",
156     "Unexpected end of file",
157     "I/O error",
158     "Line too long",
159     "Internal error",
160     "Bad date specification",
161     "Not enough arguments",
162     "Too many arguments",
163     "Ill-formed time",
164     "Number too high",
165     "Number too low",
166     "Can't open file",
167     "INCLUDE nested too deeply",
168     "Parse error",
169     "Can't compute trigger",
170     "Too many nested IFs",
171     "ELSE with no matching IF",
172     "ENDIF with no matching IF",
173     "Can't OMIT every weekday",
174     "Extraneous token(s) on line",
175     "POP-OMIT-CONTEXT without matching PUSH-OMIT-CONTEXT",
176     "RUN disabled",
177     "Domain error",
178     "Invalid identifier",
179     "Recursive function call detected",
180     "",
181     "Cannot modify system variable",
182     "C library function can't represent date/time",
183     "Attempt to redefine built-in function",
184     "Can't nest function definition in expression",
185     "Must fully specify date to use repeat factor",
186     "Year specified twice",
187     "Month specified twice",
188     "Day specified twice",
189     "Unknown token",
190     "Must specify month and day in OMIT command",
191     "Too many partial OMITs",
192     "Too many full OMITs",
193     "Warning: PUSH-OMIT-CONTEXT without matching POP-OMIT-CONTEXT",
194     "Error reading",
195     "Expecting end-of-line",
196     "Invalid Hebrew date",
197     "IIF needs odd number of arguments",
198     "Warning: Missing ENDIF",
199     "Expecting comma",
200     "Weekday specified twice",
201     "Only use one of BEFORE, AFTER or SKIP",
202     "Can't nest MSG, MSF, RUN, etc. in expression",
203     "Repeat value specified twice",
204     "Delta value specified twice",
205     "Back value specified twice",
206     "ONCE keyword used twice. (Hah.)",
207     "Expecting time after AT",
208     "THROUGH/UNTIL keyword used twice",
209     "Incomplete date specification",
210     "FROM/SCANFROM keyword used twice",
211     "Variable",
212     "Value",
213     "*UNDEFINED*",
214     "Entering UserFN",
215     "Leaving UserFN",
216     "Expired",
217     "fork() failed - can't do queued reminders",
218     "Can't access file",
219     "Illegal system date: Year is less than %d\n",
220     "Unknown debug flag '%c'\n",
221     "Unknown option '%c'\n",
222     "Unknown user '%s'\n",
223     "Could not change gid to %d\n",
224     "Could not change uid to %d\n",
225     "Out of memory for environment\n",
226     "Missing '=' sign",
227     "Missing variable name",
228     "Missing expression",
229     "Can't reset access date of %s\n",
230     "Remind: '-i' option: %s\n",
231     "No reminders.",
232     "%d reminder(s) queued for later today.\n",
233     "Expecting number",
234     "Bad function in WARN clause",
235     "Can't convert between time zones",
236     "No files matching *.rem",
237     "String too long",
238     "Time specified twice",
239     "Cannot specify DURATION without specifying AT"
240 }
241 #endif /* MK_GLOBALS */
242 ;
243 #endif /* L_ERR_OVERRIDE */
244