Changes by: flatcap
Update of /cvsroot/linux-ntfs/ntfsprogs/include/ntfs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17432/include/ntfs
Modified Files:
attrib.h bitmap.h debug.h dir.h endians.h index.h inode.h
layout.h logfile.h logging.h mft.h ntfstime.h rich.h runlist.h
support.h tree.h types.h version.h volume.h
Log Message:
implement logging in libntfs
fix whitespace
fix build problems
tidy source code
and more...
Index: attrib.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/include/ntfs/attrib.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -p -r1.22 -r1.23
--- attrib.h 16 Sep 2005 14:28:18 -0000 1.22
+++ attrib.h 21 Oct 2005 18:05:13 -0000 1.23
@@ -33,6 +33,7 @@ typedef struct _ntfs_attr_search_ctx ntf
#include "runlist.h"
#include "volume.h"
#include "debug.h"
+#include "logging.h"
extern ntfschar AT_UNNAMED[];
@@ -135,7 +136,7 @@ static __inline__ int ntfs_attrs_walk(nt
* @allocated_size: copy from the attribute record
* @data_size: copy from the attribute record
* @initialized_size: copy from the attribute record
- * @compressed_size: copy from the attribute record
+ * @compressed_size: copy from the attribute record
* @compression_block_size: size of a compression block (cb)
* @compression_block_size_bits: log2 of the size of a cb
* @compression_block_clusters: number of clusters per cb
@@ -214,9 +215,8 @@ static inline void NAttrSet##flag(ntfs_a
if (na->type == AT_DATA && na->name == AT_UNNAMED) \
NInoSet##flag(na->ni); \
else \
- Dprintf("%s(): BUG! Should be called only for " \
- "unnamed data attribute.\n", \
- __FUNCTION__); \
+ ntfs_log_trace("BUG! Should be called only for "\
+ "unnamed data attribute.\n"); \
} \
static inline void NAttrClear##flag(ntfs_attr *na) \
{ \
Index: bitmap.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/include/ntfs/bitmap.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- bitmap.h 16 Oct 2005 23:33:04 -0000 1.4
+++ bitmap.h 21 Oct 2005 18:05:13 -0000 1.5
@@ -150,15 +150,15 @@ struct ntfs_bmp {
};
-int ntfs_bmp_rollback (struct ntfs_bmp *bmp);
-int ntfs_bmp_commit (struct ntfs_bmp *bmp);
-void ntfs_bmp_free (struct ntfs_bmp *bmp);
-struct ntfs_bmp * ntfs_bmp_create (ntfs_inode *inode, ATTR_TYPES type, ntfschar *name, int name_len);
-int ntfs_bmp_add_data (struct ntfs_bmp *bmp, VCN vcn, u8 *data);
-u8 * ntfs_bmp_get_data (struct ntfs_bmp *bmp, VCN vcn);
-int ntfs_bmp_set_range (struct ntfs_bmp *bmp, VCN vcn, s64 length, int value);
-s64 ntfs_bmp_find_last_set (struct ntfs_bmp *bmp);
-int ntfs_bmp_find_space (struct ntfs_bmp *bmp, LCN start, long size);
+int ntfs_bmp_rollback(struct ntfs_bmp *bmp);
+int ntfs_bmp_commit(struct ntfs_bmp *bmp);
+void ntfs_bmp_free(struct ntfs_bmp *bmp);
+struct ntfs_bmp * ntfs_bmp_create(ntfs_inode *inode, ATTR_TYPES type, ntfschar *name, int name_len);
+int ntfs_bmp_add_data(struct ntfs_bmp *bmp, VCN vcn, u8 *data);
+u8 * ntfs_bmp_get_data(struct ntfs_bmp *bmp, VCN vcn);
+int ntfs_bmp_set_range(struct ntfs_bmp *bmp, VCN vcn, s64 length, int value);
+s64 ntfs_bmp_find_last_set(struct ntfs_bmp *bmp);
+int ntfs_bmp_find_space(struct ntfs_bmp *bmp, LCN start, long size);
#endif /* NTFS_RICH */
Index: debug.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/include/ntfs/debug.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -p -r1.9 -r1.10
--- debug.h 9 Sep 2004 14:27:59 -0000 1.9
+++ debug.h 21 Oct 2005 18:05:13 -0000 1.10
@@ -25,26 +25,31 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+
#ifdef HAVE_STDIO_H
-# include <stdio.h>
+#include <stdio.h>
#endif
#ifdef HAVE_STDARG_H
-# include <stdarg.h>
+#include <stdarg.h>
#endif
+#ifdef HAVE_STRING_H
#include <string.h>
+#endif
+#ifdef HAVE_ERRNO_H
#include <errno.h>
+#endif
struct _runlist_element;
extern void __Sprintf(const int silent, const char *fmt, ...)
- __attribute__ ((format (printf, 2, 3)));
+ __attribute__((format(printf, 2, 3)));
#define Sprintf(silent, f, a...) __Sprintf(silent, f, ##a)
#ifdef DEBUG
/* Debug output to stderr. To get it run ./configure --enable-debug. */
-extern void __ntfs_debug (const char *file, int line, const char *function,
+extern void __ntfs_debug(const char *file, int line, const char *function,
const char *format, ...) __attribute__((format(printf, 4, 5)));
#define ntfs_debug(f, a...) \
__ntfs_debug(__FILE__, __LINE__, __FUNCTION__, f, ##a)
@@ -54,7 +59,7 @@ extern void __ntfs_error(const char *fun
#define ntfs_error(sb, f, a...) __ntfs_error(__FUNCTION__, f, ##a)
extern void __Dprintf(const char *fmt, ...)
- __attribute__ ((format (printf, 1, 2)));
+ __attribute__((format(printf, 1, 2)));
#define Dprintf(f, a...) __Dprintf(f, ##a)
extern void __Dputs(const char *s);
@@ -63,8 +68,6 @@ extern void __Dputs(const char *s);
extern void __Dperror(const char *s);
#define Dperror(s) __Dperror(s)
-extern void ntfs_debug_runlist_dump(const struct _runlist_element *rl);
-
#else /* if !DEBUG */
#define ntfs_debug(f, a...) do {} while (0)
@@ -74,10 +77,14 @@ extern void ntfs_debug_runlist_dump(cons
#define Dputs(s) do {} while (0)
#define Dperror(s) do {} while (0)
-static __inline__ void ntfs_debug_runlist_dump(const struct _runlist_element *rl __attribute__((unused))) {}
-
#endif /* !DEBUG */
+#ifdef NTFS_DISABLE_DEBUG_LOGGING
+static __inline__ void ntfs_debug_runlist_dump(const struct _runlist_element *rl __attribute__((unused))) {}
+#else
+extern void ntfs_debug_runlist_dump(const struct _runlist_element *rl);
+#endif
+
#define NTFS_BUG(msg) \
{ \
int ___i; \
Index: dir.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/include/ntfs/dir.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -p -r1.8 -r1.9
--- dir.h 19 Oct 2005 22:04:46 -0000 1.8
+++ dir.h 21 Oct 2005 18:05:13 -0000 1.9
@@ -102,13 +102,13 @@ struct ntfs_dir {
};
-int ntfs_dir_rollback (struct ntfs_dir *dir);
-int ntfs_dir_truncate (ntfs_volume *vol, struct ntfs_dir *dir);
-int ntfs_dir_commit (struct ntfs_dir *dir);
-void ntfs_dir_free (struct ntfs_dir *dir);
-struct ntfs_dir * ntfs_dir_create (ntfs_volume *vol, MFT_REF mft_num);
-void ntfs_dir_add (struct ntfs_dir *parent, struct ntfs_dir *child);
-struct ntfs_dir * ntfs_dir_find2 (struct ntfs_dir *dir, ntfschar *name, int name_len);
+int ntfs_dir_rollback(struct ntfs_dir *dir);
+int ntfs_dir_truncate(ntfs_volume *vol, struct ntfs_dir *dir);
+int ntfs_dir_commit(struct ntfs_dir *dir);
+void ntfs_dir_free(struct ntfs_dir *dir);
+struct ntfs_dir * ntfs_dir_create(ntfs_volume *vol, MFT_REF mft_num);
+void ntfs_dir_add(struct ntfs_dir *parent, struct ntfs_dir *child);
+struct ntfs_dir * ntfs_dir_find2(struct ntfs_dir *dir, ntfschar *name, int name_len);
#endif /* NTFS_RICH */
Index: endians.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/include/ntfs/endians.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -p -r1.12 -r1.13
--- endians.h 20 Jun 2005 14:31:57 -0000 1.12
+++ endians.h 21 Oct 2005 18:05:13 -0000 1.13
@@ -29,7 +29,6 @@
/*
* Notes:
- *
* We define the conversion functions including typecasts since the
* defaults don't necessarily perform appropriate typecasts.
* Also, using our own functions means that we can change them if it
@@ -38,20 +37,21 @@
*/
#ifdef HAVE_ENDIAN_H
-# include <endian.h>
+#include <endian.h>
#endif
#ifdef HAVE_SYS_ENDIAN_H
-# include <sys/endian.h>
+#include <sys/endian.h>
#endif
#ifdef HAVE_MACHINE_ENDIAN_H
-# include <machine/endian.h>
+#include <machine/endian.h>
#endif
#ifdef HAVE_SYS_BYTEORDER_H
-# include <sys/byteorder.h>
+#include <sys/byteorder.h>
#endif
#ifdef HAVE_SYS_PARAM_H
-# include <sys/param.h>
+#include <sys/param.h>
#endif
+
#ifndef __BYTE_ORDER
# if defined(_BYTE_ORDER)
# define __BYTE_ORDER _BYTE_ORDER
Index: index.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/include/ntfs/index.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -r1.7 -r1.8
--- index.h 16 Oct 2005 23:33:04 -0000 1.7
+++ index.h 21 Oct 2005 18:05:13 -0000 1.8
@@ -127,14 +127,14 @@ static inline void ntfs_index_entry_mark
#include "layout.h"
-void ntfs_ie_free (INDEX_ENTRY *ie);
-INDEX_ENTRY * ntfs_ie_create (void);
-VCN ntfs_ie_get_vcn (INDEX_ENTRY *ie);
-INDEX_ENTRY * ntfs_ie_copy (INDEX_ENTRY *ie);
-INDEX_ENTRY * ntfs_ie_set_vcn (INDEX_ENTRY *ie, VCN vcn);
-INDEX_ENTRY * ntfs_ie_remove_vcn (INDEX_ENTRY *ie);
-INDEX_ENTRY * ntfs_ie_set_name (INDEX_ENTRY *ie, ntfschar *name, int namelen, FILE_NAME_TYPE_FLAGS nametype);
-INDEX_ENTRY * ntfs_ie_remove_name (INDEX_ENTRY *ie);
+void ntfs_ie_free(INDEX_ENTRY *ie);
+INDEX_ENTRY * ntfs_ie_create(void);
+VCN ntfs_ie_get_vcn(INDEX_ENTRY *ie);
+INDEX_ENTRY * ntfs_ie_copy(INDEX_ENTRY *ie);
+INDEX_ENTRY * ntfs_ie_set_vcn(INDEX_ENTRY *ie, VCN vcn);
+INDEX_ENTRY * ntfs_ie_remove_vcn(INDEX_ENTRY *ie);
+INDEX_ENTRY * ntfs_ie_set_name(INDEX_ENTRY *ie, ntfschar *name, int namelen, FILE_NAME_TYPE_FLAGS nametype);
+INDEX_ENTRY * ntfs_ie_remove_name(INDEX_ENTRY *ie);
#endif /* NTFS_RICH */
Index: inode.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/include/ntfs/inode.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -p -r1.16 -r1.17
--- inode.h 16 Oct 2005 23:33:04 -0000 1.16
+++ inode.h 21 Oct 2005 18:05:13 -0000 1.17
@@ -187,9 +187,9 @@ extern int ntfs_inode_free_space(ntfs_in
#ifdef NTFS_RICH
-int ntfs_inode_close2 (ntfs_inode *ni);
-ntfs_inode * ntfs_inode_open2 (ntfs_volume *vol, const MFT_REF mref);
-ntfs_inode * ntfs_inode_open3 (ntfs_volume *vol, const MFT_REF mref);
+int ntfs_inode_close2(ntfs_inode *ni);
+ntfs_inode * ntfs_inode_open2(ntfs_volume *vol, const MFT_REF mref);
+ntfs_inode * ntfs_inode_open3(ntfs_volume *vol, const MFT_REF mref);
#endif /* NTFS_RICH */
Index: layout.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/include/ntfs/layout.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -p -r1.32 -r1.33
--- layout.h 19 Oct 2005 22:04:46 -0000 1.32
+++ layout.h 21 Oct 2005 18:05:13 -0000 1.33
@@ -62,7 +62,7 @@ typedef struct {
Required to boot Windows. */
/*0x15*/u32 large_sectors; /* zero */
/* sizeof() = 25 (0x19) bytes */
-} __attribute__ ((__packed__)) BIOS_PARAMETER_BLOCK;
+} __attribute__((__packed__)) BIOS_PARAMETER_BLOCK;
/*
* NTFS boot sector structure.
@@ -95,7 +95,7 @@ typedef struct {
u16 end_of_sector_marker; /* End of bootsector magic. Always is
0xaa55 in little endian. */
/* sizeof() = 512 (0x200) bytes */
-} __attribute__ ((__packed__)) NTFS_BOOT_SECTOR;
+} __attribute__((__packed__)) NTFS_BOOT_SECTOR;
/*
* Magic identifiers present at the beginning of all ntfs record containing
@@ -190,7 +190,7 @@ typedef struct {
including the Update Sequence Number (usn),
thus the number of fixups is the usa_count
minus 1. */
-} __attribute__ ((__packed__)) NTFS_RECORD;
+} __attribute__((__packed__)) NTFS_RECORD;
/*
* System files mft record numbers. All these files are always marked as used
@@ -241,7 +241,7 @@ typedef enum {
/*
* These are the so far known MFT_RECORD_* flags (16-bit) which contain
* information about the mft record in which they are present.
- * _4 and _8 are needed by $Extend sub-files (don't know what to
+ * _4 and _8 are needed by $Extend sub-files (don't know what to
* call them yet...)
*/
@@ -251,7 +251,7 @@ typedef enum {
MFT_RECORD_IS_4 = const_cpu_to_le16(0x0004),
MFT_RECORD_IS_8 = const_cpu_to_le16(0x0008),
MFT_REC_SPACE_FILLER = 0xffff /* Just to make flags 16-bit. */
-} __attribute__ ((__packed__)) MFT_RECORD_FLAGS;
+} __attribute__((__packed__)) MFT_RECORD_FLAGS;
/*
* mft references (aka file references or file record segment references) are
@@ -390,7 +390,7 @@ typedef struct {
* by overwriting it since you then can't get it back...
* When reading we obviously use the data from the ntfs record header.
*/
-} __attribute__ ((__packed__)) MFT_RECORD;
+} __attribute__((__packed__)) MFT_RECORD;
/* This is the version without the NTFS 3.1+ specific fields. */
typedef struct {
@@ -457,7 +457,7 @@ typedef struct {
* by overwriting it since you then can't get it back...
* When reading we obviously use the data from the ntfs record header.
*/
-} __attribute__ ((__packed__)) MFT_RECORD_OLD;
+} __attribute__((__packed__)) MFT_RECORD_OLD;
/*
* System defined attributes (32-bit). Each attribute type has a corresponding
@@ -599,7 +599,7 @@ typedef struct {
/* 90*/ s64 min_size; /* Optional minimum attribute size. */
/* 98*/ s64 max_size; /* Maximum size of attribute. */
/* sizeof() = 0xa0 or 160 bytes */
-} __attribute__ ((__packed__)) ATTR_DEF;
+} __attribute__((__packed__)) ATTR_DEF;
/*
* Attribute flags (16-bit).
@@ -611,7 +611,7 @@ typedef enum {
illegal value. */
ATTR_IS_ENCRYPTED = const_cpu_to_le16(0x4000),
ATTR_IS_SPARSE = const_cpu_to_le16(0x8000),
-} __attribute__ ((__packed__)) ATTR_FLAGS;
+} __attribute__((__packed__)) ATTR_FLAGS;
/*
* Attribute compression.
@@ -687,7 +687,7 @@ typedef enum {
RESIDENT_ATTR_IS_INDEXED = 0x01, /* Attribute is referenced in an index
(has implications for deleting and
modifying the attribute). */
-} __attribute__ ((__packed__)) RESIDENT_ATTR_FLAGS;
+} __attribute__((__packed__)) RESIDENT_ATTR_FLAGS;
/*
* Attribute record header. Always aligned to 8-byte boundary.
@@ -733,7 +733,7 @@ typedef struct {
/* 24 */ void *resident_end[0]; /* Use offsetof(ATTR_RECORD,
resident_end) to get size of
a resident attribute. */
- } __attribute__ ((__packed__));
+ } __attribute__((__packed__));
/* Non-resident attributes. */
struct {
/* 16*/ VCN lowest_vcn; /* Lowest valid virtual cluster number
@@ -790,9 +790,9 @@ typedef struct {
/* Use offsetof(ATTR_RECORD, compressed_end) to
get size of a compressed attribute. */
/* sizeof(compressed attr) = 72*/
- } __attribute__ ((__packed__));
- } __attribute__ ((__packed__));
-} __attribute__ ((__packed__)) ATTR_RECORD;
+ } __attribute__((__packed__));
+ } __attribute__((__packed__));
+} __attribute__((__packed__)) ATTR_RECORD;
typedef ATTR_RECORD ATTR_REC;
@@ -848,7 +848,7 @@ typedef enum {
us whether this file has a view index present (eg. object id index,
quota index, one of the security indexes or the encrypting file
system related indexes). */
-} __attribute__ ((__packed__)) FILE_ATTR_FLAGS;
+} __attribute__((__packed__)) FILE_ATTR_FLAGS;
/*
* NOTE on times in NTFS: All times are in MS standard time format, i.e. they
@@ -890,7 +890,7 @@ typedef struct {
/* 36 */ u8 reserved12[12]; /* Reserved/alignment to 8-byte
boundary. */
/* 48 */ void *v1_end[0]; /* Marker for offsetof(). */
- } __attribute__ ((__packed__));
+ } __attribute__((__packed__));
/* sizeof() = 48 bytes */
/* NTFS 3.0 */
struct {
@@ -944,10 +944,10 @@ typedef struct {
journal is a very fast process, so the user
won't even notice it. */
/* 72*/ void *v3_end[0]; /* Marker for offsetof(). */
- } __attribute__ ((__packed__));
- } __attribute__ ((__packed__));
+ } __attribute__((__packed__));
+ } __attribute__((__packed__));
/* sizeof() = 72 bytes (NTFS 3.0) */
-} __attribute__ ((__packed__)) STANDARD_INFORMATION;
+} __attribute__((__packed__)) STANDARD_INFORMATION;
/*
* Attribute: Attribute list (0x20).
@@ -1008,7 +1008,7 @@ typedef struct {
name_offset to determine the location of the
name. */
/* sizeof() = 26 + (attribute_name_length * 2) bytes */
-} __attribute__ ((__packed__)) ATTR_LIST_ENTRY;
+} __attribute__((__packed__)) ATTR_LIST_ENTRY;
/*
* The maximum allowed length for a file name.
@@ -1039,7 +1039,7 @@ typedef enum {
/* 3 means that both the Win32 and the DOS filenames are
identical and hence have been saved in this single filename
record. */
-} __attribute__ ((__packed__)) FILE_NAME_TYPE_FLAGS;
+} __attribute__((__packed__)) FILE_NAME_TYPE_FLAGS;
/*
* Attribute: Filename (0x30).
@@ -1077,17 +1077,17 @@ typedef struct {
pack the extended attributes
(EAs), if such are present.*/
/* 3e*/ u16 reserved; /* Reserved for alignment. */
- } __attribute__ ((__packed__));
+ } __attribute__((__packed__));
/* 3c*/ u32 reparse_point_tag; /* Type of reparse point,
present only in reparse
points and only if there are
no EAs. */
- } __attribute__ ((__packed__));
+ } __attribute__((__packed__));
/* 40*/ u8 file_name_length; /* Length of file name in
(Unicode) characters. */
/* 41*/ FILE_NAME_TYPE_FLAGS file_name_type; /* Namespace of the file name.*/
/* 42*/ ntfschar file_name[0]; /* File name in Unicode. */
-} __attribute__ ((__packed__)) FILE_NAME_ATTR;
+} __attribute__((__packed__)) FILE_NAME_ATTR;
/*
* GUID structures store globally unique identifiers (GUID). A GUID is a
@@ -1105,7 +1105,7 @@ typedef struct {
u8 data4[8]; /* The first two bytes are the third group of four
hexadecimal digits. The remaining six bytes are the
final 12 hexadecimal digits. */
-} __attribute__ ((__packed__)) GUID;
+} __attribute__((__packed__)) GUID;
/*
* FILE_Extend/$ObjId contains an index named $O. This index contains all
@@ -1126,10 +1126,10 @@ typedef struct {
GUID birth_volume_id;
GUID birth_object_id;
GUID domain_id;
- } __attribute__ ((__packed__));
+ } __attribute__((__packed__));
u8 extended_info[48];
- } __attribute__ ((__packed__));
-} __attribute__ ((__packed__)) OBJ_ID_INDEX_DATA;
+ } __attribute__((__packed__));
+} __attribute__((__packed__)) OBJ_ID_INDEX_DATA;
/*
* Attribute: Object id (NTFS 3.0+) (0x40).
@@ -1153,10 +1153,10 @@ typedef struct {
GUID birth_object_id; /* Unique id of file when it was
first created. */
GUID domain_id; /* Reserved, zero. */
- } __attribute__ ((__packed__));
+ } __attribute__((__packed__));
u8 extended_info[48];
- } __attribute__ ((__packed__));
-} __attribute__ ((__packed__)) OBJECT_ID_ATTR;
+ } __attribute__((__packed__));
+} __attribute__((__packed__)) OBJECT_ID_ATTR;
/*
* The pre-defined IDENTIFIER_AUTHORITIES used as SID_IDENTIFIER_AUTHORITY in
@@ -1297,9 +1297,9 @@ typedef union {
struct {
u16 high_part; /* High 16-bits. */
u32 low_part; /* Low 32-bits. */
- } __attribute__ ((__packed__));
+ } __attribute__((__packed__));
u8 value[6]; /* Value as individual bytes. */
-} __attribute__ ((__packed__)) SID_IDENTIFIER_AUTHORITY;
+} __attribute__((__packed__)) SID_IDENTIFIER_AUTHORITY;
/*
* The SID structure is a variable-length structure used to uniquely identify
@@ -1332,7 +1332,7 @@ typedef struct {
u8 sub_authority_count;
SID_IDENTIFIER_AUTHORITY identifier_authority;
u32 sub_authority[1]; /* At least one sub_authority. */
-} __attribute__ ((__packed__)) SID;
+} __attribute__((__packed__)) SID;
/*
* Current constants for SIDs.
@@ -1370,7 +1370,7 @@ typedef enum {
/* This one is for WinNT&2k. */
ACCESS_MAX_MS_ACE_TYPE = 8,
-} __attribute__ ((__packed__)) ACE_TYPES;
+} __attribute__((__packed__)) ACE_TYPES;
/*
* The ACE flags (8-bit) for audit and inheritance (see below).
@@ -1394,7 +1394,7 @@ typedef enum {
/* The audit flags. */
SUCCESSFUL_ACCESS_ACE_FLAG = 0x40,
FAILED_ACCESS_ACE_FLAG = 0x80,
-} __attribute__ ((__packed__)) ACE_FLAGS;
+} __attribute__((__packed__)) ACE_FLAGS;
/*
* An ACE is an access-control entry in an access-control list (ACL).
@@ -1411,7 +1411,7 @@ typedef struct {
ACE_TYPES type; /* Type of the ACE. */
ACE_FLAGS flags; /* Flags describing the ACE. */
u16 size; /* Size in bytes of the ACE. */
-} __attribute__ ((__packed__)) ACE_HEADER;
+} __attribute__((__packed__)) ACE_HEADER;
/*
* The access mask (32-bit). Defines the access rights.
@@ -1557,7 +1557,7 @@ typedef struct {
ACCESS_MASK generic_write;
ACCESS_MASK generic_execute;
ACCESS_MASK generic_all;
-} __attribute__ ((__packed__)) GENERIC_MAPPING;
+} __attribute__((__packed__)) GENERIC_MAPPING;
/*
* The predefined ACE type structures are as defined below.
@@ -1574,7 +1574,7 @@ typedef struct {
/* 4*/ ACCESS_MASK mask; /* Access mask associated with the ACE. */
/* 8*/ SID sid; /* The SID associated with the ACE. */
-} __attribute__ ((__packed__)) ACCESS_ALLOWED_ACE, ACCESS_DENIED_ACE,
+} __attribute__((__packed__)) ACCESS_ALLOWED_ACE, ACCESS_DENIED_ACE,
SYSTEM_AUDIT_ACE, SYSTEM_ALARM_ACE;
/*
@@ -1596,7 +1596,7 @@ typedef struct {
/* 12*/ GUID object_type;
/* 28*/ GUID inherited_object_type;
/* 44*/ SID sid; /* The SID associated with the ACE. */
-} __attribute__ ((__packed__)) ACCESS_ALLOWED_OBJECT_ACE,
+} __attribute__((__packed__)) ACCESS_ALLOWED_OBJECT_ACE,
ACCESS_DENIED_OBJECT_ACE,
SYSTEM_AUDIT_OBJECT_ACE,
SYSTEM_ALARM_OBJECT_ACE;
@@ -1616,7 +1616,7 @@ typedef struct {
u16 ace_count; /* Number of ACEs in the ACL. */
u16 alignment2;
/* sizeof() = 8 bytes */
-} __attribute__ ((__packed__)) ACL;
+} __attribute__((__packed__)) ACL;
/*
* Current constants for ACLs.
@@ -1697,7 +1697,7 @@ typedef enum {
SE_SACL_PROTECTED = const_cpu_to_le16(0x2000),
SE_RM_CONTROL_VALID = const_cpu_to_le16(0x4000),
SE_SELF_RELATIVE = const_cpu_to_le16(0x8000),
-} __attribute__ ((__packed__)) SECURITY_DESCRIPTOR_CONTROL;
+} __attribute__((__packed__)) SECURITY_DESCRIPTOR_CONTROL;
/*
* Self-relative security descriptor. Contains the owner and group SIDs as well
@@ -1723,7 +1723,7 @@ typedef struct {
SE_DACL_PRESENT is set but dacl is NULL, a NULL ACL
(unconditionally granting access) is specified. */
/* sizeof() = 0x14 bytes */
-} __attribute__ ((__packed__)) SECURITY_DESCRIPTOR_RELATIVE;
+} __attribute__((__packed__)) SECURITY_DESCRIPTOR_RELATIVE;
/*
* Absolute security descriptor. Does not contain the owner and group SIDs, nor
@@ -1751,7 +1751,7 @@ typedef struct {
SE_DACL_PRESENT is set in the control field. If
SE_DACL_PRESENT is set but dacl is NULL, a NULL ACL
(unconditionally granting access) is specified. */
-} __attribute__ ((__packed__)) SECURITY_DESCRIPTOR;
+} __attribute__((__packed__)) SECURITY_DESCRIPTOR;
/*
* Current constants for security descriptors.
@@ -1825,16 +1825,16 @@ typedef struct {
u32 security_id; /* The security_id assigned to the descriptor. */
u64 offset; /* Byte offset of this entry in the $SDS stream. */
u32 length; /* Size in bytes of this entry in $SDS stream. */
-} __attribute__ ((__packed__)) SECURITY_DESCRIPTOR_HEADER;
+} __attribute__((__packed__)) SECURITY_DESCRIPTOR_HEADER;
typedef struct {
u32 hash; /* Hash of the security descriptor. */
- u32 security_id; /* The security_id assigned to the descriptor. */
+ u32 security_id; /* The security_id assigned to the descriptor. */
u64 offset_in_sds; /* Offset of the descriptor in SDS data stream */
u32 size_in_sds; /* Size of the descriptor in SDS data stream */
u64 reserved_II; /* Padding - always unicode "II" */
} __attribute__ ((__packed__)) SDH_INDEX_DATA;
-
+
typedef struct {
u32 hash; /* Hash of the security descriptor. */
u32 security_id; /* The security_id assigned to the descriptor. */
@@ -1843,7 +1843,7 @@ typedef struct {
} __attribute__ ((__packed__)) SII_INDEX_DATA;
typedef struct {
- u64 owner_id;
+ u64 owner_id;
} __attribute__ ((__packed__)) QUOTA_O_INDEX_DATA;
/*
@@ -1866,7 +1866,7 @@ typedef struct {
u32 length; /* Size in bytes of this entry in $SDS stream. */
/* 20*/ SECURITY_DESCRIPTOR_RELATIVE sid; /* The self-relative security
descriptor. */
-} __attribute__ ((__packed__)) SDS_ENTRY;
+} __attribute__((__packed__)) SDS_ENTRY;
/*
* The index entry key used in the $SII index. The collation type is
@@ -1874,7 +1874,7 @@ typedef struct {
*/
typedef struct {
u32 security_id; /* The security_id assigned to the descriptor. */
-} __attribute__ ((__packed__)) SII_INDEX_KEY;
+} __attribute__((__packed__)) SII_INDEX_KEY;
/*
* The index entry key used in the $SDH index. The keys are sorted first by
@@ -1884,7 +1884,7 @@ typedef struct {
typedef struct {
u32 hash; /* Hash of the security descriptor. */
u32 security_id; /* The security_id assigned to the descriptor. */
-} __attribute__ ((__packed__)) SDH_INDEX_KEY;
+} __attribute__((__packed__)) SDH_INDEX_KEY;
/*
* Attribute: Volume name (0x60).
@@ -1894,7 +1894,7 @@ typedef struct {
*/
typedef struct {
ntfschar name[0]; /* The name of the volume in Unicode. */
-} __attribute__ ((__packed__)) VOLUME_NAME;
+} __attribute__((__packed__)) VOLUME_NAME;
/*
* Possible flags for the volume (16-bit).
@@ -1908,7 +1908,7 @@ typedef enum {
VOLUME_REPAIR_OBJECT_ID = const_cpu_to_le16(0x0020),
VOLUME_MODIFIED_BY_CHKDSK = const_cpu_to_le16(0x8000),
VOLUME_FLAGS_MASK = const_cpu_to_le16(0x803f),
-} __attribute__ ((__packed__)) VOLUME_FLAGS;
+} __attribute__((__packed__)) VOLUME_FLAGS;
/*
* Attribute: Volume information (0x70).
@@ -1923,7 +1923,7 @@ typedef struct {
u8 major_ver; /* Major version of the ntfs format. */
u8 minor_ver; /* Minor version of the ntfs format. */
VOLUME_FLAGS flags; /* Bit array of VOLUME_* flags. */
-} __attribute__ ((__packed__)) VOLUME_INFORMATION;
+} __attribute__((__packed__)) VOLUME_INFORMATION;
/*
* Attribute: Data attribute (0x80).
@@ -1934,7 +1934,7 @@ typedef struct {
*/
typedef struct {
u8 data[0]; /* The file's data contents. */
-} __attribute__ ((__packed__)) DATA_ATTR;
+} __attribute__((__packed__)) DATA_ATTR;
/*
* Index header flags (8-bit).
@@ -1956,7 +1956,7 @@ typedef enum {
INDEX_NODE = 1, /* This node indexes other nodes, i.e. is not a
leaf node. */
NODE_MASK = 1, /* Mask for accessing the *_NODE bits. */
-} __attribute__ ((__packed__)) INDEX_HEADER_FLAGS;
+} __attribute__((__packed__)) INDEX_HEADER_FLAGS;
/*
* This is the header for indexes, describing the INDEX_ENTRY records, which
@@ -1984,7 +1984,7 @@ typedef struct {
belongs to. */
INDEX_HEADER_FLAGS flags; /* Bit field of INDEX_HEADER_FLAGS. */
u8 reserved[3]; /* Reserved/align to 8-byte boundary. */
-} __attribute__ ((__packed__)) INDEX_HEADER;
+} __attribute__((__packed__)) INDEX_HEADER;
/*
* Attribute: Index root (0x90).
@@ -2026,7 +2026,7 @@ typedef struct {
u8 reserved[3]; /* Reserved/align to 8-byte boundary. */
INDEX_HEADER index; /* Index header describing the
following index entries. */
-} __attribute__ ((__packed__)) INDEX_ROOT;
+} __attribute__((__packed__)) INDEX_ROOT;
/*
* Attribute: Index allocation (0xa0).
@@ -2057,7 +2057,7 @@ typedef struct {
* by overwriting it since you then can't get it back...
* When reading use the data from the ntfs record header.
*/
-} __attribute__ ((__packed__)) INDEX_BLOCK;
+} __attribute__((__packed__)) INDEX_BLOCK;
typedef INDEX_BLOCK INDEX_ALLOCATION;
@@ -2074,7 +2074,7 @@ typedef struct {
u32 reparse_tag; /* Reparse point type (inc. flags). */
MFT_REF file_id; /* Mft record of the file containing the
reparse point attribute. */
-} __attribute__ ((__packed__)) REPARSE_INDEX_KEY;
+} __attribute__((__packed__)) REPARSE_INDEX_KEY;
/*
* Quota flags (32-bit).
@@ -2132,7 +2132,7 @@ typedef struct {
SID sid; /* The SID of the user/object associated with
this quota entry. Equals zero for the quota
defaults entry. */
-} __attribute__ ((__packed__)) QUOTA_CONTROL_ENTRY;
+} __attribute__((__packed__)) QUOTA_CONTROL_ENTRY;
/*
* Predefined owner_id values (32-bit).
@@ -2156,7 +2156,7 @@ typedef enum {
entry does not represent a file but it
can point to a sub-node. */
INDEX_ENTRY_SPACE_FILLER = 0xffff, /* Just to force 16-bit width. */
-} __attribute__ ((__packed__)) INDEX_ENTRY_FLAGS;
+} __attribute__((__packed__)) INDEX_ENTRY_FLAGS;
/*
* This the index entry header (see below).
@@ -2173,8 +2173,8 @@ typedef struct {
index key. */
u16 data_length; /* Data length in bytes. */
u32 reservedV; /* Reserved (zero). */
- } __attribute__ ((__packed__));
- } __attribute__ ((__packed__));
+ } __attribute__((__packed__));
+ } __attribute__((__packed__));
/* 8*/ u16 length; /* Byte size of this index entry, multiple of
8-bytes. */
/* 10*/ u16 key_length; /* Byte size of the key value, which is in the
@@ -2183,7 +2183,7 @@ typedef struct {
/* 12*/ INDEX_ENTRY_FLAGS flags; /* Bit field of INDEX_ENTRY_* flags. */
/* 14*/ u16 reserved; /* Reserved/align to 8-byte boundary. */
/* sizeof() = 16 bytes */
-} __attribute__ ((__packed__)) INDEX_ENTRY_HEADER;
+} __attribute__((__packed__)) INDEX_ENTRY_HEADER;
/*
* This is an index entry. A sequence of such entries follows each INDEX_HEADER
@@ -2205,8 +2205,8 @@ typedef struct {
index key. */
u16 data_length; /* Data length in bytes. */
u32 reservedV; /* Reserved (zero). */
- } __attribute__ ((__packed__));
- } __attribute__ ((__packed__));
+ } __attribute__((__packed__));
+ } __attribute__((__packed__));
u16 length; /* Byte size of this index entry, multiple of
8-bytes. */
u16 key_length; /* Byte size of the key value, which is in the
@@ -2234,7 +2234,7 @@ typedef struct {
user_id of the owner of the quota
control entry in the data part of
the index. */
- } __attribute__ ((__packed__)) key;
+ } __attribute__((__packed__)) key;
/* The (optional) index data is inserted here when creating. */
// VCN vcn; /* If INDEX_ENTRY_NODE bit in flags is set, the last
@@ -2249,7 +2249,7 @@ typedef struct {
// aligned vcn of INDEX_ENTRY{_HEADER} *ie is given by
// (char*)ie + le16_to_cpu(ie->length) - sizeof(VCN),
// where sizeof(VCN) can be hardcoded as 8 if wanted. */
-} __attribute__ ((__packed__)) INDEX_ENTRY;
+} __attribute__((__packed__)) INDEX_ENTRY;
/*
* Attribute: Bitmap (0xb0).
@@ -2263,7 +2263,7 @@ typedef struct {
*/
typedef struct {
u8 bitmap[0]; /* Array of bits. */
-} __attribute__ ((__packed__)) BITMAP_ATTR;
+} __attribute__((__packed__)) BITMAP_ATTR;
/*
* The reparse point tag defines the type of the reparse point. It also
@@ -2316,7 +2316,7 @@ typedef struct {
u16 reparse_data_length; /* Byte size of reparse data. */
u16 reserved; /* Align to 8-byte boundary. */
u8 reparse_data[0]; /* Meaning depends on reparse_tag. */
-} __attribute__ ((__packed__)) REPARSE_POINT;
+} __attribute__((__packed__)) REPARSE_POINT;
/*
* Attribute: Extended attribute (EA) information (0xd0).
@@ -2333,14 +2333,14 @@ typedef struct {
ZwQueryEaFile() in Windows NT/2k. I.e. the
byte size of the unpacked extended
attributes. */
-} __attribute__ ((__packed__)) EA_INFORMATION;
+} __attribute__((__packed__)) EA_INFORMATION;
/*
* Extended attribute flags (8-bit).
*/
typedef enum {
NEED_EA = 0x80,
-} __attribute__ ((__packed__)) EA_FLAGS;
+} __attribute__((__packed__)) EA_FLAGS;
/*
* Attribute: Extended attribute (EA) (0xe0).
@@ -2360,7 +2360,7 @@ typedef struct {
u8 name[0]; /* Name of the EA. */
u8 value[0]; /* The value of the EA. Immediately
follows the name. */
-} __attribute__ ((__packed__)) EA_ATTR;
+} __attribute__((__packed__)) EA_ATTR;
/*
* Attribute: Property set (0xf0).
@@ -2370,7 +2370,7 @@ typedef struct {
*/
typedef struct {
/* Irrelevant as feature unused. */
-} __attribute__ ((__packed__)) PROPERTY_SET;
+} __attribute__((__packed__)) PROPERTY_SET;
/*
* Attribute: Logged utility stream (0x100).
@@ -2385,7 +2385,7 @@ typedef struct {
*/
typedef struct {
/* Can be anything the creator chooses. */
-} __attribute__ ((__packed__)) LOGGED_UTILITY_STREAM;
+} __attribute__((__packed__)) LOGGED_UTILITY_STREAM;
/*
* $EFS Data Structure:
@@ -2430,12 +2430,12 @@ typedef struct {
recovery fields (DRF), see below. Zero if
no DRFs are present. */
u32 reserved; /* Reserved. */
-} __attribute__ ((__packed__)) EFS_ATTR_HEADER;
+} __attribute__((__packed__)) EFS_ATTR_HEADER;
typedef struct {
u32 df_count; /* Number of data decryption/recovery fields in
the array. */
-} __attribute__ ((__packed__)) EFS_DF_ARRAY_HEADER;
+} __attribute__((__packed__)) EFS_DF_ARRAY_HEADER;
typedef struct {
/* 0*/ u32 df_length; /* Length of this data decryption/recovery
@@ -2446,7 +2446,7 @@ typedef struct {
u32 fek_offset; /* Offset in bytes to the FEK from the start of
the data decryption/recovery field. */
/* 16*/ u32 unknown1; /* always 0? Might be just padding. */
-} __attribute__ ((__packed__)) EFS_DF_HEADER;
+} __attribute__((__packed__)) EFS_DF_HEADER;
typedef struct {
/* 0*/ u32 cred_length; /* Length of this credential in bytes. */
@@ -2472,7 +2472,7 @@ typedef struct {
structure. */
/* 24*/ u32 public_key_blob_size; /* Size in bytes of
public key blob. */
- } __attribute__ ((__packed__));
+ } __attribute__((__packed__));
/* Certificate thumbprint. */
struct {
/* 12*/ u32 cert_thumbprint_header_size; /* Size in
@@ -2483,9 +2483,9 @@ typedef struct {
thumbprint from start of this structure. */
u32 unknown1; /* Always 0? Might be padding... */
u32 unknown2; /* Always 0? Might be padding... */
- } __attribute__ ((__packed__));
- } __attribute__ ((__packed__));
-} __attribute__ ((__packed__)) EFS_DF_CREDENTIAL_HEADER;
+ } __attribute__((__packed__));
+ } __attribute__((__packed__));
+} __attribute__((__packed__)) EFS_DF_CREDENTIAL_HEADER;
typedef EFS_DF_CREDENTIAL_HEADER EFS_DF_CRED_HEADER;
@@ -2503,7 +2503,7 @@ typedef struct {
from start of this structure or 0 if
no user name present. (This is also
known as lpDisplayInformation.) */
-} __attribute__ ((__packed__)) EFS_DF_CERTIFICATE_THUMBPRINT_HEADER;
+} __attribute__((__packed__)) EFS_DF_CERTIFICATE_THUMBPRINT_HEADER;
typedef EFS_DF_CERTIFICATE_THUMBPRINT_HEADER EFS_DF_CERT_THUMBPRINT_HEADER;
Index: logfile.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/include/ntfs/logfile.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -p -r1.13 -r1.14
--- logfile.h 24 Sep 2005 15:59:53 -0000 1.13
+++ logfile.h 21 Oct 2005 18:05:13 -0000 1.14
@@ -92,7 +92,7 @@ typedef struct {
/* 28*/ sle16 major_ver; /* Log file major version. We only support
version 1.1. */
/* sizeof() = 30 (0x1e) bytes */
-} __attribute__ ((__packed__)) RESTART_PAGE_HEADER;
+} __attribute__((__packed__)) RESTART_PAGE_HEADER;
/*
* Constant for the log client indices meaning that there are no client records
@@ -109,7 +109,7 @@ typedef struct {
enum {
RESTART_VOLUME_IS_CLEAN = const_cpu_to_le16(0x0002),
RESTART_SPACE_FILLER = 0xffff, /* gcc: Force enum bit width to 16. */
-} __attribute__ ((__packed__));
+} __attribute__((__packed__));
typedef le16 RESTART_AREA_FLAGS;
@@ -250,7 +250,7 @@ typedef struct {
system time in NTFS format (see time.h). */
/* 44*/ le32 reserved; /* Reserved/alignment to 8-byte boundary. */
/* sizeof() = 48 (0x30) bytes */
-} __attribute__ ((__packed__)) RESTART_AREA;
+} __attribute__((__packed__)) RESTART_AREA;
/*
* Log client record. The offset of this record is found by adding the offset
@@ -289,7 +289,7 @@ typedef struct {
always be "NTFS" with the remaining bytes
set to 0. */
/* sizeof() = 160 (0xa0) bytes */
-} __attribute__ ((__packed__)) LOG_CLIENT_RECORD;
+} __attribute__((__packed__)) LOG_CLIENT_RECORD;
/*
* Log page record page header. Each log page begins with this header and is
@@ -309,7 +309,7 @@ typedef struct {
union {
LSN last_lsn;
s64 file_offset;
- } __attribute__ ((__packed__)) copy;
+ } __attribute__((__packed__)) copy;
u32 flags;
u16 page_count;
u16 page_position;
@@ -318,9 +318,9 @@ typedef struct {
u16 next_record_offset;
u8 reserved[6];
LSN last_end_lsn;
- } __attribute__ ((__packed__)) packed;
- } __attribute__ ((__packed__)) header;
-} __attribute__ ((__packed__)) RECORD_PAGE_HEADER;
+ } __attribute__((__packed__)) packed;
+ } __attribute__((__packed__)) header;
+} __attribute__((__packed__)) RECORD_PAGE_HEADER;
/*
* Possible 16-bit flags for log records. (Or is it log record pages?)
@@ -330,7 +330,7 @@ typedef enum {
LOG_RECORD_SIZE_PLACE_HOLDER = 0xffff,
/* This has nothing to do with the log record. It is only so
gcc knows to make the flags 16-bit. */
-} __attribute__ ((__packed__)) LOG_RECORD_FLAGS;
+} __attribute__((__packed__)) LOG_RECORD_FLAGS;
/*
* The log client id structure identifying a log client.
@@ -338,7 +338,7 @@ typedef enum {
typedef struct {
u16 seq_number;
u16 client_index;
-} __attribute__ ((__packed__)) LOG_CLIENT_ID;
+} __attribute__((__packed__)) LOG_CLIENT_ID;
/*
* Log record header. Each log record seems to have a constant size of 0x70
@@ -374,7 +374,7 @@ typedef struct {
is not 0. */
LCN lcn;
} __attribute__((__packed__)) lcn_list[0];
-} __attribute__ ((__packed__)) LOG_RECORD;
+} __attribute__((__packed__)) LOG_RECORD;
extern BOOL ntfs_check_logfile(ntfs_attr *log_na, RESTART_PAGE_HEADER **rp);
extern BOOL ntfs_is_logfile_clean(ntfs_attr *log_na, RESTART_PAGE_HEADER *rp);
Index: logging.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/include/ntfs/logging.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- logging.h 16 Oct 2005 21:57:00 -0000 1.1
+++ logging.h 21 Oct 2005 18:05:13 -0000 1.2
@@ -22,7 +22,9 @@
#ifndef _LOGGING_H_
#define _LOGGING_H_
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif
#ifdef HAVE_STDARG_H
#include <stdarg.h>
@@ -33,8 +35,8 @@
struct ntfs_logging;
/* Function prototype for the logging handlers */
-typedef int (logging_handler) (const char *handler, const char *file, int line,
- int level, FILE *stream, const char *format, va_list args);
+typedef int (ntfs_logging_handler)(const char *function, const char *file, int line,
+ u32 level, void *data, const char *format, va_list args);
/**
* struct ntfs_logging - Control info for the logging system
@@ -45,69 +47,72 @@ typedef int (logging_handler) (const cha
struct ntfs_logging {
u32 levels;
u32 flags;
- logging_handler *handler;
+ ntfs_logging_handler *handler;
};
extern struct ntfs_logging ntfs_log;
-void ntfs_logging_set_handler (logging_handler *handler);
+void ntfs_logging_set_handler(ntfs_logging_handler *handler);
/* Enable/disable certain log levels */
-u32 ntfs_logging_set_levels (u32 levels);
-u32 ntfs_logging_clear_levels (u32 levels);
-u32 ntfs_logging_get_levels (void);
+u32 ntfs_logging_set_levels(u32 levels);
+u32 ntfs_logging_clear_levels(u32 levels);
+u32 ntfs_logging_get_levels(void);
/* Enable/disable certain log flags */
-u32 ntfs_logging_set_flags (u32 flags);
-u32 ntfs_logging_clear_flags (u32 flags);
-u32 ntfs_logging_get_flags (void);
-
-BOOL ntfs_logging_parse_option (const char *option);
-
-int ntfs_logging_redirect (const char *handler, const char *file, int line,
- int level, FILE *stream, const char *format, ...)
- __attribute__ ((format (printf, 6, 7)));
+u32 ntfs_logging_set_flags(u32 flags);
+u32 ntfs_logging_clear_flags(u32 flags);
+u32 ntfs_logging_get_flags(void);
+
+BOOL ntfs_logging_parse_option(const char *option);
+
+int ntfs_logging_redirect(const char *function, const char *file, int line,
+ u32 level, void *data, const char *format, ...)
+ __attribute__((format(printf, 6, 7)));
/* Logging handlers */
-logging_handler ntfs_logging_handler_printf __attribute__ ((format (printf, 6, 0)));
-logging_handler ntfs_logging_handler_colour __attribute__ ((format (printf, 6, 0)));
+ntfs_logging_handler ntfs_logging_handler_printf __attribute__((format(printf, 6, 0)));
+ntfs_logging_handler ntfs_logging_handler_colour __attribute__((format(printf, 6, 0)));
/* Logging levels - Determine what gets logged */
-#define LOG_LEVEL_DEBUG (1 << 0) /* x = 42 */
-#define LOG_LEVEL_TRACE (1 << 1) /* Entering function x() */
-#define LOG_LEVEL_QUIET (1 << 2) /* Quietable output */
-#define LOG_LEVEL_INFO (1 << 3) /* Volume needs defragmenting */
-#define LOG_LEVEL_VERBOSE (1 << 4) /* Forced to continue */
-#define LOG_LEVEL_PROGRESS (1 << 5) /* 54% complete */
-#define LOG_LEVEL_WARNING (1 << 6) /* You should backup before starting */
-#define LOG_LEVEL_ERROR (1 << 7) /* Operation failed, no damage done */
-#define LOG_LEVEL_PERROR (1 << 8) /* Message : standard error description */
-#define LOG_LEVEL_CRITICAL (1 << 9) /* Operation failed,damage may have occurred */
+#define NTFS_LOG_LEVEL_DEBUG (1 << 0) /* x = 42 */
+#define NTFS_LOG_LEVEL_TRACE (1 << 1) /* Entering function x() */
+#define NTFS_LOG_LEVEL_QUIET (1 << 2) /* Quietable output */
+#define NTFS_LOG_LEVEL_INFO (1 << 3) /* Volume needs defragmenting */
+#define NTFS_LOG_LEVEL_VERBOSE (1 << 4) /* Forced to continue */
+#define NTFS_LOG_LEVEL_PROGRESS (1 << 5) /* 54% complete */
+#define NTFS_LOG_LEVEL_WARNING (1 << 6) /* You should backup before starting */
+#define NTFS_LOG_LEVEL_ERROR (1 << 7) /* Operation failed, no damage done */
+#define NTFS_LOG_LEVEL_PERROR (1 << 8) /* Message : standard error description */
+#define NTFS_LOG_LEVEL_CRITICAL (1 << 9) /* Operation failed,damage may have occurred */
+#define NTFS_LOG_LEVEL_REASON (1 << 10) /* Human readable reason for failure */
/* Logging style flags - Manage the style of the output */
-#define LOG_FLAG_PREFIX (1 << 0) /* Prefix messages with "ERROR: ", etc */
-#define LOG_FLAG_FILENAME (1 << 1) /* Show the file origin of the message */
-#define LOG_FLAG_LINE (1 << 2) /* Show the line number of the message */
-#define LOG_FLAG_FUNCTION (1 << 3) /* Show the function name containing the message */
+#define NTFS_LOG_FLAG_PREFIX (1 << 0) /* Prefix messages with "ERROR: ", etc */
+#define NTFS_LOG_FLAG_FILENAME (1 << 1) /* Show the file origin of the message */
+#define NTFS_LOG_FLAG_LINE (1 << 2) /* Show the line number of the message */
+#define NTFS_LOG_FLAG_FUNCTION (1 << 3) /* Show the function name containing the message */
+#define NTFS_LOG_FLAG_ONLYNAME (1 << 4) /* Only display the filename, not the pathname */
/* Macros to simplify logging. One for each level defined above.
- * Note, if DEBUG isn't defined, then log_debug has no effect.
+ * Note, if NTFS_DISABLE_DEBUG_LOGGING is defined, then ntfs_log_debug/trace have no effect.
*/
-#define log_crit(FORMAT, ARGS...) ntfs_logging_redirect (__FUNCTION__,__FILE__,__LINE__,LOG_LEVEL_CRITICAL,NULL,FORMAT,##ARGS)
-#define log_error(FORMAT, ARGS...) ntfs_logging_redirect (__FUNCTION__,__FILE__,__LINE__,LOG_LEVEL_ERROR,NULL,FORMAT,##ARGS)
-#define log_info(FORMAT, ARGS...) ntfs_logging_redirect (__FUNCTION__,__FILE__,__LINE__,LOG_LEVEL_INFO,NULL,FORMAT,##ARGS)
-#define log_perror(FORMAT, ARGS...) ntfs_logging_redirect (__FUNCTION__,__FILE__,__LINE__,LOG_LEVEL_PERROR,NULL,FORMAT,##ARGS)
-#define log_progress(FORMAT, ARGS...) ntfs_logging_redirect (__FUNCTION__,__FILE__,__LINE__,LOG_LEVEL_PROGRESS,NULL,FORMAT,##ARGS)
-#define log_quiet(FORMAT, ARGS...) ntfs_logging_redirect (__FUNCTION__,__FILE__,__LINE__,LOG_LEVEL_QUIET,NULL,FORMAT,##ARGS)
-#define log_verbose(FORMAT, ARGS...) ntfs_logging_redirect (__FUNCTION__,__FILE__,__LINE__,LOG_LEVEL_VERBOSE,NULL,FORMAT,##ARGS)
-#define log_warn(FORMAT, ARGS...) ntfs_logging_redirect (__FUNCTION__,__FILE__,__LINE__,LOG_LEVEL_WARNING,NULL,FORMAT,##ARGS)
+#define ntfs_log_critical(FORMAT, ARGS...) ntfs_logging_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_CRITICAL,NULL,FORMAT,##ARGS)
+#define ntfs_log_error(FORMAT, ARGS...) ntfs_logging_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_ERROR,NULL,FORMAT,##ARGS)
+#define ntfs_log_info(FORMAT, ARGS...) ntfs_logging_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_INFO,NULL,FORMAT,##ARGS)
+#define ntfs_log_perror(FORMAT, ARGS...) ntfs_logging_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_PERROR,NULL,FORMAT,##ARGS)
+#define ntfs_log_progress(FORMAT, ARGS...) ntfs_logging_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_PROGRESS,NULL,FORMAT,##ARGS)
+#define ntfs_log_quiet(FORMAT, ARGS...) ntfs_logging_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_QUIET,NULL,FORMAT,##ARGS)
+#define ntfs_log_verbose(FORMAT, ARGS...) ntfs_logging_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_VERBOSE,NULL,FORMAT,##ARGS)
+#define ntfs_log_warning(FORMAT, ARGS...) ntfs_logging_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_WARNING,NULL,FORMAT,##ARGS)
+#define ntfs_log_reason(FORMAT, ARGS...) ntfs_logging_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_REASON,NULL,FORMAT,##ARGS)
#ifdef NTFS_DISABLE_DEBUG_LOGGING
-#define log_debug(FORMAT, ARGS...)do {} while (0)
-#define log_trace(FORMAT, ARGS...)do {} while (0)
+#define ntfs_log_debug(FORMAT, ARGS...)do {} while (0)
+#define ntfs_log_trace(FORMAT, ARGS...)do {} while (0)
#else
-#define log_debug(FORMAT, ARGS...) ntfs_logging_redirect (__FUNCTION__,__FILE__,__LINE__,LOG_LEVEL_DEBUG,NULL,FORMAT,##ARGS)
-#define log_trace(FORMAT, ARGS...) ntfs_logging_redirect (__FUNCTION__,__FILE__,__LINE__,LOG_LEVEL_TRACE,NULL,FORMAT,##ARGS)
+#define ntfs_log_debug(FORMAT, ARGS...) ntfs_logging_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_DEBUG,NULL,FORMAT,##ARGS)
+#define ntfs_log_trace(FORMAT, ARGS...) ntfs_logging_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_TRACE,NULL,FORMAT,##ARGS)
#endif /* NTFS_DISABLE_DEBUG_LOGGING */
#endif /* _LOGGING_H_ */
Index: mft.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/include/ntfs/mft.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- mft.h 16 Oct 2005 23:33:04 -0000 1.6
+++ mft.h 21 Oct 2005 18:05:13 -0000 1.7
@@ -116,11 +116,11 @@ extern int ntfs_mft_record_free(ntfs_vol
#include "bitmap.h"
#include "dir.h"
-int ntfs_mft_remove_attr (struct ntfs_bmp *bmp, ntfs_inode *inode, ATTR_TYPES type);
-ATTR_RECORD * ntfs_mft_add_attr (ntfs_inode *inode, ATTR_TYPES type, u8 *data, int data_len);
-int ntfs_mft_resize_resident (ntfs_inode *inode, ATTR_TYPES type, ntfschar *name, int name_len, u8 *data, int data_len);
-int ntfs_mft_free_space (struct ntfs_dir *dir);
-int ntfs_mft_add_index (struct ntfs_dir *dir);
+int ntfs_mft_remove_attr(struct ntfs_bmp *bmp, ntfs_inode *inode, ATTR_TYPES type);
+ATTR_RECORD * ntfs_mft_add_attr(ntfs_inode *inode, ATTR_TYPES type, u8 *data, int data_len);
+int ntfs_mft_resize_resident(ntfs_inode *inode, ATTR_TYPES type, ntfschar *name, int name_len, u8 *data, int data_len);
+int ntfs_mft_free_space(struct ntfs_dir *dir);
+int ntfs_mft_add_index(struct ntfs_dir *dir);
#endif /* NTFS_RICH */
Index: ntfstime.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/include/ntfs/ntfstime.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- ntfstime.h 14 Aug 2005 15:44:47 -0000 1.2
+++ ntfstime.h 21 Oct 2005 18:05:13 -0000 1.3
@@ -23,7 +23,9 @@
#ifndef _NTFS_NTFSTIME_H
#define _NTFS_NTFSTIME_H
+#ifdef HAVE_TIME_H
#include <time.h>
+#endif
#include "types.h"
Index: rich.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/include/ntfs/rich.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- rich.h 16 Oct 2005 23:33:04 -0000 1.1
+++ rich.h 21 Oct 2005 18:05:13 -0000 1.2
@@ -1,4 +1,4 @@
-/**
+/*
* rich.h - Temporary junk file. Part of the Linux-NTFS project.
*
* Copyright (c) 2004-2005 Richard Russon
@@ -40,11 +40,11 @@
#define ROUND_DOWN(num,bound) ((num) & ~((bound)-1))
#define ATTR_SIZE(s) ROUND_UP(s,8)
-ATTR_RECORD * find_attribute (const ATTR_TYPES type, ntfs_attr_search_ctx *ctx);
-ATTR_RECORD * find_first_attribute (const ATTR_TYPES type, MFT_RECORD *mft);
-int utils_free_non_residents3 (struct ntfs_bmp *bmp, ntfs_inode *inode, ATTR_RECORD *attr);
-int utils_free_non_residents2 (ntfs_inode *inode, struct ntfs_bmp *bmp);
-void ntfs_name_print (ntfschar *name, int name_len);
+ATTR_RECORD * find_attribute(const ATTR_TYPES type, ntfs_attr_search_ctx *ctx);
+ATTR_RECORD * find_first_attribute(const ATTR_TYPES type, MFT_RECORD *mft);
+int utils_free_non_residents3(struct ntfs_bmp *bmp, ntfs_inode *inode, ATTR_RECORD *attr);
+int utils_free_non_residents2(ntfs_inode *inode, struct ntfs_bmp *bmp);
+void ntfs_name_print(ntfschar *name, int name_len);
#endif /* _NTFS_RICH_H_ */
Index: runlist.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/include/ntfs/runlist.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -p -r1.8 -r1.9
--- runlist.h 13 Sep 2005 14:30:53 -0000 1.8
+++ runlist.h 21 Oct 2005 18:05:13 -0000 1.9
@@ -80,7 +80,7 @@ extern int ntfs_rl_sparse(runlist *rl);
extern s64 ntfs_rl_get_compressed_size(ntfs_volume *vol, runlist *rl);
#ifdef NTFS_TEST
-int test_rl_main (int argc, char *argv[]);
+int test_rl_main(int argc, char *argv[]);
#endif
#endif /* defined _NTFS_RUNLIST_H */
Index: support.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/include/ntfs/support.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- support.h 17 Jan 2005 11:46:32 -0000 1.6
+++ support.h 21 Oct 2005 18:05:13 -0000 1.7
@@ -26,7 +26,9 @@
#include "config.h"
#endif
+#ifdef HAVE_STDDEF_H
#include <stddef.h>
+#endif
/*
* Generic macro to convert pointers to values for comparison purposes.
Index: tree.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/include/ntfs/tree.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- tree.h 16 Oct 2005 23:33:04 -0000 1.1
+++ tree.h 21 Oct 2005 18:05:13 -0000 1.2
@@ -1,4 +1,4 @@
-/**
+/*
* tree.h - Directory tree handling code. Part of the Linux-NTFS project.
*
* Copyright (c) 2004-2005 Richard Russon
@@ -45,38 +45,38 @@ struct ntfs_dt {
};
-void ntfs_dt_free (struct ntfs_dt *dt);
-int ntfs_dt_rollback (struct ntfs_dt *dt);
-int ntfs_dt_commit (struct ntfs_dt *dt);
-BOOL ntfs_dt_create_children2 (struct ntfs_dt *dt, int count);
-BOOL ntfs_dt_resize_children3 (struct ntfs_dt *dt, int new);
-int ntfs_dt_root_count (struct ntfs_dt *dt);
-int ntfs_dt_alloc_count (struct ntfs_dt *dt);
-int ntfs_dt_initialise2 (ntfs_volume *vol, struct ntfs_dt *dt);
-struct ntfs_dt * ntfs_dt_create (struct ntfs_dir *dir, struct ntfs_dt *parent, VCN vcn);
-MFT_REF ntfs_dt_find (struct ntfs_dt *dt, ntfschar *name, int name_len);
-struct ntfs_dt * ntfs_dt_find2 (struct ntfs_dt *dt, ntfschar *name, int name_len, int *index_num);
-struct ntfs_dt * ntfs_dt_find3 (struct ntfs_dt *dt, ntfschar *name, int name_len, int *index_num);
-struct ntfs_dt * ntfs_dt_find4 (struct ntfs_dt *dt, ntfschar *name, int name_len, int *index_num);
-void ntfs_dt_find_all (struct ntfs_dt *dt);
-int ntfs_dt_find_parent (struct ntfs_dt *dt);
-BOOL ntfs_dt_isroot (struct ntfs_dt *dt);
-int ntfs_dt_root_freespace (struct ntfs_dt *dt);
-int ntfs_dt_alloc_freespace (struct ntfs_dt *dt);
-int ntfs_dt_transfer (struct ntfs_dt *old, struct ntfs_dt *new, int start, int count);
-int ntfs_dt_alloc_insert (struct ntfs_dt *dt, INDEX_ENTRY *first, int count);
-INDEX_ENTRY * ntfs_dt_alloc_insert2 (struct ntfs_dt *dt, int before, int count, int bytes);
-int ntfs_dt_root_insert (struct ntfs_dt *dt, INDEX_ENTRY *first, int count);
-int ntfs_dt_alloc_remove2 (struct ntfs_dt *dt, int start, int count);
-int ntfs_dt_root_remove2 (struct ntfs_dt *dt, int start, int count);
-int ntfs_dt_transfer2 (struct ntfs_dt *old, struct ntfs_dt *new, int start, int count);
-int ntfs_dt_root_replace (struct ntfs_dt *del, int del_num, INDEX_ENTRY *del_ie, INDEX_ENTRY *suc_ie);
-BOOL ntfs_dt_alloc_replace (struct ntfs_dt *del, int del_num, INDEX_ENTRY *del_ie, INDEX_ENTRY *suc_ie);
-BOOL ntfs_dt_root_remove (struct ntfs_dt *del, int del_num);
-BOOL ntfs_dt_alloc_remove (struct ntfs_dt *del, int del_num);
-int ntfs_dt_alloc_add (struct ntfs_dt *parent, int index_num, INDEX_ENTRY *ie, struct ntfs_dt *child);
-int ntfs_dt_root_add (struct ntfs_dt *parent, int index_num, INDEX_ENTRY *ie, struct ntfs_dt *child);
-int ntfs_dt_add2 (INDEX_ENTRY *ie, struct ntfs_dt *suc, int suc_num, struct ntfs_dt *ded);
+void ntfs_dt_free(struct ntfs_dt *dt);
+int ntfs_dt_rollback(struct ntfs_dt *dt);
+int ntfs_dt_commit(struct ntfs_dt *dt);
+BOOL ntfs_dt_create_children2(struct ntfs_dt *dt, int count);
+BOOL ntfs_dt_resize_children3(struct ntfs_dt *dt, int new);
+int ntfs_dt_root_count(struct ntfs_dt *dt);
+int ntfs_dt_alloc_count(struct ntfs_dt *dt);
+int ntfs_dt_initialise2(ntfs_volume *vol, struct ntfs_dt *dt);
+struct ntfs_dt * ntfs_dt_create(struct ntfs_dir *dir, struct ntfs_dt *parent, VCN vcn);
+MFT_REF ntfs_dt_find(struct ntfs_dt *dt, ntfschar *name, int name_len);
+struct ntfs_dt * ntfs_dt_find2(struct ntfs_dt *dt, ntfschar *name, int name_len, int *index_num);
+struct ntfs_dt * ntfs_dt_find3(struct ntfs_dt *dt, ntfschar *name, int name_len, int *index_num);
+struct ntfs_dt * ntfs_dt_find4(struct ntfs_dt *dt, ntfschar *name, int name_len, int *index_num);
+void ntfs_dt_find_all(struct ntfs_dt *dt);
+int ntfs_dt_find_parent(struct ntfs_dt *dt);
+BOOL ntfs_dt_isroot(struct ntfs_dt *dt);
+int ntfs_dt_root_freespace(struct ntfs_dt *dt);
+int ntfs_dt_alloc_freespace(struct ntfs_dt *dt);
+int ntfs_dt_transfer(struct ntfs_dt *old, struct ntfs_dt *new, int start, int count);
+int ntfs_dt_alloc_insert(struct ntfs_dt *dt, INDEX_ENTRY *first, int count);
+INDEX_ENTRY * ntfs_dt_alloc_insert2(struct ntfs_dt *dt, int before, int count, int bytes);
+int ntfs_dt_root_insert(struct ntfs_dt *dt, INDEX_ENTRY *first, int count);
+int ntfs_dt_alloc_remove2(struct ntfs_dt *dt, int start, int count);
+int ntfs_dt_root_remove2(struct ntfs_dt *dt, int start, int count);
+int ntfs_dt_transfer2(struct ntfs_dt *old, struct ntfs_dt *new, int start, int count);
+int ntfs_dt_root_replace(struct ntfs_dt *del, int del_num, INDEX_ENTRY *del_ie, INDEX_ENTRY *suc_ie);
+BOOL ntfs_dt_alloc_replace(struct ntfs_dt *del, int del_num, INDEX_ENTRY *del_ie, INDEX_ENTRY *suc_ie);
+BOOL ntfs_dt_root_remove(struct ntfs_dt *del, int del_num);
+BOOL ntfs_dt_alloc_remove(struct ntfs_dt *del, int del_num);
+int ntfs_dt_alloc_add(struct ntfs_dt *parent, int index_num, INDEX_ENTRY *ie, struct ntfs_dt *child);
+int ntfs_dt_root_add(struct ntfs_dt *parent, int index_num, INDEX_ENTRY *ie, struct ntfs_dt *child);
+int ntfs_dt_add2(INDEX_ENTRY *ie, struct ntfs_dt *suc, int suc_num, struct ntfs_dt *ded);
#endif /* _NTFS_TREE_H_ */
Index: types.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/include/ntfs/types.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -p -r1.11 -r1.12
--- types.h 20 Oct 2005 00:56:11 -0000 1.11
+++ types.h 21 Oct 2005 18:05:13 -0000 1.12
@@ -30,7 +30,9 @@
#if HAVE_STDINT_H || !HAVE_CONFIG_H
#include <stdint.h>
#endif
+#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
+#endif
typedef uint8_t u8; /* Unsigned types of an exact size */
typedef uint16_t u16;
Index: version.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/include/ntfs/version.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- version.h 7 Oct 2005 14:10:57 -0000 1.2
+++ version.h 21 Oct 2005 18:05:13 -0000 1.3
@@ -1,4 +1,4 @@
-/**
+/*
* version.h - Info about the NTFS library. Part of the Linux-NTFS project.
*
* Copyright (c) 2005 Anton Altaparmakov
Index: volume.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/include/ntfs/volume.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -p -r1.15 -r1.16
--- volume.h 16 Oct 2005 23:33:04 -0000 1.15
+++ volume.h 21 Oct 2005 18:05:13 -0000 1.16
@@ -28,15 +28,17 @@
#include "config.h"
#endif
+#ifdef HAVE_STDIO_H
#include <stdio.h>
+#endif
#ifdef HAVE_SYS_PARAM_H
-# include <sys/param.h>
+#include <sys/param.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
-# include <sys/mount.h>
+#include <sys/mount.h>
#endif
#ifdef HAVE_MNTENT_H
-# include <mntent.h>
+#include <mntent.h>
#endif
/* Both under Cygwin and DJGPP we do not have MS_RDONLY, so we define it. */
@@ -206,12 +208,12 @@ extern int ntfs_volume_write_flags(ntfs_
#ifdef NTFS_RICH
-int ntfs_volume_commit (ntfs_volume *vol);
-int ntfs_volume_rollback (ntfs_volume *vol);
-int ntfs_volume_umount2 (ntfs_volume *vol, const BOOL force);
-ntfs_volume * ntfs_volume_mount2 (const char *device, unsigned long flags, BOOL force);
-int utils_valid_device (const char *name, int force);
-ntfs_volume * utils_mount_volume (const char *device, unsigned long flags, BOOL force);
+int ntfs_volume_commit(ntfs_volume *vol);
+int ntfs_volume_rollback(ntfs_volume *vol);
+int ntfs_volume_umount2(ntfs_volume *vol, const BOOL force);
+ntfs_volume * ntfs_volume_mount2(const char *device, unsigned long flags, BOOL force);
+int utils_valid_device(const char *name, int force);
+ntfs_volume * utils_mount_volume(const char *device, unsigned long flags, BOOL force);
#endif /* NTFS_RICH */
|