ntcore_sys

Function NT_GetValueStringArray

Source
pub unsafe extern "C" fn NT_GetValueStringArray(
    value: *const NT_Value,
    last_change: *mut u64,
    arr_size: *mut usize,
) -> *mut WPI_String
Expand description

Returns a copy of the struct WPI_String array from the NT_Value. If the NT_Value is null, or is assigned to a different type, returns null.

§Parameters

  • value: NT_Value struct to get the struct WPI_String array from.
  • last_change: Returns time in ms since the last change in the value.
  • arr_size: Returns the number of elements in the array.

§Returns

Pointer to the struct WPI_String array, or null if error.

It is the caller’s responsibility to free the array once it’s no longer needed. The WPI_FreeStringArray() function is useful for this purpose. The returned array is a copy of the array in the value, and must be freed separately. Note that the individual struct WPI_Strings should not be freed, but the entire array should be freed at once. The WPI_FreeStringArray() function will free all the struct WPI_Strings.