# `Unifex.Specs`
[🔗](https://github.com/membraneframework/unifex/blob/v1.2.5/lib/unifex/specs.ex#L1)

Module that handles parsing Unifex specs for native boilerplate code generation.

For information on how to create such specs, see `Unifex.Specs.DSL` module.

# `enum_t`

```elixir
@type enum_t() :: {enum_name :: atom(), [enum_field :: atom()]}
```

# `interface_t`

```elixir
@type interface_t() :: atom()
```

Name of interface generated for the native library.
Must be a suffix of code generator module in `Unifex.CodeGenerators` namespace.

Unifex has built-in generators for `NIF` and `CNode` interfaces.

# `native_name_t`

```elixir
@type native_name_t() :: atom()
```

# `struct_t`

```elixir
@type struct_t() ::
  {struct_alias :: atom(), struct_module_name :: atom(),
   [{field_name :: atom(), field_type :: {atom() | {:list, atom()}}}]}
```

# `t`

```elixir
@type t() :: %Unifex.Specs{
  callbacks: %{
    required(hook :: :load | :upgrade | :unload | :main_function) =&gt;
      function_name :: String.t()
  },
  dirty_functions: %{
    required({function_name :: atom(), function_arity :: non_neg_integer()}) =&gt;
      :cpu | :io
  },
  enums: [],
  functions_args: [
    {function_name :: atom(), [arg_type :: {atom() | {:list, atom()}}]}
  ],
  functions_docs: [
    {function_name :: atom(), documentation :: String.t() | false}
  ],
  functions_results: [{function_name :: atom(), return_type :: Macro.t()}],
  interface: [interface_t()] | interface_t() | nil,
  module: Unifex.CodeGenerator.t() | nil,
  name: native_name_t(),
  sends: [{send_name :: atom(), send_term_type :: Macro.t()}],
  state_type: String.t() | nil,
  structs: [struct_t()]
}
```

# `parse`

```elixir
@spec parse(specs_file :: String.t(), native_name_t()) :: t()
```

Parses Unifex specs of native functions.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
