ntfstypes.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:2k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  * ntfstypes.h - This file defines four things:
  3.  * - Generic platform independent fixed-size types (e.g. ntfs_u32).
  4.  * - Specific fixed-size types (e.g. ntfs_offset_t).
  5.  * - Macros that read and write those types from and to byte arrays.
  6.  * - Types derived from OS specific ones.
  7.  *
  8.  * Copyright (C) 1996, 1998, 1999 Martin von L鰓is
  9.  * Copyright (C) 2001 Anton Altaparmakov (AIA)
  10.  */
  11. #include <linux/fs.h>
  12. #include "ntfsendian.h"
  13. #include <asm/types.h>
  14. /* Integral types */
  15. #ifndef NTFS_INTEGRAL_TYPES
  16. #define NTFS_INTEGRAL_TYPES
  17. typedef u8  ntfs_u8;
  18. typedef u16 ntfs_u16;
  19. typedef u32 ntfs_u32;
  20. typedef u64 ntfs_u64;
  21. typedef s8  ntfs_s8;
  22. typedef s16 ntfs_s16;
  23. typedef s32 ntfs_s32;
  24. typedef s64 ntfs_s64;
  25. #endif
  26. /* Unicode character type */
  27. #ifndef NTFS_WCHAR_T
  28. #define NTFS_WCHAR_T
  29. typedef u16 ntfs_wchar_t;
  30. #endif
  31. /* File offset */
  32. #ifndef NTFS_OFFSET_T
  33. #define NTFS_OFFSET_T
  34. typedef s64 ntfs_offset_t;
  35. #endif
  36. /* UTC */
  37. #ifndef NTFS_TIME64_T
  38. #define NTFS_TIME64_T
  39. typedef u64 ntfs_time64_t;
  40. #endif
  41. /*
  42.  * This is really signed long long. So we support only volumes up to 2Tb. This
  43.  * is ok as Win2k also only uses 32-bits to store clusters.
  44.  * Whatever you do keep this a SIGNED value or a lot of NTFS users with
  45.  * corrupted filesystems will lynch you! It causes massive fs corruption when
  46.  * unsigned due to the nature of many checks relying on being performed on
  47.  * signed quantities. (AIA)
  48.  */
  49. #ifndef NTFS_CLUSTER_T
  50. #define NTFS_CLUSTER_T
  51. typedef s32 ntfs_cluster_t;
  52. #endif
  53. /* Architecture independent macros. */
  54. /* PUTU32 would not clear all bytes. */
  55. #define NTFS_PUTINUM(p,i)    NTFS_PUTU64(p, i->i_number); 
  56.                              NTFS_PUTU16(((char*)p) + 6, i->sequence_number)
  57. /* System dependent types. */
  58. #include <asm/posix_types.h>
  59. #ifndef NTMODE_T
  60. #define NTMODE_T
  61. typedef __kernel_mode_t ntmode_t;
  62. #endif
  63. #ifndef NTFS_UID_T
  64. #define NTFS_UID_T
  65. typedef uid_t ntfs_uid_t;
  66. #endif
  67. #ifndef NTFS_GID_T
  68. #define NTFS_GID_T
  69. typedef gid_t ntfs_gid_t;
  70. #endif
  71. #ifndef NTFS_SIZE_T
  72. #define NTFS_SIZE_T
  73. typedef __kernel_size_t ntfs_size_t;
  74. #endif
  75. #ifndef NTFS_TIME_T
  76. #define NTFS_TIME_T
  77. typedef __kernel_time_t ntfs_time_t;
  78. #endif