summaryrefslogtreecommitdiff
path: root/quickjs.h
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2025-05-05 15:59:04 +0200
committerFabrice Bellard <fabrice@bellard.org>2025-05-05 15:59:04 +0200
commit0a6160d7b3290710daf2dbeaba73d4d50e93b684 (patch)
treeb4966d7b811806532b268fce6d48a1a58aac3ba4 /quickjs.h
parent11d076fac6691da27df021872cdb12ec44d022e6 (diff)
downloadquickjs-0a6160d7b3290710daf2dbeaba73d4d50e93b684.tar.gz
quickjs-0a6160d7b3290710daf2dbeaba73d4d50e93b684.zip
avoid relying on 'FILE *' in JS_PrintValue() API
Diffstat (limited to 'quickjs.h')
-rw-r--r--quickjs.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/quickjs.h b/quickjs.h
index b851cd9..53425a2 100644
--- a/quickjs.h
+++ b/quickjs.h
@@ -1117,7 +1117,6 @@ int JS_SetModuleExportList(JSContext *ctx, JSModuleDef *m,
typedef struct {
JS_BOOL show_hidden : 8; /* only show enumerable properties */
- JS_BOOL show_closure : 8; /* show closure variables */
JS_BOOL raw_dump : 8; /* avoid doing autoinit and avoid any malloc() call (for internal use) */
uint32_t max_depth; /* recurse up to this depth, 0 = no limit */
uint32_t max_string_length; /* print no more than this length for
@@ -1126,9 +1125,13 @@ typedef struct {
arrays or objects, 0 = no limit */
} JSPrintValueOptions;
+typedef void JSPrintValueWrite(void *opaque, const char *buf, size_t len);
+
void JS_PrintValueSetDefaultOptions(JSPrintValueOptions *options);
-void JS_PrintValueRT(JSRuntime *rt, FILE *fo, JSValueConst val, const JSPrintValueOptions *options);
-void JS_PrintValue(JSContext *ctx, FILE *fo, JSValueConst val, const JSPrintValueOptions *options);
+void JS_PrintValueRT(JSRuntime *rt, JSPrintValueWrite *write_func, void *write_opaque,
+ JSValueConst val, const JSPrintValueOptions *options);
+void JS_PrintValue(JSContext *ctx, JSPrintValueWrite *write_func, void *write_opaque,
+ JSValueConst val, const JSPrintValueOptions *options);
#undef js_unlikely
#undef js_force_inline