summaryrefslogtreecommitdiff
path: root/unix.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-08-04 23:45:20 +0000
committerDarkvater <darkvater@openttd.org>2006-08-04 23:45:20 +0000
commitb5e3718ac4ead73a7b7bb9fd694cae5d9aaefa7b (patch)
tree8366278d35f2187288e8d53bf4fc9e043e630808 /unix.c
parent4de30befaee2141e410bf0df5d5f7e3906bc0111 (diff)
downloadopenttd-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.c28
1 files changed, 0 insertions, 28 deletions
diff --git a/unix.c b/unix.c
index 7ab3fc21e..a72fcec57 100644
--- a/unix.c
+++ b/unix.c
@@ -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)
{