diff --git a/docs/C-API/vm.md b/docs/C-API/vm.md index 184d4242..200cd057 100644 --- a/docs/C-API/vm.md +++ b/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`. diff --git a/docs/LuaC-API/error.md b/docs/LuaC-API/error.md index 54f3d460..aa4fa52f 100644 --- a/docs/LuaC-API/error.md +++ b/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. diff --git a/docs/LuaC-API/stack.md b/docs/LuaC-API/stack.md index ec4d3310..ec9fbd34 100644 --- a/docs/LuaC-API/stack.md +++ b/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*);` diff --git a/docs/LuaC-API/variables.md b/docs/LuaC-API/variables.md index 2a04ee33..d8ecb99e 100644 --- a/docs/LuaC-API/variables.md +++ b/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.