mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-30 21:20:10 +01:00
glib-aux: add NMUuidType enum for nm_uuid_generate_from_string()
Let's have an enum instead of plain "int" and #define.
This commit is contained in:
parent
995c78245e
commit
414ce2236e
2 changed files with 15 additions and 8 deletions
|
|
@ -176,7 +176,7 @@ NMUuid *
|
|||
nm_uuid_generate_from_string(NMUuid * uuid,
|
||||
const char *s,
|
||||
gssize slen,
|
||||
int uuid_type,
|
||||
NMUuidType uuid_type,
|
||||
gpointer type_args)
|
||||
{
|
||||
g_return_val_if_fail(uuid, FALSE);
|
||||
|
|
@ -250,7 +250,10 @@ nm_uuid_generate_from_string(NMUuid * uuid,
|
|||
* object's #NMSettingConnection:id: property
|
||||
**/
|
||||
char *
|
||||
nm_uuid_generate_from_string_str(const char *s, gssize slen, int uuid_type, gpointer type_args)
|
||||
nm_uuid_generate_from_string_str(const char *s,
|
||||
gssize slen,
|
||||
NMUuidType uuid_type,
|
||||
gpointer type_args)
|
||||
{
|
||||
NMUuid uuid;
|
||||
|
||||
|
|
|
|||
|
|
@ -47,18 +47,22 @@ char *nm_uuid_generate_random_str(char buf[static 37]);
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
#define NM_UUID_TYPE_LEGACY 0
|
||||
#define NM_UUID_TYPE_VERSION3 3
|
||||
#define NM_UUID_TYPE_VERSION5 5
|
||||
typedef enum {
|
||||
NM_UUID_TYPE_LEGACY = 0,
|
||||
NM_UUID_TYPE_VERSION3 = 3,
|
||||
NM_UUID_TYPE_VERSION5 = 5,
|
||||
} NMUuidType;
|
||||
|
||||
NMUuid *nm_uuid_generate_from_string(NMUuid * uuid,
|
||||
const char *s,
|
||||
gssize slen,
|
||||
int uuid_type,
|
||||
NMUuidType uuid_type,
|
||||
gpointer type_args);
|
||||
|
||||
char *
|
||||
nm_uuid_generate_from_string_str(const char *s, gssize slen, int uuid_type, gpointer type_args);
|
||||
char *nm_uuid_generate_from_string_str(const char *s,
|
||||
gssize slen,
|
||||
NMUuidType uuid_type,
|
||||
gpointer type_args);
|
||||
|
||||
/* arbitrarily chosen namespace UUID for nm_uuid_generate_from_strings() */
|
||||
#define NM_UUID_NS1 "b425e9fb-7598-44b4-9e3b-5a2e3aaa4905"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue