2023-07-12 08:48:32 +08:00
|
|
|
#include "tkc.h"
|
|
|
|
|
|
|
|
ret_t dltest(const char* filename, const char* func) {
|
|
|
|
tk_dl_t* dl = tk_dl_open(filename);
|
2023-10-30 18:20:26 +08:00
|
|
|
if (dl != NULL) {
|
2023-07-12 08:48:32 +08:00
|
|
|
void* p = tk_dl_sym(dl, func);
|
2023-10-30 18:20:26 +08:00
|
|
|
if (p != NULL) {
|
2023-07-12 08:48:32 +08:00
|
|
|
log_debug("load %s %s ok\n", filename, func);
|
|
|
|
} else {
|
|
|
|
log_debug("get func failed:%s\n", tk_dl_error());
|
2023-10-30 18:20:26 +08:00
|
|
|
}
|
|
|
|
} else {
|
2023-07-12 08:48:32 +08:00
|
|
|
log_debug("load dll failed:%s\n", tk_dl_error());
|
|
|
|
}
|
|
|
|
|
|
|
|
return RET_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char* argv[]) {
|
|
|
|
platform_prepare();
|
2023-10-30 18:20:26 +08:00
|
|
|
if (argc != 3) {
|
2023-07-12 08:48:32 +08:00
|
|
|
log_debug("Usage: %s dll func\n", argv[0]);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
dltest(argv[1], argv[2]);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|