Add borderless-win32-odin, lua-dylib-odin
This commit is contained in:
34
lua-dylib-odin/main.odin
Normal file
34
lua-dylib-odin/main.odin
Normal file
@@ -0,0 +1,34 @@
|
||||
package args
|
||||
|
||||
import "base:runtime"
|
||||
import "core:fmt"
|
||||
|
||||
LUA_SHARED :: true
|
||||
import lua "vendor:lua/5.4"
|
||||
|
||||
lua_print_arg_count :: lua.L_Reg {
|
||||
name = "printargcount",
|
||||
func = lua_print_arg_count_proc,
|
||||
}
|
||||
|
||||
lua_print_arg_count_proc :: proc "c" (L: ^lua.State) -> i32 {
|
||||
context = runtime.default_context()
|
||||
top := lua.gettop(L)
|
||||
if top > 0 {
|
||||
fmt.println(top, "arguments were passed to the function", lua_print_arg_count.name)
|
||||
} else {
|
||||
fmt.println("no arguments were passed to the function", lua_print_arg_count.name)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
procs :: []lua.L_Reg{lua_print_arg_count, {nil, nil}}
|
||||
|
||||
@(export)
|
||||
luaopen_args :: proc(L: ^lua.State) -> i32 {
|
||||
lua.L_checkversion(L)
|
||||
lua.L_newlib(L, procs)
|
||||
lua.pushinteger(L, 8008135)
|
||||
lua.setfield(L, -2, "version")
|
||||
return 1
|
||||
}
|
||||
Reference in New Issue
Block a user