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.
31 lines
671 B
31 lines
671 B
name: duk_require_buffer_data
|
|
|
|
proto: |
|
|
void *duk_require_buffer_data(duk_context *ctx, duk_idx_t index, duk_size_t *out_size);
|
|
|
|
stack: |
|
|
[ ... val! ... ]
|
|
|
|
summary: |
|
|
<p>Like <code><a href="#duk_get_buffer_data">duk_get_buffer_data()</a></code>,
|
|
but throws an error if the value at <code>index</code> is not a plain buffer
|
|
or a buffer object or if the index is invalid.</p>
|
|
|
|
example: |
|
|
void *ptr;
|
|
duk_size_t sz;
|
|
|
|
ptr = duk_require_buffer_data(ctx, -3, &sz);
|
|
printf("buf=%p, size=%lu\n", ptr, (unsigned long) sz);
|
|
|
|
tags:
|
|
- stack
|
|
- buffer
|
|
- bufferobject
|
|
|
|
seealso:
|
|
- duk_get_buffer_data
|
|
- duk_require_buffer
|
|
- duk_get_buffer
|
|
|
|
introduced: 1.3.0
|
|
|