Handbook Glossary
factorcode.org
>c-ptr ( obj -- c-ptr )
Factor handbook » C library interface » Passing data between Factor and C » Passing pointers to C functions

Prev:c-ptr
Next:Alien addresses


Vocabulary
alien

Inputs
objan object


Outputs
c-ptra c-ptr


Generic word contract
Outputs a pointer to the binary data of this object.

See also
element-size, byte-length

Definition
IN: alien

GENERIC: >c-ptr ( obj -- c-ptr ) flushable


Methods
USING: accessors alien
specialized-vectors.instances.gpu.demos.bunny.bunny-vertex-struct
;

M: bunny-vertex-struct-vector >c-ptr
underlying>> underlying>> ; inline


USING: alien ;

M: c-ptr >c-ptr ; inline


USING: accessors alien
specialized-vectors.instances.math.vectors.simd.float-4 ;

M: float-4-vector >c-ptr underlying>> underlying>> ; inline


USING: accessors alien
specialized-vectors.instances.game.loop.benchmark.game-loop-benchmark
;

M: game-loop-benchmark-vector >c-ptr
underlying>> underlying>> ; inline


USING: accessors alien kernel ;

M: object >c-ptr underlying>> ; inline


USING: accessors alien
specialized-vectors.instances.alien.c-types.short ;

M: short-vector >c-ptr underlying>> underlying>> ; inline


USING: accessors alien kernel math sequences ;

M: slice >c-ptr
[ [ from>> ] [ element-size ] bi * ] [ seq>> >c-ptr ] bi
<displaced-alien> ; inline


USING: alien classes.struct kernel.private slots.private ;

M: struct >c-ptr 2 slot { c-ptr } declare ; inline


USING: accessors alien
specialized-vectors.instances.alien.c-types.uint ;

M: uint-vector >c-ptr underlying>> underlying>> ; inline


USING: accessors alien
specialized-vectors.instances.alien.c-types.ushort ;

M: ushort-vector >c-ptr underlying>> underlying>> ; inline