mirror of https://github.com/svaarala/duktape.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
420 B
21 lines
420 B
=proto
|
|
void *duk_require_buffer(duk_context *ctx, int index, size_t *out_size);
|
|
|
|
=stack
|
|
[ ... val! ... ]
|
|
|
|
=summary
|
|
<p>Like <code><a href="#duk_get_buffer">duk_get_buffer()</a></code>,
|
|
but throws an error if the value at <code>index</code> is not a buffer
|
|
or if the index is invalid.</p>
|
|
|
|
=example
|
|
void *ptr;
|
|
size_t sz;
|
|
|
|
ptr = duk_require_buffer(ctx, &sz);
|
|
printf("buf=%p, size=%d\n", ptr, (int) sz);
|
|
|
|
=tags
|
|
stack
|
|
buffer
|
|
|