Module dl stdlib

dl
Version:
0.3.3
License:
MIT
Dependencies from vmod:
0
Imports:
0
Imported by:
3
Repository:
OS-specific
Show selected OS-specific symbols.
Backend-specific
Show selected Backend-specific symbols.

Dependencies defined in v.mod

This section is empty.

Imports

This section is empty.

Imported by

Overview

dl can be used to Dynamically Load a library during runtime. It is a thin wrapper over LoadLibrary on Windows, and dlopen on Unix.

Using it, you can implement a plugin system for your application.

We highly recommend using dl.loader instead of dl directly. It provides a more user-friendly API in the V way.

Aliases

This section is empty.

Constants

#constant version

pub const version = 1

#constant dl_ext

pub const dl_ext = get_shared_library_extension()

#constant rtld_next

pub const rtld_next = voidptr(-1)

#constant rtld_now

Linux
rtld_now      = C.RTLD_NOW

#constant rtld_lazy

Linux
rtld_lazy     = C.RTLD_LAZY

#constant rtld_global

Linux
rtld_global   = C.RTLD_GLOBAL

#constant rtld_local

Linux
rtld_local    = C.RTLD_LOCAL

#constant rtld_nodelete

Linux
rtld_nodelete = C.RTLD_NODELETE

#constant rtld_noload

Linux
rtld_noload   = C.RTLD_NOLOAD

#constant rtld_now

Windows
rtld_now      = 0

#constant rtld_lazy

Windows
rtld_lazy     = 0

#constant rtld_global

Windows
rtld_global   = 0

#constant rtld_local

Windows
rtld_local    = 0

#constant rtld_nodelete

Windows
rtld_nodelete = 0

#constant rtld_noload

Windows
rtld_noload   = 0

Sum types

This section is empty.

Functions

#fn close

Windows
fn close(handle voidptr) bool

close frees the loaded a given module.

#fn close

Linux
fn close(handle voidptr) bool

close frees a given shared object.

#fn dlerror

Windows
fn dlerror() string

dlerror provides a text error diagnostic message for functions in dl it returns a human-readable string, describing the most recent error that occurred from a call to one of the dl functions, since the last call to dlerror()

#fn dlerror

Linux
fn dlerror() string

dlerror provides a text error diagnostic message for functions in dl it returns a human-readable string, describing the most recent error that occurred from a call to one of the dl functions, since the last call to dlerror()

#fn get_libname

inline
fn get_libname(libname string) string

get_libname returns a library name with the operating system specific extension for shared libraries.

#fn get_shared_library_extension

inline
fn get_shared_library_extension() string

get_shared_library_extension returns the platform dependent shared library extension i.e. .dll on windows, .so on most unixes, .dylib on macos.

#fn open

Windows
fn open(filename string, flags int) voidptr

open loads a given module into the address space of the calling process.

#fn open

Linux
fn open(filename string, flags int) voidptr

open loads the dynamic shared object.

#fn open_opt

fn open_opt(filename string, flags int) !voidptr

open_opt - loads the dynamic shared object.

Unlike open, open_opt return an option.

#fn sym

Windows
fn sym(handle voidptr, symbol string) voidptr

sym returns an address of an exported function or variable from a given module.

#fn sym

Linux
fn sym(handle voidptr, symbol string) voidptr

sym returns an address of a symbol in a given shared object.

#fn sym_opt

fn sym_opt(shared_object_handle voidptr, symbol string) !voidptr

sym_opt returns the address of a symbol in a given shared object, if found.

Unlike sym, sym_opt returns an option.

Structs

This section is empty.

Interfaces

This section is empty.

Enums

This section is empty.