1
0
mirror of https://github.com/lxsang/antd-lua-plugin synced 2025-07-26 10:49:51 +02:00

fix some stuff

This commit is contained in:
lxsang
2019-05-08 18:49:40 +02:00
parent 80f77a1f75
commit 55f298d249
3 changed files with 40 additions and 0 deletions

View File

@ -55,6 +55,15 @@ if lib then
end
fn = FFI.lookup(lib, "buff")
if(fn) then
local ptr = FFI.call(FFI.atomic(FFI.type.POINTER),{}, fn, {})
echo(FFI.string(ptr))
end
FFI.unloadAll()
end
echo("end the day")

View File

@ -1,5 +1,6 @@
#include <stdio.h>
char data[] = {'h', 'e','l', 'l', 'o'};
typedef struct{
char a;
@ -31,4 +32,9 @@ void test_string(char* buff, const char* a)
{
sprintf(buff,"you say %s", a);
printf("%s\n", buff);
}
char * buff()
{
return data;
}