pub type AParcel_stringArrayElementAllocator = Option<unsafe extern "C" fn(arrayData: *mut c_void, index: usize, length: i32, buffer: *mut *mut c_char) -> bool>;
Expand description

This is called to allocate a string inside of an array that was allocated by an AParcel_stringArrayAllocator.

The index returned will always be within the range [0, length of arrayData). The returned buffer should be at least length bytes. This includes space for a null-terminator. For a string, length will always be strictly less than or equal to the maximum size that can be held in a size_t and will always be greater than 0. However, if a ‘null’ string is being read, length will be -1.

See also AParcel_readStringArray

\param arrayData some external representation of an array. \param index the index at which a string should be allocated. \param length the length of the string to be allocated at this index. See also AParcel_stringAllocator. This includes the length required for a null-terminator. \param buffer a buffer of size ‘length’ or null if allocation failed.

\return true if the allocation succeeded, false otherwise. If length is -1, a true return here means that a ‘null’ value (or equivalent) was successfully stored.

Aliased Type§

enum AParcel_stringArrayElementAllocator {
    None,
    Some(unsafe extern "C" fn(_: *mut c_void, _: usize, _: i32, _: *mut *mut i8) -> bool),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(_: *mut c_void, _: usize, _: i32, _: *mut *mut i8) -> bool)

Some value of type T.