blueloveTH 2 vuotta sitten
vanhempi
commit
db2492829b
3 muutettua tiedostoa jossa 5 lisäystä ja 15 poistoa
  1. 2 10
      docs/C-API/vm.md
  2. 2 4
      docs/quick-start/installation.md
  3. 1 1
      web/index.js

+ 2 - 10
docs/C-API/vm.md

@@ -3,7 +3,7 @@ title: VM
 icon: dot
 order: 10
 ---
-#### `VM* pkpy_new_vm(bool use_stdio)`
+#### `VM* pkpy_new_vm()`
 
 Create a virtual machine.
 
@@ -27,12 +27,4 @@ Run a given source on a virtual machine.
 Get a global variable of a virtual machine.
 
 Return `__repr__` of the result.
-If the variable is not found, return `nullptr`.
-
-#### `char* pkpy_vm_read_output(VM* vm)`
-
-Read the standard output and standard error as string of a virtual machine.
-The `vm->use_stdio` should be `false`.
-After this operation, both stream will be cleared.
-
-Return a json representing the result.
+If the variable is not found, return `nullptr`.

+ 2 - 4
docs/quick-start/installation.md

@@ -56,14 +56,12 @@ You need to use the C++ `new` operator to create a `VM` instance.
 VM* vm = new VM();
 ```
 
-The constructor can take 2 extra parameters.
+The constructor can take 1 extra parameters.
 
-#### `VM(bool use_stdio=true, bool enable_os=true)`
+#### `VM(bool enable_os=true)`
 
-+ `use_stdio`, if `true`, the `print()` function outputs string to `stdout`. Error messages will be send to `stderr`; If `false`, they will be sent to an internal buffer. In the latter case, you need to read them via `read_output` manually.
 + `enable_os`, whether to enable OS-related features or not. This setting controls the availability of some priviledged modules such os `io` and `os` as well as builtin function `open`.
 
-
 When you are done with the `VM` instance, you need to use the C++ `delete` operator to free the memory.
 
 ```cpp

+ 1 - 1
web/index.js

@@ -113,7 +113,7 @@ var Module = {
       term.write(text + "\r\n");
     },
     'onRuntimeInitialized': function(text) {
-      var vm = Module.ccall('pkpy_new_vm', 'number', ['boolean', 'boolean'], [true, true]);
+      var vm = Module.ccall('pkpy_new_vm', 'number', ['boolean'], [true]);
       repl = Module.ccall('pkpy_new_repl', 'number', ['number'], [vm]);
       term.write(need_more_lines ? "... " : ">>> ");
     },