This could be very useful for a project I am just starting on.
No documentation, and example has no content makes the learning curve a bit steep.
Does anyone have any pointers on how to use this?
No documentation, and example has no content makes the learning curve a bit steep.
Does anyone have any pointers on how to use this?
Just call purego.Dlopen(“libname.so”, purego.RTLD_GLOBAL)
Take the returned library (make sure to check for errors with purego.Dlerror() first) and call purego.Dlsym(lib, “cfuncName”). If it exists than u can call it with either purego.SyscallN or purego.RegisterFunc
It's easier with dlopen because it's still C and therefore you have the normal headers…
Particularly an example that takes a c struct pointer would be awesome.
What happens to const char* return values that are null ? I think it is empty string, but either test case or doc confirming it would be awesome