diff options
Diffstat (limited to 'src/guid.c')
-rw-r--r-- | src/guid.c | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -72,6 +72,33 @@ guid_to_a (GUID g) return ret; } +char * +guid_to_a_simple (GUID g) +{ + char *ret = malloc (GUIDTOARETSIZE); + struct known_struct *ptr = known_guids; + + + while (ptr->name) + { + if (!guid_cmp (&g, &ptr->g)) + { + strcpy (ret, ptr->name); + return ret; + } + ptr++; + } + + snprintf (ret, GUIDTOARETSIZE, + "%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X", + g.d[3], g.d[2], g.d[1], g.d[0], g.d[5], g.d[4], g.d[7], g.d[6], + g.d[8], g.d[9], g.d[10], g.d[11], g.d[12], g.d[13], g.d[14], + g.d[15]); + + return ret; +} + + int a_to_guid (char *a, GUID * g) { |