Changes by: flatcap
Update of /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24078/ntfsprogs
Modified Files:
cluster.c cluster.h mkntfs.c ntfscat.c ntfsclone.c
ntfscluster.c ntfscmp.c ntfscp.c ntfsdump_logfile.c ntfsfix.c
ntfsinfo.c ntfslabel.c ntfsls.c ntfsmftalloc.c ntfsmount.c
ntfsmove.c ntfsresize.c ntfsrm.c ntfstruncate.c ntfsundelete.c
ntfswipe.c
Log Message:
whitespace fixes - no code changes
Index: cluster.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/cluster.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -p -r1.9 -r1.10
--- cluster.c 16 Oct 2005 22:37:48 -0000 1.9
+++ cluster.c 26 Oct 2005 22:54:57 -0000 1.10
@@ -46,7 +46,7 @@
/**
* cluster_find
*/
-int cluster_find (ntfs_volume *vol, LCN c_begin, LCN c_end, cluster_cb *cb, void *data)
+int cluster_find(ntfs_volume *vol, LCN c_begin, LCN c_end, cluster_cb *cb, void *data)
{
u64 i;
int j;
@@ -62,7 +62,7 @@ int cluster_find (ntfs_volume *vol, LCN
// Quick check that at least one cluster is in use
for (i = c_begin; (LCN)i < c_end; i++) {
- if (utils_cluster_in_use (vol, i) == 1) {
+ if (utils_cluster_in_use(vol, i) == 1) {
in_use = 1;
break;
}
@@ -70,44 +70,44 @@ int cluster_find (ntfs_volume *vol, LCN
if (!in_use) {
if (c_begin == c_end)
- Vprintf ("cluster isn't in use\n");
+ Vprintf("cluster isn't in use\n");
else
- Vprintf ("clusters aren't in use\n");
+ Vprintf("clusters aren't in use\n");
return 0;
}
- m_ctx = mft_get_search_ctx (vol);
+ m_ctx = mft_get_search_ctx(vol);
m_ctx->flags_search = FEMR_IN_USE | FEMR_BASE_RECORD;
- while (mft_next_record (m_ctx) == 0) {
- //Qprintf (RED "Inode: %llu\n" NORM, (unsigned long long)
- Qprintf ("Inode: %llu\n", (unsigned long long)
+ while (mft_next_record(m_ctx) == 0) {
+ //Qprintf(RED "Inode: %llu\n" NORM, (unsigned long long)
+ Qprintf("Inode: %llu\n", (unsigned long long)
m_ctx->inode->mft_no);
if (!(m_ctx->flags_match & FEMR_BASE_RECORD))
continue;
- Vprintf ("Inode: %llu\n", (unsigned long long)
+ Vprintf("Inode: %llu\n", (unsigned long long)
m_ctx->inode->mft_no);
- a_ctx = ntfs_attr_get_search_ctx (m_ctx->inode, NULL);
+ a_ctx = ntfs_attr_get_search_ctx(m_ctx->inode, NULL);
- while ((rec = find_attribute (AT_UNUSED, a_ctx))) {
+ while ((rec = find_attribute(AT_UNUSED, a_ctx))) {
if (!rec->non_resident) {
- Vprintf ("0x%02x skipped - attr is resident\n", a_ctx->attr->type);
+ Vprintf("0x%02x skipped - attr is resident\n", a_ctx->attr->type);
continue;
}
- runs = ntfs_mapping_pairs_decompress (vol, a_ctx->attr, NULL);
+ runs = ntfs_mapping_pairs_decompress(vol, a_ctx->attr, NULL);
if (!runs) {
- Eprintf ("Couldn't read the data runs.\n");
+ Eprintf("Couldn't read the data runs.\n");
goto done;
}
- Vprintf ("\t[0x%02X]\n", a_ctx->attr->type);
+ Vprintf("\t[0x%02X]\n", a_ctx->attr->type);
- Vprintf ("\t\tVCN\tLCN\tLength\n");
+ Vprintf("\t\tVCN\tLCN\tLength\n");
for (j = 0; runs[j].length > 0; j++) {
LCN a_begin = runs[j].lcn;
LCN a_end = a_begin + runs[j].length - 1;
@@ -115,7 +115,7 @@ int cluster_find (ntfs_volume *vol, LCN
if (a_begin < 0)
continue; // sparse, discontiguous, etc
- Vprintf ("\t\t%lld\t%lld-%lld (%lld)\n",
+ Vprintf("\t\t%lld\t%lld-%lld (%lld)\n",
(long long)runs[j].vcn,
(long long)runs[j].lcn,
(long long)(runs[j].lcn +
@@ -131,14 +131,14 @@ int cluster_find (ntfs_volume *vol, LCN
}
}
- ntfs_attr_put_search_ctx (a_ctx);
+ ntfs_attr_put_search_ctx(a_ctx);
a_ctx = NULL;
}
result = 0;
done:
- ntfs_attr_put_search_ctx (a_ctx);
- mft_put_search_ctx (m_ctx);
+ ntfs_attr_put_search_ctx(a_ctx);
+ mft_put_search_ctx(m_ctx);
return result;
}
Index: cluster.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/cluster.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- cluster.h 6 Jun 2004 14:17:26 -0000 1.3
+++ cluster.h 26 Oct 2005 22:54:57 -0000 1.4
@@ -31,9 +31,9 @@ typedef struct {
int x;
} ntfs_cluster;
-typedef int (cluster_cb) (ntfs_inode *ino, ATTR_RECORD *attr, runlist_element *run, void *data);
+typedef int (cluster_cb)(ntfs_inode *ino, ATTR_RECORD *attr, runlist_element *run, void *data);
-int cluster_find (ntfs_volume *vol, LCN c_begin, LCN c_end, cluster_cb *cb, void *data);
+int cluster_find(ntfs_volume *vol, LCN c_begin, LCN c_end, cluster_cb *cb, void *data);
#endif /* _CLUSTER_H_ */
Index: mkntfs.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/mkntfs.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -p -r1.78 -r1.79
--- mkntfs.c 25 Oct 2005 01:28:11 -0000 1.78
+++ mkntfs.c 26 Oct 2005 22:54:57 -0000 1.79
@@ -305,7 +305,7 @@ static void license(void)
/**
* usage - print a list of the parameters to the program
*/
-__attribute__ ((noreturn))
+__attribute__((noreturn))
static void usage(void)
{
copyright();
@@ -1486,7 +1486,7 @@ static int mkntfs_attr_find(const ATTR_T
*/
static int mkntfs_attr_lookup(const ATTR_TYPES type, const ntfschar *name,
const u32 name_len, const IGNORE_CASE_BOOL ic,
- const VCN lowest_vcn __attribute__ ((unused)), const u8 *val,
+ const VCN lowest_vcn __attribute__((unused)), const u8 *val,
const u32 val_len, ntfs_attr_search_ctx *ctx)
{
ntfs_inode *base_ni;
@@ -3064,7 +3064,7 @@ static int initialize_objid(MFT_RECORD *
err = insert_index_entry_in_res_dir_index(idx_entry_o,
o_size, m,
NTFS_INDEX_O, 2, AT_UNUSED);
- if (idx_entry_o) free (idx_entry_o);
+ if (idx_entry_o) free(idx_entry_o);
return err;
}
Index: ntfscat.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfscat.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -p -r1.21 -r1.22
--- ntfscat.c 23 Oct 2005 14:00:37 -0000 1.21
+++ ntfscat.c 26 Oct 2005 22:54:57 -0000 1.22
@@ -50,10 +50,10 @@
static const char *EXEC_NAME = "ntfscat";
static struct options opts;
-GEN_PRINTF (Eprintf, stderr, NULL, FALSE)
-GEN_PRINTF (Vprintf, stderr, &opts.verbose, TRUE)
-GEN_PRINTF (Qprintf, stderr, &opts.quiet, FALSE)
-static GEN_PRINTF (Printf, stderr, NULL, FALSE)
+GEN_PRINTF(Eprintf, stderr, NULL, FALSE)
+GEN_PRINTF(Vprintf, stderr, &opts.verbose, TRUE)
+GEN_PRINTF(Qprintf, stderr, &opts.quiet, FALSE)
+static GEN_PRINTF(Printf, stderr, NULL, FALSE)
/**
* version - Print version information about the program
@@ -62,7 +62,7 @@ static GEN_PRINTF (Printf, stderr, NULL
*
* Return: none
*/
-static void version (void)
+static void version(void)
{
Printf("\n%s v%s (libntfs %s) - Concatenate files and print on the "
"standard output.\n\n", EXEC_NAME, VERSION,
@@ -78,17 +78,17 @@ static void version (void)
*
* Return: none
*/
-static void usage (void)
+static void usage(void)
{
Printf ("\nUsage: %s [options] device [file]\n\n"
- " -a, --attribute type Display this attribute type\n"
- " -n, --attribute-name name Display this attribute name\n"
- " -i, --inode num Display this inode\n\n"
- " -f --force Use less caution\n"
- " -h --help Print this help\n"
- " -q --quiet Less output\n"
- " -V --version Version information\n"
- " -v --verbose More output\n\n",
+ " -a, --attribute type Display this attribute type\n"
+ " -n, --attribute-name name Display this attribute name\n"
+ " -i, --inode num Display this inode\n\n"
+ " -f --force Use less caution\n"
+ " -h --help Print this help\n"
+ " -q --quiet Less output\n"
+ " -V --version Version information\n"
+ " -v --verbose More output\n\n",
//" -r --raw Display the compressed or encrypted file",
EXEC_NAME);
Printf ("%s%s\n", ntfs_bugs, ntfs_home);
@@ -106,7 +106,7 @@ static void usage (void)
* Return: 1 Success, a valid attribute name or number
* 0 Error, not an attribute name or number
*/
-static int parse_attribute (const char *value, ATTR_TYPES *attr)
+static int parse_attribute(const char *value, ATTR_TYPES *attr)
{
static const char *attr_name[] = {
"$STANDARD_INFORMATION",
@@ -132,14 +132,14 @@ static int parse_attribute (const char *
long num;
for (i = 0; attr_name[i]; i++) {
- if ((strcmp (value, attr_name[i]) == 0) ||
- (strcmp (value, attr_name[i]+1) == 0)) {
+ if ((strcmp(value, attr_name[i]) == 0) ||
+ (strcmp(value, attr_name[i]+1) == 0)) {
*attr = (ATTR_TYPES) ((i+1)*16);
return 1;
}
}
- num = strtol (value, NULL, 0);
+ num = strtol(value, NULL, 0);
if ((num > 0) && (num < 257)) {
*attr = (ATTR_TYPES) num;
return 1;
@@ -157,7 +157,7 @@ static int parse_attribute (const char *
* Return: 1 Success
* 0 Error, one or more problems
*/
-static int parse_options (int argc, char **argv)
+static int parse_options(int argc, char **argv)
{
static const char *sopt = "-a:fh?i:n:qVv";
static const struct option lopt[] = {
@@ -185,7 +185,7 @@ static int parse_options (int argc, char
opts.attr_name = NULL;
opts.attr_name_len = 0;
- while ((c = getopt_long (argc, argv, sopt, lopt, NULL)) != (char)-1) {
+ while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != (char)-1) {
switch (c) {
case 1: /* A non-option argument */
if (!opts.device) {
@@ -200,7 +200,7 @@ static int parse_options (int argc, char
case 'a':
if (opts.attr != (ATTR_TYPES)-1) {
Eprintf("You must specify exactly one attribute.\n");
- } else if (parse_attribute (optarg, &attr) > 0) {
+ } else if (parse_attribute(optarg, &attr) > 0) {
opts.attr = attr;
break;
} else {
@@ -226,7 +226,7 @@ static int parse_options (int argc, char
break;
case 'n':
- opts.attr_name_len = ntfs_mbstoucs(optarg,
+ opts.attr_name_len = ntfs_mbstoucs(optarg,
&opts.attr_name, 0);
if (opts.attr_name_len < 0) {
Eprintf("Invalid attribute name '%s': %s\n",
@@ -244,7 +244,7 @@ static int parse_options (int argc, char
opts.verbose++;
break;
default:
- Eprintf ("Unknown option '%s'.\n", argv[optind-1]);
+ Eprintf("Unknown option '%s'.\n", argv[optind-1]);
err++;
break;
}
@@ -254,16 +254,16 @@ static int parse_options (int argc, char
opts.quiet = 0;
} else {
if (opts.device == NULL) {
- Eprintf ("You must specify a device.\n");
+ Eprintf("You must specify a device.\n");
err++;
} else if (opts.file == NULL && opts.inode == -1) {
- Eprintf ("You must specify a file or inode "
+ Eprintf("You must specify a file or inode "
"with the -i option.\n");
err++;
} else if (opts.file != NULL && opts.inode != -1) {
- Eprintf ("You can't specify both a file and inode.\n");
+ Eprintf("You can't specify both a file and inode.\n");
err++;
}
@@ -291,12 +291,12 @@ static int parse_options (int argc, char
* Return: n Success, the INDX blocks are n bytes in size
* 0 Error, not a directory
*/
-static int index_get_size (ntfs_inode *inode)
+static int index_get_size(ntfs_inode *inode)
{
ATTR_RECORD *attr90;
INDEX_ROOT *iroot;
- attr90 = find_first_attribute (AT_INDEX_ROOT, inode->mrec);
+ attr90 = find_first_attribute(AT_INDEX_ROOT, inode->mrec);
if (!attr90)
return 0; // not a directory
@@ -308,7 +308,7 @@ static int index_get_size (ntfs_inode *i
/**
* cat
*/
-static int cat (ntfs_volume *vol, ntfs_inode *inode, ATTR_TYPES type,
+static int cat(ntfs_volume *vol, ntfs_inode *inode, ATTR_TYPES type,
ntfschar *name, int namelen)
{
const int bufsize = 4096;
@@ -318,21 +318,21 @@ static int cat (ntfs_volume *vol, ntfs_i
s64 offset;
u32 block_size;
- buffer = malloc (bufsize);
+ buffer = malloc(bufsize);
if (!buffer)
return 1;
- attr = ntfs_attr_open (inode, type, name, namelen);
+ attr = ntfs_attr_open(inode, type, name, namelen);
if (!attr) {
- Eprintf ("Cannot find attribute type 0x%lx.\n", (long) type);
- free (buffer);
+ Eprintf("Cannot find attribute type 0x%lx.\n", (long) type);
+ free(buffer);
return 1;
}
if ((inode->mft_no < 2) && (attr->type == AT_DATA))
block_size = vol->mft_record_size;
else if (attr->type == AT_INDEX_ALLOCATION)
- block_size = index_get_size (inode);
+ block_size = index_get_size(inode);
else
block_size = 0;
@@ -343,26 +343,26 @@ static int cat (ntfs_volume *vol, ntfs_i
bytes_read = ntfs_attr_mst_pread(attr, offset, 1, block_size, buffer);
bytes_read *= block_size;
} else {
- bytes_read = ntfs_attr_pread (attr, offset, bufsize, buffer);
+ bytes_read = ntfs_attr_pread(attr, offset, bufsize, buffer);
}
- //fprintf (stderr, "read %lld bytes\n", bytes_read);
+ //fprintf(stderr, "read %lld bytes\n", bytes_read);
if (bytes_read == -1) {
- perror ("ERROR: Couldn't read file");
+ perror("ERROR: Couldn't read file");
break;
}
if (!bytes_read)
break;
- written = fwrite (buffer, 1, bytes_read, stdout);
+ written = fwrite(buffer, 1, bytes_read, stdout);
if (written != bytes_read) {
- perror ("ERROR: Couldn't output all data!");
+ perror("ERROR: Couldn't output all data!");
break;
}
offset += bytes_read;
}
- ntfs_attr_close (attr);
- free (buffer);
+ ntfs_attr_close(attr);
+ free(buffer);
return 0;
}
@@ -374,28 +374,28 @@ static int cat (ntfs_volume *vol, ntfs_i
* Return: 0 Success, the program worked
* 1 Error, something went wrong
*/
-int main (int argc, char *argv[])
+int main(int argc, char *argv[])
{
ntfs_volume *vol;
ntfs_inode *inode;
ATTR_TYPES attr;
int result = 1;
- if (!parse_options (argc, argv))
+ if (!parse_options(argc, argv))
return 1;
utils_set_locale();
- vol = utils_mount_volume (opts.device, MS_RDONLY, opts.force);
+ vol = utils_mount_volume(opts.device, MS_RDONLY, opts.force);
if (!vol) {
perror("ERROR: couldn't mount volume");
return 1;
}
if (opts.inode != -1)
- inode = ntfs_inode_open (vol, opts.inode);
+ inode = ntfs_inode_open(vol, opts.inode);
else
- inode = ntfs_pathname_to_inode (vol, NULL, opts.file);
+ inode = ntfs_pathname_to_inode(vol, NULL, opts.file);
if (!inode) {
perror("ERROR: Couldn't open inode");
@@ -408,8 +408,8 @@ int main (int argc, char *argv[])
result = cat(vol, inode, attr, opts.attr_name, opts.attr_name_len);
- ntfs_inode_close (inode);
- ntfs_umount (vol, FALSE);
+ ntfs_inode_close(inode);
+ ntfs_umount(vol, FALSE);
return result;
}
Index: ntfsclone.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfsclone.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -p -r1.61 -r1.62
--- ntfsclone.c 26 Oct 2005 20:48:38 -0000 1.61
+++ ntfsclone.c 26 Oct 2005 22:54:57 -0000 1.62
@@ -154,7 +154,7 @@ struct {
s64 device_size;
s64 nr_clusters;
s64 inuse;
-} __attribute__ ((__packed__)) image_hdr;
+} __attribute__((__packed__)) image_hdr;
#define NTFS_MBYTE (1000 * 1000)
@@ -499,7 +499,7 @@ static void rescue_sector(void *fd, off_
if (read_all(fd, buff, NTFS_SECTOR_SIZE) == -1) {
Printf("WARNING: Can't read sector at %llu, lost data.\n",
- (unsigned long long)pos);
+ (unsigned long long)pos);
memset(buff, '?', NTFS_SECTOR_SIZE);
memmove(buff, badsector_magic, sizeof(badsector_magic));
}
@@ -991,9 +991,9 @@ static int walk_clusters(ntfs_volume *vo
continue;
}
- deleted_inode = !(ni->mrec->flags & MFT_RECORD_IN_USE);
+ deleted_inode = !(ni->mrec->flags & MFT_RECORD_IN_USE);
- if (deleted_inode) {
+ if (deleted_inode) {
ni->mft_no = MREF(mref);
if (wipe) {
@@ -1007,7 +1007,7 @@ static int walk_clusters(ntfs_volume *vo
free(ni->mrec);
free(ni);
- if (deleted_inode)
+ if (deleted_inode)
continue;
if ((ni = ntfs_inode_open(volume, mref)) == NULL) {
@@ -1468,10 +1468,10 @@ int main(int argc, char **argv)
ntfs_size += 512; /* add backup boot sector */
if (opt.std_out) {
- if ((fd_out = fileno(stdout)) == -1)
- perr_exit("fileno for stdout failed");
+ if ((fd_out = fileno(stdout)) == -1)
+ perr_exit("fileno for stdout failed");
} else {
- /* device_size_get() might need to read() */
+ /* device_size_get() might need to read() */
int flags = O_RDWR;
if (!opt.blkdev_out) {
Index: ntfscluster.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfscluster.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -p -r1.28 -r1.29
--- ntfscluster.c 7 Oct 2005 14:10:57 -0000 1.28
+++ ntfscluster.c 26 Oct 2005 22:54:57 -0000 1.29
@@ -53,9 +53,9 @@
static const char *EXEC_NAME = "ntfscluster";
static struct options opts;
-GEN_PRINTF (Eprintf, stderr, NULL, FALSE)
-GEN_PRINTF (Vprintf, stdout, &opts.verbose, TRUE)
-GEN_PRINTF (Qprintf, stdout, &opts.quiet, FALSE)
+GEN_PRINTF(Eprintf, stderr, NULL, FALSE)
+GEN_PRINTF(Vprintf, stdout, &opts.verbose, TRUE)
+GEN_PRINTF(Qprintf, stdout, &opts.quiet, FALSE)
/**
* version - Print version information about the program
@@ -64,13 +64,13 @@ GEN_PRINTF (Qprintf, stdout, &opts.quiet
*
* Return: none
*/
-static void version (void)
+static void version(void)
{
printf("\n%s v%s (libntfs %s) - Find the owner of any given sector or "
"cluster.\n\n", EXEC_NAME, VERSION,
ntfs_libntfs_version());
- printf ("Copyright (c) 2002-2003 Richard Russon\n");
- printf ("\n%s\n%s%s\n", ntfs_gpl, ntfs_bugs, ntfs_home);
+ printf("Copyright (c) 2002-2003 Richard Russon\n");
+ printf("\n%s\n%s%s\n", ntfs_gpl, ntfs_bugs, ntfs_home);
}
/**
@@ -80,9 +80,9 @@ static void version (void)
*
* Return: none
*/
-static void usage (void)
+static void usage(void)
{
- printf ("\nUsage: %s [options] device\n"
+ printf("\nUsage: %s [options] device\n"
" -i --info Print information about the volume (default)\n"
"\n"
" -c range --cluster range Look for objects in this range of clusters\n"
@@ -97,7 +97,7 @@ static void usage (void)
" -V --version Version information\n"
" -h --help Print this help\n\n",
EXEC_NAME);
- printf ("%s%s\n", ntfs_bugs, ntfs_home);
+ printf("%s%s\n", ntfs_bugs, ntfs_home);
}
/**
@@ -109,7 +109,7 @@ static void usage (void)
* Return: 1 Success
* 0 Error, one or more problems
*/
-static int parse_options (int argc, char **argv)
+static int parse_options(int argc, char **argv)
{
static const char *sopt = "-c:F:fh?I:ilqs:vV";
static const struct option lopt[] = {
@@ -139,7 +139,7 @@ static int parse_options (int argc, char
opts.range_begin = -1;
opts.range_end = -1;
- while ((c = getopt_long (argc, argv, sopt, lopt, NULL)) != (char)-1) {
+ while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != (char)-1) {
switch (c) {
case 1: /* A non-option argument */
if (!opts.device) {
@@ -152,7 +152,7 @@ static int parse_options (int argc, char
case 'c':
if ((opts.action == act_none) &&
- (utils_parse_range (optarg, &opts.range_begin, &opts.range_end, FALSE)))
+ (utils_parse_range(optarg, &opts.range_begin, &opts.range_end, FALSE)))
opts.action = act_cluster;
else
opts.action = act_error;
@@ -175,7 +175,7 @@ static int parse_options (int argc, char
case 'I':
if (opts.action == act_none) {
opts.action = act_inode;
- opts.inode = strtol (optarg, &end, 0);
+ opts.inode = strtol(optarg, &end, 0);
if (end && *end)
err++;
} else {
@@ -199,7 +199,7 @@ static int parse_options (int argc, char
break;
case 's':
if ((opts.action == act_none) &&
- (utils_parse_range (optarg, &opts.range_begin, &opts.range_end, FALSE)))
+ (utils_parse_range(optarg, &opts.range_begin, &opts.range_end, FALSE)))
opts.action = act_sector;
else
opts.action = act_error;
@@ -212,9 +212,9 @@ static int parse_options (int argc, char
break;
default:
if ((optopt == 'c') || (optopt == 's'))
- Eprintf ("Option '%s' requires an argument.\n", argv[optind-1]);
+ Eprintf("Option '%s' requires an argument.\n", argv[optind-1]);
else
- Eprintf ("Unknown option '%s'.\n", argv[optind-1]);
+ Eprintf("Unknown option '%s'.\n", argv[optind-1]);
err++;
break;
}
@@ -230,20 +230,20 @@ static int parse_options (int argc, char
if (opts.device == NULL) {
if (argc > 1)
- Eprintf ("You must specify exactly one device.\n");
+ Eprintf("You must specify exactly one device.\n");
err++;
}
if (opts.quiet && opts.verbose) {
- Eprintf ("You may not use --quiet and --verbose at the same time.\n");
+ Eprintf("You may not use --quiet and --verbose at the same time.\n");
err++;
}
if (opts.action == act_error) {
- Eprintf ("You may only specify one action: --info, --cluster, --sector or --last.\n");
+ Eprintf("You may only specify one action: --info, --cluster, --sector or --last.\n");
err++;
} else if (opts.range_begin > opts.range_end) {
- Eprintf ("The range must be in ascending order.\n");
+ Eprintf("The range must be in ascending order.\n");
err++;
}
}
@@ -260,7 +260,7 @@ static int parse_options (int argc, char
/**
* info
*/
-static int info (ntfs_volume *vol)
+static int info(ntfs_volume *vol)
{
u64 a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u;
int cb, sb, cps;
@@ -273,23 +273,23 @@ static int info (ntfs_volume *vol)
int z;
int inuse = 0;
- m_ctx = mft_get_search_ctx (vol);
+ m_ctx = mft_get_search_ctx(vol);
m_ctx->flags_search = FEMR_IN_USE | FEMR_METADATA | FEMR_BASE_RECORD | FEMR_NOT_BASE_RECORD;
- while (mft_next_record (m_ctx) == 0) {
+ while (mft_next_record(m_ctx) == 0) {
if (!(m_ctx->flags_match & FEMR_IN_USE))
continue;
inuse++;
- a_ctx = ntfs_attr_get_search_ctx (m_ctx->inode, NULL);
+ a_ctx = ntfs_attr_get_search_ctx(m_ctx->inode, NULL);
- while ((rec = find_attribute (AT_UNUSED, a_ctx))) {
+ while ((rec = find_attribute(AT_UNUSED, a_ctx))) {
if (!rec->non_resident)
continue;
- rl = ntfs_mapping_pairs_decompress (vol, rec, NULL);
+ rl = ntfs_mapping_pairs_decompress(vol, rec, NULL);
for (z = 0; rl[z].length > 0; z++)
{
@@ -302,12 +302,12 @@ static int info (ntfs_volume *vol)
}
- free (rl);
+ free(rl);
}
- ntfs_attr_put_search_ctx (a_ctx);
+ ntfs_attr_put_search_ctx(a_ctx);
}
- mft_put_search_ctx (m_ctx);
+ mft_put_search_ctx(m_ctx);
cb = vol->cluster_size_bits;
sb = vol->sector_size_bits;
@@ -340,27 +340,27 @@ static int info (ntfs_volume *vol)
t = mc >> cb;
u = mc * 100 / b / e;
- printf ("bytes per sector : %llu\n", (unsigned long long)a);
- printf ("bytes per cluster : %llu\n", (unsigned long long)b);
- printf ("sectors per cluster : %llu\n", (unsigned long long)c);
- printf ("bytes per volume : %llu\n", (unsigned long long)d);
- printf ("sectors per volume : %llu\n", (unsigned long long)e);
- printf ("clusters per volume : %llu\n", (unsigned long long)f);
- printf ("initialized mft records : %llu\n", (unsigned long long)g);
- printf ("mft records in use : %llu\n", (unsigned long long)h);
- printf ("mft records percentage : %llu\n", (unsigned long long)i);
- printf ("bytes of free space : %llu\n", (unsigned long long)j);
- printf ("sectors of free space : %llu\n", (unsigned long long)k);
- printf ("clusters of free space : %llu\n", (unsigned long long)l);
- printf ("percentage free space : %llu\n", (unsigned long long)m);
- printf ("bytes of user data : %llu\n", (unsigned long long)n);
- printf ("sectors of user data : %llu\n", (unsigned long long)o);
- printf ("clusters of user data : %llu\n", (unsigned long long)p);
- printf ("percentage user data : %llu\n", (unsigned long long)q);
- printf ("bytes of metadata : %llu\n", (unsigned long long)r);
- printf ("sectors of metadata : %llu\n", (unsigned long long)s);
- printf ("clusters of metadata : %llu\n", (unsigned long long)t);
- printf ("percentage metadata : %llu\n", (unsigned long long)u);
+ printf("bytes per sector : %llu\n", (unsigned long long)a);
+ printf("bytes per cluster : %llu\n", (unsigned long long)b);
+ printf("sectors per cluster : %llu\n", (unsigned long long)c);
+ printf("bytes per volume : %llu\n", (unsigned long long)d);
+ printf("sectors per volume : %llu\n", (unsigned long long)e);
+ printf("clusters per volume : %llu\n", (unsigned long long)f);
+ printf("initialized mft records : %llu\n", (unsigned long long)g);
+ printf("mft records in use : %llu\n", (unsigned long long)h);
+ printf("mft records percentage : %llu\n", (unsigned long long)i);
+ printf("bytes of free space : %llu\n", (unsigned long long)j);
+ printf("sectors of free space : %llu\n", (unsigned long long)k);
+ printf("clusters of free space : %llu\n", (unsigned long long)l);
+ printf("percentage free space : %llu\n", (unsigned long long)m);
+ printf("bytes of user data : %llu\n", (unsigned long long)n);
+ printf("sectors of user data : %llu\n", (unsigned long long)o);
+ printf("clusters of user data : %llu\n", (unsigned long long)p);
+ printf("percentage user data : %llu\n", (unsigned long long)q);
+ printf("bytes of metadata : %llu\n", (unsigned long long)r);
+ printf("sectors of metadata : %llu\n", (unsigned long long)s);
+ printf("clusters of metadata : %llu\n", (unsigned long long)t);
+ printf("percentage metadata : %llu\n", (unsigned long long)u);
return 0;
}
@@ -368,7 +368,7 @@ static int info (ntfs_volume *vol)
/**
* dump_file
*/
-static int dump_file (ntfs_volume *vol, ntfs_inode *ino)
+static int dump_file(ntfs_volume *vol, ntfs_inode *ino)
{
char buffer[1024];
ntfs_attr_search_ctx *ctx;
@@ -376,41 +376,41 @@ static int dump_file (ntfs_volume *vol,
int i;
runlist *runs;
- utils_inode_get_name (ino, buffer, sizeof (buffer));
+ utils_inode_get_name(ino, buffer, sizeof(buffer));
- printf ("Dump: %s\n", buffer);
+ printf("Dump: %s\n", buffer);
- ctx = ntfs_attr_get_search_ctx (ino, NULL);
+ ctx = ntfs_attr_get_search_ctx(ino, NULL);
- while ((rec = find_attribute (AT_UNUSED, ctx))) {
- printf (" 0x%02x - ", rec->type);
+ while ((rec = find_attribute(AT_UNUSED, ctx))) {
+ printf(" 0x%02x - ", rec->type);
if (rec->non_resident) {
- printf ("non-resident\n");
- runs = ntfs_mapping_pairs_decompress (vol, rec, NULL);
+ printf("non-resident\n");
+ runs = ntfs_mapping_pairs_decompress(vol, rec, NULL);
if (runs) {
- printf (" VCN LCN Length\n");
+ printf(" VCN LCN Length\n");
for (i = 0; runs[i].length > 0; i++) {
- printf (" %8lld %8lld %8lld\n",
+ printf(" %8lld %8lld %8lld\n",
(long long)runs[i].vcn,
(long long)runs[i].lcn,
(long long)
runs[i].length);
}
- free (runs);
+ free(runs);
}
} else {
- printf ("resident\n");
+ printf("resident\n");
}
}
- ntfs_attr_put_search_ctx (ctx);
+ ntfs_attr_put_search_ctx(ctx);
return 0;
}
/**
* print_match
*/
-static int print_match (ntfs_inode *ino, ATTR_RECORD *attr,
+static int print_match(ntfs_inode *ino, ATTR_RECORD *attr,
runlist_element *run, void *data __attribute__((unused)))
{
char *buffer;
@@ -418,26 +418,26 @@ static int print_match (ntfs_inode *ino,
if (!ino || !attr || !run)
return 1;
- buffer = malloc (MAX_PATH);
+ buffer = malloc(MAX_PATH);
if (!buffer) {
- Eprintf ("!buffer\n");
+ Eprintf("!buffer\n");
return 1;
}
- utils_inode_get_name (ino, buffer, MAX_PATH);
- printf ("Inode %llu %s", (unsigned long long)ino->mft_no, buffer);
+ utils_inode_get_name(ino, buffer, MAX_PATH);
+ printf("Inode %llu %s", (unsigned long long)ino->mft_no, buffer);
- utils_attr_get_name (ino->vol, attr, buffer, MAX_PATH);
- printf ("/%s\n", buffer);
+ utils_attr_get_name(ino->vol, attr, buffer, MAX_PATH);
+ printf("/%s\n", buffer);
- free (buffer);
+ free(buffer);
return 0;
}
/**
* find_last
*/
-static int find_last (ntfs_inode *ino, ATTR_RECORD *attr, runlist_element *run,
+static int find_last(ntfs_inode *ino, ATTR_RECORD *attr, runlist_element *run,
void *data)
{
struct match *m;
@@ -463,68 +463,68 @@ static int find_last (ntfs_inode *ino, A
* Return: 0 Success, the program worked
* 1 Error, something went wrong
*/
-int main (int argc, char *argv[])
+int main(int argc, char *argv[])
{
ntfs_volume *vol;
ntfs_inode *ino = NULL;
struct match m;
int result = 1;
- if (!parse_options (argc, argv))
+ if (!parse_options(argc, argv))
return 1;
utils_set_locale();
- vol = utils_mount_volume (opts.device, MS_RDONLY, opts.force);
+ vol = utils_mount_volume(opts.device, MS_RDONLY, opts.force);
if (!vol)
return 1;
switch (opts.action) {
case act_sector:
if (opts.range_begin == opts.range_end)
- Qprintf ("Searching for sector %llu\n",
+ Qprintf("Searching for sector %llu\n",
(unsigned long long)opts.range_begin);
else
- Qprintf ("Searching for sector range %llu-%llu\n", (unsigned long long)opts.range_begin, (unsigned long long)opts.range_end);
+ Qprintf("Searching for sector range %llu-%llu\n", (unsigned long long)opts.range_begin, (unsigned long long)opts.range_end);
/* Convert to clusters */
opts.range_begin >>= (vol->cluster_size_bits - vol->sector_size_bits);
opts.range_end >>= (vol->cluster_size_bits - vol->sector_size_bits);
- result = cluster_find (vol, opts.range_begin, opts.range_end, (cluster_cb*)&print_match, NULL);
+ result = cluster_find(vol, opts.range_begin, opts.range_end, (cluster_cb*)&print_match, NULL);
break;
case act_cluster:
if (opts.range_begin == opts.range_end)
- Qprintf ("Searching for cluster %llu\n",
+ Qprintf("Searching for cluster %llu\n",
(unsigned long long)opt...
[truncated message content] |