Repository navigation
Expand file tree
/
Copy pathutils.h
More file actions
99 lines (77 loc) · 2.79 KB
/
Copy pathutils.h
File metadata and controls
99 lines (77 loc) · 2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/**
* \file utils.h
* \brief DreamShell utils
* \date 2004-2026
* \author SWAT www.dc-swat.ru
*/
#ifndef _DS_UTILS_H
#define _DS_UTILS_H
#include <stddef.h>
#include <stdio.h>
/* Macros v2 for accessing/creating DreamShell version codes */
#define DS_VER_MAJOR(v) ((v >> 24) & 0xff)
#define DS_VER_MINOR(v) ((v >> 16) & 0xff)
#define DS_VER_MICRO(v) ((v >> 8) & 0xff)
#define DS_VER_BUILD(v) ((v >> 0) & 0xff)
/* Divide build to type and number (if build counter is not used) */
#define DS_VER_BUILD_TYPE(b) ((b & 0xf0) / 0xf)
#define DS_VER_BUILD_TYPE_STR(b) (GetVersionBuildTypeString(DS_VER_BUILD_TYPE(b)))
#define DS_VER_BUILD_NUM(b) (b & 0x0f)
enum {
DS_VER_BUILD_TYPE_APLHA = 0,
DS_VER_BUILD_TYPE_BETA,
DS_VER_BUILD_TYPE_RC,
DS_VER_BUILD_TYPE_RELEASE
};
#define DS_MAKE_VER(MAJOR, MINOR, MICRO, BUILD) \
( (((MAJOR) & 0xff) << 24) \
| (((MINOR) & 0xff) << 16) \
| (((MICRO) & 0xff) << 8) \
| (((BUILD) & 0xff) << 0) )
/* Return 0 if error */
int FileSize(const char *fn);
int FileExists(const char *fn);
int DirExists(const char *dir);
int PeriphExists(const char *name);
int CopyFile(const char *src_fn, const char *dest_fn, int verbose);
int CopyDirectory(const char *src_path, const char *dest_path, int verbose);
int RemoveDirectory(const char *path, int verbose);
void arch_shutdown();
#define FLASHROM_REGION_KOREA 4
int flashrom_get_region_only();
int is_hacked_bios();
int is_custom_bios();
int is_no_syscalls();
int is_dreamcast();
int is_naomi();
int is_naomi_2();
uint32_t gzip_get_file_size(const char *filename);
void dbgio_set_dev_ds();
void dbgio_set_dev_scif();
void dbgio_set_dev_fb();
void dbgio_set_dev_sd();
void dbgio_hex_dump(char *desc, void *addr, int len);
char *realpath(const char *path, char *resolved);
int makeabspath_wd(char *buff, char *path, char *dir, size_t size);
const char *relativeFilePath(const char *rel, const char *file);
int relativeFilePath_wb(char *buff, const char *rel, const char *file);
char *getFilePath(const char *file);
int mkpath(const char *path);
void readstr(FILE *f, char *string);
int splitline(char **argv, int max, char *line);
int hex_to_int(char c);
char *strtolower(char *str);
char *strsep(char **stringp, const char *delim);
char* substring(const char* str, size_t begin, size_t len);
char *fix_path_spaces(char *str);
#if defined(__STRICT_ANSI__)
char *strndup(const char *, size_t);
#endif
/* Optimized memory utils */
void *memcpy_sh4(void *dest, const void *src, size_t count);
void *memmove_sh4(void *dest, const void *src, size_t count);
void *memset_sh4(void *dest, uint32_t val, size_t count);
#ifndef strcasestr
char *strcasestr(const char *str1, const char *str2);
#endif
#endif /*_DS_UTILS_H */