12 #ifndef AD_IO_INLINE_H
13 #define AD_IO_INLINE_H
15 #ifndef STATIC_ASSERT_H
24 unsigned char as_char[4];
31 swap(data.as_char[0], data.as_char[3]);
32 swap(data.as_char[1], data.as_char[2]);
34 return data.as_uint32;
39 ASSERT_RESULT(
size_t, 1, fwrite(&data,
sizeof(data), 1, out));
56 GBK_terminate(
"32/64bit incompatibility detected in DB-engine, please inform devel@arb-home.de");
59 typedef unsigned char uc;
66 if (b3 >= 0x10) putc(0xf0, out);
81 unsigned int b0 = getc(in);
82 unsigned int RES = b0;
86 RES = (RES << 8) | getc(in);
88 RES = (RES << 8) | getc(in);
89 if (b0 & 0x10) RES = (RES << 8) | getc(in);
90 else RES |= (b0 & 0x0f) << 24;
92 else RES |= (b0 & 0x1f) << 16;
94 else RES |= (b0 & 0x3f) << 8;
101 #error ad_io_inline.h included twice
102 #endif // AD_IO_INLINE_H
void gb_put_number(long b0, FILE *out)
long gb_get_number(FILE *in)
#define ASSERT_RESULT(Type, Expected, Expr)
void gb_write_out_uint32(uint32_t data, FILE *out)
#define CONSTEXPR_INLINE_Cxx14
uint32_t reverse_byteorder(uint32_t val)
void GBK_terminate(const char *error) __ATTR__NORETURN
CONSTEXPR_INLINE_Cxx14 void swap(unsigned char &c1, unsigned char &c2)
#define STATIC_ASSERT(const_expression)
uint32_t gb_read_in_uint32(FILE *in, bool reversed)