(fortran-arg>c-args) ( type -- main-quot added-quot )

Vocabulary
alien.fortran.private

Inputs
typean object
Outputs
main-quotan object
added-quotan object
Definition
IN: alien.fortran.private
GENERIC: (fortran-arg>c-args) ( type -- main-quot added-quot )
Methods
USING: alien.c-types alien.data alien.fortran.private
alien.strings io.encodings.ascii kernel sequences ;
M: character-type (fortran-arg>c-args)
fix-character-type single-char?
[ [ first char <ref> ] [ drop ] ]
[ [ ascii string>alien ] [ length ] ] if ;

USING: alien.complex alien.fortran.private kernel ;
M: double-complex-type (fortran-arg>c-args)
[ drop [ <complex-double> ] [ drop ] ] args?dims ;

USING: alien.c-types alien.data alien.fortran.private kernel ;
M: double-precision-type (fortran-arg>c-args)
[ drop [ double <ref> ] [ drop ] ] args?dims ;

USING: accessors alien.c-types alien.data alien.fortran
alien.fortran.private combinators kernel ;
M: integer-type (fortran-arg>c-args)
[
size>> {
{ f [ [ int <ref> ] [ drop ] ] }
{ 1 [ [ char <ref> ] [ drop ] ] }
{ 2 [ [ short <ref> ] [ drop ] ] }
{ 4 [ [ int <ref> ] [ drop ] ] }
{ 8 [ [ longlong <ref> ] [ drop ] ] }
[ invalid-fortran-type ]
} case
] args?dims ;

USING: alien.fortran.private generic kernel sequences ;
M: logical-type (fortran-arg>c-args)
[
M\ logical-type (fortran-arg>c-args) (call-next-method)
[ [ 1 0 ? ] prepend ] dip
] args?dims ;

USING: alien.fortran.private kernel ;
M: misc-type (fortran-arg>c-args) drop [ ] [ drop ] ;

USING: accessors alien.complex alien.fortran
alien.fortran.private combinators kernel ;
M: real-complex-type (fortran-arg>c-args)
[
size>> {
{ f [ [ <complex-float> ] [ drop ] ] }
{ 8 [ [ <complex-float> ] [ drop ] ] }
{ 16 [ [ <complex-double> ] [ drop ] ] }
[ invalid-fortran-type ]
} case
] args?dims ;

USING: accessors alien.c-types alien.data alien.fortran
alien.fortran.private combinators kernel ;
M: real-type (fortran-arg>c-args)
[
size>> {
{ f [ [ float <ref> ] [ drop ] ] }
{ 4 [ [ float <ref> ] [ drop ] ] }
{ 8 [ [ double <ref> ] [ drop ] ] }
[ invalid-fortran-type ]
} case
] args?dims ;