Annotation of truecrypt/common/endian.h, revision 1.1

1.1     ! root        1: /* Copyright (C) 2004 TrueCrypt Team, truecrypt.org
        !             2:    This product uses components written by Paul Le Roux <[email protected]> */
        !             3: 
        !             4: #define mputLong(memPtr,data) \
        !             5:        *memPtr++ = ( unsigned char ) ( ( ( data ) >> 24 ) & 0xFF ), \
        !             6:        *memPtr++ = ( unsigned char ) ( ( ( data ) >> 16 ) & 0xFF ), \
        !             7:        *memPtr++ = ( unsigned char ) ( ( ( data ) >> 8 ) & 0xFF ), \
        !             8:        *memPtr++ = ( unsigned char ) ( ( data ) & 0xFF )
        !             9: 
        !            10: #define mputWord(memPtr,data) \
        !            11:        *memPtr++ = ( unsigned char ) ( ( ( data ) >> 8 ) & 0xFF ), \
        !            12:        *memPtr++ = ( unsigned char ) ( ( data ) & 0xFF )
        !            13: 
        !            14: #define mputByte(memPtr,data)  \
        !            15:        *memPtr++ = ( unsigned char ) data
        !            16: 
        !            17: #define mputBytes(memPtr,data,len)  \
        !            18:        memcpy (memPtr,data,len); \
        !            19:        memPtr += len;
        !            20: 
        !            21: /* Macros to read and write 16 and 32-bit quantities in a portable manner.
        !            22:    These functions are implemented as macros rather than true functions as
        !            23:    the need to adjust the memory pointers makes them somewhat painful to call
        !            24:    in user code */
        !            25: 
        !            26: #define mgetLong(memPtr)               \
        !            27:        ( memPtr += 4, ( ( unsigned long ) memPtr[ -4 ] << 24 ) | ( ( unsigned long ) memPtr[ -3 ] << 16 ) | \
        !            28:          ( ( unsigned long ) memPtr[ -2 ] << 8 ) | ( unsigned long ) memPtr[ -1 ] )
        !            29: 
        !            30: #define mgetWord(memPtr)               \
        !            31:        ( memPtr += 2, ( unsigned short ) memPtr[ -2 ] << 8 ) | ( ( unsigned short ) memPtr[ -1 ] ) 
        !            32: 
        !            33: #define mgetByte(memPtr)               \
        !            34:        ( ( unsigned char ) *memPtr++ )
        !            35: 
        !            36: 
        !            37: #define LITTLE_ENDIAN 1
        !            38: 
        !            39: /* Everything below this line is automatically updated by the -mkproto-tool- */
        !            40: 
        !            41: void LongReverse ( unsigned long *buffer , unsigned byteCount );

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.