Skip to content

Commit 5c1b35e

Browse files
committed
Update readme
1 parent 69e2014 commit 5c1b35e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Running the previous command wild also yield warnings along with the translation
1414

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

17+
Run `./scala-native-bindgen -help` to see all available options.
18+
1719
## Building
1820

1921
Building this tool requires [CMake], [LLVM] and [Clang]. See the [Scala
@@ -54,6 +56,25 @@ cd tests
5456
sbt test
5557
```
5658

59+
## Current limitations
60+
There are multiple unsupported cases that should be considered when generating bindings:
61+
1. Currently bindgen does not support passing structs by value.
62+
For example, it will not be possible to call these two functions from Scala Native code:
63+
```c
64+
struct MyStruct {
65+
int a;
66+
};
67+
68+
struct MyStruct returnStruct();
69+
70+
void handleStruct(struct MyStruct mystr);
71+
```
72+
To support such cases one should generate bindings for C wrapper functions that use pointers to structs instead of actual structs.
73+
2. Bindgen does not generate bindings for defines.
74+
In order to use defines one should write wrapper functions that return defined values.
75+
3. There is no way to reuse already generated bindings.
76+
Bindgen outputs bindings also for headers that were included in a given header.
77+
5778
## License
5879

5980
This project is distributed under the Scala license.

0 commit comments

Comments
 (0)