@@ -577,10 +577,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "macceltic",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -507,10 +507,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "maccenteuro",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -577,10 +577,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "maccroatian",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -472,10 +472,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "maccyrillic",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -542,10 +542,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "macgaelic",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -472,10 +472,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "macgreek",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -577,10 +577,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "maciceland",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -507,10 +507,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "macinuit",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -612,10 +612,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "macroman",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -577,10 +577,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "macromanian",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -577,10 +577,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "macturkish",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -142,10 +142,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "ascii",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -520,10 +520,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table default_table = {
.charset = "default",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -323,10 +323,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "cp1250",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -277,10 +277,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "cp1251",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -358,11 +358,15 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "cp1255",
.alias = "iso8859-8",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -363,10 +363,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "cp437",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -326,10 +326,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "cp737",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -295,10 +295,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "cp775",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -291,10 +291,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "cp850",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -313,10 +313,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "cp852",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -275,10 +275,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "cp855",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -277,10 +277,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "cp857",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -340,10 +340,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "cp860",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -363,10 +363,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "cp861",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -397,10 +397,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "cp862",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -357,10 +357,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "cp863",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -383,10 +383,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "cp864",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -363,10 +363,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "cp865",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -281,10 +281,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "cp866",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -291,10 +291,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "cp869",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -249,11 +249,15 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "cp874",
.alias = "tis-620",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -7907,11 +7907,15 @@ static int char2uni(const unsigned char *rawstring, int boundlen,
return -EINVAL;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "cp932",
.alias = "sjis",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -11085,11 +11085,15 @@ static int char2uni(const unsigned char *rawstring, int boundlen,
return n;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "cp936",
.alias = "gb2312",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -13920,11 +13920,15 @@ static int char2uni(const unsigned char *rawstring, int boundlen,
return n;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "cp949",
.alias = "euc-kr",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -9456,11 +9456,15 @@ static int char2uni(const unsigned char *rawstring, int boundlen,
return n;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "cp950",
.alias = "big5",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -549,10 +549,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen,
return euc_offset;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "euc-jp",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
};
static int __init init_nls_euc_jp(void)
@@ -233,10 +233,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "iso8859-1",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -261,10 +261,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "iso8859-13",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -317,10 +317,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "iso8859-14",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -283,10 +283,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "iso8859-15",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -284,10 +284,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "iso8859-2",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -284,10 +284,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "iso8859-3",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -284,10 +284,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "iso8859-4",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -248,10 +248,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "iso8859-5",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -239,10 +239,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "iso8859-6",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -293,10 +293,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "iso8859-7",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -248,10 +248,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "iso8859-9",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -299,10 +299,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "koi8-r",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -51,10 +51,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen,
return n;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "koi8-ru",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
};
static int __init init_nls_koi8_ru(void)
@@ -306,10 +306,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return 1;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "koi8-u",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = charset2lower,
.charset2upper = charset2upper,
};
@@ -40,10 +40,14 @@ static int char2uni(const unsigned char *rawstring, int boundlen, wchar_t *uni)
return n;
}
+static const struct nls_ops charset_ops = {
+ .uni2char = uni2char,
+ .char2uni = char2uni,
+};
+
static struct nls_table table = {
.charset = "utf8",
- .uni2char = uni2char,
- .char2uni = char2uni,
+ .ops = &charset_ops,
.charset2lower = identity, /* no conversion */
.charset2upper = identity,
};
@@ -178,7 +178,7 @@ static int udf_name_from_CS0(struct super_block *sb,
}
if (UDF_QUERY_FLAG(sb, UDF_FLAG_NLS_MAP))
- conv_f = UDF_SB(sb)->s_nls_map->uni2char;
+ conv_f = UDF_SB(sb)->s_nls_map->ops->uni2char;
else
conv_f = NULL;
@@ -286,7 +286,7 @@ static int udf_name_to_CS0(struct super_block *sb,
return 0;
if (UDF_QUERY_FLAG(sb, UDF_FLAG_NLS_MAP))
- conv_f = UDF_SB(sb)->s_nls_map->char2uni;
+ conv_f = UDF_SB(sb)->s_nls_map->ops->char2uni;
else
conv_f = NULL;
@@ -22,12 +22,16 @@ typedef u16 wchar_t;
/* Arbitrary Unicode character */
typedef u32 unicode_t;
-struct nls_table {
- const char *charset;
- const char *alias;
+struct nls_ops {
int (*uni2char) (wchar_t uni, unsigned char *out, int boundlen);
int (*char2uni) (const unsigned char *rawstring, int boundlen,
wchar_t *uni);
+};
+
+struct nls_table {
+ const char *charset;
+ const char *alias;
+ const struct nls_ops *ops;
const unsigned char *charset2lower;
const unsigned char *charset2upper;
struct module *owner;
@@ -62,14 +66,14 @@ extern int utf16s_to_utf8s(const wchar_t *pwcs, int len,
static inline int nls_uni2char(const struct nls_table *table, wchar_t uni,
unsigned char *out, int boundlen)
{
- return table->uni2char(uni, out, boundlen);
+ return table->ops->uni2char(uni, out, boundlen);
}
static inline int nls_char2uni(const struct nls_table *table,
const unsigned char *rawstring,
int boundlen, wchar_t *uni)
{
- return table->char2uni(rawstring, boundlen, uni);
+ return table->ops->char2uni(rawstring, boundlen, uni);
}
static inline const char *nls_charset_name(const struct nls_table *table)
@@ -116,7 +120,7 @@ nls_nullsize(const struct nls_table *codepage)
int charlen;
char tmp[NLS_MAX_CHARSET_SIZE];
- charlen = codepage->uni2char(0, tmp, NLS_MAX_CHARSET_SIZE);
+ charlen = codepage->ops->uni2char(0, tmp, NLS_MAX_CHARSET_SIZE);
return charlen > 0 ? charlen : 1;
}