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 /************************************************************************/
21 /* PROJECT : exFAT & FAT12/16/32 File System */
22 /* FILE : exfat_nls.h */
23 /* PURPOSE : Header File for exFAT NLS Manager */
25 /*----------------------------------------------------------------------*/
28 /*----------------------------------------------------------------------*/
29 /* REVISION HISTORY (Ver 0.9) */
31 /* - 2010.11.15 [Joosun Hahn] : first writing */
33 /************************************************************************/
38 #include <linux/nls.h>
40 #include "exfat_config.h"
41 #include "exfat_global.h"
42 #include "exfat_api.h"
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"
61 #define UNI_CUR_DIR_NAME "\0."
62 #define UNI_PAR_DIR_NAME "\0.\0."
65 /*----------------------------------------------------------------------*/
66 /* Type Definitions */
67 /*----------------------------------------------------------------------*/
69 /* DOS name stucture */
71 UINT8 name
[DOS_NAME_LENGTH
];
75 /* unicode name stucture */
77 UINT16 name
[MAX_NAME_LENGTH
];
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
);
97 #endif /* __cplusplus */
99 #endif /* _EXFAT_NLS_H */
101 /* end of exfat_nls.h */