summaryrefslogtreecommitdiffstats
path: root/fs/nls/nls_gb2312.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-07-21 22:00:56 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-07-21 22:00:56 +0000
commit168660f24dfc46c2702acbe4701a446f42a59578 (patch)
treef431368afbf6b1b71809cf3fd904d800ea126f4d /fs/nls/nls_gb2312.c
parent6420f767924fa73b0ea267864d96820815f4ba5a (diff)
Merge with Linux 2.4.0-test5-pre3.
Diffstat (limited to 'fs/nls/nls_gb2312.c')
-rw-r--r--fs/nls/nls_gb2312.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/fs/nls/nls_gb2312.c b/fs/nls/nls_gb2312.c
new file mode 100644
index 000000000..542a10e97
--- /dev/null
+++ b/fs/nls/nls_gb2312.c
@@ -0,0 +1,62 @@
+/*
+ * linux/fs/nls_gb2312.c
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/nls.h>
+#include <linux/errno.h>
+
+static struct nls_table *p_nls = NULL;
+
+static struct nls_table table = {
+ "gb2312",
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ THIS_MODULE,
+};
+
+static int __init init_nls_gb2312(void)
+{
+ p_nls = load_nls("cp936");
+
+ if (p_nls) {
+ table.uni2char = p_nls->uni2char;
+ table.char2uni = p_nls->char2uni;
+ table.charset2upper = p_nls->charset2upper;
+ table.charset2lower = p_nls->charset2lower;
+ return register_nls(&table);
+ }
+
+ return -EINVAL;
+}
+
+static void __exit exit_nls_gb2312(void)
+{
+ unregister_nls(&table);
+ unload_nls(p_nls);
+}
+
+module_init(init_nls_gb2312)
+module_exit(exit_nls_gb2312)
+
+/*
+ * Overrides for Emacs so that we follow Linus's tabbing style.
+ * Emacs will notice this stuff at the end of the file and automatically
+ * adjust the settings for this buffer only. This must remain at the end
+ * of the file.
+ *
+---------------------------------------------------------------------------
+ * Local variables:
+ * c-indent-level: 8
+ * c-brace-imaginary-offset: 0
+ * c-brace-offset: -8
+ * c-argdecl-indent: 8
+ * c-label-offset: -8
+ * c-continued-statement-offset: 8
+ * c-continued-brace-offset: 0
+ * End:
+ */