Commit 522a1fc1 authored by Camil Staps's avatar Camil Staps 🐧

Minor additions to ccall documentation

parent ce90280e
Pipeline #33301 passed with stages
in 25 minutes and 10 seconds
......@@ -451,10 +451,10 @@ where
, "\n"
, "Input, output and state argument types can be:"
, " - `I` for integers"
, " - `p` for pointers (e.g. from {{`System.Pointer`}}; on most systems this is identical to `I`)"
, " - [`Rr`] for reals"
, " - `p` for pointers (on most systems this is identical to `I`)"
, " - [`Rr`] for reals (`R` for `double`s and `r` for `float`s)"
, " - `S` for Clean Strings (`{#Char}`). If used as input type this passes a pointer to the string's length (number of characters). The actual array is at offset 4/8 (32/64 bit). If this is used as output type, the C function has to return a pointer to the string's length, followed by the actual string. A copy of the string will be created in the Clean heap, and this copy will be used by Clean. If the string was allocated in C, for example using malloc, it should be deallocated in C when it is no longer used."
, " - `s` for the characters of a Clean String (handy to use in conjuction with {{`packString`}}, as the string is not null-terminated). The length (number of characters) is at offset -4/-8. (32/64 bit)."
, " - `s` for the characters of a Clean String (handy to use in conjuction with {{`packString`}}, as Clean strings are not null-terminated). The length (number of characters) is at offset -4/-8. (32/64 bit)."
, " - `A` for A-stack elements. A pointer to the third block of the node is passed. For arrays, this is a pointer to the elements. One word higher is the element type. The size of the array is two words higher."
, " - [`OF`] for function pointers"
, " - `V` for `void`, packs the following argument types in a tuple (e.g. `VIR` means `(Int, Real)`)"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment