Atom

ffi.symbol()

Resolves one native symbol address.

Signature

ffi.symbol(library, name)

Parameters

Open library and nonempty string symbol name.

Returns

Borrowed opaque pointer.

Behavior

Keeps its library alive. Releasing it is the library's responsibility.

Errors

Missing symbol or closed library.

Example

Build the native C fixture and pass its shared library path after --.

Atom
use ffi
use os
lib = ffi.load(os.args[0])
try:
    assert(type(ffi.symbol(lib, 'twice')) == ptr)
finally:
    ffi.close(lib)