From 62a66339c5398fa4bf77d791f0420aca0bfb7d4e Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sun, 21 May 2023 17:16:21 +0800 Subject: [PATCH] ... --- docs/quick-start/installation.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/quick-start/installation.md b/docs/quick-start/installation.md index 0edfa0ca..d911c93b 100644 --- a/docs/quick-start/installation.md +++ b/docs/quick-start/installation.md @@ -65,4 +65,15 @@ When you are done with the `VM` instance, use `delete` operator to dispose it. ```cpp delete vm; +``` + +### Hook standard buffer + +By default, pkpy outputs all messages and errors to `stdout` and `stderr`. +You can redirect them to your own buffer by setting `vm->_stdout` and `vm->_stderr`. + +These two fields are C function pointers `PrintFunc` with the following signature: + +```cpp +typedef void(*PrintFunc)(VM*, const Str&); ``` \ No newline at end of file