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)opts.range_begin);
else
- Qprintf ("Searching for cluster range %llu-%llu\n", (unsigned long long)opts.range_begin, (unsigned long long)opts.range_end);
- result = cluster_find (vol, opts.range_begin, opts.range_end, (cluster_cb*)&print_match, NULL);
+ Qprintf("Searching for cluster range %llu-%llu\n", (unsigned long long)opts.range_begin, (unsigned long long)opts.range_end);
+ result = cluster_find(vol, opts.range_begin, opts.range_end, (cluster_cb*)&print_match, NULL);
break;
case act_file:
ino = ntfs_pathname_to_inode(vol, NULL, opts.filename);
if (ino)
- result = dump_file (vol, ino);
+ result = dump_file(vol, ino);
break;
case act_inode:
- ino = ntfs_inode_open (vol, opts.inode);
+ ino = ntfs_inode_open(vol, opts.inode);
if (ino) {
- result = dump_file (vol, ino);
- ntfs_inode_close (ino);
+ result = dump_file(vol, ino);
+ ntfs_inode_close(ino);
} else {
- Eprintf ("Cannot open inode %llu\n",
+ Eprintf("Cannot open inode %llu\n",
(unsigned long long)opts.inode);
}
break;
case act_last:
- memset (&m, 0, sizeof (m));
+ memset(&m, 0, sizeof(m));
m.lcn = -1;
- result = cluster_find (vol, 0, LONG_MAX, (cluster_cb*)&find_last, &m);
+ result = cluster_find(vol, 0, LONG_MAX, (cluster_cb*)&find_last, &m);
if (m.lcn >= 0) {
- ino = ntfs_inode_open (vol, m.inum);
+ ino = ntfs_inode_open(vol, m.inum);
if (ino) {
- result = dump_file (vol, ino);
- ntfs_inode_close (ino);
+ result = dump_file(vol, ino);
+ ntfs_inode_close(ino);
} else {
- Eprintf ("Cannot open inode %llu\n",
+ Eprintf("Cannot open inode %llu\n",
(unsigned long long)
opts.inode);
}
@@ -535,11 +535,11 @@ int main (int argc, char *argv[])
break;
case act_info:
default:
- result = info (vol);
+ result = info(vol);
break;
}
- ntfs_umount (vol, FALSE);
+ ntfs_umount(vol, FALSE);
return result;
}
Index: ntfscmp.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfscmp.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -p -r1.11 -r1.12
--- ntfscmp.c 21 Oct 2005 18:05:14 -0000 1.11
+++ ntfscmp.c 26 Oct 2005 22:54:57 -0000 1.12
@@ -153,7 +153,7 @@ __attribute__((noreturn))
static void usage(void)
{
- printf ("\nUsage: %s [OPTIONS] DEVICE1 DEVICE2\n"
+ printf("\nUsage: %s [OPTIONS] DEVICE1 DEVICE2\n"
" Compare two NTFS volumes and tell the differences.\n"
"\n"
" -P, --no-progress-bar Don't show progress bar\n"
@@ -163,7 +163,7 @@ static void usage(void)
" -d, --debug Show debug information\n"
#endif
"\n", EXEC_NAME);
- printf ("%s%s", ntfs_bugs, ntfs_home);
+ printf("%s%s", ntfs_bugs, ntfs_home);
exit(1);
}
@@ -186,7 +186,7 @@ static void parse_options(int argc, char
memset(&opt, 0, sizeof(opt));
opt.show_progress = 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 (!opt.vol1) {
Index: ntfscp.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfscp.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -p -r1.29 -r1.30
--- ntfscp.c 21 Oct 2005 18:05:14 -0000 1.29
+++ ntfscp.c 26 Oct 2005 22:54:57 -0000 1.30
@@ -69,10 +69,10 @@ static const char *EXEC_NAME = "ntfscp";
static struct options opts;
volatile sig_atomic_t caught_terminate = 0;
-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
@@ -81,12 +81,12 @@ static GEN_PRINTF (Printf, stderr, NULL
*
* Return: none
*/
-static void version (void)
+static void version(void)
{
Printf("\n%s v%s (libntfs %s) - Overwrite files on NTFS volume.\n\n",
EXEC_NAME, VERSION, ntfs_libntfs_version());
- Printf ("Copyright (c) 2004-2005 Yura Pakhuchiy\n");
- Printf ("\n%s\n%s%s\n", ntfs_gpl, ntfs_bugs, ntfs_home);
+ Printf("Copyright (c) 2004-2005 Yura Pakhuchiy\n");
+ Printf("\n%s\n%s%s\n", ntfs_gpl, ntfs_bugs, ntfs_home);
}
/**
@@ -96,9 +96,9 @@ static void version (void)
*
* Return: none
*/
-static void usage (void)
+static void usage(void)
{
- Printf ("\nUsage: %s [options] device src_file dest_file\n\n"
+ Printf("\nUsage: %s [options] device src_file dest_file\n\n"
" -a --attribute num Write to this attribute\n"
" -i --inode Treat dest_file as inode number\n"
" -f --force Use less caution\n"
@@ -109,7 +109,7 @@ static void usage (void)
" -V --version Version information\n"
" -v --verbose More output\n\n",
EXEC_NAME);
- Printf ("%s%s\n", ntfs_bugs, ntfs_home);
+ Printf("%s%s\n", ntfs_bugs, ntfs_home);
}
/**
@@ -121,7 +121,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 = "-a:ifh?N:nqVv";
static const struct option lopt[] = {
@@ -263,7 +263,7 @@ static void signal_handler(int arg __att
* Return: 0 Success, the program worked
* 1 Error, something went wrong
*/
-int main (int argc, char *argv[])
+int main(int argc, char *argv[])
{
FILE *in;
ntfs_volume *vol;
@@ -308,7 +308,7 @@ int main (int argc, char *argv[])
{
struct stat fst;
- if (stat (opts.src_file, &fst) == -1) {
+ if (stat(opts.src_file, &fst) == -1) {
perror("ERROR: Couldn't stat source file");
goto umount;
}
Index: ntfsdump_logfile.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfsdump_logfile.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -p -r1.32 -r1.33
--- ntfsdump_logfile.c 21 Oct 2005 18:05:14 -0000 1.32
+++ ntfsdump_logfile.c 26 Oct 2005 22:54:57 -0000 1.33
@@ -87,7 +87,7 @@ typedef struct {
};
} logfile_file;
-GEN_PRINTF (Eprintf, stderr, NULL, FALSE)
+GEN_PRINTF(Eprintf, stderr, NULL, FALSE)
/**
* logfile_close
@@ -120,8 +120,8 @@ static int logfile_close(logfile_file *l
* Use when you wish to exit and collate all the cleanups together.
* if you don't have some parameter to pass, just pass NULL.
*/
-__attribute__ ((noreturn))
-__attribute__ ((format(printf, 4, 5)))
+__attribute__((noreturn))
+__attribute__((format(printf, 4, 5)))
static void device_err_exit(ntfs_volume *vol, ntfs_inode *ni,
ntfs_attr *na, const char *fmt, ...)
{
@@ -147,7 +147,7 @@ static void device_err_exit(ntfs_volume
/**
* log_err_exit -
*/
-__attribute__ ((noreturn))
+__attribute__((noreturn))
__attribute__((format(printf, 2, 3)))
static void log_err_exit(u8 *buf, const char *fmt, ...)
{
@@ -167,7 +167,7 @@ static void log_err_exit(u8 *buf, const
/**
* usage -
*/
-__attribute__ ((noreturn))
+__attribute__((noreturn))
static void usage(const char *exec_name)
{
Eprintf("%s v%s (libntfs %s) - Interpret and display information "
Index: ntfsfix.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfsfix.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -p -r1.26 -r1.27
--- ntfsfix.c 25 Oct 2005 01:28:11 -0000 1.26
+++ ntfsfix.c 26 Oct 2005 22:54:57 -0000 1.27
@@ -136,7 +136,7 @@ static void parse_options(int argc, char
memset(&opt, 0, sizeof(opt));
- 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 (!opt.volume)
@@ -307,7 +307,7 @@ static int fix_mftmirr(ntfs_volume *vol)
unsigned char *m, *m2;
int i, ret = -1; /* failure */
BOOL done;
-
+
puts("\nProcessing $MFT and $MFTMirr... ");
/* Load data from $MFT and $MFTMirr and compare the contents. */
@@ -426,7 +426,7 @@ static int fix_mount(void)
int ret = -1; /* failure */
ntfs_volume *vol;
struct ntfs_device *dev;
-
+
printf("Attempting to correct errors... ");
dev = ntfs_device_alloc(opt.volume, 0, &ntfs_device_default_io_ops, NULL);
Index: ntfsinfo.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfsinfo.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -p -r1.83 -r1.84
--- ntfsinfo.c 26 Oct 2005 20:46:37 -0000 1.83
+++ ntfsinfo.c 26 Oct 2005 22:54:57 -0000 1.84
@@ -92,9 +92,9 @@ static struct options {
u8 padding[4]; /* Unused: padding to 64 bit. */
} 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
@@ -103,18 +103,18 @@ GEN_PRINTF (Qprintf, stdout, &opts.quiet
*
* Return: none
*/
-static void version (void)
+static void version(void)
{
- printf ("\n%s v%s (libntfs %s) - Display information about an NTFS "
+ printf("\n%s v%s (libntfs %s) - Display information about an NTFS "
"Volume.\n\n", EXEC_NAME, VERSION,
ntfs_libntfs_version());
- printf ("Copyright (c)\n");
- printf (" 2002-2004 Matthew J. Fanto\n");
- printf (" 2002-2005 Anton Altaparmakov\n");
- printf (" 2002-2003 Richard Russon\n");
- printf (" 2003 Leonard Norrgård\n");
- printf (" 2004-2005 Yura Pakhuchiy\n");
- printf ("\n%s\n%s%s\n", ntfs_gpl, ntfs_bugs, ntfs_home);
+ printf("Copyright (c)\n");
+ printf(" 2002-2004 Matthew J. Fanto\n");
+ printf(" 2002-2005 Anton Altaparmakov\n");
+ printf(" 2002-2003 Richard Russon\n");
+ printf(" 2003 Leonard Norrgård\n");
+ printf(" 2004-2005 Yura Pakhuchiy\n");
+ printf("\n%s\n%s%s\n", ntfs_gpl, ntfs_bugs, ntfs_home);
}
/**
@@ -124,9 +124,9 @@ static void version (void)
*
* Return: none
*/
-static void usage (void)
+static void usage(void)
{
- printf ("\nUsage: %s [options] -d dev\n"
+ printf("\nUsage: %s [options] -d dev\n"
" -d dev --device dev The ntfs volume to display information about\n"
" -i num --inode num Display information about this inode\n"
" -F file --file file Display information about this file (absolute path)\n"
@@ -139,7 +139,7 @@ static void usage (void)
" -V --version Display version information\n"
" -h --help Display this help\n\n",
EXEC_NAME);
- printf ("%s%s\n", ntfs_bugs, ntfs_home);
+ printf("%s%s\n", ntfs_bugs, ntfs_home);
}
/**
@@ -151,7 +151,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 = "-:fhi:F:mqtTvVd:";
static const struct option lopt[] = {
@@ -178,7 +178,7 @@ static int parse_options (int argc, char
opts.inode = -1;
opts.filename = NULL;
- while ((c = getopt_long (argc, argv, sopt, lopt, NULL)) != (char)-1) {
+ while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != (char)-1) {
ntfs_log_trace("optind=%d; c='%c' optarg=\"%s\".\n", optind, c,
optarg);
switch (c) {
@@ -190,7 +190,7 @@ static int parse_options (int argc, char
break;
case 'i':
if ((opts.inode != -1) ||
- (!utils_parse_size (optarg, &opts.inode, FALSE))) {
+ (!utils_parse_size(optarg, &opts.inode, FALSE))) {
err++;
}
break;
@@ -217,7 +217,7 @@ static int parse_options (int argc, char
break;
case 'T':
/* 'T' is deprecated, notify */
- Eprintf ("Option 'T' is deprecated, it was replaced by 't'.\n");
+ Eprintf("Option 'T' is deprecated, it was replaced by 't'.\n");
err++;
break;
case 'v':
@@ -257,24 +257,24 @@ static int parse_options (int argc, char
} else {
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.inode == -1) && (opts.filename == NULL) && !opts.mft) {
if (argc > 1)
- Eprintf ("You must specify an inode to learn about.\n");
+ Eprintf("You must specify an inode to learn about.\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.inode != -1) && (opts.filename != NULL)) {
if (argc > 1)
- Eprintf ("You may not specify --inode and --file together.\n");
+ Eprintf("You may not specify --inode and --file together.\n");
err++;
}
@@ -1078,13 +1078,13 @@ static void ntfs_dump_attr_data(ATTR_REC
runlist *rl = ntfs_mapping_pairs_decompress(vol, attr, 0);
if (rl) {
runlist *rlc = rl;
- printf ("\tRunlist:\tVCN\t\tLCN\t\tLength\n");
+ printf("\tRunlist:\tVCN\t\tLCN\t\tLength\n");
while (rlc->length) {
- printf ("\t\t\t%lld\t\t%lld\t\t%lld\n",
+ printf("\t\t\t%lld\t\t%lld\t\t%lld\n",
rlc->vcn, rlc->lcn, rlc->length);
rlc++;
}
- free (rl);
+ free(rl);
} else {
Eprintf("ntfsinfo error: could not decompress runlist\n");
return;
@@ -1872,12 +1872,12 @@ int main(int argc, char **argv)
{
ntfs_volume *vol;
- 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;
@@ -1913,7 +1913,7 @@ int main(int argc, char **argv)
}
}
- ntfs_umount (vol, FALSE);
+ ntfs_umount(vol, FALSE);
return 0;
}
Index: ntfslabel.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfslabel.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -p -r1.17 -r1.18
--- ntfslabel.c 21 Oct 2005 18:05:14 -0000 1.17
+++ ntfslabel.c 26 Oct 2005 22:54:57 -0000 1.18
@@ -60,9 +60,9 @@ static struct options {
int noaction; /* Do not write to disk */
} 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
@@ -71,16 +71,16 @@ GEN_PRINTF (Qprintf, stdout, &opts.quiet
*
* Return: none
*/
-static void version (void)
+static void version(void)
{
- printf ("\n%s v%s (libntfs %s) - Display, or set, the label for an "
+ printf("\n%s v%s (libntfs %s) - Display, or set, the label for an "
"NTFS Volume.\n\n", EXEC_NAME, VERSION,
ntfs_libntfs_version());
- printf ("Copyright (c)\n");
- printf (" 2002 Matthew J. Fanto\n");
- printf (" 2002-2005 Anton Altaparmakov\n");
- printf (" 2002-2003 Richard Russon\n");
- printf ("\n%s\n%s%s\n", ntfs_gpl, ntfs_bugs, ntfs_home);
+ printf("Copyright (c)\n");
+ printf(" 2002 Matthew J. Fanto\n");
+ printf(" 2002-2005 Anton Altaparmakov\n");
+ printf(" 2002-2003 Richard Russon\n");
+ printf("\n%s\n%s%s\n", ntfs_gpl, ntfs_bugs, ntfs_home);
}
/**
@@ -90,9 +90,9 @@ static void version (void)
*
* Return: none
*/
-static void usage (void)
+static void usage(void)
{
- printf ("\nUsage: %s [options] device [label]\n"
+ printf("\nUsage: %s [options] device [label]\n"
" -n --no-action Do not write to disk\n"
" -f --force Use less caution\n"
" -q --quiet Less output\n"
@@ -100,7 +100,7 @@ static void usage (void)
" -V --version Display version information\n"
" -h --help Display this help\n\n",
EXEC_NAME);
- printf ("%s%s\n", ntfs_bugs, ntfs_home);
+ printf("%s%s\n", ntfs_bugs, ntfs_home);
}
/**
@@ -112,7 +112,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 = "-fh?nqvV";
static const struct option lopt[] = {
@@ -132,7 +132,7 @@ static int parse_options (int argc, char
opterr = 0; /* We'll handle the errors, thank you. */
- while ((c = getopt_long (argc, argv, sopt, lopt, NULL)) != -1) {
+ while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != -1) {
switch (c) {
case 1: /* A non-option argument */
if (!err && !opts.device)
@@ -162,7 +162,7 @@ static int parse_options (int argc, char
ver++;
break;
default:
- Eprintf ("Unknown option '%s'.\n", argv[optind-1]);
+ Eprintf("Unknown option '%s'.\n", argv[optind-1]);
err++;
break;
}
@@ -173,12 +173,12 @@ static int parse_options (int argc, char
} else {
if (opts.device == NULL) {
if (argc > 1)
- Eprintf ("You must specify a device.\n");
+ Eprintf("You must specify a device.\n");
err++;
}
if (opts.quiet && opts.verbose) {
- Eprintf ("You may not use --quiet and --verbose at "
+ Eprintf("You may not use --quiet and --verbose at "
"the same time.\n");
err++;
}
@@ -201,13 +201,13 @@ static int parse_options (int argc, char
*
* Print the label of the device @dev to stdout.
*/
-static int print_label (ntfs_volume *vol, unsigned long mnt_flags)
+static int print_label(ntfs_volume *vol, unsigned long mnt_flags)
{
int result = 0;
//XXX significant?
if ((mnt_flags & (NTFS_MF_MOUNTED | NTFS_MF_READONLY)) ==
NTFS_MF_MOUNTED) {
- Eprintf ("%s is mounted read-write, results may be "
+ Eprintf("%s is mounted read-write, results may be "
"unreliable.\n", opts.device);
result = 1;
}
@@ -372,7 +372,7 @@ int main(int argc, char **argv)
int result = 0;
ntfs_volume *vol;
- if (!parse_options (argc, argv))
+ if (!parse_options(argc, argv))
return 1;
utils_set_locale();
@@ -380,17 +380,17 @@ int main(int argc, char **argv)
if (!opts.label)
opts.noaction++;
- vol = utils_mount_volume (opts.device, opts.noaction ? MS_RDONLY : 0,
+ vol = utils_mount_volume(opts.device, opts.noaction ? MS_RDONLY : 0,
opts.force);
if (!vol)
return 1;
if (opts.label)
- result = change_label (vol, mnt_flags, opts.label, opts.force);
+ result = change_label(vol, mnt_flags, opts.label, opts.force);
else
- result = print_label (vol, mnt_flags);
+ result = print_label(vol, mnt_flags);
- ntfs_umount (vol, FALSE);
+ ntfs_umount(vol, FALSE);
return result;
}
Index: ntfsls.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfsls.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -p -r1.31 -r1.32
--- ntfsls.c 7 Oct 2005 14:10:57 -0000 1.31
+++ ntfsls.c 26 Oct 2005 22:54:57 -0000 1.32
@@ -275,7 +275,7 @@ static int parse_options(int argc, char
/* defaults to -a if -s is not specified */
if (!opts.system)
- opts.all++;
+ opts.all++;
if (help || ver)
opts.quiet = 0;
@@ -484,12 +484,12 @@ static int list_dir_entry(ntfsls_dirent
struct dir *dir = NULL;
- filename = calloc (1, MAX_PATH);
+ filename = calloc(1, MAX_PATH);
if (!filename)
return -1;
- if (ntfs_ucstombs (name, name_len, &filename, MAX_PATH) < 0) {
- Eprintf ("Cannot represent filename in current locale.\n");
+ if (ntfs_ucstombs(name, name_len, &filename, MAX_PATH) < 0) {
+ Eprintf("Cannot represent filename in current locale.\n");
goto free;
}
@@ -606,7 +606,7 @@ release:
}
free:
- free (filename);
+ free(filename);
return result;
}
@@ -641,7 +641,7 @@ int main(int argc, char **argv)
return 2;
}
- ni = ntfs_pathname_to_inode (vol, NULL, opts.path);
+ ni = ntfs_pathname_to_inode(vol, NULL, opts.path);
if (!ni) {
// FIXME: Print error... (AIA)
ntfs_umount(vol, FALSE);
@@ -674,9 +674,9 @@ int main(int argc, char **argv)
if (!ctx)
return -1;
- while ((rec = find_attribute (AT_FILE_NAME, ctx))) {
+ while ((rec = find_attribute(AT_FILE_NAME, ctx))) {
/* We know this will always be resident. */
- attr = (FILE_NAME_ATTR *) ((char *) rec + le16_to_cpu (rec->value_offset));
+ attr = (FILE_NAME_ATTR *) ((char *) rec + le16_to_cpu(rec->value_offset));
if (attr->file_name_type < space) {
name = attr->file_name;
Index: ntfsmftalloc.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfsmftalloc.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -p -r1.8 -r1.9
--- ntfsmftalloc.c 12 Oct 2005 11:52:41 -0000 1.8
+++ ntfsmftalloc.c 26 Oct 2005 22:54:57 -0000 1.9
@@ -166,8 +166,8 @@ static void license(void)
/**
* usage - print a list of the parameters to the program
*/
-__attribute__ ((noreturn))
-static void usage (void)
+__attribute__((noreturn))
+static void usage(void)
{
copyright();
fprintf(stderr, "Usage: %s [options] device [base-mft-record]\n"
Index: ntfsmount.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfsmount.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -p -r1.45 -r1.46
--- ntfsmount.c 23 Oct 2005 18:35:59 -0000 1.45
+++ ntfsmount.c 26 Oct 2005 22:54:57 -0000 1.46
@@ -80,7 +80,7 @@ typedef enum {
NF_STREAMS_INTERFACE_NONE, /* No access to named data streams. */
#if 0
NF_STREAMS_INTERFACE_XATTR, /* Map named data streams to xattrs. */
-#endif
+#endif
NF_STREAMS_INTERFACE_WINDOWS, /* "file:stream" interface. */
} ntfs_fuse_streams_interface;
@@ -670,7 +670,7 @@ static int ntfs_fuse_link(const char *ol
if (strchr(old_path, ':') && /* n/a for named data streams. */
ctx->streams == NF_STREAMS_INTERFACE_WINDOWS)
- return -EINVAL;
+ return -EINVAL;
if (strchr(new_path, ':') && /* n/a for named data streams. */
ctx->streams == NF_STREAMS_INTERFACE_WINDOWS)
return -EINVAL;
Index: ntfsmove.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfsmove.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -p -r1.18 -r1.19
--- ntfsmove.c 16 Oct 2005 22:37:48 -0000 1.18
+++ ntfsmove.c 26 Oct 2005 22:54:57 -0000 1.19
@@ -50,9 +50,9 @@
static const char *EXEC_NAME = "ntfsmove";
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)
#if 0
#define RED "\e[31m"
@@ -68,13 +68,13 @@ GEN_PRINTF (Qprintf, stdout, &opts.quiet
*
* Return: none
*/
-static void version (void)
+static void version(void)
{
- printf ("\n%s v%s (libntfs %s) - Move files and directories on an "
+ printf("\n%s v%s (libntfs %s) - Move files and directories on an "
"NTFS volume.\n\n", EXEC_NAME, VERSION,
ntfs_libntfs_version());
- printf ("Copyright (c) 2003 Richard Russon\n");
- printf ("\n%s\n%s%s\n", ntfs_gpl, ntfs_bugs, ntfs_home);
+ printf("Copyright (c) 2003 Richard Russon\n");
+ printf("\n%s\n%s%s\n", ntfs_gpl, ntfs_bugs, ntfs_home);
}
/**
@@ -84,9 +84,9 @@ static void version (void)
*
* Return: none
*/
-static void usage (void)
+static void usage(void)
{
- printf ("\nUsage: %s [options] device file\n"
+ printf("\nUsage: %s [options] device file\n"
"\n"
" -S --start Move to the start of the volume\n"
" -B --best Move to the best place on the volume\n"
@@ -101,7 +101,7 @@ static void usage (void)
" -V --version Version information\n"
" -v --verbose More output\n\n",
EXEC_NAME);
- printf ("%s%s\n", ntfs_bugs, ntfs_home);
+ printf("%s%s\n", ntfs_bugs, ntfs_home);
}
/**
@@ -113,7 +113,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 = "-BC:DEfh?nqSVv";
static const struct option lopt[] = {
@@ -139,7 +139,7 @@ static int parse_options (int argc, char
opterr = 0; /* We'll handle the errors, thank you. */
- while ((c = getopt_long (argc, argv, sopt, lopt, NULL)) != -1) {
+ while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != -1) {
switch (c) {
case 1: /* A non-option argument */
if (!opts.device) {
@@ -160,7 +160,7 @@ static int parse_options (int argc, char
break;
case 'C':
if (opts.location == 0) {
- opts.location = strtoll (optarg, &end, 0);
+ opts.location = strtoll(optarg, &end, 0);
if (end && *end)
err++;
} else {
@@ -202,7 +202,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;
}
@@ -214,7 +214,7 @@ static int parse_options (int argc, char
if ((opts.device == NULL) ||
(opts.file == NULL)) {
if (argc > 1)
- Eprintf ("You must specify one device and one file.\n");
+ Eprintf("You must specify one device and one file.\n");
err++;
}
@@ -225,7 +225,7 @@ static int parse_options (int argc, char
}
if (opts.location == -1) {
- Eprintf ("You may only specify one location option: "
+ Eprintf("You may only specify one location option: "
"--start, --best, --end or --cluster\n");
err++;
} else if (opts.location == 0) {
@@ -246,7 +246,7 @@ static int parse_options (int argc, char
/**
* ntfs_debug_runlist_dump2 - Dump a runlist.
*/
-static int ntfs_debug_runlist_dump2 (const runlist *rl, int abbr, char *prefix)
+static int ntfs_debug_runlist_dump2(const runlist *rl, int abbr, char *prefix)
{
//int abbr = 3; /* abbreviate long lists */
int len = 0;
@@ -274,7 +274,7 @@ static int ntfs_debug_runlist_dump2 (con
if (abbr)
if (len > 20) {
if ((i == abbr) && (len > (abbr*2)))
- printf ("%s ... ... ...\n", prefix);
+ printf("%s ... ... ...\n", prefix);
if ((i > (abbr-1)) && (i < (len - (abbr-1))))
continue;
}
@@ -295,9 +295,9 @@ static int ntfs_debug_runlist_dump2 (con
printf("%s%8lld %8lld %8lld\n", prefix,
rl->vcn, rl->lcn, rl->length);
}
- printf ("%s --------\n", prefix);
- printf ("%s %8lld\n", prefix, total);
- printf ("\n");
+ printf("%s --------\n", prefix);
+ printf("%s %8lld\n", prefix, total);
+ printf("\n");
return res;
}
@@ -306,7 +306,7 @@ static int ntfs_debug_runlist_dump2 (con
/**
* resize_nonres_attr
*/
-static int resize_nonres_attr (MFT_RECORD *m, ATTR_RECORD *a, const u32 new_size)
+static int resize_nonres_attr(MFT_RECORD *m, ATTR_RECORD *a, const u32 new_size)
{
int this_attr;
int next_attr;
@@ -323,15 +323,15 @@ static int resize_nonres_attr (MFT_RECOR
ptr = (u8*) m;
/*
- printf ("old_size = %d\n", old_size);
- printf ("new_size = %d\n", new_size);
- printf ("file_size = %d\n", file_size);
- printf ("this_attr = %d\n", this_attr);
- printf ("next_attr = %d\n", next_attr);
- printf ("tail_size = %d\n", tail_size);
+ printf("old_size = %d\n", old_size);
+ printf("new_size = %d\n", new_size);
+ printf("file_size = %d\n", file_size);
+ printf("this_attr = %d\n", this_attr);
+ printf("next_attr = %d\n", next_attr);
+ printf("tail_size = %d\n", tail_size);
*/
- memmove (ptr + this_attr + new_size, ptr + next_attr, tail_size);
+ memmove(ptr + this_attr + new_size, ptr + next_attr, tail_size);
a->length = new_size;
m->bytes_in_use += new_size - old_size;
@@ -342,7 +342,7 @@ static int resize_nonres_attr (MFT_RECOR
/**
* calc_attr_length
*/
-static int calc_attr_length (ATTR_RECORD *rec, int runlength)
+static int calc_attr_length(ATTR_RECORD *rec, int runlength)
{
int size;
@@ -361,15 +361,15 @@ static int calc_attr_length (ATTR_RECORD
/**
* dump_runs
*/
-static void dump_runs (u8 *buffer, int len)
+static void dump_runs(u8 *buffer, int len)
{
int i;
- printf ("RUN: \e[01;31m");
+ printf("RUN: \e[01;31m");
for (i = 0; i < len; i++) {
- printf (" %02x", buffer[i]);
+ printf(" %02x", buffer[i]);
}
- printf ("\e[0m\n");
+ printf("\e[0m\n");
}
#endif /* if 0 */
@@ -377,7 +377,7 @@ static void dump_runs (u8 *buffer, int l
/**
* find_unused
*/
-static runlist * find_unused (ntfs_volume *vol, s64 size, u64 loc
+static runlist * find_unused(ntfs_volume *vol, s64 size, u64 loc
__attribute__((unused)), int flags __attribute__((unused)))
{
const int bufsize = 8192;
@@ -390,34 +390,34 @@ static runlist * find_unused (ntfs_volum
int bit = 0;
runlist *res = NULL;
- //printf ("find_unused\n");
- buffer = malloc (bufsize);
+ //printf("find_unused\n");
+ buffer = malloc(bufsize);
if (!buffer) {
- printf ("!buffer\n");
+ printf("!buffer\n");
return NULL;
}
- //printf ("looking for space for %lld clusters\n", size);
+ //printf("looking for space for %lld clusters\n", size);
clus = vol->lcnbmp_na->allocated_size / bufsize;
- //printf ("clus = %d\n", clus);
+ //printf("clus = %d\n", clus);
for (i = 0; i < clus; i++) {
int bytes_read, j;
- bytes_read = ntfs_attr_pread (vol->lcnbmp_na, i*bufsize,
+ bytes_read = ntfs_attr_pread(vol->lcnbmp_na, i*bufsize,
bufsize, buffer);
if (bytes_read != bufsize) {
- printf ("!read\n");
+ printf("!read\n");
return NULL;
}
for (j = 0; j < bufsize*8; j+...
[truncated message content] |