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