-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tooling for listing unwraped API functions
- Loading branch information
Showing
3 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
generated.rs | ||
generated-functions.txt | ||
covered-functions.txt | ||
todo.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
|
||
# You might have to `cargo install bindgen-cli` for this to work | ||
bindings: | ||
all: todo | ||
|
||
generated.rs: | ||
bindgen \ | ||
-o generated.rs \ | ||
--allowlist-function '^tiledb_.*' \ | ||
--allowlist-var '^TILEDB_.*' \ | ||
wrapper.h \ | ||
-- -I/opt/tiledb/include | ||
|
||
generated-functions.txt: generated.rs | ||
rg -o --no-line-number --no-filename '\bfn\s+tiledb_[^(]+' generated.rs | sort > generated-functions.txt | ||
|
||
covered-functions.txt: | ||
rg -o --no-line-number --no-filename '\bfn\s+tiledb_[^(]+' src/*.rs | sort > covered-functions.txt | ||
|
||
todo: generated-functions.txt covered-functions.txt | ||
comm -23 generated-functions.txt covered-functions.txt > todo.txt | ||
cat todo.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
tiledb-sys | ||
=== | ||
|
||
This crate contains the raw wrapped function definitions that are then used | ||
by the `tiledb/api` crate to provide a usable Rust API to TileDB. Nothing in | ||
this crate is intended for use by anything other than `tiledb/api`. | ||
|
||
Listing Unwrapped APIs | ||
=== | ||
|
||
If you're looking to contribute to this repository, the easiest approach to | ||
looking for things to wrap is to change directories into the directory | ||
containing this file and run `make`. This will dump a list of unwrapped | ||
functions. | ||
|
||
Requirements | ||
--- | ||
|
||
To generate the todo list of functions to wrap, you need to have installed | ||
both bindgen and ripgrep. On macOS, the easiest way to acquire these | ||
is to run the following: | ||
|
||
```bash | ||
$ cargo install bindgen-cli | ||
$ brew install ripgrep | ||
``` |