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.
28 lines
663 B
28 lines
663 B
name: duk_opt_heapptr
|
|
|
|
proto: |
|
|
void *duk_opt_heapptr(duk_context *ctx, duk_idx_t idx, void *def_value);
|
|
|
|
stack: |
|
|
[ ... val! ... ]
|
|
|
|
summary: |
|
|
<p>Get a borrowed <code>void *</code> reference to a Duktape heap allocated
|
|
value (object, buffer, string) at <code>idx</code>. If the value is
|
|
<code>undefined</code> or the index is invalid, <code>def_value</code>
|
|
default value is returned. In other cases (<code>null</code> or
|
|
non-matching type) throws an error.</p>
|
|
|
|
<div include="default-pointer-validity.html" />
|
|
|
|
example: |
|
|
void *ptr;
|
|
|
|
ptr = duk_opt_heapptr(ctx, 2, default_ptr);
|
|
|
|
tags:
|
|
- stack
|
|
- borrowed
|
|
- heapptr
|
|
|
|
introduced: 2.1.0
|
|
|