summaryrefslogtreecommitdiffstats
path: root/kexi/3rdparty/uuid/unpack.c
diff options
context:
space:
mode:
Diffstat (limited to 'kexi/3rdparty/uuid/unpack.c')
-rw-r--r--kexi/3rdparty/uuid/unpack.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/kexi/3rdparty/uuid/unpack.c b/kexi/3rdparty/uuid/unpack.c
new file mode 100644
index 000000000..02005dde1
--- /dev/null
+++ b/kexi/3rdparty/uuid/unpack.c
@@ -0,0 +1,40 @@
+/*
+ * Internal routine for unpacking UUID
+ *
+ * Copyright (C) 1996, 1997 Theodore Ts'o.
+ *
+ * %Begin-Header%
+ * This file may be redistributed under the terms of the GNU
+ * Library General Public License.
+ * %End-Header%
+ */
+
+#include <string.h>
+#include "uuidP.h"
+
+void uuid_unpack(const uuid_t in, struct uuid *uu)
+{
+ const __u8 *ptr = in;
+ __u32 tmp;
+
+ tmp = *ptr++;
+ tmp = (tmp << 8) | *ptr++;
+ tmp = (tmp << 8) | *ptr++;
+ tmp = (tmp << 8) | *ptr++;
+ uu->time_low = tmp;
+
+ tmp = *ptr++;
+ tmp = (tmp << 8) | *ptr++;
+ uu->time_mid = tmp;
+
+ tmp = *ptr++;
+ tmp = (tmp << 8) | *ptr++;
+ uu->time_hi_and_version = tmp;
+
+ tmp = *ptr++;
+ tmp = (tmp << 8) | *ptr++;
+ uu->clock_seq = tmp;
+
+ memcpy(uu->node, ptr, 6);
+}
+