=proto void *duk_get_buffer(duk_context *ctx, duk_idx_t index, duk_size_t *out_size); =stack [ ... val! ... ] =summary
Get the data pointer for a buffer value at index
without modifying
or coercing the value. Returns a non-NULL
pointer if the value is a
valid buffer (fixed or dynamic) with a non-zero size. For a zero-size buffer,
may return a NULL
or a non-NULL
pointer. Returns NULL
if the value is not a buffer or the index is invalid. If out_size
is
non-NULL
, the size of the buffer is written to *out_size
; 0
is written if the return value is NULL
.
NULL
with zero size is returned for
a non-buffer. The same values may be returned for a zero-size buffer (although
it is also possible that a non-NULL
pointer is returned).