From 9b2e290336e7c8de7117e1fb24ba5443fed56698 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Wed, 11 May 2016 11:40:47 +0300 Subject: Working locale --- categories.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'categories.c') 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 #include @@ -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]; -- cgit v1.2.3-60-g2f50