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

Get the Duktape/C function pointer (a duk_c_function) from an ECMAScript function object associated with a Duktape/C function. If the value is not such a function or idx is invalid, returns NULL.

If you prefer an error to be thrown for an invalid value or index, use duk_require_c_function().

example: | duk_c_function funcptr; funcptr = duk_get_c_function(ctx, -3); tags: - stack - function seealso: - duk_get_c_function_default introduced: 1.0.0