/*
* uuid.c -- utility routines for manipulating UUID's.
+ *
+ * %Begin-Header%
+ * This file may be redistributed under the terms of the GNU Library
+ * General Public License, version 2.
+ * %End-Header%
*/
+#include "config.h"
#include <stdio.h>
#include <string.h>
-#include <asm/types.h>
+#include <ext2fs/ext2_types.h>
#include "e2p.h"
int i;
for (i=0, cp = uu; i < 16; i++)
- if (*cp)
+ if (*cp++)
return 0;
return 1;
}
tmp = *ptr++;
tmp = (tmp << 8) | *ptr++;
uu->time_mid = tmp;
-
+
tmp = *ptr++;
tmp = (tmp << 8) | *ptr++;
uu->time_hi_and_version = tmp;
uuid.node[0], uuid.node[1], uuid.node[2],
uuid.node[3], uuid.node[4], uuid.node[5]);
}
+
+const char *e2p_uuid2str(void *uu)
+{
+ static char buf[80];
+
+ if (e2p_is_null_uuid(uu))
+ return "<none>";
+ e2p_uuid_to_str(uu, buf);
+ return buf;
+}
+