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 /unix.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 'unix.c')
-rw-r--r-- | unix.c | 28 |
1 files changed, 0 insertions, 28 deletions
@@ -414,34 +414,6 @@ bool FileExists(const char *filename) return access(filename, 0) == 0; } -static int LanguageCompareFunc(const void *a, const void *b) -{ - return strcmp(*(const char* const *)a, *(const char* const *)b); -} - -int GetLanguageList(char **languages, int max) -{ - DIR *dir; - struct dirent *dirent; - int num = 0; - - dir = opendir(_path.lang_dir); - if (dir != NULL) { - while ((dirent = readdir(dir)) != NULL) { - char *t = strrchr(dirent->d_name, '.'); - - if (t != NULL && strcmp(t, ".lng") == 0) { - languages[num++] = strdup(dirent->d_name); - if (num == max) break; - } - } - closedir(dir); - } - - qsort(languages, num, sizeof(char*), LanguageCompareFunc); - return num; -} - #if defined(__BEOS__) || defined(__linux__) static void ChangeWorkingDirectory(char *exe) { |