| 1 | extern crate bindgenrust-analyzer cargo apr-sys 0.2.4 bindgen/; |
| 2 | |
| 3 | fn create_bindingsrust-analyzer cargo apr-sys 0.2.4 create_bindings().( |
| 4 | apr_path: &stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/::Pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/Path#, |
| 5 | apu_path: &stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/::Pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/Path#, |
| 6 | out_path: &stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/::Pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/Path#, |
| 7 | apr_include_paths: &[&stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/::Pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/Path#], |
| 8 | ) { |
| 9 | // Generate bindings using bindgen |
| 10 | let mut builder = bindgenrust-analyzer cargo bindgen 0.72.1 crate/::Builderrust-analyzer cargo bindgen 0.72.1 Builder#::defaultrust-analyzer cargo bindgen 0.72.1 impl#[Builder][Default]default().().use_corerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]use_core().(); |
| 11 | // check if the pool-debug feature is present |
| 12 | if stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::envrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/::varrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/var().("CARGO_FEATURE_POOL_DEBUG").is_okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]is_ok().() { |
| 13 | builder = builder.clang_argrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]clang_arg().("-DAPR_POOL_DEBUG"); |
| 14 | } |
| 15 | let bindings = builder |
| 16 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apr_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 17 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apr_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_allocator.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 18 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apr_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_general.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 19 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apr_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_errno.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 20 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apr_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_pools.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 21 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apr_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_version.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 22 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apr_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_tables.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 23 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apr_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_hash.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 24 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apr_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_file_info.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 25 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apr_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_file_io.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 26 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apr_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_getopt.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 27 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apu_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_uri.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 28 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apr_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_time.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 29 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apu_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_date.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 30 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apr_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_version.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 31 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apu_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apu_version.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 32 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apr_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_strings.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 33 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apr_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_thread_proc.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 34 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apr_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_thread_mutex.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 35 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apr_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_thread_cond.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 36 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apr_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_dso.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 37 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apr_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_env.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 38 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apr_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_network_io.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 39 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apr_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_mmap.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 40 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apr_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_user.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 41 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apu_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_md5.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 42 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apu_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_sha1.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 43 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apu_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_base64.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 44 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apu_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_uuid.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 45 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apu_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_strmatch.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 46 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apu_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_xlate.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 47 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apu_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_xml.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 48 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apu_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_crypto.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 49 | .headerrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header().(apu_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr_queue.h").to_strrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]to_str().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().()) |
| 50 | .header_contentsrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]header_contents().( |
| 51 | "platform_headers.h", |
| 52 | if cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(windows) { |
| 53 | "#include <winsock2.h>\n#include <ws2tcpip.h>" |
| 54 | } else { |
| 55 | "#include <sys/socket.h>\n#include <sys/types.h>" |
| 56 | }, |
| 57 | ) |
| 58 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr.h") |
| 59 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_general.h") |
| 60 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_allocator.h") |
| 61 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_version.h") |
| 62 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_errno.h") |
| 63 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_pools.h") |
| 64 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_tables.h") |
| 65 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_hash.h") |
| 66 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_file_info.h") |
| 67 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_file_io.h") |
| 68 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_getopt.h") |
| 69 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_uri.h") |
| 70 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_time.h") |
| 71 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_date.h") |
| 72 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_strings.h") |
| 73 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_version.h") |
| 74 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apu_version.h") |
| 75 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_thread_proc.h") |
| 76 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_thread_mutex.h") |
| 77 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_thread_cond.h") |
| 78 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_dso.h") |
| 79 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_env.h") |
| 80 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_network_io.h") |
| 81 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_mmap.h") |
| 82 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_user.h") |
| 83 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_md5.h") |
| 84 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_sha1.h") |
| 85 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_base64.h") |
| 86 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_uuid.h") |
| 87 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_strmatch.h") |
| 88 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_xlate.h") |
| 89 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_xml.h") |
| 90 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_crypto.h") |
| 91 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_queue.h") |
| 92 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_portable.h") |
| 93 | .allowlist_filerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_file().(".*[/\\\\]apr_support.h") |
| 94 | // Explicitly allowlist fundamental APR types that may be defined via |
| 95 | // typedef chains through system headers. On some platforms (e.g. EL9), |
| 96 | // bindgen may attribute these to system headers rather than apr.h, |
| 97 | // causing them to be filtered out by the allowlist_file rules above. |
| 98 | .allowlist_typerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_type().("apr_int16_t") |
| 99 | .allowlist_typerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_type().("apr_uint16_t") |
| 100 | .allowlist_typerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_type().("apr_int32_t") |
| 101 | .allowlist_typerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_type().("apr_uint32_t") |
| 102 | .allowlist_typerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_type().("apr_int64_t") |
| 103 | .allowlist_typerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_type().("apr_uint64_t") |
| 104 | .allowlist_typerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_type().("apr_size_t") |
| 105 | .allowlist_typerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_type().("apr_ssize_t") |
| 106 | .allowlist_typerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_type().("apr_off_t") |
| 107 | .allowlist_typerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_type().("apr_socklen_t") |
| 108 | .allowlist_typerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_type().("apr_ino_t") |
| 109 | .allowlist_typerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_type().("apr_uintptr_t") |
| 110 | .allowlist_typerust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]allowlist_type().("apr_intptr_t") |
| 111 | .clang_argsrust-analyzer cargo bindgen 0.72.1 options/impl#[Builder]clang_args().( |
| 112 | apr_include_paths |
| 113 | .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().() |
| 114 | .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|path| formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("-I{}", path.displayrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]display().())), |
| 115 | ) |
| 116 | .generaterust-analyzer cargo bindgen 0.72.1 impl#[Builder]generate().() |
| 117 | .expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]expect().("Failed to generate bindings"); |
| 118 | |
| 119 | bindings |
| 120 | .write_to_filerust-analyzer cargo bindgen 0.72.1 impl#[Bindings]write_to_file().(out_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("bindings.rs")) |
| 121 | .expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]expect().("Failed to write bindings"); |
| 122 | } |
| 123 | |
| 124 | fn mainrust-analyzer cargo apr-sys 0.2.4 main().() { |
| 125 | let deps = system_depsrust-analyzer cargo system-deps 8.0.0 crate/::Configrust-analyzer cargo system-deps 8.0.0 Config#::newrust-analyzer cargo system-deps 8.0.0 impl#[Config]new().().proberust-analyzer cargo system-deps 8.0.0 impl#[Config]probe().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 126 | |
| 127 | let apr = deps.get_by_namerust-analyzer cargo system-deps 8.0.0 impl#[Dependencies]get_by_name().("apr-1").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(); |
| 128 | |
| 129 | let apr_util = deps.get_by_namerust-analyzer cargo system-deps 8.0.0 impl#[Dependencies]get_by_name().("apr-util-1").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(); |
| 130 | |
| 131 | let apr_path = apr |
| 132 | .include_pathsrust-analyzer cargo system-deps 8.0.0 Library#include_paths. |
| 133 | .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().() |
| 134 | .findrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/iter/impl#[`Iter<'a, T>`][Iterator]find().(|x| x.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apr.h").existsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]exists().()) |
| 135 | .expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]expect().("Failed to find apr.h"); |
| 136 | |
| 137 | let apr_util_path = apr_util |
| 138 | .include_pathsrust-analyzer cargo system-deps 8.0.0 Library#include_paths. |
| 139 | .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().() |
| 140 | .findrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/iter/impl#[`Iter<'a, T>`][Iterator]find().(|x| x.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apu.h").existsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]exists().()) |
| 141 | .expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]expect().("Failed to find apu.h"); |
| 142 | |
| 143 | let out_path = stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/::PathBufrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/PathBuf#::fromrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[PathBuf][`From<String>`]from().(stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::envrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/::varrust-analyzer cargo std https://github.com/rust-lang/rust/library/std env/var().("OUT_DIR").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().()); |
| 144 | create_bindingsrust-analyzer cargo apr-sys 0.2.4 create_bindings().( |
| 145 | apr_path.as_pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[PathBuf]as_path().(), |
| 146 | apr_util_path.as_pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[PathBuf]as_path().(), |
| 147 | out_path.as_pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[PathBuf]as_path().(), |
| 148 | apr.include_pathsrust-analyzer cargo system-deps 8.0.0 Library#include_paths. |
| 149 | .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().() |
| 150 | .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|x| x.as_pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[PathBuf]as_path().()) |
| 151 | .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<_>>() |
| 152 | .as_slicerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]as_slice().(), |
| 153 | ); |
| 154 | |
| 155 | // Check if APU_HAVE_CRYPTO is defined and non-zero in apu.h |
| 156 | let apu_h = stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::read_to_stringrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/read_to_string().(apr_util_path.joinrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]join().("apu.h")).expectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]expect().("Failed to read apu.h"); |
| 157 | let has_crypto = apu_h.linesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]lines().().anyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#any().(|line| { |
| 158 | let trimmed = line.trimrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]trim().(); |
| 159 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(rest) = trimmed.strip_prefixrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]strip_prefix().("#define") { |
| 160 | let rest = rest.trimrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]trim().(); |
| 161 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(value) = rest.strip_prefixrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]strip_prefix().("APU_HAVE_CRYPTO") { |
| 162 | return value.trimrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]trim().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne().!=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[`&A`][`PartialEq<&B>`]ne()."0"; |
| 163 | } |
| 164 | } |
| 165 | false |
| 166 | }); |
| 167 | if has_crypto { |
| 168 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("cargo:rustc-cfg=apu_have_crypto"); |
| 169 | } |
| 170 | } |