次の UUID 構造体がある場合:
typedef unsigned long unsigned32;
typedef unsigned short unsigned16;
typedef unsigned char unsigned8;
typedef unsigned char byte;
typedef struct {
unsigned32 time_low;
unsigned16 time_mid;
unsigned16 time_hi_and_version;
unsigned8 clock_seq_hi_and_reserved;
unsigned8 clock_seq_low;
byte node[6];
} uuid_t;
それをcharとして表現することは可能でしょうか?そのような:
unsigned char uuid[128];
その場合、次のような値をどのように操作しますか。
uuid.time_low = htonl(uuid.time_low); //uuid[0...32] = htonl(uuid[0...32])?
uuid.time_mid = htons(uuid.time_mid); //uuid[33...48] = htonl(uuid[33...48])?
uuid.time_hi_and_version = htons(uuid.time_hi_and_version); //uuid[49...64] = htonl(uuid[49...64])?
だから私の質問は、実際のコードで以下の例を実際にどのように実装するかです:
uuid[0...32] = htonl(uuid[0...32])
私は正しい軌道に乗っていますか?どんな提案でも大歓迎です!