apr-0.1.16/.cargo_vcs_info.json0000644000000001360000000000100117030ustar { "git": { "sha1": "1563ae7f97170f459aa95fb217acadb0444120f5" }, "path_in_vcs": "" }apr-0.1.16/.github/CODEOWNERS000064400000000000000000000000121046102023000134170ustar 00000000000000* @jelmer apr-0.1.16/.github/FUNDING.yml000064400000000000000000000000171046102023000136460ustar 00000000000000github: jelmer apr-0.1.16/.github/dependabot.yml000064400000000000000000000006251046102023000146660ustar 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.16/.github/workflows/publish.yaml000064400000000000000000000012211046102023000164160ustar 00000000000000on: push: tags: - 'v*' # Push events to every tag not containing / workflow_dispatch: name: Publish jobs: publish: name: Publish runs-on: ubuntu-latest steps: - name: Checkout sources uses: actions/checkout@v4 - name: Install apr run: sudo apt install -y libapr1-dev libaprutil1-dev libutf8proc-dev - name: Install stable toolchain uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable override: true - run: cargo publish --token ${CRATES_TOKEN} env: CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }} apr-0.1.16/.github/workflows/rust.yml000064400000000000000000000017511046102023000156140ustar 00000000000000name: Rust on: push: branches: [ "master" ] pull_request: branches: [ "master" ] env: CARGO_TERM_COLOR: always jobs: build: strategy: matrix: os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Install apr run: sudo apt install -y libapr1-dev libaprutil1-dev libutf8proc-dev if: "matrix.os == 'ubuntu-latest'" - name: Install apr (Mac OS) run: | brew install apr-util apr pkg-config utf8proc echo "$(brew --prefix)/opt/pkg-config/bin" >> $GITHUB_PATH pkg-config --list-all if: "matrix.os == 'macos-latest'" - name: Build run: cargo build --verbose env: PKG_CONFIG_PATH: "/opt/homebrew/opt/apr-util/lib/pkgconfig:/opt/homebrew/opt/apr/lib/pkgconfig" - name: Run tests run: cargo test --verbose env: PKG_CONFIG_PATH: "/opt/homebrew/opt/apr-util/lib/pkgconfig:/opt/homebrew/opt/apr/lib/pkgconfig" apr-0.1.16/.gitignore000064400000000000000000000000131046102023000124550ustar 00000000000000/target *~ apr-0.1.16/Cargo.toml0000644000000023500000000000100077010ustar # 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.16" authors = ["Jelmer Vernooij "] build = "build.rs" autobins = false autoexamples = false autotests = false autobenches = false description = "Rust bindings for Apache Portable Runtime" homepage = "https://github.com/jelmer/apr-rs" documentation = "https://docs.rs/apr" 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] name = "apr" path = "src/lib.rs" doctest = false [dependencies.ctor] version = "0.2" [dependencies.url] version = "2" optional = true [build-dependencies.bindgen] version = ">=0.60" [build-dependencies.system-deps] version = "7" [features] pool-debug = [] url = ["dep:url"] apr-0.1.16/Cargo.toml.orig000064400000000000000000000011131046102023000133560ustar 00000000000000[package] name = "apr" version = "0.1.16" 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" documentation = "https://docs.rs/apr" [lib] doctest = false [dependencies] ctor = "0.2" url = { version = "2", optional = true } [features] url = ["dep:url"] pool-debug = [] [build-dependencies] bindgen = ">=0.60" system-deps = "7" [package.metadata.system-deps] apr-1 = "*" "apr-util-1" = "*" apr-0.1.16/README.md000064400000000000000000000003461046102023000117550ustar 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.16/build.rs000064400000000000000000000067711046102023000121530ustar 00000000000000extern crate bindgen; fn create_bindings( apr_path: &std::path::Path, apu_path: &std::path::Path, out_path: &std::path::Path, apr_include_paths: &[&std::path::Path], ) { // Generate bindings using bindgen let mut builder = bindgen::Builder::default(); // check if the pool-debug feature is present if std::env::var("CARGO_FEATURE_POOL_DEBUG").is_ok() { builder = builder.clang_arg("-DAPR_POOL_DEBUG"); } let bindings = builder .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(apu_path.join("apr_uri.h").to_str().unwrap()) .header(apr_path.join("apr_time.h").to_str().unwrap()) .header(apu_path.join("apr_date.h").to_str().unwrap()) .header(apr_path.join("apr_version.h").to_str().unwrap()) .header(apu_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_util = deps.get_by_name("apr-util-1").unwrap(); let apr_path = apr .include_paths .iter() .find(|x| x.join("apr.h").exists()) .expect("Failed to find apr.h"); let apr_util_path = apr_util .include_paths .iter() .find(|x| x.join("apu.h").exists()) .expect("Failed to find apu.h"); let out_path = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap()); create_bindings( apr_path.as_path(), apr_util_path.as_path(), out_path.as_path(), apr.include_paths .iter() .map(|x| x.as_path()) .collect::>() .as_slice(), ); } apr-0.1.16/disperse.conf000064400000000000000000000001171046102023000131570ustar 00000000000000# See https://github.com/jelmer/disperse timeout_days: 5 tag_name: "v$VERSION" apr-0.1.16/src/date.rs000064400000000000000000000054151046102023000125520ustar 00000000000000//! Date parsing functions use crate::generated::apr_date_checkmask; use crate::time::Time; /// Check if the given data matches the mask. 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 } } /// Parse the given data as an HTTP date. pub fn parse_http(data: &str) -> Option