BLUELOVETH 2 anos atrás
pai
commit
239fd7e18b
4 arquivos alterados com 15 adições e 5 exclusões
  1. 4 4
      docs/C-API/vm.md
  2. 3 0
      docs/LuaC-API/error.md
  3. 1 1
      docs/LuaC-API/stack.md
  4. 7 0
      docs/LuaC-API/variables.md

+ 4 - 4
docs/C-API/vm.md

@@ -4,10 +4,6 @@ icon: dot
 order: 10
 ---
 
-!!!
-Lua Style C-API cannot be mixed with Legacy C-API.
-!!!
-
 #### `VM* pkpy_new_vm()`
 
 Create a virtual machine.
@@ -20,6 +16,10 @@ Add a source module into a virtual machine.
 
 Run a given source on a virtual machine.
 
+#### `void pkpy_vm_exec_2(pkpy::VM* vm, const char* source, const char* filename, int mode, const char* module)`
+
+Advanced version of `pkpy_vm_exec`.
+
 #### `void pkpy_delete(void* p)`
 
 Delete a pointer allocated by `pkpy_xxx_xxx`.

+ 3 - 0
docs/LuaC-API/error.md

@@ -15,3 +15,6 @@ order: 5
 
 Return true if the vm is currently in an error state.
 
+#### `bool pkpy_error(pkpy_vm*, const char* name, const char* message)`
+
+Set the error state of the vm. It is almost equivalent to `raise` in python.

+ 1 - 1
docs/LuaC-API/stack.md

@@ -14,7 +14,7 @@ Stack index is 0-based instead of 1-based.
 
 Pop `n` items from the stack.
 
-#### `bool pkpy_push_function(pkpy_vm*, pkpy_function)`
+#### `bool pkpy_push_function(pkpy_vm*, pkpy_function, int argc)`
 
 Push a function onto the stack. The function is of `typedef int (*pkpy_function)(pkpy_vm*);`
 

+ 7 - 0
docs/LuaC-API/variables.md

@@ -17,3 +17,10 @@ Set the global variable to the value at the top of the stack.
 
 Get the global variable and push it to the top of the stack.
 
+#### `bool pkpy_getattr(pkpy_vm*, const char* name)`
+
+A wrapper of `OP_LOAD_ATTR` bytecode.
+
+#### `bool pkpy_setattr(pkpy_vm*, const char* name)`
+
+A wrapper of `OP_STORE_ATTR` bytecode.