c-type


Vocabulary
alien.c-types

Definition


Methods




M: c-type box
[ [ first ] bi@ ] [ boxer>> ] bi* {
{ "from_float" [ drop ] }
{ "from_double" [ drop ] }
{ "from_signed_1" [ drop char ^^convert-integer ] }
{ "from_unsigned_1" [ drop uchar ^^convert-integer ] }
{ "from_signed_2" [ drop short ^^convert-integer ] }
{ "from_unsigned_2" [ drop ushort ^^convert-integer ] }
{ "from_signed_4" [ drop int ^^convert-integer ] }
{ "from_unsigned_4" [ drop uint ^^convert-integer ] }
{ "allot_alien" [ drop ^^box-alien ] }
[ swap <gc-map> ^^box ]
} case ;


















M: c-type unbox
[ rep>> ] [ unboxer>> ] bi [
{
{ "to_float" [ drop ] }
{ "to_double" [ drop ] }
{ "to_signed_1" [ drop ] }
{ "to_unsigned_1" [ drop ] }
{ "to_signed_2" [ drop ] }
{ "to_unsigned_2" [ drop ] }
{ "to_signed_4" [ drop ] }
{ "to_unsigned_4" [ drop ] }
{ "alien_offset" [ drop ^^unbox-any-c-ptr ] }
[ swap ^^unbox ]
} case 1array
] [ drop f f 3array 1array ] 2bi ;