diff options
author | Darin Adler <darin@src.gnome.org> | 2001-03-06 23:33:19 +0000 |
---|---|---|
committer | Darin Adler <darin@src.gnome.org> | 2001-03-06 23:33:19 +0000 |
commit | e7d9f82a0f48921d9ead9da0a584466d43dc11df (patch) | |
tree | 32858b98ff9089b89c03615b78261e38b20798c8 /capplets/file-types/libuuid/pack.c | |
parent | e0d6ca4c742dc0d59c4544996d2eecd989ff052b (diff) | |
download | gnome-control-center-e7d9f82a0f48921d9ead9da0a584466d43dc11df.tar.gz |
Merge all changes from gnome-vfs-1 branch to HEAD.GNOME-VFS_1_0_ANCHORCONTROL_CENTER_1_4_0CONTROL_CENTER_1_0_ANCHORgnome-vfs-1-0
Diffstat (limited to 'capplets/file-types/libuuid/pack.c')
-rw-r--r-- | capplets/file-types/libuuid/pack.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/capplets/file-types/libuuid/pack.c b/capplets/file-types/libuuid/pack.c new file mode 100644 index 000000000..94be488aa --- /dev/null +++ b/capplets/file-types/libuuid/pack.c @@ -0,0 +1,46 @@ +/* + * Internal routine for packing UUID's + * + * Copyright (C) 1996, 1997 Theodore Ts'o. + * + * %Begin-Header% + * This file may be redistributed under the terms of the GNU Public + * License. + * %End-Header% + */ + +#include <string.h> +#include "uuidP.h" + +void uuid_pack(struct uuid *uu, uuid_t ptr) +{ + guint32 tmp; + unsigned char *out = ptr; + + tmp = uu->time_low; + out[3] = (unsigned char) tmp; + tmp >>= 8; + out[2] = (unsigned char) tmp; + tmp >>= 8; + out[1] = (unsigned char) tmp; + tmp >>= 8; + out[0] = (unsigned char) tmp; + + tmp = uu->time_mid; + out[5] = (unsigned char) tmp; + tmp >>= 8; + out[4] = (unsigned char) tmp; + + tmp = uu->time_hi_and_version; + out[7] = (unsigned char) tmp; + tmp >>= 8; + out[6] = (unsigned char) tmp; + + tmp = uu->clock_seq; + out[9] = (unsigned char) tmp; + tmp >>= 8; + out[8] = (unsigned char) tmp; + + memcpy(out+10, uu->node, 6); +} + |