-- script.lua -- A function to greet the user and call a C function function greet(name, age) print("Hello, " .. name .. "! You are " .. age .. " years old.") -- Call the C function from inside greet lua_call_c_function("Hello from Lua, called inside greet!") end function print_person(person) print("Name: " .. person.name) print("Age: " .. person.age) end -- Use the enum values in Lua function print_color(color) if color == 1 then print("The color is RED.") elseif color == GREEN then print("The color is GREEN.") elseif color == BLUE then print("The color is BLUE.") else print("Unknown color.") end end -- Call the Lua function with an enum value print_color(RED) -- Passing RED value from the C enum print_color(GREEN) -- Passing GREEN value from the C enum print_color(BLUE) -- Passing BLUE value from the C enum lua_call_c_function("Hello from Lua, called by itself!") print_person(person) -- print("last value is " .. age)