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.40 by root, Wed Apr 28 19:49:50 2010 UTC vs.
Revision 1.42 by root, Thu Apr 29 12:24:04 2010 UTC

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; 109bool object_thawer::errors_are_fatal = true;
110 110
111object_thawer::object_thawer (const char *data, AV *perlav)
112: name (strdup ("(memory stream)"))
113{
114 av = perlav;
115 text = newSVpv (data, 0);
116 sv_catpv (text, thawer_eof);
117 line = SvPVbyte_nolen (text);
118 next ();
119}
120
111object_thawer::object_thawer (const_utf8_string path) 121object_thawer::object_thawer (const_utf8_string path)
112{ 122{
113 new_from_path (path); 123 new_from_path (path);
114} 124}
115 125
164 174
165 CALL_END; 175 CALL_END;
166 } 176 }
167} 177}
168 178
169object_thawer::object_thawer (const char *data, AV *perlav)
170: name (strdup ("(memory stream)"))
171{
172 av = perlav;
173 text = newSVpv (data, 0);
174 sv_catpv (text, thawer_eof);
175 line = SvPVbyte_nolen (text);
176 next ();
177}
178
179void 179void
180object_thawer::get (attachable *obj, int oid) 180object_thawer::get (attachable *obj, int oid)
181{ 181{
182 if (!av || oid < 0) // this is actually an error of sorts 182 if (!av || oid < 0) // this is actually an error of sorts
183 return; 183 return;
248 exit (1); 248 exit (1);
249 } 249 }
250} 250}
251 251
252void 252void
253object_thawer::parse_warn (const char *msg) 253object_thawer::parse_warn (const char *msg) const
254{ 254{
255 LOG (llevWarn, "%s:%d, \"%s %s\": %s\n", 255 LOG (llevWarn, "%s:%d, \"%s %s\": %s\n",
256 this->name, linenum, 256 this->name, linenum,
257 kw_str ? kw_str : "<null>", 257 kw_str ? kw_str : "<null>",
258 value ? value : "<null>", 258 value ? value : "<null>",
259 msg); 259 msg);
260} 260}
261 261
262bool 262bool
263object_thawer::parse_error (const char *type, const char *name, bool skip) 263object_thawer::parse_error (const char *type, const char *name, bool skip) const
264{ 264{
265 if (!type) type = "file section"; 265 if (!type) type = "file section";
266 if (!name) name = "generic"; 266 if (!name) name = "generic";
267 267
268 switch (kw) 268 switch (kw)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines