apr-0.1.9/.github/workflows/rust.yml000064400000000000000000000006431046102023000155350ustar 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@v3 - 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.9/.gitignore000064400000000000000000000000131046102023000123770ustar 00000000000000/target *~ apr-0.1.9/Cargo.toml0000644000000021420000000000100076220ustar # 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.9" 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.pkg-config] version = "0.3" [build-dependencies.system-deps] version = "6" [features] url = ["dep:url"] apr-0.1.9/Cargo.toml.orig000064400000000000000000000010471046102023000133060ustar 00000000000000[package] name = "apr" version = "0.1.9" 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" pkg-config = "0.3" system-deps = "6" [package.metadata.system-deps] apr-1 = "*" "apr-util-1" = "*" apr-0.1.9/README.md000064400000000000000000000003461046102023000116770ustar 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.9/build.rs000064400000000000000000000056121046102023000120660ustar 00000000000000extern crate bindgen; extern crate pkg_config; fn create_bindings(out_path: &std::path::Path) { let pc_apr = pkg_config::Config::new() .probe("apr-1") .unwrap_or_else(|e| panic!("Failed to find apr library: {}", e)); let apr_path = pc_apr .include_paths .iter() .find(|x| x.join("apr.h").exists()) .expect("Failed to find apr.h"); // 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( pc_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() { system_deps::Config::new().probe().unwrap(); let out_path = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap()); create_bindings(out_path.as_path()); } apr-0.1.9/disperse.conf000064400000000000000000000001171046102023000131010ustar 00000000000000# See https://github.com/jelmer/disperse timeout_days: 5 tag_name: "v$VERSION" apr-0.1.9/src/date.rs000064400000000000000000000042411046102023000124700ustar 00000000000000use crate::generated::apr_date_checkmask; use crate::time::Time; pub fn checkmask(data: &str, mask: &str) -> bool { unsafe { apr_date_checkmask(data.as_ptr() as *const i8, mask.as_ptr() as *const i8) != 0 } } pub fn parse_http(data: &str) -> Option