Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kornilova203 committed Jun 15, 2018
1 parent 69e2014 commit 5c1b35e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Running the previous command wild also yield warnings along with the translation

`./scala-native-bindgen /usr/include/uv.h -name uv -- > uv.scala`

Run `./scala-native-bindgen -help` to see all available options.

## Building

Building this tool requires [CMake], [LLVM] and [Clang]. See the [Scala
Expand Down Expand Up @@ -54,6 +56,25 @@ cd tests
sbt test
```

## Current limitations
There are multiple unsupported cases that should be considered when generating bindings:
1. Currently bindgen does not support passing structs by value.
For example, it will not be possible to call these two functions from Scala Native code:
```c
struct MyStruct {
int a;
};

struct MyStruct returnStruct();

void handleStruct(struct MyStruct mystr);
```
To support such cases one should generate bindings for C wrapper functions that use pointers to structs instead of actual structs.
2. Bindgen does not generate bindings for defines.
In order to use defines one should write wrapper functions that return defined values.
3. There is no way to reuse already generated bindings.
Bindgen outputs bindings also for headers that were included in a given header.

## License

This project is distributed under the Scala license.
Expand Down

0 comments on commit 5c1b35e

Please sign in to comment.