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
11
struct
duk_hnativefunction
{
12
/* shared object part */
13
duk_hobject
obj
;
14
15
duk_c_function
func
;
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_c_function
duk_ret_t(* duk_c_function)(duk_context *ctx)
Definition
duktape-1.5.2/src-noline/duktape.h:177
duk_hnativefunction
Definition
duktape-1.5.2/src-noline/duktape.c:5788
duk_hnativefunction::magic
duk_int16_t magic
Definition
duktape-1.5.2/src-noline/duktape.c:5794
duk_hnativefunction::obj
duk_hobject obj
Definition
duktape-1.5.2/src-noline/duktape.c:5790
duk_hnativefunction::nargs
duk_int16_t nargs
Definition
duktape-1.5.2/src-noline/duktape.c:5793
duk_hnativefunction::func
duk_c_function func
Definition
duktape-1.5.2/src-noline/duktape.c:5792
duk_hobject
Definition
duktape-1.5.2/src-noline/duktape.c:5328
vendor
civetweb
third_party
duktape-1.8.0
src-separate
duk_hnativefunction.h
Generated by
1.10.0