protobuf-gen-luaコンパイルdllファイル
3010 ワード
1 #ifndef _WIN32
2 #include
3 #endif
1 static int struct_unpack(lua_State *L)
2 {
3 uint8_t format = luaL_checkinteger(L, 1);
4 size_t len;
5 const uint8_t* buffer = (uint8_t*)luaL_checklstring(L, 2, &len);
6 size_t pos = luaL_checkinteger(L, 3);
7 uint8_t out[8];
8 buffer += pos;
1 __declspec(dllexport)
2 int luaopen_pb (lua_State *L)
1 int main(int argc, char* argv[])
2 {
3 lua_State *L = lua_open();
4 //luaL_openlibs(L);
5 luaopen_pb(L);
6 lua_close(L);
7 return 0;
8 }