### 6` `Miscellaneous Support

procedure

(list->cblock lst type) → any

lst : list? type : ctype?

procedure

(vector->cblock vec type) → any

vec : vector? type : type?

procedure

(vector->cpointer vec) → cpointer?

vec : vector?

procedure

(flvector->cpointer flvec) → cpointer?

flvec : flvector?

procedure

(saved-errno new-value) → void? new-value : exact-integer?

Changed in version 6.4.0.9 of package base: Added the one-argument variant.

procedure

(lookup-errno sym) → exact-integer?

sym : (or/c 'EINTR 'EEXIST 'EAGAIN)

The conversion is roughly equivalent to

(let ([p (malloc from-type)]) (ptr-set! p from-type v) (ptr-ref p to-type))

If v is a cpointer, (cpointer-gcable? v) is true, and from-type and to-type are both based on _pointer or _gcpointer, then from-type is implicitly converted with _gcable to ensure that the result cpointer is treated as referring to memory that is managed by the garbage collector.

If v is a pointer with an offset component (e.g., from ptr-add), (cpointer-gcable? v) is true, and the result is a cpointer, then the result pointer has the same offset component as v. If (cpointer-gcable? v) is false, then any offset is folded into the pointer base for the result.

procedure

(cblock->list cblock type length) → list?

cblock : any/c type : ctype? length : exact-nonnegative-integer?

procedure

(cblock->vector cblock type length) → vector?

cblock : any/c type : ctype? length : exact-nonnegative-integer?