uncart/source/common.h
2015-05-11 03:08:32 -04:00

38 lines
819 B
C

#pragma once
#include <inttypes.h>
#include <stddef.h>
#include <stdbool.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
typedef int8_t s8;
typedef int16_t s16;
typedef int32_t s32;
typedef int64_t s64;
typedef volatile u8 vu8;
typedef volatile u16 vu16;
typedef volatile u32 vu32;
typedef volatile u64 vu64;
inline char* strupper(const char* str) {
char* buffer = (char*)malloc(strlen(str) + 1);
for (int i = 0; i < strlen(str); ++i)
buffer[i] = toupper((unsigned)str[i]);
return buffer;
}
inline char* strlower(const char* str) {
char* buffer = (char*)malloc(strlen(str) + 1);
for (int i = 0; i < strlen(str); ++i)
buffer[i] = tolower((unsigned)str[i]);
return buffer;
}