1 | /*␊ |
2 | * Convert.h␊ |
3 | * Declare conversion utility functions␊ |
4 | * --Rek␊ |
5 | */␊ |
6 | ␊ |
7 | #ifndef __CONVERT_H␊ |
8 | #define __CONVERT_H␊ |
9 | #include "libsaio.h"␊ |
10 | #include "efi.h"␊ |
11 | ␊ |
12 | #define UUID_LEN 16␊ |
13 | typedef unsigned char uuid_t[UUID_LEN];␊ |
14 | typedef unsigned char uuid_string_t[sizeof ("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx") ];␊ |
15 | ␊ |
16 | void getStringFromUUID(const uuid_t uuid, uuid_string_t out);␊ |
17 | uuid_t* newUUIDFromString(const char *source);␊ |
18 | void * convertHexStr2Binary(const char *hexStr, int *outLength);␊ |
19 | ␊ |
20 | static inline uint16_t dp_swap16(uint16_t toswap)␊ |
21 | {␊ |
22 | return (((toswap & 0x00FF) << 8) | ((toswap & 0xFF00) >> 8));␊ |
23 | }␊ |
24 | ␊ |
25 | static inline uint32_t dp_swap32(uint32_t toswap)␊ |
26 | {␊ |
27 | return ((toswap & 0x000000FF) << 24) |␊ |
28 | ((toswap & 0x0000FF00) << 8 ) |␊ |
29 | ((toswap & 0x00FF0000) >> 8 ) |␊ |
30 | ((toswap & 0xFF000000) >> 24);␊ |
31 | }␊ |
32 | ␊ |
33 | ␊ |
34 | #endif␊ |
35 | |