mirror of
https://github.com/LibreSplit/LibreSplit.git
synced 2026-04-27 06:10:27 +00:00
Will probably need to find a better way to allow plugins to access internal functions of LibreSplit instead of this "PlugAPI bridge" I've made
27 lines
663 B
C
27 lines
663 B
C
#include "lua.h"
|
|
#include "plugin.h"
|
|
#include "plugin_utils.h"
|
|
#include <stdio.h>
|
|
|
|
const char plugin_name[] = "Test Plugin";
|
|
const char plugin_description[] = "Does nothing, it just exists";
|
|
const char plugin_version[] = "0.1";
|
|
const char plugin_author[] = "The LibreSplit Core Team";
|
|
|
|
int do_something_lua(lua_State* L)
|
|
{
|
|
if (lua_gettop(L) != 0) {
|
|
printf("No arguments, we're still way too early for that");
|
|
lua_pushnil(L);
|
|
return 1;
|
|
}
|
|
printf("Hello from a Lua C Function");
|
|
lua_pushnumber(L, 1);
|
|
return 1;
|
|
}
|
|
|
|
int plug_init(PlugAPI* api)
|
|
{
|
|
api->register_lua_function("sayHello", do_something_lua);
|
|
return 0;
|
|
}
|