Annotation of embedaddon/strongswan/src/libimcv/imv/imv_lang_string.h, revision 1.1.1.1
1.1 misho 1: /*
2: * Copyright (C) 2012 Andreas Steffen
3: * HSR Hochschule fuer Technik Rapperswil
4: *
5: * This program is free software; you can redistribute it and/or modify it
6: * under the terms of the GNU General Public License as published by the
7: * Free Software Foundation; either version 2 of the License, or (at your
8: * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9: *
10: * This program is distributed in the hope that it will be useful, but
11: * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13: * for more details.
14: */
15:
16: /**
17: *
18: * @defgroup imv_lang_string_t imv_lang_string
19: * @{ @ingroup libimcv_imv
20: */
21:
22: #ifndef IMV_LANG_STRING_H_
23: #define IMV_LANG_STRING_H_
24:
25: #include <library.h>
26: #include <collections/enumerator.h>
27:
28: typedef struct imv_lang_string_t imv_lang_string_t;
29:
30: /**
31: * Define a language string entry
32: */
33: struct imv_lang_string_t {
34:
35: /**
36: * language code
37: */
38: char *lang;
39:
40: /**
41: * UTF-8 string in the corresponding language
42: */
43: char *string;
44:
45: };
46:
47: /**
48: * Select the preferred language
49: *
50: * @param language_enumerator enumerator over user preferred languages
51: * @param languages string array of available languages
52: * @param lang_count number of available languages
53: * @return selected language as a language code
54: */
55: char* imv_lang_string_select_lang(enumerator_t *language_enumerator,
56: char* languages[], int lang_count);
57:
58: /**
59: * Select the preferred language string
60: *
61: * @param lang_string multi-lingual array of strings
62: * @param lang language code of preferred language
63: * @return selected string
64: */
65: char* imv_lang_string_select_string(imv_lang_string_t lang_string[], char *lang);
66:
67: #endif /** IMV_LANG_STRING_H_ @}*/
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>