Mercurial > embed
comparison libduktape/duktape.h @ 88:b561f5e85bdd
duktape: upgrade to 2.6.0, closes #2504
author | David Demelier <markand@malikania.fr> |
---|---|
date | Mon, 19 Oct 2020 10:43:25 +0200 |
parents | 0bd0077049ff |
children | 4636dddd5ad2 |
comparison
equal
deleted
inserted
replaced
87:00ef6d3553bd | 88:b561f5e85bdd |
---|---|
1 /* | 1 /* |
2 * Duktape public API for Duktape 2.3.0. | 2 * Duktape public API for Duktape 2.6.0. |
3 * | 3 * |
4 * See the API reference for documentation on call semantics. The exposed, | 4 * See the API reference for documentation on call semantics. The exposed, |
5 * supported API is between the "BEGIN PUBLIC API" and "END PUBLIC API" | 5 * supported API is between the "BEGIN PUBLIC API" and "END PUBLIC API" |
6 * comments. Other parts of the header are Duktape internal and related to | 6 * comments. Other parts of the header are Duktape internal and related to |
7 * e.g. platform/compiler/feature detection. | 7 * e.g. platform/compiler/feature detection. |
8 * | 8 * |
9 * Git commit d7fdb67f18561a50e06bafd196c6b423af9ad6fe (v2.3.0). | 9 * Git commit fffa346eff06a8764b02c31d4336f63a773a95c3 (v2.6.0). |
10 * Git branch master. | 10 * Git branch v2-maintenance. |
11 * | 11 * |
12 * See Duktape AUTHORS.rst and LICENSE.txt for copyright and | 12 * See Duktape AUTHORS.rst and LICENSE.txt for copyright and |
13 * licensing information. | 13 * licensing information. |
14 */ | 14 */ |
15 | 15 |
19 * Duktape license | 19 * Duktape license |
20 * =============== | 20 * =============== |
21 * | 21 * |
22 * (http://opensource.org/licenses/MIT) | 22 * (http://opensource.org/licenses/MIT) |
23 * | 23 * |
24 * Copyright (c) 2013-2018 by Duktape authors (see AUTHORS.rst) | 24 * Copyright (c) 2013-2019 by Duktape authors (see AUTHORS.rst) |
25 * | 25 * |
26 * Permission is hereby granted, free of charge, to any person obtaining a copy | 26 * Permission is hereby granted, free of charge, to any person obtaining a copy |
27 * of this software and associated documentation files (the "Software"), to deal | 27 * of this software and associated documentation files (the "Software"), to deal |
28 * in the Software without restriction, including without limitation the rights | 28 * in the Software without restriction, including without limitation the rights |
29 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | 29 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
98 * * Christopher Hiller (https://github.com/boneskull) | 98 * * Christopher Hiller (https://github.com/boneskull) |
99 * * Gonzalo Diethelm (https://github.com/gonzus) | 99 * * Gonzalo Diethelm (https://github.com/gonzus) |
100 * * Michal Kasperek (https://github.com/michalkas) | 100 * * Michal Kasperek (https://github.com/michalkas) |
101 * * Andrew Janke (https://github.com/apjanke) | 101 * * Andrew Janke (https://github.com/apjanke) |
102 * * Steve Fan (https://github.com/stevefan1999) | 102 * * Steve Fan (https://github.com/stevefan1999) |
103 * * Edward Betts (https://github.com/edwardbetts) | |
104 * * Ozhan Duz (https://github.com/webfolderio) | |
105 * * Akos Kiss (https://github.com/akosthekiss) | |
106 * * TheBrokenRail (https://github.com/TheBrokenRail) | |
107 * * Jesse Doyle (https://github.com/jessedoyle) | |
108 * * Gero Kuehn (https://github.com/dc6jgk) | |
109 * * James Swift (https://github.com/phraemer) | |
110 * * Luis de Bethencourt (https://github.com/luisbg) | |
111 * * Ian Whyman (https://github.com/v00d00) | |
112 * * Rick Sayre (https://github.com/whorfin) | |
103 * | 113 * |
104 * Other contributions | 114 * Other contributions |
105 * =================== | 115 * =================== |
106 * | 116 * |
107 * The following people have contributed something other than code (e.g. reported | 117 * The following people have contributed something other than code (e.g. reported |
138 * * https://github.com/chris-y | 148 * * https://github.com/chris-y |
139 * * Laurent Zubiaur (https://github.com/lzubiaur) | 149 * * Laurent Zubiaur (https://github.com/lzubiaur) |
140 * * Neil Kolban (https://github.com/nkolban) | 150 * * Neil Kolban (https://github.com/nkolban) |
141 * * Wilhelm Wanecek (https://github.com/wanecek) | 151 * * Wilhelm Wanecek (https://github.com/wanecek) |
142 * * Andrew Janke (https://github.com/apjanke) | 152 * * Andrew Janke (https://github.com/apjanke) |
153 * * Unamer (https://github.com/unamer) | |
154 * * Karl Dahlke (eklhad@gmail.com) | |
143 * | 155 * |
144 * If you are accidentally missing from this list, send me an e-mail | 156 * If you are accidentally missing from this list, send me an e-mail |
145 * (``sami.vaarala@iki.fi``) and I'll fix the omission. | 157 * (``sami.vaarala@iki.fi``) and I'll fix the omission. |
146 */ | 158 */ |
147 | 159 |
162 * to #if (DUK_VERSION >= NNN) against Duktape API version. The same value | 174 * to #if (DUK_VERSION >= NNN) against Duktape API version. The same value |
163 * is also available to ECMAScript code in Duktape.version. Unofficial | 175 * is also available to ECMAScript code in Duktape.version. Unofficial |
164 * development snapshots have 99 for patch level (e.g. 0.10.99 would be a | 176 * development snapshots have 99 for patch level (e.g. 0.10.99 would be a |
165 * development version after 0.10.0 but before the next official release). | 177 * development version after 0.10.0 but before the next official release). |
166 */ | 178 */ |
167 #define DUK_VERSION 20300L | 179 #define DUK_VERSION 20600L |
168 | 180 |
169 /* Git commit, describe, and branch for Duktape build. Useful for | 181 /* Git commit, describe, and branch for Duktape build. Useful for |
170 * non-official snapshot builds so that application code can easily log | 182 * non-official snapshot builds so that application code can easily log |
171 * which Duktape snapshot was used. Not available in the ECMAScript | 183 * which Duktape snapshot was used. Not available in the ECMAScript |
172 * environment. | 184 * environment. |
173 */ | 185 */ |
174 #define DUK_GIT_COMMIT "d7fdb67f18561a50e06bafd196c6b423af9ad6fe" | 186 #define DUK_GIT_COMMIT "fffa346eff06a8764b02c31d4336f63a773a95c3" |
175 #define DUK_GIT_DESCRIBE "v2.3.0" | 187 #define DUK_GIT_DESCRIBE "v2.6.0" |
176 #define DUK_GIT_BRANCH "master" | 188 #define DUK_GIT_BRANCH "v2-maintenance" |
177 | 189 |
178 /* External duk_config.h provides platform/compiler/OS dependent | 190 /* External duk_config.h provides platform/compiler/OS dependent |
179 * typedefs and macros, and DUK_USE_xxx config options so that | 191 * typedefs and macros, and DUK_USE_xxx config options so that |
180 * the rest of Duktape doesn't need to do any feature detection. | 192 * the rest of Duktape doesn't need to do any feature detection. |
181 * DUK_VERSION is defined before including so that configuration | 193 * DUK_VERSION is defined before including so that configuration |
381 #define DUK_DEFPROP_W DUK_DEFPROP_WRITABLE | 393 #define DUK_DEFPROP_W DUK_DEFPROP_WRITABLE |
382 #define DUK_DEFPROP_E DUK_DEFPROP_ENUMERABLE | 394 #define DUK_DEFPROP_E DUK_DEFPROP_ENUMERABLE |
383 #define DUK_DEFPROP_C DUK_DEFPROP_CONFIGURABLE | 395 #define DUK_DEFPROP_C DUK_DEFPROP_CONFIGURABLE |
384 #define DUK_DEFPROP_WE (DUK_DEFPROP_WRITABLE | DUK_DEFPROP_ENUMERABLE) | 396 #define DUK_DEFPROP_WE (DUK_DEFPROP_WRITABLE | DUK_DEFPROP_ENUMERABLE) |
385 #define DUK_DEFPROP_WC (DUK_DEFPROP_WRITABLE | DUK_DEFPROP_CONFIGURABLE) | 397 #define DUK_DEFPROP_WC (DUK_DEFPROP_WRITABLE | DUK_DEFPROP_CONFIGURABLE) |
398 #define DUK_DEFPROP_EC (DUK_DEFPROP_ENUMERABLE | DUK_DEFPROP_CONFIGURABLE) | |
386 #define DUK_DEFPROP_WEC (DUK_DEFPROP_WRITABLE | DUK_DEFPROP_ENUMERABLE | DUK_DEFPROP_CONFIGURABLE) | 399 #define DUK_DEFPROP_WEC (DUK_DEFPROP_WRITABLE | DUK_DEFPROP_ENUMERABLE | DUK_DEFPROP_CONFIGURABLE) |
387 #define DUK_DEFPROP_HAVE_W DUK_DEFPROP_HAVE_WRITABLE | 400 #define DUK_DEFPROP_HAVE_W DUK_DEFPROP_HAVE_WRITABLE |
388 #define DUK_DEFPROP_HAVE_E DUK_DEFPROP_HAVE_ENUMERABLE | 401 #define DUK_DEFPROP_HAVE_E DUK_DEFPROP_HAVE_ENUMERABLE |
389 #define DUK_DEFPROP_HAVE_C DUK_DEFPROP_HAVE_CONFIGURABLE | 402 #define DUK_DEFPROP_HAVE_C DUK_DEFPROP_HAVE_CONFIGURABLE |
390 #define DUK_DEFPROP_HAVE_WE (DUK_DEFPROP_HAVE_WRITABLE | DUK_DEFPROP_HAVE_ENUMERABLE) | 403 #define DUK_DEFPROP_HAVE_WE (DUK_DEFPROP_HAVE_WRITABLE | DUK_DEFPROP_HAVE_ENUMERABLE) |
391 #define DUK_DEFPROP_HAVE_WC (DUK_DEFPROP_HAVE_WRITABLE | DUK_DEFPROP_HAVE_CONFIGURABLE) | 404 #define DUK_DEFPROP_HAVE_WC (DUK_DEFPROP_HAVE_WRITABLE | DUK_DEFPROP_HAVE_CONFIGURABLE) |
405 #define DUK_DEFPROP_HAVE_EC (DUK_DEFPROP_HAVE_ENUMERABLE | DUK_DEFPROP_HAVE_CONFIGURABLE) | |
392 #define DUK_DEFPROP_HAVE_WEC (DUK_DEFPROP_HAVE_WRITABLE | DUK_DEFPROP_HAVE_ENUMERABLE | DUK_DEFPROP_HAVE_CONFIGURABLE) | 406 #define DUK_DEFPROP_HAVE_WEC (DUK_DEFPROP_HAVE_WRITABLE | DUK_DEFPROP_HAVE_ENUMERABLE | DUK_DEFPROP_HAVE_CONFIGURABLE) |
393 #define DUK_DEFPROP_SET_W DUK_DEFPROP_SET_WRITABLE | 407 #define DUK_DEFPROP_SET_W DUK_DEFPROP_SET_WRITABLE |
394 #define DUK_DEFPROP_SET_E DUK_DEFPROP_SET_ENUMERABLE | 408 #define DUK_DEFPROP_SET_E DUK_DEFPROP_SET_ENUMERABLE |
395 #define DUK_DEFPROP_SET_C DUK_DEFPROP_SET_CONFIGURABLE | 409 #define DUK_DEFPROP_SET_C DUK_DEFPROP_SET_CONFIGURABLE |
396 #define DUK_DEFPROP_SET_WE (DUK_DEFPROP_SET_WRITABLE | DUK_DEFPROP_SET_ENUMERABLE) | 410 #define DUK_DEFPROP_SET_WE (DUK_DEFPROP_SET_WRITABLE | DUK_DEFPROP_SET_ENUMERABLE) |
397 #define DUK_DEFPROP_SET_WC (DUK_DEFPROP_SET_WRITABLE | DUK_DEFPROP_SET_CONFIGURABLE) | 411 #define DUK_DEFPROP_SET_WC (DUK_DEFPROP_SET_WRITABLE | DUK_DEFPROP_SET_CONFIGURABLE) |
412 #define DUK_DEFPROP_SET_EC (DUK_DEFPROP_SET_ENUMERABLE | DUK_DEFPROP_SET_CONFIGURABLE) | |
398 #define DUK_DEFPROP_SET_WEC (DUK_DEFPROP_SET_WRITABLE | DUK_DEFPROP_SET_ENUMERABLE | DUK_DEFPROP_SET_CONFIGURABLE) | 413 #define DUK_DEFPROP_SET_WEC (DUK_DEFPROP_SET_WRITABLE | DUK_DEFPROP_SET_ENUMERABLE | DUK_DEFPROP_SET_CONFIGURABLE) |
399 #define DUK_DEFPROP_CLEAR_W DUK_DEFPROP_CLEAR_WRITABLE | 414 #define DUK_DEFPROP_CLEAR_W DUK_DEFPROP_CLEAR_WRITABLE |
400 #define DUK_DEFPROP_CLEAR_E DUK_DEFPROP_CLEAR_ENUMERABLE | 415 #define DUK_DEFPROP_CLEAR_E DUK_DEFPROP_CLEAR_ENUMERABLE |
401 #define DUK_DEFPROP_CLEAR_C DUK_DEFPROP_CLEAR_CONFIGURABLE | 416 #define DUK_DEFPROP_CLEAR_C DUK_DEFPROP_CLEAR_CONFIGURABLE |
402 #define DUK_DEFPROP_CLEAR_WE (DUK_DEFPROP_CLEAR_WRITABLE | DUK_DEFPROP_CLEAR_ENUMERABLE) | 417 #define DUK_DEFPROP_CLEAR_WE (DUK_DEFPROP_CLEAR_WRITABLE | DUK_DEFPROP_CLEAR_ENUMERABLE) |
403 #define DUK_DEFPROP_CLEAR_WC (DUK_DEFPROP_CLEAR_WRITABLE | DUK_DEFPROP_CLEAR_CONFIGURABLE) | 418 #define DUK_DEFPROP_CLEAR_WC (DUK_DEFPROP_CLEAR_WRITABLE | DUK_DEFPROP_CLEAR_CONFIGURABLE) |
419 #define DUK_DEFPROP_CLEAR_EC (DUK_DEFPROP_CLEAR_ENUMERABLE | DUK_DEFPROP_CLEAR_CONFIGURABLE) | |
404 #define DUK_DEFPROP_CLEAR_WEC (DUK_DEFPROP_CLEAR_WRITABLE | DUK_DEFPROP_CLEAR_ENUMERABLE | DUK_DEFPROP_CLEAR_CONFIGURABLE) | 420 #define DUK_DEFPROP_CLEAR_WEC (DUK_DEFPROP_CLEAR_WRITABLE | DUK_DEFPROP_CLEAR_ENUMERABLE | DUK_DEFPROP_CLEAR_CONFIGURABLE) |
405 #define DUK_DEFPROP_ATTR_W (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_W) | 421 #define DUK_DEFPROP_ATTR_W (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_W) |
406 #define DUK_DEFPROP_ATTR_E (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_E) | 422 #define DUK_DEFPROP_ATTR_E (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_E) |
407 #define DUK_DEFPROP_ATTR_C (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_C) | 423 #define DUK_DEFPROP_ATTR_C (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_C) |
408 #define DUK_DEFPROP_ATTR_WE (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_WE) | 424 #define DUK_DEFPROP_ATTR_WE (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_WE) |
409 #define DUK_DEFPROP_ATTR_WC (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_WC) | 425 #define DUK_DEFPROP_ATTR_WC (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_WC) |
426 #define DUK_DEFPROP_ATTR_EC (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_EC) | |
410 #define DUK_DEFPROP_ATTR_WEC (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_WEC) | 427 #define DUK_DEFPROP_ATTR_WEC (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_WEC) |
411 | 428 |
412 /* Flags for duk_push_thread_raw() */ | 429 /* Flags for duk_push_thread_raw() */ |
413 #define DUK_THREAD_NEW_GLOBAL_ENV (1U << 0) /* create a new global environment */ | 430 #define DUK_THREAD_NEW_GLOBAL_ENV (1U << 0) /* create a new global environment */ |
414 | 431 |
445 | 462 |
446 /* | 463 /* |
447 * Macros to create Symbols as C statically constructed strings. | 464 * Macros to create Symbols as C statically constructed strings. |
448 * | 465 * |
449 * Call e.g. as DUK_HIDDEN_SYMBOL("myProperty") <=> ("\xFF" "myProperty"). | 466 * Call e.g. as DUK_HIDDEN_SYMBOL("myProperty") <=> ("\xFF" "myProperty"). |
467 * | |
450 * Local symbols have a unique suffix, caller should take care to avoid | 468 * Local symbols have a unique suffix, caller should take care to avoid |
451 * conflicting with the Duktape internal representation by e.g. prepending | 469 * conflicting with the Duktape internal representation by e.g. prepending |
452 * a '!' character: DUK_LOCAL_SYMBOL("myLocal", "!123"). | 470 * a '!' character: DUK_LOCAL_SYMBOL("myLocal", "!123"). |
453 * | 471 * |
454 * Note that these can only be used for string constants, not dynamically | 472 * Note that these can only be used for string constants, not dynamically |
455 * created strings. | 473 * created strings. |
474 * | |
475 * You shouldn't normally use DUK_INTERNAL_SYMBOL() at all. It is reserved | |
476 * for Duktape internal symbols only. There are no versioning guarantees | |
477 * for internal symbols. | |
456 */ | 478 */ |
457 | 479 |
458 #define DUK_HIDDEN_SYMBOL(x) ("\xFF" x) | 480 #define DUK_HIDDEN_SYMBOL(x) ("\xFF" x) |
459 #define DUK_GLOBAL_SYMBOL(x) ("\x80" x) | 481 #define DUK_GLOBAL_SYMBOL(x) ("\x80" x) |
460 #define DUK_LOCAL_SYMBOL(x,uniq) ("\x81" x "\xff" uniq) | 482 #define DUK_LOCAL_SYMBOL(x,uniq) ("\x81" x "\xff" uniq) |
461 #define DUK_WELLKNOWN_SYMBOL(x) ("\x81" x "\xff") | 483 #define DUK_WELLKNOWN_SYMBOL(x) ("\x81" x "\xff") |
484 #define DUK_INTERNAL_SYMBOL(x) ("\x82" x) | |
462 | 485 |
463 /* | 486 /* |
464 * If no variadic macros, __FILE__ and __LINE__ are passed through globals | 487 * If no variadic macros, __FILE__ and __LINE__ are passed through globals |
465 * which is ugly and not thread safe. | 488 * which is ugly and not thread safe. |
466 */ | 489 */ |
642 DUK_EXTERNAL_DECL void duk_swap(duk_context *ctx, duk_idx_t idx1, duk_idx_t idx2); | 665 DUK_EXTERNAL_DECL void duk_swap(duk_context *ctx, duk_idx_t idx1, duk_idx_t idx2); |
643 DUK_EXTERNAL_DECL void duk_swap_top(duk_context *ctx, duk_idx_t idx); | 666 DUK_EXTERNAL_DECL void duk_swap_top(duk_context *ctx, duk_idx_t idx); |
644 DUK_EXTERNAL_DECL void duk_dup(duk_context *ctx, duk_idx_t from_idx); | 667 DUK_EXTERNAL_DECL void duk_dup(duk_context *ctx, duk_idx_t from_idx); |
645 DUK_EXTERNAL_DECL void duk_dup_top(duk_context *ctx); | 668 DUK_EXTERNAL_DECL void duk_dup_top(duk_context *ctx); |
646 DUK_EXTERNAL_DECL void duk_insert(duk_context *ctx, duk_idx_t to_idx); | 669 DUK_EXTERNAL_DECL void duk_insert(duk_context *ctx, duk_idx_t to_idx); |
670 DUK_EXTERNAL_DECL void duk_pull(duk_context *ctx, duk_idx_t from_idx); | |
647 DUK_EXTERNAL_DECL void duk_replace(duk_context *ctx, duk_idx_t to_idx); | 671 DUK_EXTERNAL_DECL void duk_replace(duk_context *ctx, duk_idx_t to_idx); |
648 DUK_EXTERNAL_DECL void duk_copy(duk_context *ctx, duk_idx_t from_idx, duk_idx_t to_idx); | 672 DUK_EXTERNAL_DECL void duk_copy(duk_context *ctx, duk_idx_t from_idx, duk_idx_t to_idx); |
649 DUK_EXTERNAL_DECL void duk_remove(duk_context *ctx, duk_idx_t idx); | 673 DUK_EXTERNAL_DECL void duk_remove(duk_context *ctx, duk_idx_t idx); |
650 DUK_EXTERNAL_DECL void duk_xcopymove_raw(duk_context *to_ctx, duk_context *from_ctx, duk_idx_t count, duk_bool_t is_copy); | 674 DUK_EXTERNAL_DECL void duk_xcopymove_raw(duk_context *to_ctx, duk_context *from_ctx, duk_idx_t count, duk_bool_t is_copy); |
651 | 675 |
701 DUK_EXTERNAL_DECL void duk_push_thread_stash(duk_context *ctx, duk_context *target_ctx); | 725 DUK_EXTERNAL_DECL void duk_push_thread_stash(duk_context *ctx, duk_context *target_ctx); |
702 | 726 |
703 DUK_EXTERNAL_DECL duk_idx_t duk_push_object(duk_context *ctx); | 727 DUK_EXTERNAL_DECL duk_idx_t duk_push_object(duk_context *ctx); |
704 DUK_EXTERNAL_DECL duk_idx_t duk_push_bare_object(duk_context *ctx); | 728 DUK_EXTERNAL_DECL duk_idx_t duk_push_bare_object(duk_context *ctx); |
705 DUK_EXTERNAL_DECL duk_idx_t duk_push_array(duk_context *ctx); | 729 DUK_EXTERNAL_DECL duk_idx_t duk_push_array(duk_context *ctx); |
730 DUK_EXTERNAL_DECL duk_idx_t duk_push_bare_array(duk_context *ctx); | |
706 DUK_EXTERNAL_DECL duk_idx_t duk_push_c_function(duk_context *ctx, duk_c_function func, duk_idx_t nargs); | 731 DUK_EXTERNAL_DECL duk_idx_t duk_push_c_function(duk_context *ctx, duk_c_function func, duk_idx_t nargs); |
707 DUK_EXTERNAL_DECL duk_idx_t duk_push_c_lightfunc(duk_context *ctx, duk_c_function func, duk_idx_t nargs, duk_idx_t length, duk_int_t magic); | 732 DUK_EXTERNAL_DECL duk_idx_t duk_push_c_lightfunc(duk_context *ctx, duk_c_function func, duk_idx_t nargs, duk_idx_t length, duk_int_t magic); |
708 DUK_EXTERNAL_DECL duk_idx_t duk_push_thread_raw(duk_context *ctx, duk_uint_t flags); | 733 DUK_EXTERNAL_DECL duk_idx_t duk_push_thread_raw(duk_context *ctx, duk_uint_t flags); |
709 DUK_EXTERNAL_DECL duk_idx_t duk_push_proxy(duk_context *ctx, duk_uint_t proxy_flags); | 734 DUK_EXTERNAL_DECL duk_idx_t duk_push_proxy(duk_context *ctx, duk_uint_t proxy_flags); |
710 | 735 |
935 DUK_EXTERNAL_DECL duk_c_function duk_require_c_function(duk_context *ctx, duk_idx_t idx); | 960 DUK_EXTERNAL_DECL duk_c_function duk_require_c_function(duk_context *ctx, duk_idx_t idx); |
936 DUK_EXTERNAL_DECL duk_context *duk_require_context(duk_context *ctx, duk_idx_t idx); | 961 DUK_EXTERNAL_DECL duk_context *duk_require_context(duk_context *ctx, duk_idx_t idx); |
937 DUK_EXTERNAL_DECL void duk_require_function(duk_context *ctx, duk_idx_t idx); | 962 DUK_EXTERNAL_DECL void duk_require_function(duk_context *ctx, duk_idx_t idx); |
938 #define duk_require_callable(ctx,idx) \ | 963 #define duk_require_callable(ctx,idx) \ |
939 duk_require_function((ctx), (idx)) | 964 duk_require_function((ctx), (idx)) |
965 DUK_EXTERNAL_DECL void duk_require_constructor_call(duk_context *ctx); | |
966 DUK_EXTERNAL_DECL void duk_require_constructable(duk_context *ctx, duk_idx_t idx); | |
940 DUK_EXTERNAL_DECL void *duk_require_heapptr(duk_context *ctx, duk_idx_t idx); | 967 DUK_EXTERNAL_DECL void *duk_require_heapptr(duk_context *ctx, duk_idx_t idx); |
941 | 968 |
942 /* Symbols are object coercible and covered by DUK_TYPE_MASK_STRING. */ | 969 /* Symbols are object coercible and covered by DUK_TYPE_MASK_STRING. */ |
943 #define duk_require_object_coercible(ctx,idx) \ | 970 #define duk_require_object_coercible(ctx,idx) \ |
944 ((void) duk_check_type_mask((ctx), (idx), DUK_TYPE_MASK_BOOLEAN | \ | 971 ((void) duk_check_type_mask((ctx), (idx), DUK_TYPE_MASK_BOOLEAN | \ |
984 #define duk_to_dynamic_buffer(ctx,idx,out_size) \ | 1011 #define duk_to_dynamic_buffer(ctx,idx,out_size) \ |
985 duk_to_buffer_raw((ctx), (idx), (out_size), DUK_BUF_MODE_DYNAMIC) | 1012 duk_to_buffer_raw((ctx), (idx), (out_size), DUK_BUF_MODE_DYNAMIC) |
986 | 1013 |
987 /* safe variants of a few coercion operations */ | 1014 /* safe variants of a few coercion operations */ |
988 DUK_EXTERNAL_DECL const char *duk_safe_to_lstring(duk_context *ctx, duk_idx_t idx, duk_size_t *out_len); | 1015 DUK_EXTERNAL_DECL const char *duk_safe_to_lstring(duk_context *ctx, duk_idx_t idx, duk_size_t *out_len); |
1016 DUK_EXTERNAL_DECL const char *duk_to_stacktrace(duk_context *ctx, duk_idx_t idx); | |
1017 DUK_EXTERNAL_DECL const char *duk_safe_to_stacktrace(duk_context *ctx, duk_idx_t idx); | |
989 #define duk_safe_to_string(ctx,idx) \ | 1018 #define duk_safe_to_string(ctx,idx) \ |
990 duk_safe_to_lstring((ctx), (idx), NULL) | 1019 duk_safe_to_lstring((ctx), (idx), NULL) |
991 | 1020 |
992 /* | 1021 /* |
993 * Value length | 1022 * Value length |
1008 DUK_EXTERNAL_DECL void duk_base64_decode(duk_context *ctx, duk_idx_t idx); | 1037 DUK_EXTERNAL_DECL void duk_base64_decode(duk_context *ctx, duk_idx_t idx); |
1009 DUK_EXTERNAL_DECL const char *duk_hex_encode(duk_context *ctx, duk_idx_t idx); | 1038 DUK_EXTERNAL_DECL const char *duk_hex_encode(duk_context *ctx, duk_idx_t idx); |
1010 DUK_EXTERNAL_DECL void duk_hex_decode(duk_context *ctx, duk_idx_t idx); | 1039 DUK_EXTERNAL_DECL void duk_hex_decode(duk_context *ctx, duk_idx_t idx); |
1011 DUK_EXTERNAL_DECL const char *duk_json_encode(duk_context *ctx, duk_idx_t idx); | 1040 DUK_EXTERNAL_DECL const char *duk_json_encode(duk_context *ctx, duk_idx_t idx); |
1012 DUK_EXTERNAL_DECL void duk_json_decode(duk_context *ctx, duk_idx_t idx); | 1041 DUK_EXTERNAL_DECL void duk_json_decode(duk_context *ctx, duk_idx_t idx); |
1042 DUK_EXTERNAL_DECL void duk_cbor_encode(duk_context *ctx, duk_idx_t idx, duk_uint_t encode_flags); | |
1043 DUK_EXTERNAL_DECL void duk_cbor_decode(duk_context *ctx, duk_idx_t idx, duk_uint_t decode_flags); | |
1013 | 1044 |
1014 DUK_EXTERNAL_DECL const char *duk_buffer_to_string(duk_context *ctx, duk_idx_t idx); | 1045 DUK_EXTERNAL_DECL const char *duk_buffer_to_string(duk_context *ctx, duk_idx_t idx); |
1015 | 1046 |
1016 /* | 1047 /* |
1017 * Buffer | 1048 * Buffer |