1 #ifndef _LINUX_NLS_H 2 #define _LINUX_NLS_H 3 4 #include <linux/init.h> 5 6 /* unicode character */ 7 typedef __u16 wchar_t; 8 9 struct nls_table { 10 char *charset; 11 int (*uni2char) (wchar_t uni, unsigned char *out, int boundlen); 12 int (*char2uni) (const unsigned char *rawstring, int boundlen, 13 wchar_t *uni); 14 unsigned char *charset2lower; 15 unsigned char *charset2upper; 16 struct module *owner; 17 struct nls_table *next; 18 }; 19 20 /* this value hold the maximum octet of charset */ 21 #define NLS_MAX_CHARSET_SIZE 6 /* for UTF-8 */ 22 23 /* nls.c */ 24 extern int register_nls(struct nls_table *); 25 extern int unregister_nls(struct nls_table *); 26 extern struct nls_table *load_nls(char *); 27 extern void unload_nls(struct nls_table *); 28 extern struct nls_table *load_nls_default(void); 29 30 extern int utf8_mbtowc(wchar_t *, const __u8 *, int); 31 extern int utf8_mbstowcs(wchar_t *, const __u8 *, int); 32 extern int utf8_wctomb(__u8 *, wchar_t, int); 33 extern int utf8_wcstombs(__u8 *, const wchar_t *, int); 34 35 #endif /* _LINUX_NLS_H */ 36 37