Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libbz2-rs-sys-cdylib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ semver-prefix = ["libbz2-rs-sys/semver-prefix"] # prefix all symbols in a semver
capi = []

[dependencies]
libbz2-rs-sys = { version = "0.1.3", path = "../libbz2-rs-sys", default-features = false, features = ["c-allocator"] }
libbz2-rs-sys = { version = "0.1.3", path = "../libbz2-rs-sys", default-features = false, features = ["c-allocator", "export-symbols"] }
libc = "0.2"

[package.metadata.capi.library]
Expand Down
7 changes: 4 additions & 3 deletions libbz2-rs-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ default = ["std", "stdio"]
c-allocator = ["dep:libc"] # use a malloc-based C allocator (rust is picked over c if both are configured)
rust-allocator = [] # use the rust global allocator (rust is picked over c if both are configured)
std = ["rust-allocator"]
custom-prefix = [] # use the LIBBZ2_RS_SYS_PREFIX to prefix all exported symbols
testing-prefix = [] # prefix all symbols with LIBBZ2_RS_SYS_TEST_ for testing
semver-prefix = [] # prefix all symbols in a semver-compatible way
export-symbols = []
custom-prefix = ["export-symbols"] # use the LIBBZ2_RS_SYS_PREFIX to prefix all exported symbols
testing-prefix = ["export-symbols"] # prefix all symbols with LIBBZ2_RS_SYS_TEST_ for testing
semver-prefix = ["export-symbols"] # prefix all symbols in a semver-compatible way
stdio = ["dep:libc"] # corresponds to BZ_NO_STDIO; only the low-level api is available when this flag is disabled
__internal-fuzz-disable-checksum = []

Expand Down
18 changes: 9 additions & 9 deletions libbz2-rs-sys/src/bzlib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pub(crate) use prefix;
///
/// - The first component is the version of stock zlib that this release is compatible with
/// - The final component is the zlib-rs version used to build this release.
#[export_name = prefix!(BZ2_bzlibVersion)]
#[cfg_attr(feature = "export-symbols", export_name = prefix!(BZ2_bzlibVersion))]
#[cfg(feature = "stdio")]
pub const extern "C" fn BZ2_bzlibVersion() -> *const core::ffi::c_char {
const LIBBZ2_RS_SYS_VERSION: &str = concat!(libbz2_rs_sys_version!(), "\0");
Expand Down Expand Up @@ -759,7 +759,7 @@ fn isempty_rl(s: &mut EState) -> bool {
/// - `strm` is `NULL`
/// - `strm` satisfies the requirements of `&mut *strm`
/// * The `bzalloc`, `bzfree` and `opaque` fields form a [valid allocator](bz_stream#custom-allocators).
#[export_name = prefix!(BZ2_bzCompressInit)]
#[cfg_attr(feature = "export-symbols", export_name = prefix!(BZ2_bzCompressInit))]
pub unsafe extern "C" fn BZ2_bzCompressInit(
strm: *mut bz_stream,
blockSize100k: c_int,
Expand Down Expand Up @@ -1077,7 +1077,7 @@ impl TryFrom<i32> for Action {
/// * Either
/// - `strm.next_out` is `NULL` and `strm.avail_out` is `0`
/// - `strm.next_out` is writable for `strm.avail_out` bytes
#[export_name = prefix!(BZ2_bzCompress)]
#[cfg_attr(feature = "export-symbols", export_name = prefix!(BZ2_bzCompress))]
pub unsafe extern "C" fn BZ2_bzCompress(strm: *mut bz_stream, action: c_int) -> c_int {
let Some(strm) = (unsafe { BzStream::from_ptr(strm) }) else {
return ReturnCode::BZ_PARAM_ERROR as c_int;
Expand Down Expand Up @@ -1182,7 +1182,7 @@ fn compress_loop(strm: &mut BzStream<EState>, s: &mut EState, action: i32) -> Re
/// * Either
/// - `strm` is `NULL`
/// - `strm` satisfies the requirements of `&mut *strm` and was initialized with [`BZ2_bzCompressInit`]
#[export_name = prefix!(BZ2_bzCompressEnd)]
#[cfg_attr(feature = "export-symbols", export_name = prefix!(BZ2_bzCompressEnd))]
pub unsafe extern "C" fn BZ2_bzCompressEnd(strm: *mut bz_stream) -> c_int {
let Some(strm) = (unsafe { BzStream::from_ptr(strm) }) else {
return ReturnCode::BZ_PARAM_ERROR as c_int;
Expand Down Expand Up @@ -1243,7 +1243,7 @@ pub(crate) enum DecompressMode {
/// - `strm` is `NULL`
/// - `strm` satisfies the requirements of `&mut *strm`
/// * The `bzalloc`, `bzfree` and `opaque` fields form a [valid allocator](bz_stream#custom-allocators).
#[export_name = prefix!(BZ2_bzDecompressInit)]
#[cfg_attr(feature = "export-symbols", export_name = prefix!(BZ2_bzDecompressInit))]
pub unsafe extern "C" fn BZ2_bzDecompressInit(
strm: *mut bz_stream,
verbosity: c_int,
Expand Down Expand Up @@ -1786,7 +1786,7 @@ fn un_rle_obuf_to_output_small(strm: &mut BzStream<DState>, s: &mut DState) -> b
/// * Either
/// - `strm.next_out` is `NULL` and `strm.avail_out` is `0`
/// - `strm.next_out` is writable for `strm.avail_out` bytes
#[export_name = prefix!(BZ2_bzDecompress)]
#[cfg_attr(feature = "export-symbols", export_name = prefix!(BZ2_bzDecompress))]
pub unsafe extern "C" fn BZ2_bzDecompress(strm: *mut bz_stream) -> c_int {
let Some(strm) = (unsafe { BzStream::from_ptr(strm) }) else {
return ReturnCode::BZ_PARAM_ERROR as c_int;
Expand Down Expand Up @@ -1888,7 +1888,7 @@ pub(crate) fn BZ2_bzDecompressHelp(strm: &mut BzStream<DState>) -> ReturnCode {
/// * Either
/// - `strm` is `NULL`
/// - `strm` satisfies the requirements of `&mut *strm` and was initialized with [`BZ2_bzDecompressInit`]
#[export_name = prefix!(BZ2_bzDecompressEnd)]
#[cfg_attr(feature = "export-symbols", export_name = prefix!(BZ2_bzDecompressEnd))]
pub unsafe extern "C" fn BZ2_bzDecompressEnd(strm: *mut bz_stream) -> c_int {
let Some(strm) = (unsafe { BzStream::from_ptr(strm) }) else {
return ReturnCode::BZ_PARAM_ERROR as c_int;
Expand Down Expand Up @@ -1959,7 +1959,7 @@ fn BZ2_bzDecompressEndHelp(strm: &mut BzStream<DState>) -> ReturnCode {
/// - `source` is readable for `sourceLen`
///
/// [`pointer::as_mut`]: https://doc.rust-lang.org/core/primitive.pointer.html#method.as_mut
#[export_name = prefix!(BZ2_bzBuffToBuffCompress)]
#[cfg_attr(feature = "export-symbols", export_name = prefix!(BZ2_bzBuffToBuffCompress))]
pub unsafe extern "C" fn BZ2_bzBuffToBuffCompress(
dest: *mut c_char,
destLen: *mut c_uint,
Expand Down Expand Up @@ -2074,7 +2074,7 @@ unsafe fn BZ2_bzBuffToBuffCompressHelp(
/// - `source` is readable for `sourceLen`
///
/// [`pointer::as_mut`]: https://doc.rust-lang.org/core/primitive.pointer.html#method.as_mut
#[export_name = prefix!(BZ2_bzBuffToBuffDecompress)]
#[cfg_attr(feature = "export-symbols", export_name = prefix!(BZ2_bzBuffToBuffDecompress))]
pub unsafe extern "C" fn BZ2_bzBuffToBuffDecompress(
dest: *mut c_char,
destLen: *mut c_uint,
Expand Down
Loading