Initial community commit
This commit is contained in:
28
Src/external_dependencies/openmpt-trunk/include/premake/binmodules/example/main.c
vendored
Normal file
28
Src/external_dependencies/openmpt-trunk/include/premake/binmodules/example/main.c
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
#include "luashim.h"
|
||||
|
||||
|
||||
static int example_test(lua_State* L)
|
||||
{
|
||||
lua_pushstring(L, "hello ");
|
||||
lua_pushvalue(L, 1);
|
||||
lua_concat(L, 2);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static const luaL_Reg example_functions[] = {
|
||||
{ "test", example_test },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport) int luaopen_example(lua_State *L)
|
||||
#else
|
||||
int luaopen_example(lua_State *L)
|
||||
#endif
|
||||
{
|
||||
shimInitialize(L);
|
||||
luaL_register(L, "example", example_functions);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user