diff options
author | Darkvater <darkvater@openttd.org> | 2006-08-04 23:45:20 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2006-08-04 23:45:20 +0000 |
commit | b5e3718ac4ead73a7b7bb9fd694cae5d9aaefa7b (patch) | |
tree | 8366278d35f2187288e8d53bf4fc9e043e630808 /win32.c | |
parent | 4de30befaee2141e410bf0df5d5f7e3906bc0111 (diff) | |
download | openttd-b5e3718ac4ead73a7b7bb9fd694cae5d9aaefa7b.tar.xz |
(svn r5763) - Cleanup: Move the now unified GetLanguageList and comparator function to strings.c where it belongs.
Diffstat (limited to 'win32.c')
-rw-r--r-- | win32.c | 28 |
1 files changed, 0 insertions, 28 deletions
@@ -1097,34 +1097,6 @@ bool FileExists(const char *filename) return true; } -static int CDECL LanguageCompareFunc(const void *a, const void *b) -{ - return strcmp(*(const char* const *)a, *(const char* const *)b); -} - -int GetLanguageList(char **languages, int max) -{ - HANDLE hand; - int num = 0; - char filedir[MAX_PATH]; - WIN32_FIND_DATA fd; - sprintf(filedir, "%s*.lng", _path.lang_dir); - - hand = FindFirstFile(filedir, &fd); - if (hand != INVALID_HANDLE_VALUE) { - do { - if (!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { - languages[num++] = strdup(fd.cFileName); - if (num == max) break; - } - } while (FindNextFile(hand, &fd)); - FindClose(hand); - } - - qsort(languages, num, sizeof(char*), LanguageCompareFunc); - return num; -} - static int ParseCommandLine(char *line, char **argv, int max_argc) { int n = 0; |