[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Advice request to build C functions in a library for Lua5.1
- From: Bradley Smith <gmane@...>
- Date: Thu, 25 Oct 2007 14:00:02 -0700
Leave the c code as is, and try the following script. Note that the
require is assigned to mylib because the module does not set the name
and only returns a table. Also note that the prin function is not a
global, but is in the mylib table.
#!/usr/bin/env lua
package.cpath = "./?.so;" .. package.cpath
local mylib = require("mylib")
print "\nHello World\n"
-- call a C function and send a number
local indicator = mylib.prin(1)
print("The result is ", indicator)