https://github.com/membraneframework/unifex
Tool for generating interfaces between native C code and Elixir
https://github.com/membraneframework/unifex
Last synced: about 1 year ago
JSON representation
Tool for generating interfaces between native C code and Elixir
- Host: GitHub
- URL: https://github.com/membraneframework/unifex
- Owner: membraneframework
- License: apache-2.0
- Created: 2018-07-24T16:38:57.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-11-13T09:20:43.000Z (over 1 year ago)
- Last Synced: 2025-05-16T03:48:49.048Z (about 1 year ago)
- Language: Elixir
- Homepage:
- Size: 858 KB
- Stars: 82
- Watchers: 5
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Unifex
[](https://hex.pm/packages/unifex)
[](https://hexdocs.pm/unifex/)
[](https://circleci.com/gh/membraneframework/unifex)
Unifex is a tool for generating interfaces between native C code and Elixir, that:
- provides intuitive and concise tools for defining native interfaces,
- generates all the boilerplate for you,
- provides useful abstractions over binaries and state,
- makes native code independent from [erl_nif](https://erlang.org/doc/man/erl_nif.html)
or [ei](https://erlang.org/doc/man/ei.html) library, so the same code is usable either with NIFs or CNodes.
API documentation is available at [HexDocs](https://hexdocs.pm/unifex/).
Unifex uses [Bundlex](https://github.com/membraneframework/bundlex) to compile and load the native code. See there for supported platforms & details.
This tool is maintained by the [Membrane Framework](https://membraneframework.org/) team.
This version supports bugged version of functions returning nil, as well as fixed ones. This functionality should be removed in version 2.0.0
For more info see: [Issue](https://github.com/membraneframework/membrane_core/issues/758)
## Installation
To install, you need to configure Mix project as follows:
```elixir
defmodule MyApp.Mixfile do
use Mix.Project
def project do
[
app: :my_app,
compilers: [:unifex, :bundlex] ++ Mix.compilers, # add unifex and bundlex to compilers
...,
deps: deps()
]
end
defp deps() do
[
{:unifex, "~> 1.2"}
]
end
end
```
## Usage
For detailed usage description see [Creating Unifex Natives](https://hexdocs.pm/unifex/creating_unifex_natives.html) guide.
## Supported types
For currently supported types see [Supported Types](https://hexdocs.pm/unifex/supported_types.html) section.
## See also
Unifex depends on the following libraries:
- [Bundlex](https://github.com/membraneframework/bundlex)
- [Shmex](https://github.com/membraneframework/shmex)
## Copyright and License
Copyright 2018, [Software Mansion](https://swmansion.com/?utm_source=git&utm_medium=readme&utm_campaign=membrane)
[](https://swmansion.com/?utm_source=git&utm_medium=readme&utm_campaign=membrane)
Licensed under the [Apache License, Version 2.0](LICENSE)