2022-05-28 01:57:32 -07:00
|
|
|
#ifndef PLATFORM_COMPAT_H
|
|
|
|
#define PLATFORM_COMPAT_H
|
|
|
|
|
2022-05-28 02:49:55 -07:00
|
|
|
#include <stddef.h>
|
|
|
|
|
2022-05-28 01:57:32 -07:00
|
|
|
// TODO: This is compatibility cross-platform layer. Designed to have minimal
|
|
|
|
// impact on the codebase. Remove once it's no longer needed.
|
|
|
|
|
2022-05-28 02:34:49 -07:00
|
|
|
// A naive cross-platform MAX_PATH/PATH_MAX/MAX_PATH drop-in replacement.
|
|
|
|
//
|
|
|
|
// TODO: Remove when we migrate to use std::filesystem::path or std::string to
|
|
|
|
// represent paths across the codebase.
|
|
|
|
#define COMPAT_MAX_PATH 260
|
|
|
|
|
2022-05-28 13:17:48 -07:00
|
|
|
#define COMPAT_MAX_DRIVE 3
|
|
|
|
#define COMPAT_MAX_DIR 256
|
|
|
|
#define COMPAT_MAX_FNAME 256
|
|
|
|
#define COMPAT_MAX_EXT 256
|
|
|
|
|
2022-05-28 01:57:32 -07:00
|
|
|
int compat_stricmp(const char* string1, const char* string2);
|
|
|
|
int compat_strnicmp(const char* string1, const char* string2, size_t size);
|
|
|
|
char* compat_strupr(char* string);
|
|
|
|
char* compat_strlwr(char* string);
|
|
|
|
char* compat_itoa(int value, char* buffer, int radix);
|
2022-05-28 13:17:48 -07:00
|
|
|
void compat_splitpath(const char* path, char* drive, char* dir, char* fname, char* ext);
|
|
|
|
void compat_makepath(char* path, const char* drive, const char* dir, const char* fname, const char* ext);
|
2022-05-28 14:22:40 -07:00
|
|
|
long compat_filelength(int fd);
|
2022-05-29 08:08:55 -07:00
|
|
|
int compat_mkdir(const char* path);
|
2022-05-28 01:57:32 -07:00
|
|
|
|
|
|
|
#endif /* PLATFORM_COMPAT_H */
|