cffi_port (cffi v0.3.1)

View Source

Summary

Types

port_lib/0

-type port_lib() :: {port_lib, pid(), non_neg_integer()}.

port_ptr/0

-type port_ptr() :: {port_ptr, pid(), non_neg_integer()}.

Functions

alloc(_, Bytes)

-spec alloc(port_lib(), pos_integer()) -> port_ptr().

alloc_struct(Lib, StructName)

-spec alloc_struct(port_lib(), atom()) -> port_ptr().

alloc_type(Lib, Type)

-spec alloc_type(port_lib(), term()) -> port_ptr().

alloc_type(Lib, Type, Count)

-spec alloc_type(port_lib(), term(), pos_integer()) -> port_ptr().

array_ptr(Ptr, ElemType, Index)

-spec array_ptr(port_ptr(), term(), non_neg_integer()) -> port_ptr().

array_read(Ptr, ElemType, Index)

-spec array_read(port_ptr(), term(), non_neg_integer()) -> term().

array_write(Ptr, ElemType, Index, Value)

-spec array_write(port_ptr(), term(), non_neg_integer(), term()) -> ok.

call(Lib, Func, RetType)

-spec call(port_lib(), string() | binary(), term()) -> {ok, term()} | {error, term()}.

call(_, Func, RetType, Args)

-spec call(port_lib(), string() | binary(), term(), list()) -> {ok, term()} | {error, term()}.

call_va(_, Func, RetType, NFixed, Args)

-spec call_va(port_lib(), string() | binary(), term(), pos_integer(), list()) ->
                 {ok, term()} | {error, term()}.

close(_)

-spec close(port_lib()) -> ok.

code_change(OldVsn, S, Extra)

field_ptr(Ptr, TypeName, FieldName)

-spec field_ptr(port_ptr(), atom(), atom()) -> port_ptr().

free(_)

-spec free(port_ptr()) -> ok.

handle_call(Req, From, S)

handle_cast(Msg, S)

handle_info(Info, State)

init(_)

is_null(_)

-spec is_null(port_ptr()) -> boolean().

lib_pid(_)

-spec lib_pid(port_lib()) -> pid().

lib_port(_)

-spec lib_port(port_lib()) -> port().

load(Path)

-spec load(string() | binary()) -> {ok, port_lib()} | {error, term()}.

map_to_struct(Ptr, TypeName, Map)

-spec map_to_struct(port_ptr(), atom(), map()) -> ok.

null(_)

-spec null(port_lib()) -> port_ptr().

ptr_add(_, Offset)

-spec ptr_add(port_ptr(), integer()) -> port_ptr().

read(Ptr, Type)

-spec read(port_ptr(), term()) -> term().

read_bytes(_, Size)

-spec read_bytes(port_ptr(), pos_integer()) -> binary().

struct_read(Ptr, TypeName, FieldName)

-spec struct_read(port_ptr(), atom(), atom()) -> term().

struct_to_map(Ptr, TypeName)

-spec struct_to_map(port_ptr(), atom()) -> map().

struct_write(Ptr, TypeName, FieldName, Value)

-spec struct_write(port_ptr(), atom(), atom(), term()) -> ok.

terminate(Reason, State)

with_alloc(Lib, Bytes, Fun)

-spec with_alloc(port_lib(), pos_integer(), fun((port_ptr()) -> R)) -> R.

with_alloc(Lib, Type, Count, Fun)

-spec with_alloc(port_lib(), term(), pos_integer(), fun((port_ptr()) -> R)) -> R.

write(Ptr, Type, Value)

-spec write(port_ptr(), term(), term()) -> ok.

write_bytes(_, Bytes)

-spec write_bytes(port_ptr(), binary()) -> ok.