use core::ffi::c_char;
extern "C" {
type CStrArrayRepr;
}
pub struct CStrArray {
inner: CStrArrayRepr,
}
impl CStrArray {
/// Turns a pointer to a NULL-terminated array of NUL-terminated strings into a `CStrArray`.
///
/// # Safety
///
/// The pointer must point to a NULL-terminated array of NUL-terminated strings.
#[inline]
pub unsafe fn from_ptr<'a>(ptr: *const *const c_char) -> &'a CStrArray {
&*(ptr as *const CStrArray)
}
#[must_use]
#[inline]
pub const fn as_ptr(&self) -> *const *const c_char {
&self.inner as *const _ as *const *const c_char
}
}