name: duk_opt_pointer proto: | void *duk_opt_pointer(duk_context *ctx, duk_idx_t idx, void *def_value); stack: | [ ... val! ... ] summary: |

Get the pointer value at idx as void * without modifying or coercing the value. If the value is undefined or the index is invalid, def_value default value is returned. In other cases (null or non-matching type) throws an error.

example: | void *ptr; ptr = duk_opt_pointer(ctx, -3, (void *) 0x12345678); printf("my pointer is: %p\n", ptr); tags: - stack introduced: 2.1.0