Skip to content

unix dlfcn

IsaacShelton edited this page Nov 13, 2022 · 5 revisions

unix/dlfcn

unix/dlfcn.adept contains definitions from <dlfcn.h>.

Functions

  • foreign dlclose(ptr) int
  • foreign dlerror() *ubyte
  • foreign dlopen(*ubyte, int) ptr
  • foreign dlsym(ptr, *ubyte) ptr

Constants

define RTLD_LAZY = 0x1
define RTLD_NOW = 0x2
define RTLD_LOCAL = 0x4
define RTLD_GLOBAL = 0x8

MacOS-only Definitions

#if __macos__
    RTLD_NOLOAD == 0x10
    RTLD_NODELETE == 0x80
    RTLD_FIRST == 0x100
    RTLD_NEXT == -1 as ptr
    RTLD_DEFAULT == -2 as ptr
    RTLD_SELF == -3 as ptr
    RTLD_MAIN_ONLY == -5 as ptr
    
    struct dl_info (
        dli_fname *ubyte,
        dli_fbase ptr,
        dli_sname *ubyte,
        dli_saddr ptr
    )
    alias Dl_info = dl_info
    foreign dladdr(ptr, *Dl_info) int
#end
Clone this wiki locally