--- deliantra/server/include/cfperl.h 2007/01/08 01:19:03 1.49 +++ deliantra/server/include/cfperl.h 2007/03/01 12:28:16 1.58 @@ -62,6 +62,8 @@ void cfperl_init (); void cfperl_main (); +void cfperl_emergency_save (); +void cfperl_cleanup (int make_core); ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -131,13 +133,13 @@ MTH static void check_mortals (); enum { - F_DESTROYED = 0x01, - F_BORROWED = 0x02, + F_DESTROYED = 0x01, + F_DEBUG_TRACE = 0x02, }; // 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; } @@ -166,7 +168,8 @@ AV *cb; // CF+ callbacks shstr attach; // generic extension attachment information - void optimise (); // possibly save some memory by destroying unneeded data + void sever_self (); // sever this object from its self, if it has one. + void optimise (); // possibly save some memory by destroying unneeded data attachable () : flags (0), refcnt (0), self (0), cb (0), attach (0) @@ -341,8 +344,10 @@ { SV *text; // text part 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; } @@ -353,13 +358,24 @@ 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 (); - const char *get_str () { return last_value; } // may be 0 + //TODO: remove, deprecated + keyword get_kv () + { + next (); + return kw; + } + + + 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; @@ -378,8 +394,11 @@ void get (uint32 &i) { i = get_sint64 (); } void get (sint64 &i) { i = get_sint64 (); } + + bool parse_error (const char *type = 0, const char *name = 0, bool skip = true); }; +//TODO: remove char *fgets (char *s, int n, object_thawer &thawer); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////