VirtualBox

Changeset 11413 in vbox for trunk/include


Ignore:
Timestamp:
Aug 14, 2008 8:03:03 AM (16 years ago)
Author:
vboxsync
Message:

Runtime: small fix to the UUID code, splitting the ClockSeq field and put the UUID variant in the right place. Rest is cleanup and documenting that the IPRT UUIDs are little endian.

Location:
trunk/include/iprt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/types.h

    r11347 r11413  
    11571157/**
    11581158 * UUID data type.
     1159 *
     1160 * @note IPRT defines that the first three integers in the @c Gen struct
     1161 * interpretation are in little endian representation. This is different to
     1162 * many other UUID implementation, and requires conversion if you need to
     1163 * achieve consistent results.
    11591164 */
    11601165typedef union RTUUID
     
    11681173    /** 64-bit view. */
    11691174    uint64_t    au64[2];
    1170     /** The way the UUID is declared by the ext2 guys. */
     1175    /** The way the UUID is declared by the DCE specification. */
    11711176    struct
    11721177    {
     
    11741179        uint16_t    u16TimeMid;
    11751180        uint16_t    u16TimeHiAndVersion;
    1176         uint16_t    u16ClockSeq;
     1181        uint8_t     u8ClockSeqHiAndReserved;
     1182        uint8_t     u8ClockSeqLow;
    11771183        uint8_t     au8Node[6];
    11781184    } Gen;
  • trunk/include/iprt/uuid.h

    r9743 r11413  
    4444 * Generates new UUID value.
    4545 *
     46 * @note IPRT uses little endian byte ordering in the UUID integer fields. If
     47 * you want to pass IPRT UUIDs in binary representation to other UUID libraries
     48 * and expect to get exactly the same string representation as in IPRT, you
     49 * need to convert the first three integer fields (one 32 bit value, two 16 bit
     50 * values) separately to big endian (also called network byte order).
     51 *
     52 * @sa RTUUID::Gen
     53 *
    4654 * @returns iprt status code.
    4755 * @param   pUuid           Where to store generated uuid.
     
    7785 * Compares a UUID value with a UUID string.
    7886 *
     87 * @note IPRT uses little endian byte ordering in the UUID integer fields. If
     88 * you want to pass IPRT UUIDs in binary representation to other UUID libraries
     89 * and expect to get exactly the same string representation as in IPRT, you
     90 * need to convert the first three integer fields (one 32 bit value, two 16 bit
     91 * values) separately to big endian (also called network byte order).
     92 * Correspondingly, if you want to get the right result with UUIDs which are in
     93 * big endian format, you need to convert them before using this function.
     94 *
     95 * @sa RTUUID::Gen
     96 *
    7997 * @returns 0 if eq, < 0 or > 0.
    8098 * @param   pUuid1          First value to compare. NULL is not allowed.
     
    85103/**
    86104 * Converts binary UUID to its string representation.
     105 *
     106 * @note IPRT uses little endian byte ordering in the UUID integer fields. If
     107 * you want to pass IPRT UUIDs in binary representation to other UUID libraries
     108 * and expect to get exactly the same string representation as in IPRT, you
     109 * need to convert the first three integer fields (one 32 bit value, two 16 bit
     110 * values) separately to big endian (also called network byte order).
     111 * Correspondingly, if you want to get the right result with UUIDs which are in
     112 * big endian format, you need to convert them before using this function.
     113 *
     114 * @sa RTUUID::Gen
    87115 *
    88116 * @returns iprt status code.
     
    95123/**
    96124 * Converts UUID from its string representation to binary format.
     125 *
     126 * @note IPRT uses little endian byte ordering in the UUID integer fields. If
     127 * you want to pass IPRT UUIDs in binary representation to other UUID libraries
     128 * and expect to get exactly the same string representation as in IPRT, you
     129 * need to convert the first three integer fields (one 32 bit value, two 16 bit
     130 * values) separately to big endian (also called network byte order).
     131 * Correspondingly, if you want to get the right result with UUIDs which are in
     132 * big endian format, you need to convert them before using this function.
     133 *
     134 * @sa RTUUID::Gen
    97135 *
    98136 * @returns iprt status code.
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette