Data update
This commit is contained in:
parent
4d5544505c
commit
4924dd0264
3073 changed files with 55820 additions and 4408 deletions
|
|
@ -0,0 +1,19 @@
|
|||
local s1, s2 = "Hello", " World!"
|
||||
local ffi = require "pluto:ffi"
|
||||
local lib = ffi.open(os.platform == "windows" ? "msvcrt" : "libc.so.6")
|
||||
if lib then
|
||||
print("Shared library found")
|
||||
lib:cdef[[
|
||||
char *strcat(char *dest, const char *src);
|
||||
size_t strlen(const char *str);
|
||||
]]
|
||||
local s = lib.strcat(s1, s2)
|
||||
print(s)
|
||||
print(lib.strlen(s))
|
||||
lib = nil
|
||||
else
|
||||
print("Shared library not found.")
|
||||
local s = s1 .. s2
|
||||
print(s)
|
||||
print(#s)
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue