Types.h File Reference

Used for types used by RSA. More...


Namespaces

namespace  cat

Classes

class  cat::rect< T >
class  cat::AutoArray< T >
class  cat::Automatic< T >
class  cat::NoCopies

Defines

#define FALSE   false
#define TRUE   true
#define COM_RELEASE(ref)   if (ref) { (ref)->Release(); (ref) = 0; }
#define SINGLE_RELEASE(ref)   if (ref) { delete (ref); (ref) = 0; }
#define ARRAY_RELEASE(ref)   if (ref) { delete [](ref); (ref) = 0; }
#define BOSWAP32(n)   ( ((n) << 24) | (((n) & 0x00ff0000) >> 8) | (((n) & 0x0000ff00) << 8) | ((n) >> 24) )
#define BOSWAP16(n)   ( ((n) << 8) | ((n) >> 8) )
#define swapBE(n)
#define getBE(n)   (n)
#define ROL8(n, r)   ( ((n) << (r)) | ((n) >> ( 8 - (r))) )
#define ROR8(n, r)   ( ((n) >> (r)) | ((n) << ( 8 - (r))) )
#define ROL16(n, r)   ( ((n) << (r)) | ((n) >> (16 - (r))) )
#define ROR16(n, r)   ( ((n) >> (r)) | ((n) << (16 - (r))) )
#define ROL32(n, r)   ( ((n) << (r)) | ((n) >> (32 - (r))) )
#define ROR32(n, r)   ( ((n) >> (r)) | ((n) << (32 - (r))) )
#define MEMADD32(ptr, len, val)
#define STRNCPY(dest, src, size)
#define MEMCLR(dest, size)   memset(dest, 0, size)
#define OBJCLR(object)   memset(&(object), 0, sizeof(object))
#define _C1B_INTERMED(n)   ( (n) - (((n) >> 1) & 033333333333) - (((n) >> 2) & 011111111111) )
#define COUNT1BITS32(n)   ( ((_C1B_INTERMED(n) + (_C1B_INTERMED(n) >> 3)) & 030707070707) % 63 )
#define AT_LEAST_2_BITS(n)   ( (n) & ((n) - 1) )
#define LEAST_SIGNIFICANT_BIT(n)   ( (n) & -(n) )
#define IS_POWER_OF_2(n)   ( n && !AT_LEAST_2_BITS(n) )
#define CEIL_UNIT(n, width)   ( ( (n) + (width) - 1 ) / (width) )
#define CEIL(n, width)   ( CEIL_UNIT(n, width) * (width) )

Typedefs

typedef unsigned char cat::u8
typedef signed char cat::s8
typedef unsigned short cat::u16
typedef signed short cat::s16
typedef unsigned int cat::u32
typedef signed int cat::s32
typedef float cat::f32
typedef double cat::f64
typedef s32 cat::sfp22_10
typedef u32 cat::ufp22_10
typedef s32 cat::sfp16_16
typedef u32 cat::ufp16_16

Functions

INLINE void cat::swapLE (u32 &n)
INLINE void cat::swapLE (u16 &n)
INLINE u32 cat::getLE (u32 n)
INLINE u16 cat::getLE (u16 n)
INLINE void cat::swapLE (s32 &n)
INLINE void cat::swapLE (s16 &n)
INLINE s32 cat::getLE (s32 n)
INLINE s16 cat::getLE (s16 n)
INLINE cat::u32 next_highest_power_of_2 (cat::u32 n)


Detailed Description

Used for types used by RSA.

/// Fundamental tools & types
///
/// Catid(cat02e@fsu.edu)
///
/// 8/9/2004 Added SINGLE/ARRAY_RELEASE
/// 8/5/2004 Added COMPILER_ preprocessors
///    class NoCopies
/// 8/1/2004 Removed mask stuff
/// 7/29/2004 Added swapLE, swapBE, getLE, getBE
/// 7/28/2004 Automatic and AutoArray now compile in dev-c++
///    Added pre-processor conditions to support 
///    other compilers
///    Removed GETWORD and GETDWORD
/// 7/15/2004 Now using COM_RELEASE throughout CatGL3
/// 6/22/2004 Removed triple and pair
/// 6/12/2004 AutoDeallocate -> Automatic, AutoArray
/// 6/9/2004 OBJCLR
/// 5/2/2004 class AutoDeallocate
/// 5/1/2004 IS_POWER_OF_2, next_highest_power_of_2
/// 4/30/2004 Merged character manip macros
/// 2/23/2004 CEIL*
///    Removed MEMCOPY32 and MEMCLEAR32,
///    memcpy and memset are now faster
///    MAKE_MASK
/// 2/10/2004 LITTLE_ENDIAN
///    COUNT1BITS32
///    AT_LEAST_2_BITS
///    LEAST_SIGNIFICANT_BIT
/// X-mas/2003 [u/s]int?? -> [u/s]??
/// 7/3/2003 Added template triple, point->pair
/// 6/15/2003 Added template rect, point
/// 3/30/2003 Added RO?8, RO?16 and ?int64
///    Added MEMCOPY32 and MEMCLEAR32
/// 3/12/2003 Added GETWORD and GETDWORD
/// 1/16/2003 Formalized this library.
///
/// Tabs: 4 spaces
/// Dist: public
/// 

Define Documentation

#define FALSE   false
 

Define an alias between FALSE and false

#define MEMADD32 ptr,
len,
val   ) 
 

Value:

{ \
        register u32 *__data = (u32*)(ptr); /* pointer to data to clear */ \
        register s32 __length = (len); /* number of 32-bit blocks */ \
        \
        switch (__length % 8) \
{ \
        case 0: do { *__data++ += (val); \
        case 7:   *__data++ += (val); \
        case 6:   *__data++ += (val); \
        case 5:   *__data++ += (val); \
        case 4:   *__data++ += (val); \
        case 3:   *__data++ += (val); \
        case 2:   *__data++ += (val); \
        case 1:   *__data++ += (val); \
        __length -= 8; \
                        } while(__length > 0); \
} \
}

#define STRNCPY dest,
src,
size   ) 
 

Value:

{ \
        strncpy(dest, src, size); \
        dest[size-1] = 0; \
}
Safe null-terminated string -> char buffer copy
Parameters:
dest the resulting string
src the string to copy
size the number of char to copy

#define TRUE   true
 

Define an alias between TRUE and true


Generated on Sat Oct 14 08:37:37 2006 for RakNet by  doxygen 1.4.6-NO