Skip to content

Commit

Permalink
separated luawrapper directory
Browse files Browse the repository at this point in the history
  • Loading branch information
missdeer committed Feb 5, 2024
1 parent be14bcf commit 8cb5255
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion luahandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"time"

"github.com/aarzilli/golua/lua"
lw "github.com/missdeer/getnovel/luawrapper"
"github.com/missdeer/golib/httputil"
"gitlab.com/ambrevar/golua/unicode"
)
Expand Down Expand Up @@ -124,7 +125,7 @@ func checkLuaFile(localDirPath string, fileName string) error {
func (h *ExternalHandler) initLuaEnv() {
h.l.OpenLibs()

registerLuaAPIs(h.l)
lw.RegisterLuaAPIs(h.l)

unicode.GoLuaReplaceFuncs(h.l)

Expand Down
4 changes: 2 additions & 2 deletions luaapi.go → luawrapper/luaapi.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main
package luawrapper

import (
"github.com/aarzilli/golua/lua"
Expand Down Expand Up @@ -26,7 +26,7 @@ func DetectContentCharset(L *lua.State) int {
return 1
}

func registerLuaAPIs(L *lua.State) {
func RegisterLuaAPIs(L *lua.State) {
// add string.convert(from, to, str) method
L.GetGlobal("string")
L.PushGoFunction(ConvertEncoding)
Expand Down

0 comments on commit 8cb5255

Please sign in to comment.