TUM-Logo

libRASCH

 

Home
 

General

About libRASCH/News
Design
Screen shots
Sample programs (with source code)
License
 

Download

libRASCH
Tools
 

Documentation

User
Developer
 

Resources

Mailing list
Supported Formats
Plugins
Status
Links
 
Contact
About this site
 
Last updated
Tue Mar 27 23:03:52 2007
libRASCH: ra_endian.h File Reference

ra_endian.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define RA_LITTLE_ENDIAN   1
#define RA_BIG_ENDIAN   2
#define _swap16(x, l)
#define _swap32(x, l)
#define be16_to_cpu(x)   _swap16(x,0)
#define be32_to_cpu(x)   _swap32(x,0)
#define le16_to_cpu(x)   _swap16(x,1)
#define le32_to_cpu(x)   _swap32(x,1)


Detailed Description

The header file contains macros handling endian issues.

Author:
Raphael Schneider (rasch@med1.med.tum.de)

Definition in file ra_endian.h.


Define Documentation

#define _swap16 x,
 ) 
 

Value:

do {                                                  short endian_t = x;                                     int endian_type = get_endian_type();                                                                    if (l && (endian_type == RA_LITTLE_ENDIAN))              break;                                         if (!l && (endian_type == RA_BIG_ENDIAN))                break;                                                                                             x = ((endian_t & 0x00ff) << 8) |                        ((endian_t & 0xff00) >> 8);                   } while(0)

Definition at line 28 of file ra_endian.h.

#define _swap32 x,
 ) 
 

Value:

do {                                                  long endian_t = x;                                      int endian_type = get_endian_type();                                                                    if (l && (endian_type == RA_LITTLE_ENDIAN))              break;                                         if (!l && (endian_type == RA_BIG_ENDIAN))                break;                                                                                             x = ((endian_t & 0x000000ff) << 24) |                   ((endian_t & 0x0000ff00) << 8)  |                   ((endian_t & 0x00ff0000) >> 8)  |                   ((endian_t & 0xff000000) >> 24);              } while(0)

Definition at line 42 of file ra_endian.h.

#define be16_to_cpu  )     _swap16(x,0)
 

Definition at line 59 of file ra_endian.h.

#define be32_to_cpu  )     _swap32(x,0)
 

Definition at line 60 of file ra_endian.h.

#define le16_to_cpu  )     _swap16(x,1)
 

Definition at line 62 of file ra_endian.h.

#define le32_to_cpu  )     _swap32(x,1)
 

Definition at line 63 of file ra_endian.h.

#define RA_BIG_ENDIAN   2
 

Definition at line 26 of file ra_endian.h.

Referenced by set_endian_type().

#define RA_LITTLE_ENDIAN   1
 

Definition at line 25 of file ra_endian.h.

Referenced by set_endian_type().


Generated on Fri May 27 11:33:17 2005 for libRASCH by  doxygen 1.4.2