=proto void *duk_require_buffer(duk_context *ctx, int index, size_t *out_size); =stack [ ... val! ... ] =summary

Like duk_get_buffer(), but throws an error if the value at index is not a buffer or if the index is invalid.

=example void *ptr; size_t sz; ptr = duk_require_buffer(ctx, &sz); printf("buf=%p, size=%d\n", ptr, (int) sz); =tags stack buffer