mirror of
https://github.com/Karaka-Management/cOMS.git
synced 2026-01-10 19:08:39 +00:00
bug fixes
This commit is contained in:
parent
15c1033d3f
commit
7d48cfaa37
|
|
@ -10,10 +10,28 @@
|
|||
#define COMS_DATABASE_TYPE_H
|
||||
|
||||
enum DatabaseType : byte {
|
||||
DB_TYPE_UNKNOWN,
|
||||
DB_TYPE_SQLITE,
|
||||
DB_TYPE_MARIA,
|
||||
DB_TYPE_PSQL,
|
||||
DB_TYPE_MSSQL
|
||||
};
|
||||
|
||||
DatabaseType database_type_from_string(const char* str)
|
||||
{
|
||||
if (str_compare(str, "sqlite", sizeof("sqlite") - 1) == 0) {
|
||||
return DB_TYPE_SQLITE;
|
||||
} else if (str_compare(str, "mariadb", sizeof("mariadb") - 1) == 0) {
|
||||
return DB_TYPE_MARIA;
|
||||
} else if (str_compare(str, "mysql", sizeof("mysql") - 1) == 0) {
|
||||
return DB_TYPE_MARIA;
|
||||
} else if (str_compare(str, "psql", sizeof("psql") - 1) == 0) {
|
||||
return DB_TYPE_PSQL;
|
||||
} else if (str_compare(str, "mssql", sizeof("mssql") - 1) == 0) {
|
||||
return DB_TYPE_MSSQL;
|
||||
}
|
||||
|
||||
return DB_TYPE_UNKNOWN;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -861,7 +861,7 @@ void iterate_directory(const char* base_path, const char* file_ending, void (*ha
|
|||
if (!str_ends_with(base_path, "/")) {
|
||||
str_concat_append(full_path, "/");
|
||||
}
|
||||
str_concat_append(full_path, entry->d_name);
|
||||
str_concat_append(full_path, find_file_data.cFileName);
|
||||
|
||||
if (find_file_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
|
||||
iterate_directory(full_path, file_ending, handler, args);
|
||||
|
|
|
|||
|
|
@ -829,9 +829,8 @@ int32 str_copy_until(char* __restrict dest, const char* __restrict src, char del
|
|||
return len;
|
||||
}
|
||||
|
||||
// @todo Inconsistent parameter order of dest and src with other functions
|
||||
inline
|
||||
void str_copy_until(const char* __restrict src, char* __restrict dest, const char* __restrict delim) noexcept
|
||||
void str_copy_until(char* __restrict dest, const char* __restrict src, const char* __restrict delim) noexcept
|
||||
{
|
||||
size_t len = str_length(delim);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user