glib-aux: change nm_uuid_is_valid_full() to nm_uuid_is_normalized_full()

Most of the time, we care about whether we have a normalized UUID.

nm_uuid_is_valid_full() only exists for a particular case where we want
to use the function in a header, without including "nm-uuid.h". In that
case, we actually also care about normalized UUIDs.
This commit is contained in:
Thomas Haller 2021-06-02 10:22:51 +02:00
parent 6ce7b3ca0f
commit 25f4d23e13
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
3 changed files with 8 additions and 8 deletions

View file

@ -60,14 +60,14 @@ nm_settings_storage_get_plugin(const NMSettingsStorage *self)
return self->_plugin;
}
gboolean nm_uuid_is_valid_full(const char *str);
gboolean nm_uuid_is_normalized_full(const char *str);
static inline const char *
nm_settings_storage_get_uuid(const NMSettingsStorage *self)
{
g_return_val_if_fail(NM_IS_SETTINGS_STORAGE(self), NULL);
nm_assert(nm_uuid_is_valid_full(self->_uuid));
nm_assert(nm_uuid_is_normalized_full(self->_uuid));
return self->_uuid;
}
@ -76,7 +76,7 @@ nm_settings_storage_get_uuid_opt(const NMSettingsStorage *self)
{
g_return_val_if_fail(NM_IS_SETTINGS_STORAGE(self), NULL);
nm_assert(!self->_uuid || nm_uuid_is_valid_full(self->_uuid));
nm_assert(!self->_uuid || nm_uuid_is_normalized_full(self->_uuid));
return self->_uuid;
}

View file

@ -130,13 +130,13 @@ nm_uuid_generate_random(NMUuid *out_uuid)
/*****************************************************************************/
gboolean
nm_uuid_is_valid_full(const char *str)
nm_uuid_is_normalized_full(const char *str)
{
/* The only reason why this exists is that nm_uuid_is_valid() is an inline function.
/* The only reason why this exists is that nm_uuid_is_normalized() is an inline function.
* If you need to forward declare the function, that won't work.
*
* Usually, you wouldn't use this variant! */
return nm_uuid_is_valid(str);
return nm_uuid_is_normalized(str);
}
/*****************************************************************************/

View file

@ -33,14 +33,14 @@ gboolean nm_uuid_is_null(const NMUuid *uuid);
/*****************************************************************************/
gboolean nm_uuid_is_valid_full(const char *str);
static inline gboolean
nm_uuid_is_valid(const char *str)
{
return str && nm_uuid_parse_full(str, NULL, NULL);
}
gboolean nm_uuid_is_normalized_full(const char *str);
static inline gboolean
nm_uuid_is_normalized(const char *str)
{