mirror of
https://git.proxmox.com/git/fwupd
synced 2025-07-27 07:32:12 +00:00
trivial: Add some new helper API for future functionality
This commit is contained in:
parent
f818404d81
commit
f3ec632492
@ -1942,6 +1942,27 @@ fu_common_bytes_compare(GBytes *bytes1, GBytes *bytes2, GError **error)
|
||||
return fu_common_bytes_compare_raw(buf1, bufsz1, buf2, bufsz2, error);
|
||||
}
|
||||
|
||||
/**
|
||||
* fu_byte_array_compare:
|
||||
* @buf1: a data blob
|
||||
* @buf2: another #GByteArray
|
||||
* @error: (nullable): optional return location for an error
|
||||
*
|
||||
* Compares two buffers for equality.
|
||||
*
|
||||
* Returns: %TRUE if @buf1 and @buf2 are identical
|
||||
*
|
||||
* Since: 1.8.0
|
||||
**/
|
||||
gboolean
|
||||
fu_byte_array_compare(GByteArray *buf1, GByteArray *buf2, GError **error)
|
||||
{
|
||||
g_return_val_if_fail(buf1 != NULL, FALSE);
|
||||
g_return_val_if_fail(buf2 != NULL, FALSE);
|
||||
g_return_val_if_fail(error == NULL || *error == NULL, FALSE);
|
||||
return fu_common_bytes_compare_raw(buf1->data, buf1->len, buf2->data, buf2->len, error);
|
||||
}
|
||||
|
||||
/**
|
||||
* fu_common_bytes_pad:
|
||||
* @bytes: data blob
|
||||
|
@ -359,6 +359,8 @@ void
|
||||
fu_byte_array_append_uint64(GByteArray *array, guint64 data, FuEndianType endian);
|
||||
void
|
||||
fu_byte_array_append_bytes(GByteArray *array, GBytes *bytes);
|
||||
gboolean
|
||||
fu_byte_array_compare(GByteArray *buf1, GByteArray *buf2, GError **error);
|
||||
|
||||
void
|
||||
fu_common_write_uint16(guint8 *buf, guint16 val_native, FuEndianType endian);
|
||||
|
@ -1021,6 +1021,7 @@ LIBFWUPDPLUGIN_1.7.7 {
|
||||
LIBFWUPDPLUGIN_1.8.0 {
|
||||
global:
|
||||
fu_backend_invalidate;
|
||||
fu_byte_array_compare;
|
||||
fu_cfi_device_chip_select;
|
||||
fu_cfi_device_chip_select_locker_new;
|
||||
fu_common_reverse_uint8;
|
||||
|
Loading…
Reference in New Issue
Block a user