Handbook
Glossary
alien>string ( c-ptr encoding -- string/f )
Factor handbook
»
C library interface
»
Passing data between Factor and C
»
C strings
Prev:
malloc-string ( string encoding -- alien )
Vocabulary
alien
.
strings
Inputs
c-ptr
a
c-ptr
encoding
an encoding descriptor
Outputs
string/f
a string or
f
Word description
Reads a null-terminated C string from the specified address with the given encoding.
See also
string>alien
,
malloc-string
Definition
IN:
alien.strings
GENERIC#:
alien>string
1
( c-ptr encoding -- string/f )
Methods
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.strings
kernel
;
M:
f
alien>string
drop
;
USING:
accessors
alien.strings
kernel
;
M:
object
alien>string
[
underlying>>
]
dip
alien>string
;