~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Linux/fs/nls/nls_gb2312.c

Version: ~ [ 2.4.0 ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * linux/fs/nls_gb2312.c
  3  */
  4 
  5 #include <linux/module.h>
  6 #include <linux/kernel.h>
  7 #include <linux/string.h>
  8 #include <linux/nls.h>
  9 #include <linux/errno.h>
 10 
 11 static struct nls_table *p_nls;
 12 
 13 static struct nls_table table = {
 14         "gb2312",
 15         NULL,
 16         NULL,
 17         NULL,
 18         NULL,
 19         THIS_MODULE,
 20 };
 21 
 22 static int __init init_nls_gb2312(void)
 23 {
 24         p_nls = load_nls("cp936");
 25 
 26         if (p_nls) {
 27                 table.uni2char = p_nls->uni2char;
 28                 table.char2uni = p_nls->char2uni;
 29                 table.charset2upper = p_nls->charset2upper;
 30                 table.charset2lower = p_nls->charset2lower;
 31                 return register_nls(&table);
 32         }
 33 
 34         return -EINVAL;
 35 }
 36 
 37 static void __exit exit_nls_gb2312(void)
 38 {
 39         unregister_nls(&table);
 40         unload_nls(p_nls);
 41 }
 42 
 43 module_init(init_nls_gb2312)
 44 module_exit(exit_nls_gb2312)
 45 
 46 /*
 47  * Overrides for Emacs so that we follow Linus's tabbing style.
 48  * Emacs will notice this stuff at the end of the file and automatically
 49  * adjust the settings for this buffer only.  This must remain at the end
 50  * of the file.
 51  *
 52 ---------------------------------------------------------------------------
 53  * Local variables:
 54  * c-indent-level: 8
 55  * c-brace-imaginary-offset: 0
 56  * c-brace-offset: -8
 57  * c-argdecl-indent: 8
 58  * c-label-offset: -8
 59  * c-continued-statement-offset: 8
 60  * c-continued-brace-offset: 0
 61  * End:
 62  */
 63 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.