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.


#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))


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.

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,

Return maximum value

#define min a,

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.

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

void hton_us iu16   us,
iu8    num

Byte swap multiple shorts.

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.