docs: make some minor fixes for module interface description

native-modules
sammyette 2023-07-10 22:45:49 -04:00
parent dcbb65a611
commit 42446fbf57
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
2 changed files with 8 additions and 4 deletions

View File

@ -12,13 +12,15 @@ menu:
to load Hilbish plugins/modules. to load Hilbish plugins/modules.
Hilbish modules are Go-written plugins (see https://pkg.go.dev/plugin) Hilbish modules are Go-written plugins (see https://pkg.go.dev/plugin)
that are used to add functionality to Hilbish that cannot be written that are used to add functionality to Hilbish that cannot be written
n Lua for any reason. in Lua for any reason.
To make a valid native module, the Go plugin To make a valid native module, the Go plugin
has to export a Loader function with a signature like so: has to export a Loader function with a signature like so:
`func(*rt.Runtime) rt.Value` `func(*rt.Runtime) rt.Value`.
`rt` in this case refers to the Runtime type at `rt` in this case refers to the Runtime type at
https://pkg.go.dev/github.com/arnodel/golua@master/runtime#Runtime https://pkg.go.dev/github.com/arnodel/golua@master/runtime#Runtime
Hilbish uses this package as its Lua runtime. You will need to read Hilbish uses this package as its Lua runtime. You will need to read
it to use it for a native plugin. it to use it for a native plugin.

View File

@ -14,13 +14,15 @@ import (
to load Hilbish plugins/modules. to load Hilbish plugins/modules.
Hilbish modules are Go-written plugins (see https://pkg.go.dev/plugin) Hilbish modules are Go-written plugins (see https://pkg.go.dev/plugin)
that are used to add functionality to Hilbish that cannot be written that are used to add functionality to Hilbish that cannot be written
n Lua for any reason. in Lua for any reason.
To make a valid native module, the Go plugin To make a valid native module, the Go plugin
has to export a Loader function with a signature like so: has to export a Loader function with a signature like so:
`func(*rt.Runtime) rt.Value` `func(*rt.Runtime) rt.Value`.
`rt` in this case refers to the Runtime type at `rt` in this case refers to the Runtime type at
https://pkg.go.dev/github.com/arnodel/golua@master/runtime#Runtime https://pkg.go.dev/github.com/arnodel/golua@master/runtime#Runtime
Hilbish uses this package as its Lua runtime. You will need to read Hilbish uses this package as its Lua runtime. You will need to read
it to use it for a native plugin. it to use it for a native plugin.
*/ */