Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

tools.h File Reference

Tool declarations. More...

#include <config.h>
#include <types.h>

Go to the source code of this file.

Defines

#define swap_us(us)   (((us&0x00FF)<<8)|((us&0xFF00)>>8))
 Byte swap single short. More...

#define swap_ul(ul)   (((ul&0x000000FF)<<24)|((ul&0x0000FF00)<<8)|((ul&0x00FF0000)>>8)|((ul&0xFF000000)>>24))
 Byte swap single long. More...

#define hton_us(us)
#define hton_ul(ul)
#define min(a, b)   ((a)<(b)?(a):(b))
#define max(a, b)   ((a)>(b)?(a):(b))

Functions

void hton_us (iu16 *us, iu8 num)
 Byte swap multiple shorts. More...

void hton_ul (iu32 *ul, iu8 num)
 Byte swap multiple longs. More...


Detailed Description

Tool declarations.

Id:
tools.h,v 1.11 2002/12/22 15:42:56 m Exp


Define Documentation

#define hton_ul ul   
 

#define hton_us us   
 

#define max a,
     ((a)>(b)?(a):(b))
 

Return maximum value

#define min a,
     ((a)<(b)?(a):(b))
 

Return minimum value

#define swap_ul ul       (((ul&0x000000FF)<<24)|((ul&0x0000FF00)<<8)|((ul&0x00FF0000)>>8)|((ul&0xFF000000)>>24))
 

Byte swap single long.

#define swap_us us       (((us&0x00FF)<<8)|((us&0xFF00)>>8))
 

Byte swap single short.


Function Documentation

void hton_ul iu32   ul,
iu8    num
 

Byte swap multiple longs.

Parameters:
ul  Pointer to an array of longs.
num  Number of longs to process.

void hton_us iu16   us,
iu8    num
 

Byte swap multiple shorts.

Parameters:
us  Pointer to an array of shorts.
num  Number of shorts to process.


Copyright 2002 by Matthias Bruestle. This is licensed under the GNU General Public License.