--- deliantra/server/include/cfperl.h 2007/02/13 16:23:31 1.55 +++ deliantra/server/include/cfperl.h 2007/04/16 06:23:41 1.60 @@ -138,8 +138,8 @@ }; // object is delete'd after the refcount reaches 0 - mutable int ACC (RW, refcnt); int ACC (RW, flags); + mutable int ACC (RW, refcnt); MTH void refcnt_inc () const { ++refcnt; } MTH void refcnt_dec () const { --refcnt; } @@ -337,8 +337,8 @@ }; // compatibility support, should be removed when no longer needed -int fprintf (object_freezer &freezer, const char *format, ...); -int fputs (const char *s, object_freezer &freezer); +void fprintf (object_freezer &freezer, const char *format, ...); +void fputs (const char *s, object_freezer &freezer); struct object_thawer { @@ -346,7 +346,8 @@ AV *av; // perl part int linenum; char *line; // current beginning of line - char *last_keyword, *last_value; + keyword kw; + char *kw_str, *value; const char *name; operator bool () { return !!text; } @@ -357,13 +358,23 @@ void get (attachable *obj, int oid); - keyword get_kv (); // also parse value for later use - void skip_kv (keyword kw); + // parse next line + void next (); + // skip the current key-value (usually fetch next line, for + // multiline-fields, skips untilt he corresponding end-kw + void skip (); + + //TODO: remove, deprecated + keyword get_kv () + { + next (); + return kw; + } - const char *get_str () { return last_value; } // may be 0 + char *get_str () { return value; } // may be 0 void get (shstr &sh) const; - void get_ornull (shstr &sh) const { sh = last_value; } + void get_ornull (shstr &sh) const { sh = value; } void get_ml (keyword kend, shstr &sh); sint32 get_sint32 () const; @@ -383,7 +394,7 @@ void get (uint32 &i) { i = get_sint64 (); } void get (sint64 &i) { i = get_sint64 (); } - bool parse_error (keyword kw, const char *type = 0, const char *name = 0, bool skip = true); + bool parse_error (const char *type = 0, const char *name = 0, bool skip = true); }; //TODO: remove