Handbook
Glossary
struct-c-type
Vocabulary
classes
.
struct
Definition
USING:
alien.c-types
;
IN:
classes.struct
TUPLE:
struct-c-type
<
abstract-c-type
fields return-in-registers?
;
Methods
USING:
alien.c-types
classes.struct
;
M:
struct-c-type
base-type
;
USING:
alien.c-types
classes.struct
compiler.cfg.builder.alien.boxing
compiler.cfg.hats
compiler.cfg.intrinsics.allot
kernel
;
M:
struct-c-type
box
'[
_
heap-size
^^allot-byte-array
dup
^^unbox-byte-array
]
2dip
implode-struct
;
USING:
assocs
classes.struct
compiler.cfg.builder.alien.boxing
cpu.architecture
kernel
sequences
;
M:
struct-c-type
box-parameter
dup
value-struct?
[
[
[
drop
first
]
dip
explode-struct
keys
]
keep
]
unless
box
;
USING:
assocs
classes.struct
compiler.cfg.builder.alien.boxing
cpu.architecture
generic
kernel
namespaces
sequences
;
M:
struct-c-type
box-return
dup
return-struct-in-registers?
[
M\
struct-c-type
box-return
(call-next-method)
]
[
[
[
[
{
}
assert-sequence=
]
bi@
struct-return-area
get
]
dip
explode-struct-return
keys
]
keep
box
]
if
;
USING:
classes.struct
compiler.cfg.builder.alien.boxing
;
M:
struct-c-type
flatten-c-type
flatten-struct-type
;
USING:
classes.struct
compiler.cfg.builder.alien.boxing
;
M:
struct-c-type
flatten-parameter-type
frob-struct
flatten-c-type
;
USING:
accessors
alien.c-types
classes.struct
cpu.arm.64.abi
kernel
sequences
;
M::
struct-c-type
homogeneous-aggregate-members
( type -- members/f )
type
fields>>
[|
field |
field
type>>
lookup-c-type
homogeneous-aggregate-members
[
field
offset>>
offset-homogeneous-members
]
[
f
]
if*
]
map
:>
fields fields
[
]
all?
[
fields
concat
type
heap-size
dense-homogeneous-members
]
[
f
]
if
;
USING:
classes.struct
compiler.cfg.builder.alien.boxing
cpu.architecture
generic
kernel
;
M:
struct-c-type
load-return
dup
return-struct-in-registers?
[
M\
struct-c-type
load-return
(call-next-method)
]
[
drop
{
}
]
if
;
USING:
alien.c-types
classes.struct
;
M:
struct-c-type
lookup-c-type
;
USING:
accessors
alien.c-types
arrays
classes.struct
cpu.x86.64.unix
kernel
math
sequences
;
M:
struct-c-type
struct-types&offset
fields>>
[
[
type>>
lookup-c-type
struct-types&offset
]
[
offset>>
]
bi
'[
first2
_
+
2array
]
map
]
map
concat
;
USING:
classes.struct
compiler.cfg.builder.alien.boxing
compiler.cfg.hats
kernel
;
M:
struct-c-type
unbox
[
^^unbox-any-c-ptr
]
dip
explode-struct
;
USING:
alien.c-types
arrays
assocs
classes.struct
compiler.cfg.builder.alien.boxing
compiler.cfg.hats
cpu.architecture
kernel
layouts
math.order
;
M:
struct-c-type
unbox-parameter
dup
value-struct?
[
unbox
]
[
[
nip
[
heap-size
]
[
c-type-align
cell
max
]
bi
f
^^local-allot
dup
]
[
[
^^unbox-any-c-ptr
]
dip
explode-struct
keys
]
2bi
implode-struct
1array
{
{
int-rep
f
f
}
}
]
if
;
USING:
arrays
assocs
classes.struct
compiler.cfg.builder.alien.boxing
cpu.architecture
generic
kernel
namespaces
;
M:
struct-c-type
unbox-return
dup
return-struct-in-registers?
[
M\
struct-c-type
unbox-return
(call-next-method)
]
[
[
struct-return-area
get
]
2dip
unbox
keys
implode-struct
return-struct-pointer?
[
struct-return-area
get
1array
{
int-rep
}
]
[
{
}
{
}
]
if
]
if
;