| 1 | # nghttp2-sys |
| 2 | |
| 3 | A common library for linking `nghttp2` to rust programs (also known as |
| 4 | libnghttp2). |
| 5 | |
| 6 | ## Generating bindings |
| 7 | |
| 8 | Before `bindgen`: |
| 9 | |
| 10 | * Copy `nghttp2ver.h.in` to `nghttp2ver.h` |
| 11 | * Edit `nghttp2ver.h` to remove `@FOO@`, replacing with 0 |
| 12 | |
| 13 | ```sh |
| 14 | $ bindgen \ |
| 15 | ./nghttp2/lib/includes/nghttp2/nghttp2.h \ |
| 16 | -o src/lib.rs \ |
| 17 | --no-layout-tests \ |
| 18 | --distrust-clang-mangling \ |
| 19 | --no-prepend-enum-name \ |
| 20 | --rustfmt-bindings \ |
| 21 | --whitelist-function '.*nghttp2.*' \ |
| 22 | --whitelist-type '.*nghttp2.*' \ |
| 23 | --whitelist-var '.*nghttp2.*' \ |
| 24 | -- \ |
| 25 | -I ./nghttp2/lib/includes |
| 26 | ``` |
| 27 | |
| 28 | Afterwards |
| 29 | |
| 30 | * Remove `*vprintf*` |
| 31 | * Remove `va_list`-related things |
| 32 | * Add `#![allow(bad_style)]` |
| 33 | |
| 34 | # License |
| 35 | |
| 36 | This project is licensed under either of |
| 37 | |
| 38 | * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or |
| 39 | http://www.apache.org/licenses/LICENSE-2.0) |
| 40 | * MIT license ([LICENSE-MIT](LICENSE-MIT) or |
| 41 | http://opensource.org/licenses/MIT) |
| 42 | |
| 43 | at your option. |
| 44 | |
| 45 | ### Contribution |
| 46 | |
| 47 | Unless you explicitly state otherwise, any contribution intentionally submitted |
| 48 | for inclusion in `nghttp2-sys` by you, as defined in the Apache-2.0 license, |
| 49 | shall be dual licensed as above, without any additional terms or conditions. |