193 files changed, 80411 insertions, 44563 deletions
diff --git a/include/ntfs-3g/volume.h b/include/ntfs-3g/volume.h index 253e482..a181ccc 100755 --- a/include/ntfs-3g/volume.h +++ b/include/ntfs-3g/volume.h @@ -5,6 +5,7 @@ * Copyright (c) 2004-2005 Richard Russon * Copyright (c) 2005-2006 Yura Pakhuchiy * Copyright (c) 2005-2009 Szabolcs Szakacsits + * Copyright (c) 2010 Jean-Pierre Andre * * This program/include file is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as published @@ -42,22 +43,6 @@ #include <mntent.h> #endif -/* - * Under Cygwin, DJGPP and FreeBSD we do not have MS_RDONLY, - * so we define them ourselves. - */ -#ifndef MS_RDONLY -#define MS_RDONLY 1 -#endif - -#define MS_EXCLUSIVE 0x08000000 - -#ifndef MS_RECOVER -#define MS_RECOVER 0x10000000 -#endif - -#define MS_IGNORE_HIBERFILE 0x20000000 - /* Forward declaration */ typedef struct _ntfs_volume ntfs_volume; @@ -72,13 +57,29 @@ typedef struct _ntfs_volume ntfs_volume; /** * enum ntfs_mount_flags - * + * Flags for the ntfs_mount() function. + */ +enum { + NTFS_MNT_NONE = 0x00000000, + NTFS_MNT_RDONLY = 0x00000001, + NTFS_MNT_FORENSIC = 0x04000000, /* No modification during + * mount. */ + NTFS_MNT_EXCLUSIVE = 0x08000000, + NTFS_MNT_RECOVER = 0x10000000, + NTFS_MNT_IGNORE_HIBERFILE = 0x20000000, +}; +typedef unsigned long ntfs_mount_flags; + +/** + * enum ntfs_mounted_flags - + * * Flags returned by the ntfs_check_if_mounted() function. */ typedef enum { NTFS_MF_MOUNTED = 1, /* Device is mounted. */ NTFS_MF_ISROOT = 2, /* Device is mounted as system root. */ NTFS_MF_READONLY = 4, /* Device is mounted read-only. */ -} ntfs_mount_flags; +} ntfs_mounted_flags; extern int ntfs_check_if_mounted(const char *file, unsigned long *mnt_flags); @@ -107,6 +108,11 @@ typedef enum { NV_ReadOnly, /* 1: Volume is read-only. */ NV_CaseSensitive, /* 1: Volume is mounted case-sensitive. */ NV_LogFileEmpty, /* 1: $logFile journal is empty. */ + NV_ShowSysFiles, /* 1: Show NTFS metafiles. */ + NV_ShowHidFiles, /* 1: Show files marked hidden. */ + NV_HideDotFiles, /* 1: Set hidden flag on dot files */ + NV_Compression, /* 1: allow compression */ + NV_NoFixupWarn, /* 1: Do not log fixup errors */ } ntfs_volume_state_bits; #define test_nvol_flag(nv, flag) test_bit(NV_##flag, (nv)->state) @@ -125,6 +131,26 @@ typedef enum { #define NVolSetLogFileEmpty(nv) set_nvol_flag(nv, LogFileEmpty) #define NVolClearLogFileEmpty(nv) clear_nvol_flag(nv, LogFileEmpty) +#define NVolShowSysFiles(nv) test_nvol_flag(nv, ShowSysFiles) +#define NVolSetShowSysFiles(nv) set_nvol_flag(nv, ShowSysFiles) +#define NVolClearShowSysFiles(nv) clear_nvol_flag(nv, ShowSysFiles) + +#define NVolShowHidFiles(nv) test_nvol_flag(nv, ShowHidFiles) +#define NVolSetShowHidFiles(nv) set_nvol_flag(nv, ShowHidFiles) +#define NVolClearShowHidFiles(nv) clear_nvol_flag(nv, ShowHidFiles) + +#define NVolHideDotFiles(nv) test_nvol_flag(nv, HideDotFiles) +#define NVolSetHideDotFiles(nv) set_nvol_flag(nv, HideDotFiles) +#define NVolClearHideDotFiles(nv) clear_nvol_flag(nv, HideDotFiles) + +#define NVolCompression(nv) test_nvol_flag(nv, Compression) +#define NVolSetCompression(nv) set_nvol_flag(nv, Compression) +#define NVolClearCompression(nv) clear_nvol_flag(nv, Compression) + +#define NVolNoFixupWarn(nv) test_nvol_flag(nv, NoFixupWarn) +#define NVolSetNoFixupWarn(nv) set_nvol_flag(nv, NoFixupWarn) +#define NVolClearNoFixupWarn(nv) clear_nvol_flag(nv, NoFixupWarn) + /* * NTFS version 1.1 and 1.2 are used by Windows NT4. * NTFS version 2.x is used by Windows 2000 Beta @@ -217,6 +243,9 @@ struct _ntfs_volume { FILE_UpCase. */ u32 upcase_len; /* Length in Unicode characters of the upcase table. */ + ntfschar *locase; /* Lower case equivalents of all 65536 2-byte + Unicode characters. Only if option + case_ignore is set. */ ATTR_DEF *attrdef; /* Attribute definitions. Obtained from FILE_AttrDef. */ @@ -228,7 +257,9 @@ struct _ntfs_volume { s64 free_mft_records; /* Same for free mft records (see above) */ BOOL efs_raw; /* volume is mounted for raw access to efs-encrypted files */ - +#ifdef XATTR_MAPPINGS + struct XATTRMAPPING *xattr_mapping; +#endif /* XATTR_MAPPINGS */ #if CACHE_INODE_SIZE struct CACHE_HEADER *xinode_cache; #endif @@ -252,12 +283,12 @@ extern const char *ntfs_home; extern ntfs_volume *ntfs_volume_alloc(void); extern ntfs_volume *ntfs_volume_startup(struct ntfs_device *dev, - unsigned long flags); + ntfs_mount_flags flags); extern ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, - unsigned long flags); + ntfs_mount_flags flags); -extern ntfs_volume *ntfs_mount(const char *name, unsigned long flags); +extern ntfs_volume *ntfs_mount(const char *name, ntfs_mount_flags flags); extern int ntfs_umount(ntfs_volume *vol, const BOOL force); extern int ntfs_version_is_supported(ntfs_volume *vol); @@ -270,8 +301,13 @@ extern int ntfs_volume_error(int err); extern void ntfs_mount_error(const char *vol, const char *mntpoint, int err); extern int ntfs_volume_get_free_space(ntfs_volume *vol); +extern int ntfs_volume_rename(ntfs_volume *vol, const ntfschar *label, + int label_len); +extern int ntfs_set_shown_files(ntfs_volume *vol, + BOOL show_sys_files, BOOL show_hid_files, BOOL hide_dot_files); extern int ntfs_set_locale(void); +extern int ntfs_set_ignore_case(ntfs_volume *vol); #endif /* defined _NTFS_VOLUME_H */ |