diff options
author | Konstantin <ria.freelander@gmail.com> | 2016-05-11 11:40:47 +0300 |
---|---|---|
committer | Konstantin <ria.freelander@gmail.com> | 2016-05-11 11:40:47 +0300 |
commit | 9b2e290336e7c8de7117e1fb24ba5443fed56698 (patch) | |
tree | 45184aa9bbdfc32fbc00d395133fde8b03ecae76 /categories.c | |
parent | a24e4fa0b990214b369b59704193eb64be27483c (diff) | |
download | musl-locales-9b2e290336e7c8de7117e1fb24ba5443fed56698.tar.gz musl-locales-9b2e290336e7c8de7117e1fb24ba5443fed56698.tar.bz2 musl-locales-9b2e290336e7c8de7117e1fb24ba5443fed56698.tar.xz musl-locales-9b2e290336e7c8de7117e1fb24ba5443fed56698.zip |
Working locale
Diffstat (limited to 'categories.c')
-rw-r--r-- | categories.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/categories.c b/categories.c index 8d8ae9e..29a9b57 100644 --- a/categories.c +++ b/categories.c @@ -1,3 +1,13 @@ +/* + * + * Copyright (c) 2016 Konstantin Pugin + * Konstantin Pugin (ria.freelander@gmail.com) + * + * Licensed under the LGPL v3. + * + * A 'locale' command implementation for musl. + * + */ #include "categories.h" #include <stdlib.h> #include <string.h> @@ -79,6 +89,19 @@ const struct cat_item get_cat_item_for_name(const char *name) return invalid; } +const char* get_cat_name_for_item_name(const char *name) +{ + for(int i = 0; i < LC_ALL; i++) + { + for(int j = 0; cats[i][j].type != CAT_TYPE_END; j++) + { + if(!strcmp(name,cats[i][j].name)) + return get_name_for_cat(i); + } + } + return ""; +} + const struct cat_item* get_cat_for_locale_cat(int locale_cat) { return cats[locale_cat]; |