… | |
… | |
58 | |
58 | |
59 | typedef object_thawer &object_thawer_ref; |
59 | typedef object_thawer &object_thawer_ref; |
60 | typedef object_freezer &object_freezer_ref; |
60 | typedef object_freezer &object_freezer_ref; |
61 | |
61 | |
62 | typedef std::string std__string; |
62 | typedef std::string std__string; |
63 | |
|
|
64 | #if IVSIZE >= 8 |
|
|
65 | typedef IV val64; |
|
|
66 | # define newSVval64 newSViv |
|
|
67 | # define SvVAL64 SvIV |
|
|
68 | #else |
|
|
69 | typedef double val64; |
|
|
70 | # define newSVval64 newSVnv |
|
|
71 | # define SvVAL64 SvNV |
|
|
72 | #endif |
|
|
73 | |
63 | |
74 | static PerlInterpreter *perl; |
64 | static PerlInterpreter *perl; |
75 | |
65 | |
76 | tstamp NOW, runtime; |
66 | tstamp NOW, runtime; |
77 | |
67 | |
… | |
… | |
444 | inline SV *to_sv (living & v) { return to_sv (&v); } |
434 | inline SV *to_sv (living & v) { return to_sv (&v); } |
445 | |
435 | |
446 | inline SV *to_sv (const std::string & v) { return newSVpvn (v.data (), v.size ()); } |
436 | inline SV *to_sv (const std::string & v) { return newSVpvn (v.data (), v.size ()); } |
447 | inline SV *to_sv (const treasurelist *v) { return to_sv (v->name); } |
437 | inline SV *to_sv (const treasurelist *v) { return to_sv (v->name); } |
448 | |
438 | |
449 | inline SV *to_sv (UUID v) |
439 | inline SV *to_sv (UUID v) { return newSVpv (v.c_str (), 0); } |
450 | { |
|
|
451 | char buf[128]; |
|
|
452 | snprintf (buf, 128, "<1.%" PRIx64 ">", v.seq); |
|
|
453 | return newSVpv (buf, 0); |
|
|
454 | } |
|
|
455 | |
440 | |
456 | inline void sv_to (SV *sv, shstr &v) { v = SvOK (sv) ? SvPVutf8_nolen (sv) : 0; } |
441 | inline void sv_to (SV *sv, shstr &v) { v = SvOK (sv) ? SvPVutf8_nolen (sv) : 0; } |
457 | inline void sv_to (SV *sv, char * &v) { free (v); v = SvOK (sv) ? strdup (SvPV_nolen (sv)) : 0; } |
442 | inline void sv_to (SV *sv, char * &v) { free (v); v = SvOK (sv) ? strdup (SvPV_nolen (sv)) : 0; } |
458 | inline void sv_to (SV *sv, bool &v) { v = SvIV (sv); } |
443 | inline void sv_to (SV *sv, bool &v) { v = SvIV (sv); } |
459 | inline void sv_to (SV *sv, signed char &v) { v = SvIV (sv); } |
444 | inline void sv_to (SV *sv, signed char &v) { v = SvIV (sv); } |
… | |
… | |
501 | v.assign (data, len); |
486 | v.assign (data, len); |
502 | } |
487 | } |
503 | |
488 | |
504 | inline void sv_to (SV *sv, UUID &v) |
489 | inline void sv_to (SV *sv, UUID &v) |
505 | { |
490 | { |
506 | unsigned int version; |
491 | if (!v.parse (SvPV_nolen (sv))) |
507 | |
|
|
508 | if (2 != sscanf (SvPV_nolen (sv), "<%d.%" SCNx64 ">", &version, &v.seq) || 1 != version) |
|
|
509 | croak ("unparsable uuid: %s", SvPV_nolen (sv)); |
492 | croak ("unparsable uuid: %s", SvPV_nolen (sv)); |
510 | } |
493 | } |
511 | |
494 | |
512 | inline void sv_to (SV *sv, object::flags_t::reference v) { v = SvTRUE (sv); } |
495 | inline void sv_to (SV *sv, object::flags_t::reference v) { v = SvTRUE (sv); } |
513 | |
496 | |
… | |
… | |
1419 | const_iv (ATNR_PARALYZE) const_iv (ATNR_TURN_UNDEAD) const_iv (ATNR_FEAR) const_iv (ATNR_CANCELLATION) |
1402 | const_iv (ATNR_PARALYZE) const_iv (ATNR_TURN_UNDEAD) const_iv (ATNR_FEAR) const_iv (ATNR_CANCELLATION) |
1420 | const_iv (ATNR_DEPLETE) const_iv (ATNR_DEATH) const_iv (ATNR_CHAOS) const_iv (ATNR_COUNTERSPELL) |
1403 | const_iv (ATNR_DEPLETE) const_iv (ATNR_DEATH) const_iv (ATNR_CHAOS) const_iv (ATNR_COUNTERSPELL) |
1421 | const_iv (ATNR_GODPOWER) const_iv (ATNR_HOLYWORD) const_iv (ATNR_BLIND) const_iv (ATNR_INTERNAL) |
1404 | const_iv (ATNR_GODPOWER) const_iv (ATNR_HOLYWORD) const_iv (ATNR_BLIND) const_iv (ATNR_INTERNAL) |
1422 | const_iv (ATNR_LIFE_STEALING) const_iv (ATNR_DISEASE) |
1405 | const_iv (ATNR_LIFE_STEALING) const_iv (ATNR_DISEASE) |
1423 | |
1406 | |
1424 | const_iv (MAP_IN_MEMORY) const_iv (MAP_SWAPPED) const_iv (MAP_LOADING) const_iv (MAP_SAVING) |
1407 | const_iv (MAP_ACTIVE) const_iv (MAP_SWAPPED) const_iv (MAP_LOADING) const_iv (MAP_SAVING) |
|
|
1408 | const_iv (MAP_INACTIVE) |
1425 | |
1409 | |
1426 | const_iv (KLASS_ATTACHABLE) const_iv (KLASS_GLOBAL) const_iv (KLASS_OBJECT) |
1410 | const_iv (KLASS_ATTACHABLE) const_iv (KLASS_GLOBAL) const_iv (KLASS_OBJECT) |
1427 | const_iv (KLASS_CLIENT) const_iv (KLASS_PLAYER) const_iv (KLASS_MAP) |
1411 | const_iv (KLASS_CLIENT) const_iv (KLASS_PLAYER) const_iv (KLASS_MAP) |
1428 | |
1412 | |
1429 | const_iv (VERSION_CS) const_iv (VERSION_SC) |
1413 | const_iv (VERSION_CS) const_iv (VERSION_SC) |
… | |
… | |
1749 | RETVAL = newSVpv (resist_plus[atnr], 0); |
1733 | RETVAL = newSVpv (resist_plus[atnr], 0); |
1750 | else |
1734 | else |
1751 | XSRETURN_UNDEF; |
1735 | XSRETURN_UNDEF; |
1752 | OUTPUT: RETVAL |
1736 | OUTPUT: RETVAL |
1753 | |
1737 | |
1754 | SV * |
1738 | UUID |
1755 | uuid_cur () |
1739 | uuid_cur () |
1756 | CODE: |
1740 | CODE: |
1757 | RETVAL = to_sv (UUID::cur); |
1741 | RETVAL = UUID::cur; |
1758 | OUTPUT: |
1742 | OUTPUT: |
1759 | RETVAL |
1743 | RETVAL |
1760 | |
1744 | |
1761 | SV * |
1745 | UUID |
1762 | uuid_gen () |
1746 | uuid_gen () |
1763 | CODE: |
1747 | CODE: |
1764 | RETVAL = to_sv (UUID::gen ()); |
1748 | RETVAL = UUID::gen (); |
|
|
1749 | OUTPUT: |
|
|
1750 | RETVAL |
|
|
1751 | |
|
|
1752 | val64 |
|
|
1753 | uuid_seq (UUID uuid) |
|
|
1754 | CODE: |
|
|
1755 | RETVAL = uuid.seq; |
|
|
1756 | OUTPUT: |
|
|
1757 | RETVAL |
|
|
1758 | |
|
|
1759 | UUID |
|
|
1760 | uuid_str (val64 seq) |
|
|
1761 | CODE: |
|
|
1762 | RETVAL.seq = seq; |
1765 | OUTPUT: |
1763 | OUTPUT: |
1766 | RETVAL |
1764 | RETVAL |
1767 | |
1765 | |
1768 | void |
1766 | void |
1769 | coin_names () |
1767 | coin_names () |