https://github.com/eliaskosunen/libcppffi
C++ bindings over libffi
https://github.com/eliaskosunen/libcppffi
cplusplus ffi libffi
Last synced: 8 months ago
JSON representation
C++ bindings over libffi
- Host: GitHub
- URL: https://github.com/eliaskosunen/libcppffi
- Owner: eliaskosunen
- License: mit
- Archived: true
- Created: 2017-03-29T12:36:01.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-09T16:53:38.000Z (about 8 years ago)
- Last Synced: 2024-08-04T10:04:02.889Z (11 months ago)
- Topics: cplusplus, ffi, libffi
- Language: C++
- Size: 56.6 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# libcppffi
[](https://travis-ci.org/eliaskosunen/libcppffi)
[](https://coveralls.io/github/eliaskosunen/libcppffi?branch=master)Header-only templated C++ wrapper over the C library [libffi](https://github.com/libffi/libffi)
WORK IN PROGRESS. It's buggy and lacks features. There isn't any documentation yet.
Essentially a zero-cost abstraction that gives you strong type-safety.
## Example
```cpp
#include
#includeint foo()
{
return 42;
}void bar(float f)
{
std::cout << f << '\n';
}int main()
{
std::cout << ffi::call(foo) << '\n';
ffi::call(bar, 3.14f);ffi::cif foo_cif;
auto foo_call = foo_cif.bind(foo);
std::cout << foo_call() << '\n';
}
```## License
libcppffi is licensed under the MIT license.
Copyright 2017 Elias Kosunen