summaryrefslogtreecommitdiffstats
path: root/ui/rccnames.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2005-07-05 03:15:53 +0000
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2005-07-05 03:15:53 +0000
commit9922cef1af71786ae788903b52a8968e5775d510 (patch)
treebadf23fc2701946b61df1d15227736783e44a754 /ui/rccnames.c
parenta21deef1c62467b21500f94dfb2ab3d58e69cb85 (diff)
downloadlibrcc-9922cef1af71786ae788903b52a8968e5775d510.tar.gz
librcc-9922cef1af71786ae788903b52a8968e5775d510.tar.bz2
librcc-9922cef1af71786ae788903b52a8968e5775d510.tar.xz
librcc-9922cef1af71786ae788903b52a8968e5775d510.zip
Save / Load
Diffstat (limited to 'ui/rccnames.c')
-rw-r--r--ui/rccnames.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/ui/rccnames.c b/ui/rccnames.c
index 961dbbc..2e11165 100644
--- a/ui/rccnames.c
+++ b/ui/rccnames.c
@@ -3,29 +3,42 @@
#include "internal.h"
const char *rccUiGetLanguageName(rcc_ui_context ctx, const char *lang) {
+ const char *res;
unsigned int i;
rcc_language_name *names;
if ((!ctx)||(!lang)) return NULL;
-
+
names = ctx->language_names;
+
+ if (names) {
+ for (i=0;names[i].sn;i++)
+ if (!strcmp(lang, names[i].sn)) return names[i].name;
+ }
- for (i=0;names[i].sn;i++)
- if (!strcmp(lang, names[i].sn)) return names[i].name;
+
+ res = rccGetLanguageFullName(lang);
+ if (res) return res;
return lang;
}
const char *rccUiGetOptionName(rcc_ui_context ctx, rcc_option option) {
+ const char *res;
unsigned int i;
rcc_option_name *names;
- if (!ctx) return NULL;
+ if ((!ctx)||(option<0)||(option>RCC_MAX_OPTIONS)) return NULL;
names = ctx->option_names;
- for (i=0;((i<RCC_MAX_OPTIONS)&&(names[i].option!=RCC_MAX_OPTIONS));i++)
- if (names[i].option == option) return names[i].name;
+ if (names) {
+ for (i=0;((i<RCC_MAX_OPTIONS)&&(names[i].option!=RCC_MAX_OPTIONS));i++)
+ if (names[i].option == option) return names[i].name;
+ }
+
+ res = rccGetOptionFullName(option);
+ if (res) return res;
- return NULL;
+ return "";
}