Mercurial > irccd
comparison extern/duktape/duktape.h @ 363:c26b75fb97e3
Irccd: upgrade Duktape to 1.5.1
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 01 Dec 2016 13:05:12 +0100 |
parents | a24e2de22565 |
children | 70b0c9e40131 |
comparison
equal
deleted
inserted
replaced
362:33c1ee29feef | 363:c26b75fb97e3 |
---|---|
1 /* | 1 /* |
2 * Duktape public API for Duktape 1.5.0. | 2 * Duktape public API for Duktape 1.5.1. |
3 * | 3 * |
4 * See the API reference for documentation on call semantics. | 4 * See the API reference for documentation on call semantics. |
5 * The exposed API is inside the DUK_API_PUBLIC_H_INCLUDED | 5 * The exposed API is inside the DUK_API_PUBLIC_H_INCLUDED |
6 * include guard. Other parts of the header are Duktape | 6 * include guard. Other parts of the header are Duktape |
7 * internal and related to platform/compiler/feature detection. | 7 * internal and related to platform/compiler/feature detection. |
8 * | 8 * |
9 * Git commit 83d557704ee63f68ab40b6fcb00995c9b3d6777c (v1.5.0). | 9 * Git commit 2cc76e9ff1f64869e1146ad7317d8cbe33bbd27e (v1.5.1). |
10 * Git branch master. | 10 * Git branch HEAD. |
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 |
216 * to #ifdef against Duktape API version. The same value is also available | 216 * to #ifdef against Duktape API version. The same value is also available |
217 * to Ecmascript code in Duktape.version. Unofficial development snapshots | 217 * to Ecmascript code in Duktape.version. Unofficial development snapshots |
218 * have 99 for patch level (e.g. 0.10.99 would be a development version | 218 * have 99 for patch level (e.g. 0.10.99 would be a development version |
219 * after 0.10.0 but before the next official release). | 219 * after 0.10.0 but before the next official release). |
220 */ | 220 */ |
221 #define DUK_VERSION 10500L | 221 #define DUK_VERSION 10501L |
222 | 222 |
223 /* Git commit, describe, and branch for Duktape build. Useful for | 223 /* Git commit, describe, and branch for Duktape build. Useful for |
224 * non-official snapshot builds so that application code can easily log | 224 * non-official snapshot builds so that application code can easily log |
225 * which Duktape snapshot was used. Not available in the Ecmascript | 225 * which Duktape snapshot was used. Not available in the Ecmascript |
226 * environment. | 226 * environment. |
227 */ | 227 */ |
228 #define DUK_GIT_COMMIT "83d557704ee63f68ab40b6fcb00995c9b3d6777c" | 228 #define DUK_GIT_COMMIT "2cc76e9ff1f64869e1146ad7317d8cbe33bbd27e" |
229 #define DUK_GIT_DESCRIBE "v1.5.0" | 229 #define DUK_GIT_DESCRIBE "v1.5.1" |
230 #define DUK_GIT_BRANCH "master" | 230 #define DUK_GIT_BRANCH "HEAD" |
231 | 231 |
232 /* Duktape debug protocol version used by this build. */ | 232 /* Duktape debug protocol version used by this build. */ |
233 #define DUK_DEBUG_PROTOCOL_VERSION 1 | 233 #define DUK_DEBUG_PROTOCOL_VERSION 1 |
234 | 234 |
235 /* Used to represent invalid index; if caller uses this without checking, | 235 /* Used to represent invalid index; if caller uses this without checking, |
424 | 424 |
425 DUK_API_NORETURN(DUK_EXTERNAL_DECL void duk_error_raw(duk_context *ctx, duk_errcode_t err_code, const char *filename, duk_int_t line, const char *fmt, ...)); | 425 DUK_API_NORETURN(DUK_EXTERNAL_DECL void duk_error_raw(duk_context *ctx, duk_errcode_t err_code, const char *filename, duk_int_t line, const char *fmt, ...)); |
426 | 426 |
427 #ifdef DUK_API_VARIADIC_MACROS | 427 #ifdef DUK_API_VARIADIC_MACROS |
428 #define duk_error(ctx,err_code,...) \ | 428 #define duk_error(ctx,err_code,...) \ |
429 duk_error_raw((ctx), (duk_errcode_t) (err_code), (const char *) (__FILE__), (duk_int_t) (__LINE__), __VA_ARGS__) | 429 duk_error_raw((ctx), (duk_errcode_t) (err_code), (const char *) (DUK_FILE_MACRO), (duk_int_t) (DUK_LINE_MACRO), __VA_ARGS__) |
430 #else | 430 #else |
431 DUK_API_NORETURN(DUK_EXTERNAL_DECL void duk_error_stash(duk_context *ctx, duk_errcode_t err_code, const char *fmt, ...)); | 431 DUK_API_NORETURN(DUK_EXTERNAL_DECL void duk_error_stash(duk_context *ctx, duk_errcode_t err_code, const char *fmt, ...)); |
432 /* One problem with this macro is that expressions like the following fail | 432 /* One problem with this macro is that expressions like the following fail |
433 * to compile: "(void) duk_error(...)". But because duk_error() is noreturn, | 433 * to compile: "(void) duk_error(...)". But because duk_error() is noreturn, |
434 * they make little sense anyway. | 434 * they make little sense anyway. |
435 */ | 435 */ |
436 #define duk_error \ | 436 #define duk_error \ |
437 (duk_api_global_filename = (const char *) (__FILE__), \ | 437 (duk_api_global_filename = (const char *) (DUK_FILE_MACRO), \ |
438 duk_api_global_line = (duk_int_t) (__LINE__), \ | 438 duk_api_global_line = (duk_int_t) (DUK_LINE_MACRO), \ |
439 duk_error_stash) /* last value is func pointer, arguments follow in parens */ | 439 duk_error_stash) /* last value is func pointer, arguments follow in parens */ |
440 #endif | 440 #endif |
441 | 441 |
442 DUK_API_NORETURN(DUK_EXTERNAL_DECL void duk_error_va_raw(duk_context *ctx, duk_errcode_t err_code, const char *filename, duk_int_t line, const char *fmt, va_list ap)); | 442 DUK_API_NORETURN(DUK_EXTERNAL_DECL void duk_error_va_raw(duk_context *ctx, duk_errcode_t err_code, const char *filename, duk_int_t line, const char *fmt, va_list ap)); |
443 #define duk_error_va(ctx,err_code,fmt,ap) \ | 443 #define duk_error_va(ctx,err_code,fmt,ap) \ |
444 duk_error_va_raw((ctx), (duk_errcode_t) (err_code), (const char *) (__FILE__), (duk_int_t) (__LINE__), (fmt), (ap)) | 444 duk_error_va_raw((ctx), (duk_errcode_t) (err_code), (const char *) (DUK_FILE_MACRO), (duk_int_t) (DUK_LINE_MACRO), (fmt), (ap)) |
445 | 445 |
446 /* | 446 /* |
447 * Other state related functions | 447 * Other state related functions |
448 */ | 448 */ |
449 | 449 |
545 | 545 |
546 DUK_EXTERNAL_DECL duk_idx_t duk_push_error_object_raw(duk_context *ctx, duk_errcode_t err_code, const char *filename, duk_int_t line, const char *fmt, ...); | 546 DUK_EXTERNAL_DECL duk_idx_t duk_push_error_object_raw(duk_context *ctx, duk_errcode_t err_code, const char *filename, duk_int_t line, const char *fmt, ...); |
547 | 547 |
548 #ifdef DUK_API_VARIADIC_MACROS | 548 #ifdef DUK_API_VARIADIC_MACROS |
549 #define duk_push_error_object(ctx,err_code,...) \ | 549 #define duk_push_error_object(ctx,err_code,...) \ |
550 duk_push_error_object_raw((ctx), (err_code), (const char *) (__FILE__), (duk_int_t) (__LINE__), __VA_ARGS__) | 550 duk_push_error_object_raw((ctx), (err_code), (const char *) (DUK_FILE_MACRO), (duk_int_t) (DUK_LINE_MACRO), __VA_ARGS__) |
551 #else | 551 #else |
552 DUK_EXTERNAL_DECL duk_idx_t duk_push_error_object_stash(duk_context *ctx, duk_errcode_t err_code, const char *fmt, ...); | 552 DUK_EXTERNAL_DECL duk_idx_t duk_push_error_object_stash(duk_context *ctx, duk_errcode_t err_code, const char *fmt, ...); |
553 /* Note: parentheses are required so that the comma expression works in assignments. */ | 553 /* Note: parentheses are required so that the comma expression works in assignments. */ |
554 #define duk_push_error_object \ | 554 #define duk_push_error_object \ |
555 (duk_api_global_filename = (const char *) (__FILE__), \ | 555 (duk_api_global_filename = (const char *) (DUK_FILE_MACRO), \ |
556 duk_api_global_line = (duk_int_t) (__LINE__), \ | 556 duk_api_global_line = (duk_int_t) (DUK_LINE_MACRO), \ |
557 duk_push_error_object_stash) /* last value is func pointer, arguments follow in parens */ | 557 duk_push_error_object_stash) /* last value is func pointer, arguments follow in parens */ |
558 #endif | 558 #endif |
559 | 559 |
560 DUK_EXTERNAL_DECL duk_idx_t duk_push_error_object_va_raw(duk_context *ctx, duk_errcode_t err_code, const char *filename, duk_int_t line, const char *fmt, va_list ap); | 560 DUK_EXTERNAL_DECL duk_idx_t duk_push_error_object_va_raw(duk_context *ctx, duk_errcode_t err_code, const char *filename, duk_int_t line, const char *fmt, va_list ap); |
561 #define duk_push_error_object_va(ctx,err_code,fmt,ap) \ | 561 #define duk_push_error_object_va(ctx,err_code,fmt,ap) \ |
562 duk_push_error_object_va_raw((ctx), (err_code), (const char *) (__FILE__), (duk_int_t) (__LINE__), (fmt), (ap)) | 562 duk_push_error_object_va_raw((ctx), (err_code), (const char *) (DUK_FILE_MACRO), (duk_int_t) (DUK_LINE_MACRO), (fmt), (ap)) |
563 | 563 |
564 #define DUK_BUF_FLAG_DYNAMIC (1 << 0) /* internal flag: dynamic buffer */ | 564 #define DUK_BUF_FLAG_DYNAMIC (1 << 0) /* internal flag: dynamic buffer */ |
565 #define DUK_BUF_FLAG_EXTERNAL (1 << 1) /* internal flag: external buffer */ | 565 #define DUK_BUF_FLAG_EXTERNAL (1 << 1) /* internal flag: external buffer */ |
566 #define DUK_BUF_FLAG_NOZERO (1 << 2) /* internal flag: don't zero allocated buffer */ | 566 #define DUK_BUF_FLAG_NOZERO (1 << 2) /* internal flag: don't zero allocated buffer */ |
567 | 567 |