mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-16 00:15:08 +01:00
0f17471b27
*Added sources of the custom libs to the branches *Fixed crash when switching from list layout to grid/carousel layout *Removed 1:1 copy option because its meaningless and almost the same as installing all partitions *Fixed install partition selection. This option needs a reset. Go to settings and reselect your option for this. *Fixed schinese and tchinese language modes (filename bugs. has to be schinese.lang and tchinese.lang like on SVN) *Fixed bug in sound buffer circle *Fixed incorrect behaviour of x-flip when selecting system like (thx Cyan for the patch) *Accept ios revision 65535 for Waninkokos IOSes (thx to PPSainity for pointing it out) *Merged the new theming style branch into trunk. Just as a reminder: ALL old themes will not work until the themers did port it to the new style! *Removed old theme style completely Theme example: The example file of the theme is the Default.them file. It can be found in the SVN trunk. Change in loading of themes: When selecting a theme now a list of all .them files in a folder is displayed. The image folder of that theme has to be in the same folder as the .them file. The image path is defined in the head of the .them file in the line with "Image-Folder: Example\n".
85 lines
1.5 KiB
C
85 lines
1.5 KiB
C
/*
|
|
* 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 <stdio.h>
|
|
#include <string.h>
|
|
#include <ext2fs/ext2_types.h>
|
|
|
|
#include "e2p.h"
|
|
|
|
struct uuid {
|
|
__u32 time_low;
|
|
__u16 time_mid;
|
|
__u16 time_hi_and_version;
|
|
__u16 clock_seq;
|
|
__u8 node[6];
|
|
};
|
|
|
|
/* Returns 1 if the uuid is the NULL uuid */
|
|
int e2p_is_null_uuid(void *uu)
|
|
{
|
|
__u8 *cp;
|
|
int i;
|
|
|
|
for (i=0, cp = uu; i < 16; i++)
|
|
if (*cp++)
|
|
return 0;
|
|
return 1;
|
|
}
|
|
|
|
static void e2p_unpack_uuid(void *in, struct uuid *uu)
|
|
{
|
|
__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);
|
|
}
|
|
|
|
void e2p_uuid_to_str(void *uu, char *out)
|
|
{
|
|
struct uuid uuid;
|
|
|
|
e2p_unpack_uuid(uu, &uuid);
|
|
sprintf(out,
|
|
"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
|
|
uuid.time_low, uuid.time_mid, uuid.time_hi_and_version,
|
|
uuid.clock_seq >> 8, uuid.clock_seq & 0xFF,
|
|
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;
|
|
}
|
|
|