CD exfat support for Tomato. https://github.com/dorimanx/exfat-nofuse.
[tomato.git] / release / src-rt / linux / linux-2.6 / fs / exfat / exfat_nls.h
blob5b14cef02463c356bd91adce44affc32cf7351d5
1 /*
2 * Copyright (C) 2012-2013 Samsung Electronics Co., Ltd.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 /************************************************************************/
20 /* */
21 /* PROJECT : exFAT & FAT12/16/32 File System */
22 /* FILE : exfat_nls.h */
23 /* PURPOSE : Header File for exFAT NLS Manager */
24 /* */
25 /*----------------------------------------------------------------------*/
26 /* NOTES */
27 /* */
28 /*----------------------------------------------------------------------*/
29 /* REVISION HISTORY (Ver 0.9) */
30 /* */
31 /* - 2010.11.15 [Joosun Hahn] : first writing */
32 /* */
33 /************************************************************************/
35 #ifndef _EXFAT_NLS_H
36 #define _EXFAT_NLS_H
38 #include <linux/nls.h>
40 #include "exfat_config.h"
41 #include "exfat_global.h"
42 #include "exfat_api.h"
44 #ifdef __cplusplus
45 extern "C" {
46 #endif /* __cplusplus */
48 /*----------------------------------------------------------------------*/
49 /* Constant & Macro Definitions */
50 /*----------------------------------------------------------------------*/
52 #define NUM_UPCASE 2918
54 #define DOS_CUR_DIR_NAME ". "
55 #define DOS_PAR_DIR_NAME ".. "
57 #ifdef __LITTLE_ENDIAN
58 #define UNI_CUR_DIR_NAME ".\0"
59 #define UNI_PAR_DIR_NAME ".\0.\0"
60 #else
61 #define UNI_CUR_DIR_NAME "\0."
62 #define UNI_PAR_DIR_NAME "\0.\0."
63 #endif
65 /*----------------------------------------------------------------------*/
66 /* Type Definitions */
67 /*----------------------------------------------------------------------*/
69 /* DOS name stucture */
70 typedef struct {
71 UINT8 name[DOS_NAME_LENGTH];
72 UINT8 name_case;
73 } DOS_NAME_T;
75 /* unicode name stucture */
76 typedef struct {
77 UINT16 name[MAX_NAME_LENGTH];
78 UINT16 name_hash;
79 UINT8 name_len;
80 } UNI_NAME_T;
82 /*----------------------------------------------------------------------*/
83 /* External Function Declarations */
84 /*----------------------------------------------------------------------*/
86 /* NLS management function */
87 UINT16 nls_upper(struct super_block *sb, UINT16 a);
88 INT32 nls_dosname_cmp(struct super_block *sb, UINT8 *a, UINT8 *b);
89 INT32 nls_uniname_cmp(struct super_block *sb, UINT16 *a, UINT16 *b);
90 void nls_uniname_to_dosname(struct super_block *sb, DOS_NAME_T *p_dosname, UNI_NAME_T *p_uniname, INT32 *p_lossy);
91 void nls_dosname_to_uniname(struct super_block *sb, UNI_NAME_T *p_uniname, DOS_NAME_T *p_dosname);
92 void nls_uniname_to_cstring(struct super_block *sb, UINT8 *p_cstring, UNI_NAME_T *p_uniname);
93 void nls_cstring_to_uniname(struct super_block *sb, UNI_NAME_T *p_uniname, UINT8 *p_cstring, INT32 *p_lossy);
95 #ifdef __cplusplus
97 #endif /* __cplusplus */
99 #endif /* _EXFAT_NLS_H */
101 /* end of exfat_nls.h */