first commit

This commit is contained in:
snarmph 2021-09-30 17:42:28 +02:00
commit efd4d9c750
13 changed files with 1950 additions and 0 deletions

31
strutils.h Normal file
View file

@ -0,0 +1,31 @@
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
#include <string.h>
#if _WIN32
#define stricmp _stricmp
#elif __unix__ || __APPLE__
#define stricmp strcasecmp
#else
#error "stricmp is not supported"
#endif
// prefix str -> changes string
// prefix cstr -> allocates new string and returns it
// int str
void strToLower(char *str);
void strnToLower(char *str, size_t len);
char *cstrdup(const char *str);
char *cstrToLower(const char *str);
#ifdef __cplusplus
} // extern "C"
#endif