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:
@ -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")
|
@ -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;
|
||||
}
|
Reference in New Issue
Block a user