// Common header for tinyff library // Not recommended to be included directly #ifndef TINYFF_COMMON_H #define TINYFF_COMMON_H #include #include // Flags typedef bool ff_flag; #define FF_ENABLE true #define FF_DISABLE false // Functions static inline uint32_t get_big_endian(const uint8_t *buffer) { return (uint32_t)(buffer[0] << 24) | (uint32_t)(buffer[1] << 16) | (uint32_t)(buffer[2] << 8) | (uint32_t)(buffer[3]); } static inline uint32_t get_little_endian(const uint8_t *buffer) { return (uint32_t)(buffer[0]) | (uint32_t)(buffer[1] << 8) | (uint32_t)(buffer[2] << 16) | (uint32_t)(buffer[3] << 24); } #endif