Handbook
Glossary
c-ptr
Factor handbook
»
C library interface
»
Passing data between Factor and C
»
Passing pointers to C functions
Next:
>c-ptr ( obj -- c-ptr )
Vocabulary
alien
Class description
Class of objects consisting of aliens, byte arrays and
f
. These objects all can be used as values of
pointer
C types.
Definition
USING:
byte-arrays
;
IN:
alien
UNION:
c-ptr
alien
POSTPONE:
f
byte-array
;
Methods
USING:
alien
;
M:
c-ptr
>c-ptr
;
inline
USING:
alien
alien.strings
io
io.encodings
io.streams.memory
kernel
;
M:
c-ptr
alien>string
[
<memory-stream>
]
[
<decoder>
]
bi*
"\0"
swap
stream-read-until
drop
;
USING:
alien
alien.strings
kernel
;
M:
c-ptr
string>alien
drop
;