UUID creation.
More...
Go to the source code of this file.
UUID creation.
Definition in file uuidutils.h.
◆ gvm_uuid_make()
| char * gvm_uuid_make |
( |
void |
| ) |
|
Make a new universal identifier.
- Returns
- A newly allocated string holding the identifier, which the caller must free, or NULL on failure.
Definition at line 30 of file uuidutils.c.
31{
32 char *id;
33 uuid_t uuid;
34
35
36 uuid_generate (uuid);
37 if (uuid_is_null (uuid) == 1)
38 {
39 g_warning ("%s: failed to generate UUID", __func__);
40 return NULL;
41 }
42
43
44 id = g_malloc0 (sizeof (char) * 37);
45 if (id == NULL)
46 {
47 g_warning ("%s: Cannot export UUID to text: out of memory", __func__);
48 return NULL;
49 }
50
51
52 uuid_unparse (uuid, id);
53
54 return id;
55}
Referenced by mqtt_set_client_id().