Allow dynamically setting output for printers

Some functions like print and debug/stacktrace print
to a file, usually stdout. This file can now be optionally set
via a dynamic variable.
This commit is contained in:
Calvin Rose
2019-04-16 21:44:19 -04:00
parent 513d551df6
commit 7918add47d
6 changed files with 32 additions and 20 deletions
+3 -2
View File
@@ -1279,11 +1279,12 @@ JANET_API JanetRange janet_getslice(int32_t argc, const Janet *argv);
JANET_API int32_t janet_gethalfrange(const Janet *argv, int32_t n, int32_t length, const char *which);
JANET_API int32_t janet_getargindex(const Janet *argv, int32_t n, int32_t length, const char *which);
JANET_API FILE *janet_getfile(const Janet *argv, int32_t n, int *flags);
JANET_API Janet janet_dyn(const char *name);
JANET_API void janet_setdyn(const char *name, Janet value);
JANET_API FILE *janet_getfile(const Janet *argv, int32_t n, int *flags);
JANET_API FILE *janet_dynfile(const char *name, FILE *def);
/* Marshal API */
#define janet_marshal_size(ctx, x) janet_marshal_int64((ctx), (int64_t) (x))
JANET_API void janet_marshal_int(JanetMarshalContext *ctx, int32_t value);