30#define MAX_LANGV_SIZE 32
41 envstr = getenv(
"LANGUAGE");
42 if ((envstr != NULL) && (envstr[0] != 0)) {
46 envstr = getenv(
"LC_ALL");
47 if ((envstr != NULL) && (envstr[0] != 0)) {
51 envstr = getenv(
"LC_MESSAGES");
52 if ((envstr != NULL) && (envstr[0] != 0)) {
56 envstr = getenv(
"LANG");
57 if ((envstr != NULL) && (envstr[0] != 0)) {
86 while ((envlang[lend] != 0) &&
87 (envlang[lend] !=
':') &&
88 (envlang[lend] !=
'.')) {
89 if (envlang[lend] ==
'_') {
95 nlang = malloc(lend - lstart + 1);
96 memcpy(nlang, envlang + lstart, lend - lstart);
97 nlang[lend - lstart] = 0;
101 if (lunder != lstart) {
102 nlang = malloc(lunder - lstart + 1);
103 memcpy(nlang, envlang + lstart, lunder - lstart);
104 nlang[lunder - lstart] = 0;
105 langv[++langc] = nlang;
109 while ((envlang[lend] != 0) &&
110 (envlang[lend] !=
':')) {
113 if (envlang[lend] == 0) {
118 lstart = lunder = lend;
char ** filepath_path_to_strvec(const char *path)
Convert a colon separated list of path elements into a string vector.
void filepath_free_strvec(char **pathv)
Free a string vector.
char ** filepath_generate(char *const *pathv, const char *const *langv)
Merge two string vectors into a resource search path vector.
Utility routines to obtain paths to file resources.
char ** respaths
resource search path vector
char ** fb_init_resource_path(const char *resource_path)
Create an array of valid paths to search for resources.
#define MAX_LANGV_SIZE
resource search path vector
static char ** get_language_names(void)
build a string vector of language names
static const char * get_language_env(void)
goes through the environment in appropriate order to find configured language
Interface to utility string handling.