apr-0.1.10/.cargo_vcs_info.json0000644000000001360000000000100116750ustar { "git": { "sha1": "7e40226282a647e28e22d6a61ad4b00bfc132262" }, "path_in_vcs": "" }apr-0.1.10/.github/CODEOWNERS000064400000000000000000000000121046102023000134110ustar 00000000000000* @jelmer apr-0.1.10/.github/FUNDING.yml000064400000000000000000000000171046102023000136400ustar 00000000000000github: jelmer apr-0.1.10/.github/dependabot.yml000064400000000000000000000006251046102023000146600ustar 00000000000000# Please see the documentation for all configuration options: # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates version: 2 updates: - package-ecosystem: "cargo" directory: "/" schedule: interval: "weekly" rebase-strategy: "disabled" - package-ecosystem: "github-actions" directory: "/" schedule: interval: weekly apr-0.1.10/.github/workflows/rust.yml000064400000000000000000000006431046102023000156050ustar 00000000000000name: Rust on: push: branches: [ "master" ] pull_request: branches: [ "master" ] env: CARGO_TERM_COLOR: always jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install apr run: sudo apt install -y libapr1-dev libaprutil1-dev libutf8proc-dev - name: Build run: cargo build --verbose - name: Run tests run: cargo test --verbose apr-0.1.10/.gitignore000064400000000000000000000000131046102023000124470ustar 00000000000000/target *~ apr-0.1.10/Cargo.toml0000644000000020620000000000100076730ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" name = "apr" version = "0.1.10" authors = ["Jelmer Vernooij "] description = "Rust bindings for Apache Portable Runtime" homepage = "https://github.com/jelmer/apr-rs" readme = "README.md" license = "Apache-2.0" repository = "https://github.com/jelmer/apr-rs.git" [package.metadata.system-deps] apr-1 = "*" apr-util-1 = "*" [lib] doctest = false [dependencies.ctor] version = "0.2" [dependencies.url] version = "2" optional = true [build-dependencies.bindgen] version = ">=0.60" [build-dependencies.system-deps] version = "6" [features] url = ["dep:url"] apr-0.1.10/Cargo.toml.orig000064400000000000000000000010251046102023000133520ustar 00000000000000[package] name = "apr" version = "0.1.10" edition = "2021" authors = ["Jelmer Vernooij "] repository = "https://github.com/jelmer/apr-rs.git" homepage = "https://github.com/jelmer/apr-rs" license = "Apache-2.0" description = "Rust bindings for Apache Portable Runtime" [lib] doctest = false [dependencies] ctor = "0.2" url = { version = "2", optional = true } [features] url = ["dep:url"] [build-dependencies] bindgen = ">=0.60" system-deps = "6" [package.metadata.system-deps] apr-1 = "*" "apr-util-1" = "*" apr-0.1.10/README.md000064400000000000000000000003461046102023000117470ustar 00000000000000Rust bindings for the Apache Portable Runtime (APR) library and the associated APR Util library. This crate provides a safe interface to the APR library. It is intended to be used by other crates that need to interface with APR. apr-0.1.10/build.rs000064400000000000000000000060221046102023000121320ustar 00000000000000extern crate bindgen; fn create_bindings( apr_path: &std::path::Path, out_path: &std::path::Path, apr_include_paths: &[&std::path::Path], ) { // Generate bindings using bindgen let bindings = bindgen::Builder::default() .header(apr_path.join("apr.h").to_str().unwrap()) .header(apr_path.join("apr_allocator.h").to_str().unwrap()) .header(apr_path.join("apr_general.h").to_str().unwrap()) .header(apr_path.join("apr_errno.h").to_str().unwrap()) .header(apr_path.join("apr_pools.h").to_str().unwrap()) .header(apr_path.join("apr_version.h").to_str().unwrap()) .header(apr_path.join("apr_tables.h").to_str().unwrap()) .header(apr_path.join("apr_hash.h").to_str().unwrap()) .header(apr_path.join("apr_file_info.h").to_str().unwrap()) .header(apr_path.join("apr_file_io.h").to_str().unwrap()) .header(apr_path.join("apr_getopt.h").to_str().unwrap()) .header(apr_path.join("apr_uri.h").to_str().unwrap()) .header(apr_path.join("apr_time.h").to_str().unwrap()) .header(apr_path.join("apr_date.h").to_str().unwrap()) .header(apr_path.join("apr_version.h").to_str().unwrap()) .header(apr_path.join("apu_version.h").to_str().unwrap()) .header(apr_path.join("apr_strings.h").to_str().unwrap()) .header(apr_path.join("apr_thread_proc.h").to_str().unwrap()) .allowlist_file(".*/apr.h") .allowlist_file(".*/apr_general.h") .allowlist_file(".*/apr_allocator.h") .allowlist_file(".*/apr_version.h") .allowlist_file(".*/apr_errno.h") .allowlist_file(".*/apr_pools.h") .allowlist_file(".*/apr_tables.h") .allowlist_file(".*/apr_hash.h") .allowlist_file(".*/apr_file_info.h") .allowlist_file(".*/apr_file_io.h") .allowlist_file(".*/apr_getopt.h") .allowlist_file(".*/apr_uri.h") .allowlist_file(".*/apr_time.h") .allowlist_file(".*/apr_date.h") .allowlist_file(".*/apr_strings.h") .allowlist_file(".*/apr_version.h") .allowlist_file(".*/apu_version.h") .allowlist_file(".*/apr_thread_proc.h") .clang_args( apr_include_paths .iter() .map(|path| format!("-I{}", path.display())), ) .generate() .expect("Failed to generate bindings"); bindings .write_to_file(out_path.join("generated.rs")) .expect("Failed to write bindings"); } fn main() { let deps = system_deps::Config::new().probe().unwrap(); let apr = deps.get_by_name("apr-1").unwrap(); let apr_path = apr .include_paths .iter() .find(|x| x.join("apr.h").exists()) .expect("Failed to find apr.h"); let out_path = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap()); create_bindings( apr_path.as_path(), out_path.as_path(), apr.include_paths .iter() .map(|x| x.as_path()) .collect::>() .as_slice(), ); } apr-0.1.10/disperse.conf000064400000000000000000000001171046102023000131510ustar 00000000000000# See https://github.com/jelmer/disperse timeout_days: 5 tag_name: "v$VERSION" apr-0.1.10/src/date.rs000064400000000000000000000050271046102023000125430ustar 00000000000000use crate::generated::apr_date_checkmask; use crate::time::Time; pub fn checkmask(data: &str, mask: &str) -> bool { let (data, mask) = (std::ffi::CString::new(data).unwrap(), std::ffi::CString::new(mask).unwrap()); unsafe { apr_date_checkmask(data.as_ptr() as *const std::ffi::c_char, mask.as_ptr() as *const std::ffi::c_char) != 0 } } pub fn parse_http(data: &str) -> Option