Skip to main content

pamoja_profile_with_reads

Function pamoja_profile_with_reads 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_profile_with_reads( profile: *const PamojaProfile, quantity: *const c_char, unit: *const c_char, ) -> *mut PamojaProfile
Expand description

Returns a copy of a profile that says what it reads.

§Arguments

  • profile - the profile.
  • quantity - the quantity its control decides on, such as temperature, as null-terminated UTF-8.
  • unit - the unit its numbers are in, such as celsius, as null-terminated UTF-8.

§Returns

A handle the caller must release with pamoja_profile_free, or null if a pointer is null, a string is not UTF-8, or the quantity or unit is not lowercase words joined by underscores, with the reason available from pamoja_last_error_message.

§Safety

profile must be a live handle from a call that produced one, and quantity and unit must be valid null-terminated UTF-8 strings for the duration of the call; any may be null.