1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/dl/dl_nix.c.v
2020-04-28 11:53:55 +02:00

20 lines
367 B
V

module dl
#include <dlfcn.h>
fn C.dlopen(filename charptr, flags int) voidptr
fn C.dlsym(handle voidptr, symbol charptr) voidptr
pub const (
RTLD_NOW = C.RTLD_NOW
DL_EXT = '.so'
)
pub fn open(filename string, flags int) voidptr {
return C.dlopen(filename.str, flags)
}
pub fn sym(handle voidptr, symbol string) voidptr {
return C.dlsym(handle, symbol.str)
}