This commit is contained in:
2026-04-22 19:36:06 +08:00
commit bb062ecfb4
370 changed files with 291868 additions and 0 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;
}