Atom

ffi.extension()

Opens an Atom extension and registers its exports.

Signature

ffi.extension(path)

Parameters

Nonempty string path to a library exporting atom_extension_v1.

Returns

Library handle exposing registered values and functions.

Behavior

Runs native initialization synchronously. Exported functions depend on the opened handle.

Errors

Load, missing entry symbol or extension initialization failure.

Example

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

Atom
use ffi
use os
lib = ffi.extension(os.args[0])
try:
    print(lib.greet())
finally:
    ffi.close(lib)