ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/freezethaw.C
(Generate patch)

Comparing deliantra/server/server/freezethaw.C (file contents):
Revision 1.38 by root, Thu Apr 15 04:56:47 2010 UTC vs.
Revision 1.39 by root, Thu Apr 15 06:05:52 2010 UTC

104} 104}
105#endif 105#endif
106 106
107static const char thawer_eof[] = "\n\n\n\0\0\0"; 107static const char thawer_eof[] = "\n\n\n\0\0\0";
108 108
109bool object_thawer::errors_are_fatal = true;
110
109object_thawer::object_thawer (const char *path) 111object_thawer::object_thawer (const char *path)
110: name (strdup (path)) 112: name (strdup (path))
111{ 113{
112 av = 0; 114 av = 0;
113 text = 0; 115 text = 0;
223 resolve_delayed_derefs (false); 225 resolve_delayed_derefs (false);
224 226
225 free ((void *)name); 227 free ((void *)name);
226} 228}
227 229
230static void
231error_out ()
232{
233 if (object_thawer::errors_are_fatal)
234 {
235 LOG (llevError, "(parse errors at this time are fatal, exiting)");
236 exit (1);
237 }
238}
239
228void 240void
229object_thawer::parse_warn (const char *msg) 241object_thawer::parse_warn (const char *msg)
230{ 242{
231 LOG (llevWarn, "%s:%d, \"%s %s\": %s\n", 243 LOG (llevWarn, "%s:%d, \"%s %s\": %s\n",
232 this->name, linenum, 244 this->name, linenum,
244 switch (kw) 256 switch (kw)
245 { 257 {
246 case KW_EOF: 258 case KW_EOF:
247 LOG (llevError, "%s:%d end of file while reading %s '%s', aborting load.\n", 259 LOG (llevError, "%s:%d end of file while reading %s '%s', aborting load.\n",
248 this->name, linenum, type, name); 260 this->name, linenum, type, name);
261 error_out ();
249 return false; 262 return false;
250 263
251 case KW_ERROR: 264 case KW_ERROR:
252 LOG (llevError, "%s:%d error while reading %s '%s', at '%s', aborting load.\n", 265 LOG (llevError, "%s:%d error while reading %s '%s', at '%s', aborting load.\n",
253 this->name, linenum, 266 this->name, linenum,
254 type, name, 267 type, name,
255 kw_str ? kw_str : "<file load>"); 268 kw_str ? kw_str : "<file load>");
269 error_out ();
256 return false; 270 return false;
257 271
258 default: 272 default:
259 LOG (llevError, "%s:%d unexpected line (%s %s) while reading %s '%s', %s.\n", 273 LOG (llevError, "%s:%d unexpected line (%s %s) while reading %s '%s', %s.\n",
260 this->name, linenum, 274 this->name, linenum,
261 kw_str ? kw_str : "<null>", 275 kw_str ? kw_str : "<null>",
262 value ? value : "<null>", 276 value ? value : "<null>",
263 type, name, 277 type, name,
264 skip ? "skipping line" : "aborting load"); 278 skip ? "skipping line" : "aborting load");
279 error_out ();
265 return skip; 280 return skip;
266 } 281 }
267} 282}
268 283
269void 284void

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines