1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! FFI string utilities — back-compat shim over `doom_fish_utils::ffi_string`.
//!
//! Re-exports the generic, framework-agnostic helpers and adds the thin
//! wrappers [`crate::utils::ffi_string::ffi_string_owned`] and
//! [`crate::utils::ffi_string::ffi_string_owned_or_empty`]. They bake in
//! `crate::ffi::acf_free_string` as the deallocator so existing call sites
//! that used the apple-cf-specific helpers compile unchanged.
pub use ;
/// Retrieves a string from an FFI function that returns an owned C string
/// pointer allocated by Swift (typically via `strdup`), freeing it with
/// `acf_free_string`.
///
/// This is a thin convenience over
/// [`doom_fish_utils::ffi_string::ffi_string_owned`].
///
/// # Safety
/// The caller must ensure the returned pointer was allocated by the
/// `apple-cf` Swift bridge (so that `acf_free_string` correctly releases
/// it). See the underlying helper for full safety contract.
pub unsafe
/// Same as [`crate::utils::ffi_string::ffi_string_owned`] but returns an empty
/// string on failure.
///
/// # Safety
/// Same requirements as [`crate::utils::ffi_string::ffi_string_owned`].
pub unsafe