exfat_nls.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Copyright (C) 2012-2013 Samsung Electronics Co., Ltd.
  3. *
  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.
  8. *
  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.
  13. *
  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.
  17. */
  18. #ifndef _EXFAT_NLS_H
  19. #define _EXFAT_NLS_H
  20. #include <linux/nls.h>
  21. #include "exfat_config.h"
  22. #include "exfat_global.h"
  23. #include "exfat_api.h"
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. #define NUM_UPCASE 2918
  28. #define DOS_CUR_DIR_NAME ". "
  29. #define DOS_PAR_DIR_NAME ".. "
  30. #if (FFS_CONFIG_LITTLE_ENDIAN == 1)
  31. #define UNI_CUR_DIR_NAME ".\0"
  32. #define UNI_PAR_DIR_NAME ".\0.\0"
  33. #else
  34. #define UNI_CUR_DIR_NAME "\0."
  35. #define UNI_PAR_DIR_NAME "\0.\0."
  36. #endif
  37. typedef struct {
  38. UINT8 name[DOS_NAME_LENGTH];
  39. UINT8 name_case;
  40. } DOS_NAME_T;
  41. typedef struct {
  42. UINT16 name[MAX_NAME_LENGTH];
  43. UINT16 name_hash;
  44. UINT8 name_len;
  45. } UNI_NAME_T;
  46. UINT16 nls_upper(struct super_block *sb, UINT16 a);
  47. INT32 nls_dosname_cmp(struct super_block *sb, UINT8 *a, UINT8 *b);
  48. INT32 nls_uniname_cmp(struct super_block *sb, UINT16 *a, UINT16 *b);
  49. void nls_uniname_to_dosname(struct super_block *sb, DOS_NAME_T *p_dosname, UNI_NAME_T *p_uniname, INT32 *p_lossy);
  50. void nls_dosname_to_uniname(struct super_block *sb, UNI_NAME_T *p_uniname, DOS_NAME_T *p_dosname);
  51. void nls_uniname_to_cstring(struct super_block *sb, UINT8 *p_cstring, UNI_NAME_T *p_uniname);
  52. void nls_cstring_to_uniname(struct super_block *sb, UNI_NAME_T *p_uniname, UINT8 *p_cstring, INT32 *p_lossy);
  53. #ifdef __cplusplus
  54. }
  55. #endif
  56. #endif