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 ] }
{ "allot_alien" [ drop ^^box-alien ] }
[
cell 8 = [
{
{ ~quotation~ ~quotation~ }
{ ~quotation~ ~quotation~ }
[ f ]
} cond
] [ f ] if
[ 2nip ^^convert-integer ] [ swap <gc-map> ^^box ]
if*
]
} 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 ] }
{ "alien_offset" [ drop ^^unbox-any-c-ptr ] }
[
dup { "to_signed_4" "to_unsigned_4" } member?
[ cell 8 = not ] [ t ] if
[ swap ^^unbox ] [ 2drop ] if
]
} case 1array
] [ drop f f 3array 1array ] 2bi record-reg-reps ;