USING: alien.accessors alien.c-types alien.libraries alien.strings
alien.syntax byte-arrays cpu.x86 eval help.markup help.syntax io
-io.backend io.encodings.utf16n io.encodings.utf8 kernel math
+io.backend io.encodings.utf16 io.encodings.utf8 kernel math
quotations sequences system ;
IN: alien
{ $description "Tests if the alien is a relic from an earlier session. A byte array is never considered to have expired, whereas passing " { $link f } " always yields true." } ;
HELP: <bad-alien>
-{ $values { "alien" c-ptr } }
+{ $values { "alien" c-ptr } }
{ $description "Constructs an invalid alien pointer that has expired." } ;
HELP: <displaced-alien>
HELP: free-callback
{ $values { "alien" alien } }
-{ $description "Releases the callback heap memory allocated for an alien callback. " }
+{ $description "Releases the callback heap memory allocated for an alien callback." }
{ $warning "If the callback is invoked (either from C or Factor) after it has been freed, then Factor may crash." } ;
HELP: with-callback
{ $class-description "Class of objects consisting of aliens, byte arrays and " { $link f } ". These objects all can be used as values of " { $link pointer } " C types." } ;
HELP: alien-invoke
-{ $values { "args..." "zero or more objects passed to the C function" } { "return" "a C return type" } { "library" "a logical library name" } { "function" "a C function name" } { "parameters" "a sequence of C parameter types" } { "return..." "the return value of the function, if not " { $link void } } }
+{ $values { "args..." "zero or more objects passed to the C function" } { "return" "a C return type" } { "library" "a logical library name" } { "function" "a C function name" } { "parameters" "a sequence of C parameter types" } { "varargs?" boolean } { "return..." "the return value of the function, if not " { $link void } } }
{ $description "Calls a C library function with the given name. Input parameters are taken from the data stack, and the return value is pushed on the data stack after the function returns. A return type of " { $link void } " indicates that no value is to be expected." }
{ $notes "C type names are documented in " { $link "c-types-specs" } "." }
{ $errors "Throws an " { $link callsite-not-compiled } " if the word calling " { $link alien-invoke } " was not compiled with the optimizing compiler." } ;
<displaced-alien>
alien-address
}
-"Anywhere that a " { $link alien } " instance is accepted, the " { $link f } " singleton may be passed in to denote a null pointer."
+"Anywhere that an " { $link alien } " instance is accepted, the " { $link f } " singleton may be passed in to denote a null pointer."
$nl
-"Usually alien objects do not have to created and dereferenced directly; instead declaring C function parameters and return values as having a " { $link pointer } " type such as " { $snippet "void*" } " takes care of the details."
+"Usually alien objects do not have to be created and dereferenced directly; instead declaring C function parameters and return values as having a " { $link pointer } " type such as " { $snippet "void*" } " takes care of the details."
{ $subsections
"syntax-aliens"
"alien-expiry"