From 123b1028ecea619dd0f31d707d9f9036873dbe52 Mon Sep 17 00:00:00 2001 From: "cantab.net!aia21" Date: Fri, 23 Apr 2004 13:55:49 +0000 Subject: [PATCH] Fix lots of warnings about no prototypes by adding the 'static' keyword. (Yuval) (Logical change 1.381) --- ntfsprogs/ntfscat.c | 10 +++++----- ntfsprogs/ntfscluster.c | 16 ++++++++------- ntfsprogs/ntfslabel.c | 12 +++++------ ntfsprogs/ntfsls.c | 8 ++++---- ntfsprogs/ntfsmove.c | 35 +++++++++++++++++--------------- ntfsprogs/ntfstruncate.c | 26 ++++++++++++------------ ntfsprogs/ntfsundelete.c | 43 ++++++++++++++++++++-------------------- ntfsprogs/ntfswipe.c | 24 +++++++++++----------- 8 files changed, 90 insertions(+), 84 deletions(-) diff --git a/ntfsprogs/ntfscat.c b/ntfsprogs/ntfscat.c index 304ba129..c16c5907 100644 --- a/ntfsprogs/ntfscat.c +++ b/ntfsprogs/ntfscat.c @@ -43,7 +43,7 @@ static struct options opts; GEN_PRINTF (Eprintf, stderr, NULL, FALSE) GEN_PRINTF (Vprintf, stderr, &opts.verbose, TRUE) GEN_PRINTF (Qprintf, stderr, &opts.quiet, FALSE) -GEN_PRINTF (Printf, stderr, NULL, FALSE) +static GEN_PRINTF (Printf, stderr, NULL, FALSE) /** * version - Print version information about the program @@ -52,7 +52,7 @@ GEN_PRINTF (Printf, stderr, NULL, FALSE) * * Return: none */ -void version (void) +static void version (void) { Printf ("\n%s v%s - Concatenate files and print on the standard output.\n\n", EXEC_NAME, VERSION); @@ -67,7 +67,7 @@ void version (void) * * Return: none */ -void usage (void) +static void usage (void) { Printf ("\nUsage: %s [options] device [file]\n\n" " -a, --attribute num Display this attribute\n" @@ -93,7 +93,7 @@ void usage (void) * Return: 1 Success * 0 Error, one or more problems */ -int parse_options (int argc, char **argv) +static int parse_options (int argc, char **argv) { static const char *sopt = "-a:fh?i:qVv"; // F:N: static const struct option lopt[] = { @@ -210,7 +210,7 @@ int parse_options (int argc, char **argv) /** * cat */ -int cat (ntfs_volume *vol, ntfs_inode *inode, ATTR_TYPES type, uchar_t *name, int namelen) +static int cat (ntfs_volume *vol, ntfs_inode *inode, ATTR_TYPES type, uchar_t *name, int namelen) { /* increase 1024 only if you fix partial writes below */ const int bufsize = 1024; diff --git a/ntfsprogs/ntfscluster.c b/ntfsprogs/ntfscluster.c index bb6dbad6..777c142a 100644 --- a/ntfsprogs/ntfscluster.c +++ b/ntfsprogs/ntfscluster.c @@ -52,7 +52,7 @@ GEN_PRINTF (Qprintf, stdout, &opts.quiet, FALSE) * * Return: none */ -void version (void) +static void version (void) { printf ("\n%s v%s - Find the owner of any given sector or cluster.\n\n", EXEC_NAME, VERSION); @@ -67,7 +67,7 @@ void version (void) * * Return: none */ -void usage (void) +static void usage (void) { printf ("\nUsage: %s [options] device\n" " -i --info Print information about the volume (default)\n" @@ -96,7 +96,7 @@ void usage (void) * Return: 1 Success * 0 Error, one or more problems */ -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[] = { @@ -247,7 +247,7 @@ int parse_options (int argc, char **argv) /** * info */ -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; @@ -355,7 +355,7 @@ int info (ntfs_volume *vol) /** * dump_file */ -int dump_file (ntfs_volume *vol, ntfs_inode *ino) +static int dump_file (ntfs_volume *vol, ntfs_inode *ino) { u8 buffer[1024]; ntfs_attr_search_ctx *ctx; @@ -397,7 +397,8 @@ int dump_file (ntfs_volume *vol, ntfs_inode *ino) /** * print_match */ -int print_match (ntfs_inode *ino, ATTR_RECORD *attr, runlist_element *run, void *data) +static int print_match (ntfs_inode *ino, ATTR_RECORD *attr, + runlist_element *run, void *data) { char *buffer; @@ -423,7 +424,8 @@ int print_match (ntfs_inode *ino, ATTR_RECORD *attr, runlist_element *run, void /** * find_last */ -int find_last (ntfs_inode *ino, ATTR_RECORD *attr, runlist_element *run, void *data) +static int find_last (ntfs_inode *ino, ATTR_RECORD *attr, runlist_element *run, + void *data) { struct match *m; diff --git a/ntfsprogs/ntfslabel.c b/ntfsprogs/ntfslabel.c index 74597805..3ad49878 100644 --- a/ntfsprogs/ntfslabel.c +++ b/ntfsprogs/ntfslabel.c @@ -58,7 +58,7 @@ GEN_PRINTF (Qprintf, stdout, &opts.quiet, FALSE) * * Return: none */ -void version (void) +static void version (void) { printf ("\n%s v%s - Display, or set, the label for an NTFS Volume.\n\n", EXEC_NAME, VERSION); @@ -76,7 +76,7 @@ void version (void) * * Return: none */ -void usage (void) +static void usage (void) { printf ("\nUsage: %s [options] device [label]\n" " -n --no-action Do not write to disk\n" @@ -98,7 +98,7 @@ void usage (void) * Return: 1 Success * 0 Error, one or more problems */ -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[] = { @@ -187,7 +187,7 @@ int parse_options (int argc, char *argv[]) * * Print the label of the device @dev to stdout. */ -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? @@ -211,7 +211,7 @@ int print_label (ntfs_volume *vol, unsigned long mnt_flags) * Return 0 on success and -1 with errno = ENOSPC if not enough space in the * mft record. */ -int resize_resident_attribute_value(MFT_RECORD *m, ATTR_RECORD *a, +static int resize_resident_attribute_value(MFT_RECORD *m, ATTR_RECORD *a, const u32 new_vsize) { int new_alen, new_muse; @@ -246,7 +246,7 @@ int resize_resident_attribute_value(MFT_RECORD *m, ATTR_RECORD *a, * * Change the label on the device @dev to @label. */ -int change_label(ntfs_volume *vol, unsigned long mnt_flags, char *label, BOOL force) +static int change_label(ntfs_volume *vol, unsigned long mnt_flags, char *label, BOOL force) { ntfs_attr_search_ctx *ctx = NULL; uchar_t *new_label = NULL; diff --git a/ntfsprogs/ntfsls.c b/ntfsprogs/ntfsls.c index 00310f96..ac1734c0 100644 --- a/ntfsprogs/ntfsls.c +++ b/ntfsprogs/ntfsls.c @@ -65,7 +65,7 @@ GEN_PRINTF(Qprintf, stdout, &opts.quiet, FALSE) * * Return: none */ -void version(void) +static void version(void) { printf("\n%s v%s - Display information about an NTFS Volume.\n\n", EXEC_NAME, VERSION); @@ -82,7 +82,7 @@ void version(void) * * Return: none */ -void usage(void) +static void usage(void) { printf("\nUsage: %s [options] -d /dev/hda1\n" "\n" @@ -113,7 +113,7 @@ void usage(void) * Return: 1 Success * 0 Error, one or more problems */ -int parse_options(int argc, char *argv[]) +static int parse_options(int argc, char *argv[]) { static const char *sopt = "-ad:Ffh?ilp:qsVvx"; static const struct option lopt[] = { @@ -226,7 +226,7 @@ typedef struct { * list_entry * FIXME: Should we print errors as we go along? (AIA) */ -int list_entry(ntfsls_dirent *dirent, const uchar_t *name, +static int list_entry(ntfsls_dirent *dirent, const uchar_t *name, const int name_len, const int name_type, const s64 pos, const MFT_REF mref, const unsigned dt_type) { diff --git a/ntfsprogs/ntfsmove.c b/ntfsprogs/ntfsmove.c index bcd44eeb..f1f600fe 100644 --- a/ntfsprogs/ntfsmove.c +++ b/ntfsprogs/ntfsmove.c @@ -57,7 +57,7 @@ GEN_PRINTF (Qprintf, stdout, &opts.quiet, FALSE) * * Return: none */ -void version (void) +static void version (void) { printf ("\n%s v%s - Move files and directories on an NTFS volume.\n\n", EXEC_NAME, VERSION); @@ -72,7 +72,7 @@ void version (void) * * Return: none */ -void usage (void) +static void usage (void) { printf ("\nUsage: %s [options] device file\n" "\n" @@ -101,7 +101,7 @@ void usage (void) * Return: 1 Success * 0 Error, one or more problems */ -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[] = { @@ -233,7 +233,7 @@ int parse_options (int argc, char **argv) /** * ntfs_debug_runlist_dump2 - Dump a runlist. */ -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; @@ -291,7 +291,7 @@ int ntfs_debug_runlist_dump2 (const runlist *rl, int abbr, char *prefix) /** * resize_nonres_attr */ -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; @@ -327,7 +327,7 @@ int resize_nonres_attr (MFT_RECORD *m, ATTR_RECORD *a, const u32 new_size) /** * calc_attr_length */ -int calc_attr_length (ATTR_RECORD *rec, int runlength) +static int calc_attr_length (ATTR_RECORD *rec, int runlength) { int size; @@ -344,7 +344,7 @@ int calc_attr_length (ATTR_RECORD *rec, int runlength) /** * dump_runs */ -void dump_runs (u8 *buffer, int len) +static void dump_runs (u8 *buffer, int len) { int i; printf ("RUN: "); @@ -358,7 +358,7 @@ void dump_runs (u8 *buffer, int len) /** * find_unused */ -runlist * find_unused (ntfs_volume *vol, s64 size, u64 loc, int flags) +static runlist * find_unused (ntfs_volume *vol, s64 size, u64 loc, int flags) { const int bufsize = 8192; u8 *buffer; @@ -439,7 +439,7 @@ done: * Any fragmented MFT records * The boot file 'ntldr' */ -int dont_move (ntfs_inode *ino) +static int dont_move (ntfs_inode *ino) { static const uchar_t ntldr[6] = { const_cpu_to_le16('n'), const_cpu_to_le16('t'), const_cpu_to_le16('l'), @@ -480,7 +480,7 @@ int dont_move (ntfs_inode *ino) /** * bitmap_alloc */ -int bitmap_alloc (ntfs_volume *vol, runlist_element *rl) +static int bitmap_alloc (ntfs_volume *vol, runlist_element *rl) { int res; @@ -498,7 +498,7 @@ int bitmap_alloc (ntfs_volume *vol, runlist_element *rl) /** * bitmap_free */ -int bitmap_free (ntfs_volume *vol, runlist_element *rl) +static int bitmap_free (ntfs_volume *vol, runlist_element *rl) { int res; @@ -516,7 +516,7 @@ int bitmap_free (ntfs_volume *vol, runlist_element *rl) /** * data_copy */ -int data_copy (ntfs_volume *vol, runlist_element *from, runlist_element *to) +static int data_copy (ntfs_volume *vol, runlist_element *from, runlist_element *to) { int i; u8 *buffer; @@ -567,7 +567,8 @@ int data_copy (ntfs_volume *vol, runlist_element *from, runlist_element *to) * copy data * deallocate old space */ -s64 move_runlist (ntfs_volume *vol, runlist_element *from, runlist_element *to) +static s64 move_runlist (ntfs_volume *vol, runlist_element *from, + runlist_element *to) { int i; @@ -632,7 +633,8 @@ s64 move_runlist (ntfs_volume *vol, runlist_element *from, runlist_element *to) // requires a mrec arg, not an ino (ino->mrec will do for now) // check size of new runlist before allocting / moving // replace one datarun with another (by hand) -s64 move_datarun (ntfs_volume *vol, ntfs_inode *ino, ATTR_RECORD *rec, runlist_element *run, u64 loc, int flags) +static s64 move_datarun (ntfs_volume *vol, ntfs_inode *ino, ATTR_RECORD *rec, + runlist_element *run, u64 loc, int flags) { runlist *from; runlist *to; @@ -719,7 +721,8 @@ s64 move_datarun (ntfs_volume *vol, ntfs_inode *ino, ATTR_RECORD *rec, runlist_e * = 0 Nothing to do * < 0 Error */ -s64 move_attribute (ntfs_volume *vol, ntfs_inode *ino, ATTR_RECORD *rec, u64 loc, int flags) +static s64 move_attribute (ntfs_volume *vol, ntfs_inode *ino, ATTR_RECORD *rec, + u64 loc, int flags) { int i; s64 res; @@ -763,7 +766,7 @@ s64 move_attribute (ntfs_volume *vol, ntfs_inode *ino, ATTR_RECORD *rec, u64 loc * = 0 Nothing to do * < 0 Error */ -s64 move_file (ntfs_volume *vol, ntfs_inode *ino, u64 loc, int flags) +static s64 move_file (ntfs_volume *vol, ntfs_inode *ino, u64 loc, int flags) { char *buffer; ntfs_attr_search_ctx *ctx; diff --git a/ntfsprogs/ntfstruncate.c b/ntfsprogs/ntfstruncate.c index abb59e1a..8a048357 100644 --- a/ntfsprogs/ntfstruncate.c +++ b/ntfsprogs/ntfstruncate.c @@ -95,7 +95,7 @@ struct { /** * Dprintf - debugging output (-vv); overriden by quiet (-q) */ -void Dprintf(const char *fmt, ...) +static void Dprintf(const char *fmt, ...) { va_list ap; @@ -130,7 +130,7 @@ GEN_PRINTF(Qprintf, stdout, &opts.quiet, FALSE) /** * err_exit - error output and terminate; ignores quiet (-q) */ -void err_exit(const char *fmt, ...) +static void err_exit(const char *fmt, ...) { va_list ap; @@ -145,7 +145,7 @@ void err_exit(const char *fmt, ...) /** * copyright - print copyright statements */ -void copyright(void) +static void copyright(void) { fprintf(stderr, "Copyright (c) 2002-2003 Anton Altaparmakov\n" "Copyright (c) 2003 Richard Russon\n" @@ -156,7 +156,7 @@ void copyright(void) /** * license - print licese statement */ -void license(void) +static void license(void) { fprintf(stderr, "%s", ntfs_gpl); } @@ -189,7 +189,7 @@ void usage (void) /** * parse_options */ -void parse_options(int argc, char *argv[]) +static void parse_options(int argc, char *argv[]) { long long ll; char *s, *s2; @@ -304,7 +304,7 @@ void parse_options(int argc, char *argv[]) * terminating null byte. If a unicode character was encountered which could * not be converted -1 is returned. */ -int ucstos(char *dest, const uchar_t *src, int maxlen) +static int ucstos(char *dest, const uchar_t *src, int maxlen) { uchar_t u; int i; @@ -326,7 +326,7 @@ int ucstos(char *dest, const uchar_t *src, int maxlen) /** * dump_resident_attr_val */ -void dump_resident_attr_val(ATTR_TYPES type, char *val, u32 val_len) +static void dump_resident_attr_val(ATTR_TYPES type, char *val, u32 val_len) { const char *don_t_know = "Don't know what to do with this attribute " "type yet."; @@ -474,7 +474,7 @@ void dump_resident_attr_val(ATTR_TYPES type, char *val, u32 val_len) /** * dump_resident_attr */ -void dump_resident_attr(ATTR_RECORD *a) +static void dump_resident_attr(ATTR_RECORD *a) { int i; @@ -497,7 +497,7 @@ void dump_resident_attr(ATTR_RECORD *a) /** * dump_mapping_pairs_array */ -void dump_mapping_pairs_array(char *b, unsigned int max_len) +static void dump_mapping_pairs_array(char *b, unsigned int max_len) { // TODO return; @@ -506,7 +506,7 @@ void dump_mapping_pairs_array(char *b, unsigned int max_len) /** * dump_non_resident_attr */ -void dump_non_resident_attr(ATTR_RECORD *a) +static void dump_non_resident_attr(ATTR_RECORD *a) { s64 l; int i; @@ -545,7 +545,7 @@ void dump_non_resident_attr(ATTR_RECORD *a) /** * dump_attr_record */ -void dump_attr_record(MFT_RECORD *m, ATTR_RECORD *a) +static void dump_attr_record(MFT_RECORD *m, ATTR_RECORD *a) { unsigned int u; char s[0x200]; @@ -642,7 +642,7 @@ void dump_attr_record(MFT_RECORD *m, ATTR_RECORD *a) /** * dump_mft_record */ -void dump_mft_record(MFT_RECORD *m) +static void dump_mft_record(MFT_RECORD *m) { ATTR_RECORD *a; unsigned int u; @@ -695,7 +695,7 @@ void dump_mft_record(MFT_RECORD *m) /** * ntfstruncate_exit */ -void ntfstruncate_exit(void) +static void ntfstruncate_exit(void) { int err; diff --git a/ntfsprogs/ntfsundelete.c b/ntfsprogs/ntfsundelete.c index c9a565b0..ef37d08b 100644 --- a/ntfsprogs/ntfsundelete.c +++ b/ntfsprogs/ntfsundelete.c @@ -72,7 +72,7 @@ GEN_PRINTF (Qprintf, stdout, &opts.quiet, FALSE) * * Return: none */ -void version (void) +static void version (void) { printf ("\n%s v%s - Recover deleted files from an NTFS Volume.\n\n", EXEC_NAME, VERSION); @@ -88,7 +88,7 @@ void version (void) * * Return: none */ -void usage (void) +static void usage (void) { printf ("\nUsage: %s [options] device\n" " -s --scan Scan for files (default)\n" @@ -135,7 +135,7 @@ void usage (void) * Return: 1, Success, the string was transformed * 0, An error occurred */ -int transform (const char *pattern, char **regex) +static int transform (const char *pattern, char **regex) { char *result; int length, i, j; @@ -210,7 +210,7 @@ int transform (const char *pattern, char **regex) * Return: 1 Success * 0 Error, the string was malformed */ -int parse_time (const char *value, time_t *since) +static int parse_time (const char *value, time_t *since) { time_t result, now; char *suffix = NULL; @@ -266,7 +266,7 @@ int parse_time (const char *value, time_t *since) * Return: 1 Success * 0 Error, one or more problems */ -int parse_options (int argc, char *argv[]) +static int parse_options (int argc, char *argv[]) { static const char *sopt = "-b:Cc:d:fh?m:o:p:sS:t:u:qvV"; static const struct option lopt[] = { @@ -515,7 +515,7 @@ int parse_options (int argc, char *argv[]) * * Return: none */ -void free_file (struct ufile *file) +static void free_file (struct ufile *file) { struct list_head *item, *tmp; @@ -563,7 +563,7 @@ void free_file (struct ufile *file) * Return: n The number of $FILENAME attributes found * -1 Error */ -int get_filenames (struct ufile *file) +static int get_filenames (struct ufile *file) { ATTR_RECORD *rec; FILE_NAME_ATTR *attr; @@ -639,7 +639,7 @@ int get_filenames (struct ufile *file) * Return: n The number of $FILENAME attributes found * -1 Error */ -int get_data (struct ufile *file, ntfs_volume *vol) +static int get_data (struct ufile *file, ntfs_volume *vol) { ATTR_RECORD *rec; ntfs_attr_search_ctx *ctx; @@ -713,7 +713,7 @@ int get_data (struct ufile *file, ntfs_volume *vol) * Return: Pointer A ufile object containing the results * NULL Error */ -struct ufile * read_record (ntfs_volume *vol, long long record) +static struct ufile * read_record (ntfs_volume *vol, long long record) { ATTR_RECORD *attr10, *attr20, *attr90; struct ufile *file; @@ -807,7 +807,7 @@ struct ufile * read_record (ntfs_volume *vol, long long record) * Return: n The percentage of the file that _could_ be recovered * -1 Error */ -int calc_percentage (struct ufile *file, ntfs_volume *vol) +static int calc_percentage (struct ufile *file, ntfs_volume *vol) { runlist_element *rl = NULL; struct list_head *pos; @@ -924,7 +924,7 @@ int calc_percentage (struct ufile *file, ntfs_volume *vol) * * Return: none */ -void dump_record (struct ufile *file) +static void dump_record (struct ufile *file) { char buffer[20]; char *name; @@ -1035,7 +1035,7 @@ void dump_record (struct ufile *file) * * Return: none */ -void list_record (struct ufile *file) +static void list_record (struct ufile *file) { char buffer[20]; struct list_head *item; @@ -1092,7 +1092,7 @@ void list_record (struct ufile *file) * Return: 1 There is a matching filename. * 0 There is no match. */ -int name_match (regex_t *re, struct ufile *file) +static int name_match (regex_t *re, struct ufile *file) { struct list_head *item; int result; @@ -1130,7 +1130,8 @@ int name_match (regex_t *re, struct ufile *file) * Return: -1 Error, something went wrong * 0 Success, all the data was written */ -unsigned int write_data (int fd, const char *buffer, unsigned int bufsize) +static unsigned int write_data (int fd, const char *buffer, + unsigned int bufsize) { ssize_t result1, result2; @@ -1177,8 +1178,8 @@ unsigned int write_data (int fd, const char *buffer, unsigned int bufsize) * * Return: n Length of the allocated name */ -int create_pathname (const char *dir, const char *name, const char *stream, - char *buffer, int bufsize) +static int create_pathname (const char *dir, const char *name, + const char *stream, char *buffer, int bufsize) { if (!name) name = UNKNOWN; @@ -1208,7 +1209,7 @@ int create_pathname (const char *dir, const char *name, const char *stream, * Return: -1 Error, failed to create the file * n Success, this is the file descriptor */ -int open_file (const char *pathname) +static int open_file (const char *pathname) { int flags; @@ -1232,7 +1233,7 @@ int open_file (const char *pathname) * Return: 1 Success, set the file's date and time * 0 Error, failed to change the file's date and time */ -int set_date (const char *pathname, time_t date) +static int set_date (const char *pathname, time_t date) { struct utimbuf ut; @@ -1260,7 +1261,7 @@ int set_date (const char *pathname, time_t date) * Return: -1 Error, something went wrong * n Success, the number of recoverable files */ -int scan_disk (ntfs_volume *vol) +static int scan_disk (ntfs_volume *vol) { const int BUFSIZE = 8192; char *buffer = NULL; @@ -1383,7 +1384,7 @@ out: * Return: 0 Error, something went wrong * 1 Success, the data was recovered */ -int undelete_file (ntfs_volume *vol, long long inode) +static int undelete_file (ntfs_volume *vol, long long inode) { char pathname[256]; char *buffer = NULL; @@ -1586,7 +1587,7 @@ free: * Return: 0 Success, all the records were written * 1 Error, something went wrong */ -int copy_mft (ntfs_volume *vol, long long mft_begin, long long mft_end) +static int copy_mft (ntfs_volume *vol, long long mft_begin, long long mft_end) { char pathname[256]; ntfs_attr *mft; diff --git a/ntfsprogs/ntfswipe.c b/ntfsprogs/ntfswipe.c index 90bb0479..7df7d5a7 100644 --- a/ntfsprogs/ntfswipe.c +++ b/ntfsprogs/ntfswipe.c @@ -51,7 +51,7 @@ GEN_PRINTF (Qprintf, stdout, &opts.quiet, FALSE) * * Return: none */ -void version (void) +static void version (void) { printf ("\n%s v%s - Overwrite the unused space on an NTFS Volume.\n\n", EXEC_NAME, VERSION); @@ -66,7 +66,7 @@ void version (void) * * Return: none */ -void usage (void) +static void usage (void) { printf ("\nUsage: %s [options] device\n" " -i --info Show volume information (default)\n" @@ -107,7 +107,7 @@ void usage (void) * Return: 0 Error, invalid string * n Success, the count of numbers parsed */ -int parse_list (char *list, int **result) +static int parse_list (char *list, int **result) { char *ptr; char *end; @@ -167,7 +167,7 @@ int parse_list (char *list, int **result) * Return: 1 Success * 0 Error, one or more problems */ -int parse_options (int argc, char *argv[]) +static int parse_options (int argc, char *argv[]) { static char *sopt = "-ab:c:dfh?ilmnpqtuvV"; static struct option lopt[] = { @@ -350,7 +350,7 @@ int parse_options (int argc, char *argv[]) * Return: 1 Success, the clusters were wiped * 0 Error, something went wrong */ -s64 wipe_unused (ntfs_volume *vol, int byte, enum action act) +static s64 wipe_unused (ntfs_volume *vol, int byte, enum action act) { s64 i; s64 total = 0; @@ -404,7 +404,7 @@ free: * Return: 1 Success, the clusters were wiped * 0 Error, something went wrong */ -s64 wipe_tails (ntfs_volume *vol, int byte, enum action act) +static s64 wipe_tails (ntfs_volume *vol, int byte, enum action act) { if (!vol || (byte < 0)) return -1; @@ -424,7 +424,7 @@ s64 wipe_tails (ntfs_volume *vol, int byte, enum action act) * Return: 1 Success, the clusters were wiped * 0 Error, something went wrong */ -s64 wipe_mft (ntfs_volume *vol, int byte, enum action act) +static s64 wipe_mft (ntfs_volume *vol, int byte, enum action act) { // by considering the individual attributes we might be able to // wipe a few more bytes at the attr's tail. @@ -554,7 +554,7 @@ free: * Return: 1 Success, the clusters were wiped * 0 Error, something went wrong */ -s64 wipe_directory (ntfs_volume *vol, int byte, enum action act) +static s64 wipe_directory (ntfs_volume *vol, int byte, enum action act) { if (!vol || (byte < 0)) return -1; @@ -574,7 +574,7 @@ s64 wipe_directory (ntfs_volume *vol, int byte, enum action act) * Return: 1 Success, the clusters were wiped * 0 Error, something went wrong */ -s64 wipe_logfile (ntfs_volume *vol, int byte, enum action act) +static s64 wipe_logfile (ntfs_volume *vol, int byte, enum action act) { const int NTFS_BUF_SIZE2 = 8192; //FIXME(?): We might need to zero the LSN field of every single mft @@ -675,7 +675,7 @@ error_exit: * Return: 1 Success, the clusters were wiped * 0 Error, something went wrong */ -s64 wipe_pagefile (ntfs_volume *vol, int byte, enum action act) +static s64 wipe_pagefile (ntfs_volume *vol, int byte, enum action act) { // wipe completely, chkdsk doesn't do anything, booting writes header const int NTFS_BUF_SIZE2 = 4096; @@ -757,7 +757,7 @@ error_exit: * Return: 1 Success, displayed some info * 0 Error, something went wrong */ -int ntfs_info (ntfs_volume *vol) +static int ntfs_info (ntfs_volume *vol) { u8 *buffer; @@ -933,7 +933,7 @@ bmpdone: * * Return: none */ -void print_summary (void) +static void print_summary (void) { int i;