#ifndef UNDAR_LIBC_H #define UNDAR_LIBC_H #include #include typedef uint8_t u8; typedef int8_t i8; typedef uint16_t u16; typedef int16_t i16; typedef uint32_t u32; typedef int32_t i32; typedef float f32; #define true 1 #define false 0 #define bool u8 #define nil NULL #define USED(x) ((void)(x)) #define AS_INT(v) ((i32)(v)) #define AS_NAT(v) ((u32)(v)) #define AS_REAL(v) ((i32)(v)) #define FLOAT_TO_REAL(v) (((i32)(v)) * 65536.0f) #define REAL_TO_FLOAT(v) (((f32)(v)) / 65536.0f) void mcpy(u8 *dest, const u8 *src, u32 n); i32 scpy(char* to, const char *from, u32 length); bool seq(const char *s1, const char *s2); bool sleq(const char *s1, const char *s2, u32 length); u32 slen(const char *str); u32 snlen(const char *str, u32 max_len); #endif