endian-c-type>c-type-symbol ( symbol -- symbol' )


Vocabulary
alien.endian

Definition
USING: alien.c-types combinators kernel sequences ;

IN: alien.endian

: endian-c-type>c-type-symbol ( symbol -- symbol' )
{
{ [ dup { ule16 ube16 } member? ] [ drop ushort ] }
{ [ dup { le16 be16 } member? ] [ drop short ] }
{ [ dup { ule32 ube32 } member? ] [ drop uint ] }
{ [ dup { le32 be32 } member? ] [ drop int ] }
{ [ dup { ule64 ube64 } member? ] [ drop ulonglong ] }
{ [ dup { le64 be64 } member? ] [ drop longlong ] }
[ unknown-endian-c-type ]
} cond ;