Add these two constants, which can be passed as part of the flags to
duk_console_init(). Their meanings are:
- DUK_CONSOLE_TO_STDOUT: all console output goes to stdout
- DUK_CONSOLE_TO_STDERR: all console output goes to stderr
- default, no flags: output for warn and above goes to stderr, output
for info and below goes to stdout
The constants are used both for the flags parameter to
duk_console_init(), as well as for the flags saved in magic and passed
to duk__console_log_helper(); that way we avoid defining additional,
similar constants for these two different usages.
All Makefiles in extra folder were using gcc instead of $(CC), fix this
to allow cross-compilation
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
* Shared error throwers for smaller footprint.
* Add explicit checks for a few potential wraps and out-of-range casts.
* Remove unnecessary cbor extra test helpers (for definite and indefinite
length arrays and maps).
* Related CBOR extra Makefile changes and improvements.
* Add duk_cbor_init() to create the global object binding if caller
wants it.
* CBOR README update.
Previously extras relied on ../../src which only exists in the end user
distributable. It's better to run tools/configure.py because the extras
will then work both from the main repo and the distributable. Also the
configure.py will be more apparent and maybe picked up by the user.
* Add support for encoding into JX which is useful for testing because e.g.
zero sign, NaN, and Inf are preserved in output.
* Support -d (decode CBOR to JSON) and -e (encode JSON to CBOR) for brevity,
but add support for explicit -r (read format) and -w (write format) options.
Supported formats are: cbor, json, jx.
* Support also -r js (eval input as Ecmascript) for testing; this allows e.g.
creation of typed arrays.
* Add --indent N option which affects json/jx output.
* Update usage.
* Remove now unnecessary test.c tool.
* Implement CBOR half-float decoding for all inputs: denormals, normals,
Inf, NaN.
* Enable half-float encoding now that the decoder is fully functional.
The encoder still doesn't emit denormals, but that's not mandatory.
* Implement single precision encoding, with same limitation for denormals
as with half-floats.
* Warning trivia, e.g. cast memcpy() to void, signed/unsigned casts.
* Comment improvements.
* Tracking of rough waste (increments of 4 bytes) approximation.
May give false positives, but unlikely to do so much in practice.
* Global HWM tracking. VERY, VERY slow but useful for manual testing
of problematic code, startup memory usage, pool config validation,
etc.
duk_compile() + DUK_COMPILE_SHEBANG is not enough for modules because there is
a module function wrapper which offsets the shebang in the module source when
Duktape actually sees it.
* Rename prepare_sources.py to configure.py; the operation is similar to
autoconf ./configure so the association is useful.
* Rename make_dist.py to dist.py.
* Generate only one source set (combined or separate) for one run of
configure.py.
* Change dist.py to run configure.py three times to generate the default
source sets.
* Use an autodeleted temporary directory for preparing sources, which
removes some of the manual temporary file handling.
* Tolerate Proxy setup errors in case Proxy throws (= disabled).
* Fix bug in JX encoding error handling. Incorrect quote marks caused
value to be number coerced (+v) rather than string coerced (''+v).
* Fix function name in README.
* Rename duk_module_node_peval_file() to duk_module_node_peval_main() which
is less confusing (the function doesn't eval a file but expects the module
source on the value stack).
* Fix forward declaration of duk__push_module_object() which was missing the
"int main" argument.
* Avoid DUK_ERR_API_ERROR which is now removed; use DUK_ERR_TYPE_ERROR instead.
* Fix duk_safe_call() which was depending on Duktape 1.x API, now supports both
1.x and 2.x.
* Change typing from "int main" to "duk_bool_t main".
* Comment and C convention trivia.