| 1 | package Pointer::sv; | ||
| 2 | use Pointer -Base; | ||
| 3 | use Config; | ||
| 4 | |||
| 5 | const sizeof => $Config{intsize} + 8; | ||
| 6 | const type => 'sv'; | ||
| 7 | const pack_template => 'i!i!i!'; | ||
| 8 | |||
| 9 | sub sv_any { | ||
| 10 | ($self->get)[0]; | ||
| 11 | } | ||
| 12 | |||
| 13 | sub sv_refcnt { | ||
| 14 | ($self->get)[1]; | ||
| 15 | } | ||
| 16 | |||
| 17 | sub sv_flags { | ||
| 18 | ($self->get)[2]; | ||
| 19 | } | ||
| 20 | |||
| 21 | our @EXPORT = qw( | ||
| 22 | SVs_PADBUSY SVs_PADTMP SVs_PADMY | ||
| 23 | SVs_TEMP SVs_OBJECT | ||
| 24 | SVs_GMG SVs_SMG SVs_RMG | ||
| 25 | SVf_IOK SVf_NOK SVf_POK SVf_ROK | ||
| 26 | SVf_FAKE SVf_OOK SVf_BREAK SVf_READONLY | ||
| 27 | SVp_IOK SVp_NOK SVp_POK | ||
| 28 | SVp_SCREAM SVf_UTF8 SVf_AMAGIC | ||
| 29 | ); | ||
| 30 | |||
| 31 | use constant SVs_PADBUSY => 0x00000100; | ||
| 32 | use constant SVs_PADTMP => 0x00000200; | ||
| 33 | use constant SVs_PADMY => 0x00000400; | ||
| 34 | use constant SVs_TEMP => 0x00000800; | ||
| 35 | use constant SVs_OBJECT => 0x00001000; | ||
| 36 | use constant SVs_GMG => 0x00002000; | ||
| 37 | use constant SVs_SMG => 0x00004000; | ||
| 38 | use constant SVs_RMG => 0x00008000; | ||
| 39 | use constant SVf_IOK => 0x00010000; | ||
| 40 | use constant SVf_NOK => 0x00020000; | ||
| 41 | use constant SVf_POK => 0x00040000; | ||
| 42 | use constant SVf_ROK => 0x00080000; | ||
| 43 | use constant SVf_FAKE => 0x00100000; | ||
| 44 | use constant SVf_OOK => 0x00200000; | ||
| 45 | use constant SVf_BREAK => 0x00400000; | ||
| 46 | use constant SVf_READONLY => 0x00800000; | ||
| 47 | use constant SVp_IOK => 0x01000000; | ||
| 48 | use constant SVp_NOK => 0x02000000; | ||
| 49 | use constant SVp_POK => 0x04000000; | ||
| 50 | use constant SVp_SCREAM => 0x08000000; | ||
| 51 | use constant SVf_UTF8 => 0x20000000; | ||
| 52 | use constant SVf_AMAGIC => 0x10000000; |