mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 04:50:07 +01:00
glib-aux: use nm_uuid_unparse()
This commit is contained in:
parent
cd45ad4acf
commit
596bf4b91b
3 changed files with 3 additions and 18 deletions
|
|
@ -2402,7 +2402,7 @@ _uuid_data_init(UuidData *uuid_data, gboolean packed, gboolean is_fake, const NM
|
|||
nm_utils_bin2hexstr_full(uuid, sizeof(*uuid), '\0', FALSE, uuid_data->str);
|
||||
} else {
|
||||
G_STATIC_ASSERT_EXPR(sizeof(uuid_data->str) >= 37);
|
||||
_nm_utils_uuid_unparse(uuid, uuid_data->str);
|
||||
nm_uuid_unparse(uuid, uuid_data->str);
|
||||
}
|
||||
return uuid_data;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3055,20 +3055,6 @@ _nm_utils_uuid_parse(const char *str, NMUuid *out_uuid)
|
|||
return out_uuid;
|
||||
}
|
||||
|
||||
char *
|
||||
_nm_utils_uuid_unparse(const NMUuid *uuid, char *out_str /*[37]*/)
|
||||
{
|
||||
nm_assert(uuid);
|
||||
|
||||
if (!out_str) {
|
||||
/* for convenience, allow %NULL to indicate that a new
|
||||
* string should be allocated. */
|
||||
out_str = g_malloc(37);
|
||||
}
|
||||
uuid_unparse_lower(uuid->uuid, out_str);
|
||||
return out_str;
|
||||
}
|
||||
|
||||
NMUuid *
|
||||
_nm_utils_uuid_generate_random(NMUuid *out_uuid)
|
||||
{
|
||||
|
|
@ -3107,7 +3093,7 @@ nm_utils_uuid_generate_buf_(char *buf)
|
|||
nm_assert(buf);
|
||||
|
||||
_nm_utils_uuid_generate_random(&uuid);
|
||||
return _nm_utils_uuid_unparse(&uuid, buf);
|
||||
return nm_uuid_unparse(&uuid, buf);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -3220,7 +3206,7 @@ nm_utils_uuid_generate_from_string(const char *s, gssize slen, int uuid_type, gp
|
|||
NMUuid uuid;
|
||||
|
||||
nm_utils_uuid_generate_from_string_bin(&uuid, s, slen, uuid_type, type_args);
|
||||
return _nm_utils_uuid_unparse(&uuid, NULL);
|
||||
return nm_uuid_unparse(&uuid, g_new(char, 37));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -353,7 +353,6 @@ gboolean _nm_utils_check_module_file(const char * name,
|
|||
/*****************************************************************************/
|
||||
|
||||
NMUuid *_nm_utils_uuid_parse(const char *str, NMUuid *uuid);
|
||||
char * _nm_utils_uuid_unparse(const NMUuid *uuid, char *out_str /*[37]*/);
|
||||
NMUuid *_nm_utils_uuid_generate_random(NMUuid *out_uuid);
|
||||
|
||||
gboolean nm_utils_uuid_is_null(const NMUuid *uuid);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue