Handbook
Glossary
lookup-c-type ( name -- c-type )
Factor handbook
»
C library interface
»
Passing data between Factor and C
»
C type specifiers
Prev:
TYPEDEF:
Next:
Primitive C types
Vocabulary
alien
.
c-types
Inputs
name
a
c-type-name
Outputs
c-type
a
c-type
Word description
Looks up a C type by name.
Errors
Throws a
no-c-type
error if the type does not exist, or the word is not a C type.
Definition
IN:
alien.c-types
GENERIC:
lookup-c-type
( name -- c-type )
foldable
flushable
Methods
USING:
alien.c-types
arrays
;
M:
array
lookup-c-type
;
USING:
accessors
alien.c-types
alien.c-types.private
kernel
;
M:
pointer
lookup-c-type
[
\
void*
lookup-c-type
]
dip
to>>
dup
primitive-pointer-type?
[
drop
]
[
(pointer-c-type)
]
if
;
USING:
alien.arrays
alien.c-types
;
M:
string-type
lookup-c-type
;
USING:
alien.c-types
classes.struct
;
M:
struct-c-type
lookup-c-type
;
USING:
alien.c-types
kernel
words
;
M:
word
lookup-c-type
[
"c-type"
word-prop
resolve-typedef
]
[
no-c-type
]
?unless
;