7 typedef unsigned int uint;
14 #define MIN(x,y) ((x) < (y) ? (x) : (y))
15 #define MAX(x,y) ((x) > (y) ? (x) : (y))
17 #define UNUSED __attribute__((unused))
19 static inline uint get_u16_le(byte *p)
21 return (p[1] << 8) | p[0];
24 static inline uint get_u16_be(byte *p)
26 return (p[0] << 8) | p[1];
29 static inline uint get_u32_le(byte *p)
31 return (p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0];
34 static inline uint get_u32_be(byte *p)
36 return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
39 static inline void put_u16_le(byte *p, u16 x)
45 static inline void put_u16_be(byte *p, u16 x)
51 static inline void put_u32_be(byte *p, u32 x)
54 p[1] = (x >> 16) & 0xff;
55 p[2] = (x >> 8) & 0xff;
59 static inline void put_u32_le(byte *p, u32 x)
62 p[2] = (x >> 16) & 0xff;
63 p[1] = (x >> 8) & 0xff;
69 void debug_printf(const char *fmt, ...);
70 void debug_puts(const char *s);
71 void debug_putc(int c);