mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-14 07:09:57 +00:00
Add fwupd_trust_flag_to_string()
This commit is contained in:
parent
da887df142
commit
c1e3ded9a3
@ -118,3 +118,37 @@ fwupd_device_flag_from_string (const gchar *device_flag)
|
|||||||
return FU_DEVICE_FLAG_LOCKED;
|
return FU_DEVICE_FLAG_LOCKED;
|
||||||
return FU_DEVICE_FLAG_LAST;
|
return FU_DEVICE_FLAG_LAST;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* fwupd_trust_flag_to_string:
|
||||||
|
*
|
||||||
|
* Since: 0.7.0
|
||||||
|
**/
|
||||||
|
const gchar *
|
||||||
|
fwupd_trust_flag_to_string (FwupdTrustFlags trust_flag)
|
||||||
|
{
|
||||||
|
if (trust_flag == FWUPD_TRUST_FLAG_NONE)
|
||||||
|
return "none";
|
||||||
|
if (trust_flag == FWUPD_TRUST_FLAG_PAYLOAD)
|
||||||
|
return "payload";
|
||||||
|
if (trust_flag == FWUPD_TRUST_FLAG_METADATA)
|
||||||
|
return "metadata";
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* fwupd_trust_flag_from_string:
|
||||||
|
*
|
||||||
|
* Since: 0.7.0
|
||||||
|
**/
|
||||||
|
FwupdTrustFlags
|
||||||
|
fwupd_trust_flag_from_string (const gchar *trust_flag)
|
||||||
|
{
|
||||||
|
if (g_strcmp0 (trust_flag, "none") == 0)
|
||||||
|
return FWUPD_TRUST_FLAG_NONE;
|
||||||
|
if (g_strcmp0 (trust_flag, "payload") == 0)
|
||||||
|
return FWUPD_TRUST_FLAG_PAYLOAD;
|
||||||
|
if (g_strcmp0 (trust_flag, "metadata") == 0)
|
||||||
|
return FWUPD_TRUST_FLAG_METADATA;
|
||||||
|
return FWUPD_TRUST_FLAG_LAST;
|
||||||
|
}
|
||||||
|
@ -83,5 +83,7 @@ const gchar *fwupd_status_to_string (FwupdStatus status);
|
|||||||
FwupdStatus fwupd_status_from_string (const gchar *status);
|
FwupdStatus fwupd_status_from_string (const gchar *status);
|
||||||
const gchar *fwupd_device_flag_to_string (FwupdDeviceFlags device_flag);
|
const gchar *fwupd_device_flag_to_string (FwupdDeviceFlags device_flag);
|
||||||
FwupdDeviceFlags fwupd_device_flag_from_string (const gchar *device_flag);
|
FwupdDeviceFlags fwupd_device_flag_from_string (const gchar *device_flag);
|
||||||
|
const gchar *fwupd_trust_flag_to_string (FwupdTrustFlags trust_flag);
|
||||||
|
FwupdTrustFlags fwupd_trust_flag_from_string (const gchar *trust_flag);
|
||||||
|
|
||||||
#endif /* __FWUPD_ENUMS_H */
|
#endif /* __FWUPD_ENUMS_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user