00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <string.h>
00022 #include <stdio.h>
00023 #include "sysdep.h"
00024 #include "uuid.h"
00025 #include "uuidlib.h"
00026
00027 int main(int argc, char **argv) {
00028 char *guid, *uuid;
00029 uuid__t u;
00030 int i;
00031
00032 guid = (char *) malloc(36);
00033 uuid = (char *) malloc(22);
00034
00035
00036 strcpy(guid,"f65bd198-8dd1-11b2-85ed-931411acf515");
00037 printf("guid is - %s\n",guid);
00038
00039 fn_squash_guid(guid,uuid);
00040 printf("uuid is - %s\n",uuid);
00041
00042 fn_expand_uuid(uuid,guid);
00043 printf("guid id - %s\n",guid);
00044
00045 return 0;
00046 }
00047
00048 void puid(uuid__t* u) {
00049 int i;
00050
00051 printf("%8.8x-%4.4x-%4.4x-%2.2x%2.2x-", u->time_low, u->time_mid,
00052 u->time_hi_and_version, u->clock_seq_hi_and_reserved,
00053 u->clock_seq_low);
00054 for (i = 0; i < 6; i++)
00055 printf("%2.2x", u->node[i]);
00056 printf("\n");
00057 };
00058