Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
duktape-1.8.0/src-separate/duk_hnativefunction.h
Go to the documentation of this file.
1/*
2 * Heap native function representation.
3 */
4
5#ifndef DUK_HNATIVEFUNCTION_H_INCLUDED
6#define DUK_HNATIVEFUNCTION_H_INCLUDED
7
8#define DUK_HNATIVEFUNCTION_NARGS_VARARGS ((duk_int16_t) -1)
9#define DUK_HNATIVEFUNCTION_NARGS_MAX ((duk_int16_t) 0x7fff)
10
12 /* shared object part */
14
16 duk_int16_t nargs;
17 duk_int16_t magic;
18
19 /* The 'magic' field allows an opaque 16-bit field to be accessed by the
20 * Duktape/C function. This allows, for instance, the same native function
21 * to be used for a set of very similar functions, with the 'magic' field
22 * providing the necessary non-argument flags / values to guide the behavior
23 * of the native function. The value is signed on purpose: it is easier to
24 * convert a signed value to unsigned (simply AND with 0xffff) than vice
25 * versa.
26 *
27 * Note: cannot place nargs/magic into the heaphdr flags, because
28 * duk_hobject takes almost all flags already (and needs the spare).
29 */
30};
31
32#endif /* DUK_HNATIVEFUNCTION_H_INCLUDED */
duk_ret_t(* duk_c_function)(duk_context *ctx)