ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/cfperl.h
(Generate patch)

Comparing deliantra/server/include/cfperl.h (file contents):
Revision 1.48 by root, Sun Jan 7 18:01:09 2007 UTC vs.
Revision 1.55 by root, Tue Feb 13 16:23:31 2007 UTC

60 60
61////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 61//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
62 62
63void cfperl_init (); 63void cfperl_init ();
64void cfperl_main (); 64void cfperl_main ();
65void cfperl_emergency_save ();
66void cfperl_cleanup (int make_core);
65 67
66////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 68//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
67 69
68// virtual server time, excluding time jumps and lag 70// virtual server time, excluding time jumps and lag
69extern double runtime; 71extern double runtime;
129 131
130 static unordered_vector<attachable *> mortals; 132 static unordered_vector<attachable *> mortals;
131 MTH static void check_mortals (); 133 MTH static void check_mortals ();
132 134
133 enum { 135 enum {
134 F_DESTROYED = 0x01, 136 F_DESTROYED = 0x01,
135 F_BORROWED = 0x02, 137 F_DEBUG_TRACE = 0x02,
136 }; 138 };
137 139
138 // object is delete'd after the refcount reaches 0 140 // object is delete'd after the refcount reaches 0
139 mutable int ACC (RW, refcnt); 141 mutable int ACC (RW, refcnt);
140 int ACC (RW, flags); 142 int ACC (RW, flags);
141 143
142 MTH void refcnt_inc () const { ++refcnt; } 144 MTH void refcnt_inc () const { ++refcnt; }
143 MTH void refcnt_dec () const { --refcnt; } 145 MTH void refcnt_dec () const { --refcnt; }
144 146
147 MTH int refcnt_cnt () const;
145 // check wether the object has died and destroy 148 // check wether the object has died and destroy
146 MTH void refcnt_chk () { if (refcnt <= 0) do_check (); } 149 MTH void refcnt_chk () { if (refcnt <= 0) do_check (); }
147 150
148 // destroy the object unless it was already destroyed 151 // destroy the object unless it was already destroyed
149 // this politely asks everybody interested the reduce 152 // this politely asks everybody interested the reduce
163 166
164 HV *self; // CF+ perl self 167 HV *self; // CF+ perl self
165 AV *cb; // CF+ callbacks 168 AV *cb; // CF+ callbacks
166 shstr attach; // generic extension attachment information 169 shstr attach; // generic extension attachment information
167 170
171 void sever_self (); // sever this object from its self, if it has one.
168 void optimise (); // possibly save some memory by destroying unneeded data 172 void optimise (); // possibly save some memory by destroying unneeded data
169 173
170 attachable () 174 attachable ()
171 : flags (0), refcnt (0), self (0), cb (0), attach (0) 175 : flags (0), refcnt (0), self (0), cb (0), attach (0)
172 { 176 {
173 } 177 }
338 342
339struct object_thawer 343struct object_thawer
340{ 344{
341 SV *text; // text part 345 SV *text; // text part
342 AV *av; // perl part 346 AV *av; // perl part
347 int linenum;
343 char *line; // current beginning of line 348 char *line; // current beginning of line
344 char *last_keyword, *last_value; 349 char *last_keyword, *last_value;
345 const char *name; 350 const char *name;
346 351
347 operator bool () { return !!text; } 352 operator bool () { return !!text; }
375 void get (uint16 &i) { i = get_sint32 (); } 380 void get (uint16 &i) { i = get_sint32 (); }
376 void get (sint32 &i) { i = get_sint32 (); } 381 void get (sint32 &i) { i = get_sint32 (); }
377 382
378 void get (uint32 &i) { i = get_sint64 (); } 383 void get (uint32 &i) { i = get_sint64 (); }
379 void get (sint64 &i) { i = get_sint64 (); } 384 void get (sint64 &i) { i = get_sint64 (); }
380};
381 385
386 bool parse_error (keyword kw, const char *type = 0, const char *name = 0, bool skip = true);
387};
388
389//TODO: remove
382char *fgets (char *s, int n, object_thawer &thawer); 390char *fgets (char *s, int n, object_thawer &thawer);
383 391
384////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 392//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
385 393
386struct coroapi { 394struct coroapi {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines