mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-11-27 21:54:15 +01:00
c8d5b12a12
-fix for issue #6 - now setting 'return to' to 'disable' will properly disable it. -fixed a few strncpy's to make sure the last char is '/0'. to prevent any string overflow even though it shouldn't happen. -other code cleanup
39 lines
779 B
C
39 lines
779 B
C
|
|
#ifndef _UTILS_H_
|
|
#define _UTILS_H_
|
|
|
|
#include <gctypes.h>
|
|
|
|
#define KB_SIZE 1024.0
|
|
#define MB_SIZE 1048576.0
|
|
#define GB_SIZE 1073741824.0
|
|
|
|
#define MAX_FAT_PATH 1024
|
|
|
|
#define round_up(x,n) (-(-(x) & -(n)))
|
|
|
|
#define ALIGN(n, x) (((x) + (n - 1)) & ~(n - 1))
|
|
#define ALIGN32(x) (((x) + 31) & ~31)
|
|
|
|
#define TITLE_ID(x,y) (((u64)(x) << 32) | (y))
|
|
#define TITLE_UPPER(x) ((u32)((x) >> 32))
|
|
#define TITLE_LOWER(x) ((u32)(x) & 0xFFFFFFFF)
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif /* __cplusplus */
|
|
|
|
/* Prototypes */
|
|
u64 le64(u64);
|
|
u32 le32(u32);
|
|
u16 le16(u16);
|
|
|
|
bool str_replace(char *str, const char *olds, const char *news, int size);
|
|
bool str_replace_all(char *str, const char *olds, const char *news, int size);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif /* __cplusplus */
|
|
|
|
#endif
|