func GSub(L *State, s string, p string, r string) string { Cs := C.CString(s) Cp := C.CString(p) Cr := C.CString(r) ret := C.GoString(C.luaL_gsub(L.s, Cs, Cp, Cr)) C.free(unsafe.Pointer(Cs)) C.free(unsafe.Pointer(Cp)) C.free(unsafe.Pointer(Cr)) return ret }
// luaL_gsub func (L *State) GSub(s string, p string, r string) string { Cs := C.CString(s) Cp := C.CString(p) Cr := C.CString(r) defer func() { C.free(unsafe.Pointer(Cs)) C.free(unsafe.Pointer(Cp)) C.free(unsafe.Pointer(Cr)) }() return C.GoString(C.luaL_gsub(L.s, Cs, Cp, Cr)) }
func GSub(L *State, s string, p string, r string) string { return C.GoString(C.luaL_gsub(L.s, C.CString(s), C.CString(p), C.CString(r))) }