This commit is contained in:
root
2024-04-24 10:25:44 +08:00
parent 627bf43ee3
commit 248388a322
5271 changed files with 3753425 additions and 803 deletions

18
include/dp2_sdk_c.h Normal file
View File

@@ -0,0 +1,18 @@
#pragma once
#include <dlfcn.h>
typedef struct lua_State lua_State;
typedef void (*dp2_game_script_t)(void(*ufptr)(lua_State* L, void*), void* udptr);
// 进入dp的锁, 触发回调, 同时获得lua指针
static int dp2_game_script(void(*ufptr)(lua_State* L, void*), void* udptr) {
void* fn = dlsym(RTLD_DEFAULT, "__dp2_game_script");
if (!fn) {
return 1;
}
dp2_game_script_t func = (dp2_game_script_t)fn;
printf("\n函数\n");
func(ufptr, udptr);
printf("\n调用成功\n");
return 0;
}