diff --git a/basis/alien/c-types/c-types-docs.factor b/basis/alien/c-types/c-types-docs.factor index a0dea4e539..b221051efc 100755 --- a/basis/alien/c-types/c-types-docs.factor +++ b/basis/alien/c-types/c-types-docs.factor @@ -66,12 +66,12 @@ HELP: unbox-return { $notes "This is an internal word used by the compiler when compiling callbacks." } ; HELP: define-deref -{ $values { "name" "a word name" } } +{ $values { "c-type" "a C type" } } { $description "Defines a word " { $snippet "*name" } " with stack effect " { $snippet "( c-ptr -- value )" } " for reading a value with C type " { $snippet "name" } " stored at an alien pointer." } { $notes "This is an internal word called when defining C types, there is no need to call it on your own." } ; HELP: define-out -{ $values { "name" "a word name" } } +{ $values { "c-type" "a C type" } } { $description "Defines a word " { $snippet "<" { $emphasis "name" } ">" } " with stack effect " { $snippet "( value -- array )" } ". This word allocates a byte array large enough to hold a value with C type " { $snippet "name" } ", and writes the value at the top of the stack to the array." } { $notes "This is an internal word called when defining C types, there is no need to call it on your own." } ; diff --git a/basis/alien/c-types/c-types.factor b/basis/alien/c-types/c-types.factor index 1252836491..1245aedc32 100755 --- a/basis/alien/c-types/c-types.factor +++ b/basis/alien/c-types/c-types.factor @@ -297,11 +297,11 @@ M: long-long-type box-parameter ( n c-type -- ) M: long-long-type box-return ( c-type -- ) f swap box-parameter ; -: define-deref ( name -- ) +: define-deref ( c-type -- ) [ name>> CHAR: * prefix "alien.c-types" create ] [ c-getter 0 prefix ] bi (( c-ptr -- value )) define-inline ; -: define-out ( word -- ) +: define-out ( c-type -- ) [ name>> "alien.c-types" constructor-word ] [ dup c-setter '[ _ heap-size (byte-array) [ 0 @ ] keep ] ] bi (( value -- c-ptr )) define-inline ;