File: endian_macros.h

package info (click to toggle)
unmo3 0.6-2
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 320 kB
  • sloc: ansic: 1,013; makefile: 35; sh: 31
file content (13 lines) | stat: -rw-r--r-- 404 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
#ifndef ENDIAN_MACROS_H
#define ENDIAN_MACROS_H 1

/* little endian macro */
#define ifget8(f) ((unsigned long)fgetc(f))
#define ifget16(f) ( ifget8(f) | (ifget8(f)<<8UL) ) 
#define ifget32(f) ( ifget16(f) | (ifget16(f)<<16UL) ) 

#define iget8(p) ((unsigned char)*(p))
#define iget16(p) ( iget8(p) | (iget8(p+1)<<8UL) ) 
#define iget32(p) ( iget16(p) | (iget16(p+2)<<16UL) ) 

#endif // ENDIAN_MACROS_H