bittypes.h File Reference

#include <stdio.h>
#include <sys/types.h>

Go to the source code of this file.

Defines

#define TRUE   (1==1)
#define FALSE   (1==0)
#define HOST_BYTE_ORDER   0
#define SWAPPED_HOST_BYTE_ORDER   1
#define NTAR_ALIGN_XBYTES(a, bytes)   (((a) + (bytes-1)) & (~(bytes-1)))
 Macro used to align an integer to x bytes in excess.
#define NTAR_ALIGN_32BITS(a)   NTAR_ALIGN_XBYTES(a,4)
 Macro used to align an integer to 32 bits in excess.
#define NTAR_ALIGN_64BITS(a)   NTAR_ALIGN_XBYTES(a,8)
 Macro used to align an integer to 64 bits in excess.
#define NTAR_ALIGN_NATIVE(a)   NTAR_ALIGN_XBYTES(a, sizeof(void*))
#define NTAR_SWAP_64BITS(a)
#define NTAR_SWAP_16BITS(a)
#define NTAR_SWAP_32BITS(a)
#define u_int32   u_int32_t
#define int32   int32_t
#define u_int16   u_int16_t
#define int16   int16_t
#define u_int8   u_int8_t
#define int8   int8_t
#define u_int64   u_int64_t
#define int64   int64_t

Typedefs

typedef int64 ntar_foff


Define Documentation

#define FALSE   (1==0)
 

#define HOST_BYTE_ORDER   0
 

#define int16   int16_t
 

#define int32   int32_t
 

#define int64   int64_t
 

#define int8   int8_t
 

#define NTAR_ALIGN_32BITS  )     NTAR_ALIGN_XBYTES(a,4)
 

Macro used to align an integer to 32 bits in excess.

#define NTAR_ALIGN_64BITS  )     NTAR_ALIGN_XBYTES(a,8)
 

Macro used to align an integer to 64 bits in excess.

#define NTAR_ALIGN_NATIVE  )     NTAR_ALIGN_XBYTES(a, sizeof(void*))
 

#define NTAR_ALIGN_XBYTES a,
bytes   )     (((a) + (bytes-1)) & (~(bytes-1)))
 

Macro used to align an integer to x bytes in excess.

#define NTAR_SWAP_16BITS  ) 
 

Value:

((u_int16)(\
                                (((a) & 0xFF00) >> 8) +\
                                (((a) & 0x00FF) << 8)\
                            ))

#define NTAR_SWAP_32BITS  ) 
 

Value:

((u_int32)(\
                                (((a) & 0x000000FF) << 24) +\
                                (((a) & 0x0000FF00) << 8) +\
                                (((a) & 0x00FF0000) >> 8) +\
                                (((a) & 0xFF000000) >> 24)\
                            ))

#define NTAR_SWAP_64BITS  ) 
 

Value:

(\
                                (((a) & 0xFF00000000000000LL) >> 56) +\
                                (((a) & 0x00FF000000000000LL) >> 40) +\
                                (((a) & 0x0000FF0000000000LL) >> 24) +\
                                (((a) & 0x000000FF00000000LL) >> 8)  +\
                                (((a) & 0x00000000FF000000LL) << 8)  +\
                                (((a) & 0x0000000000FF0000LL) << 24) +\
                                (((a) & 0x000000000000FF00LL) << 40) +\
                                (((a) & 0x00000000000000FFLL) << 56) \
                            )

#define SWAPPED_HOST_BYTE_ORDER   1
 

#define TRUE   (1==1)
 

#define u_int16   u_int16_t
 

#define u_int32   u_int32_t
 

#define u_int64   u_int64_t
 

#define u_int8   u_int8_t
 


Typedef Documentation

typedef int64 ntar_foff
 


NTAR documentation. Copyright (c) 2004 - 2005 Condor Engineering, Inc. All rights reserved.