… | |
… | |
79 | |
79 | |
80 | // some macros to simplify perl in-calls |
80 | // some macros to simplify perl in-calls |
81 | |
81 | |
82 | #define CHECK_ERROR \ |
82 | #define CHECK_ERROR \ |
83 | if (SvTRUE (ERRSV)) \ |
83 | if (SvTRUE (ERRSV)) \ |
84 | LOG (llevError, "runtime error in %s: %s\n", __func__, SvPVutf8_nolen (ERRSV)); |
84 | LOG (llevError, "runtime error in %s: %s", __func__, SvPVutf8_nolen (ERRSV)); |
85 | |
85 | |
86 | #define CALL_BEGIN(args) dSP; ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, args) |
86 | #define CALL_BEGIN(args) dSP; ENTER; SAVETMPS; PUSHMARK (SP); EXTEND (SP, args) |
87 | #define CALL_ARG_SV(sv) PUSHs (sv_2mortal (sv)) // separate because no refcount inc |
87 | #define CALL_ARG_SV(sv) PUSHs (sv_2mortal (sv)) // separate because no refcount inc |
88 | #define CALL_ARG(expr) PUSHs (sv_2mortal (to_sv (expr))) |
88 | #define CALL_ARG(expr) PUSHs (sv_2mortal (to_sv (expr))) |
89 | #define CALL_CALL(name, flags) PUTBACK; int count = call_pv (name, (flags) | G_EVAL); SPAGAIN; |
89 | #define CALL_CALL(name, flags) PUTBACK; int count = call_pv (name, (flags) | G_EVAL); SPAGAIN; |
… | |
… | |
99 | void cfperl_make_book (object *book, int level); |
99 | void cfperl_make_book (object *book, int level); |
100 | void cfperl_send_msg (client *ns, int color, const char *type, const char *msg); |
100 | void cfperl_send_msg (client *ns, int color, const char *type, const char *msg); |
101 | int cfperl_can_merge (object *ob1, object *ob2); |
101 | int cfperl_can_merge (object *ob1, object *ob2); |
102 | |
102 | |
103 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
103 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
|
|
104 | |
|
|
105 | #if IVSIZE >= 8 |
|
|
106 | typedef IV val64; |
|
|
107 | typedef IV uval64; |
|
|
108 | # define newSVval64 newSViv |
|
|
109 | # define SvVAL64 SvIV |
|
|
110 | # define newSVuval64 newSVuv |
|
|
111 | # define SvUVAL64 SvUV |
|
|
112 | #else |
|
|
113 | typedef double val64; |
|
|
114 | # define newSVval64 newSVnv |
|
|
115 | # define SvVAL64 SvNV |
|
|
116 | # define newSVuval64 newSVnv |
|
|
117 | # define SvUVAL64 SvNV |
|
|
118 | #endif |
104 | |
119 | |
105 | extern tstamp runtime; // virtual server time, excluding time jumps and lag |
120 | extern tstamp runtime; // virtual server time, excluding time jumps and lag |
106 | extern tstamp NOW; // real time of current server tick |
121 | extern tstamp NOW; // real time of current server tick |
107 | |
122 | |
108 | enum event_klass |
123 | enum event_klass |