]> gitweb.factorcode.org Git - factor.git/blob - basis/specialized-arrays/direct/direct-docs.factor
windows.com: split off prettyprinting into windows.com.prettyprint
[factor.git] / basis / specialized-arrays / direct / direct-docs.factor
1 USING: help.markup help.syntax byte-arrays alien ;
2 IN: specialized-arrays.direct
3
4 ARTICLE: "specialized-arrays.direct" "Direct-mapped specialized arrays"
5 "The " { $vocab-link "specialized-arrays.direct" } " vocabulary implements fixed-length sequence types for storing machine values in unmanaged C memory."
6 $nl
7 "For each primitive C type " { $snippet "T" } ", a set of words are defined:"
8 { $table
9     { { $snippet "direct-T-array" } { "The class of direct arrays with elements of type " { $snippet "T" } } }
10     { { $snippet "<direct-T-array>" } { "Constructor for arrays with elements of type " { $snippet "T" } "; stack effect " { $snippet "( alien len -- array )" } } }
11 }
12 "Each direct array has a " { $slot "underlying" } " slot holding an " { $link simple-alien } " pointer to the raw data. This data can be passed to C functions."
13 $nl
14 "The primitive C types for which direct arrays exist:"
15 { $list
16     { $snippet "char" }
17     { $snippet "uchar" }
18     { $snippet "short" }
19     { $snippet "ushort" }
20     { $snippet "int" }
21     { $snippet "uint" }
22     { $snippet "long" }
23     { $snippet "ulong" }
24     { $snippet "longlong" }
25     { $snippet "ulonglong" }
26     { $snippet "float" }
27     { $snippet "double" }
28     { $snippet "void*" }
29     { $snippet "bool" }
30 }
31 "Direct arrays are generated with a functor in the " { $vocab-link "specialized-arrays.direct.functor" } " vocabulary." ;
32
33 ABOUT: "specialized-arrays.direct"