Changes by: antona
Update of /cvsroot/linux-ntfs/linux-ntfs/include
In directory usw-pr-cvs1:/tmp/cvs-serv27454/include
Modified Files:
dir.h layout.h
Log Message:
ntfs_readdir() has arrived.
Index: dir.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/dir.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -U2 -r1.2 -r1.3
--- dir.h 6 Jun 2002 20:47:29 -0000 1.2
+++ dir.h 8 Jun 2002 14:12:01 -0000 1.3
@@ -25,4 +25,6 @@
#define NTFS_DIR_H
+#include "types.h"
+
/* The little endian Unicode string $I30 as a global constant. */
extern uchar_t I30[5];
@@ -30,4 +32,30 @@
extern __u64 ntfs_lookup_inode_by_name(ntfs_inode *dir_ni,
const uchar_t *uname, const int uname_len);
+
+/*
+ * File types (adapted from include <linux/fs.h>)
+ */
+#define NTFS_DT_UNKNOWN 0
+#define NTFS_DT_FIFO 1
+#define NTFS_DT_CHR 2
+#define NTFS_DT_DIR 4
+#define NTFS_DT_BLK 6
+#define NTFS_DT_REG 8
+#define NTFS_DT_LNK 10
+#define NTFS_DT_SOCK 12
+#define NTFS_DT_WHT 14
+
+/*
+ * This is the "ntfs_filldir" function type, used by ntfs_readdir() to let
+ * the caller specify what kind of dirent layout it wants to have.
+ * This allows the caller to read directories into their application or
+ * to have different dirent layouts depending on the binary type.
+ */
+typedef int (*ntfs_filldir_t)(void *dirent, const uchar_t *name,
+ const int name_len, const int name_type, const __s64 pos,
+ const MFT_REF mref, const unsigned dt_type);
+
+extern int ntfs_readdir(ntfs_inode *dir_ni, __s64 *pos,
+ void *dirent, ntfs_filldir_t filldir);
#endif /* defined NTFS_DIR_H */
Index: layout.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/layout.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -U2 -r1.20 -r1.21
--- layout.h 5 Jun 2002 00:29:18 -0000 1.20
+++ layout.h 8 Jun 2002 14:12:01 -0000 1.21
@@ -286,4 +286,7 @@
typedef __u64 MFT_REF;
+#define MK_MREF(m, s) ((MFT_REF)(((MFT_REF)(s) << 48) | \
+ ((MFT_REF)(m) & MFT_REF_MASK_CPU)))
+
#define MREF(x) ((__u64)((x) & MFT_REF_MASK_CPU))
#define MSEQNO(x) ((__u16)(((x) >> 48) & 0xffff))
|