mirror of
https://github.com/ondra-novak/gates_of_skeldal.git
synced 2025-09-05 11:25:59 -04:00
changed savegame
This commit is contained in:
parent
ea1ef2cb84
commit
e1967ded4f
14 changed files with 370 additions and 119 deletions
|
@ -15,6 +15,22 @@ int istrcmp(const char *a, const char *b) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int istrncmp(const char *a, const char *b, size_t sz) {
|
||||
while (*a && *b && sz) {
|
||||
char ca = toupper(*a);
|
||||
char cb = toupper(*b);
|
||||
if (ca<cb) return -1;
|
||||
if (ca>cb) return 1;
|
||||
++a;
|
||||
++b;
|
||||
--sz;
|
||||
}
|
||||
if (sz == 0) return 0;
|
||||
if (*a) return 1;
|
||||
if (*b) return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void strupper(char *c) {
|
||||
while (*c) {
|
||||
*c = toupper(*c);
|
||||
|
|
|
@ -88,6 +88,7 @@ FILE *fopen_icase(const char *pathname, const char *mode);
|
|||
const char *file_icase_find(const char *pathname);
|
||||
|
||||
int istrcmp(const char *a, const char *b);
|
||||
int istrncmp(const char *a, const char *b, size_t sz);
|
||||
int imatch(const char *haystack, const char *needle);
|
||||
const char *strcopy_n(char *target, const char *source, int target_size);
|
||||
#define MIN(a, b) ((a)<(b)?(a):(b))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue