summaryrefslogtreecommitdiffstats
path: root/source3/lib/util_uuid.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@sernet.de>2007-11-25 10:10:52 +0100
committerGünther Deschner <gd@samba.org>2007-11-27 14:18:47 +0100
commit1011b32678c7b32472a909b9f515698947d2a389 (patch)
treedd81c00e9cbb967cad2bc725f7a0754851b1764e /source3/lib/util_uuid.c
parent80c2446321c519797a57b8006942a983f8481d79 (diff)
downloadsamba-1011b32678c7b32472a909b9f515698947d2a389.tar.gz
samba-1011b32678c7b32472a909b9f515698947d2a389.tar.xz
samba-1011b32678c7b32472a909b9f515698947d2a389.zip
Remove some statics
(This used to be commit 1fab16ffb888cd4ec18e52d9da33976a67a5d104)
Diffstat (limited to 'source3/lib/util_uuid.c')
-rw-r--r--source3/lib/util_uuid.c44
1 files changed, 13 insertions, 31 deletions
diff --git a/source3/lib/util_uuid.c b/source3/lib/util_uuid.c
index 606bfd2147c..36c04e9b849 100644
--- a/source3/lib/util_uuid.c
+++ b/source3/lib/util_uuid.c
@@ -44,14 +44,6 @@ void smb_uuid_unpack(const UUID_FLAT in, struct GUID *uu)
memcpy(uu->node, in.info+10, 6);
}
-struct GUID smb_uuid_unpack_static(const UUID_FLAT in)
-{
- static struct GUID uu;
-
- smb_uuid_unpack(in, &uu);
- return uu;
-}
-
void smb_uuid_generate_random(struct GUID *uu)
{
UUID_FLAT tmp;
@@ -63,30 +55,20 @@ void smb_uuid_generate_random(struct GUID *uu)
uu->time_hi_and_version = (uu->time_hi_and_version & 0x0FFF) | 0x4000;
}
-char *smb_uuid_to_string(const struct GUID uu)
-{
- char *out;
-
- asprintf(&out, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
- uu.time_low, uu.time_mid, uu.time_hi_and_version,
- uu.clock_seq[0], uu.clock_seq[1],
- uu.node[0], uu.node[1], uu.node[2],
- uu.node[3], uu.node[4], uu.node[5]);
-
- return out;
-}
-
-const char *smb_uuid_string_static(const struct GUID uu)
+const char *smb_uuid_string(TALLOC_CTX *mem_ctx, const struct GUID uu)
{
- static char out[37];
-
- slprintf(out, sizeof(out),
- "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
- uu.time_low, uu.time_mid, uu.time_hi_and_version,
- uu.clock_seq[0], uu.clock_seq[1],
- uu.node[0], uu.node[1], uu.node[2],
- uu.node[3], uu.node[4], uu.node[5]);
- return out;
+ char *result;
+
+ result = talloc_asprintf(
+ mem_ctx,
+ "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
+ uu.time_low, uu.time_mid, uu.time_hi_and_version,
+ uu.clock_seq[0], uu.clock_seq[1],
+ uu.node[0], uu.node[1], uu.node[2],
+ uu.node[3], uu.node[4], uu.node[5]);
+
+ SMB_ASSERT(result != NULL);
+ return result;
}
bool smb_string_to_uuid(const char *in, struct GUID* uu)