char *xmalloc ();
char *xrealloc ();
-static int change_file_group ();
-static int change_dir_group ();
-static void describe_change ();
-static void parse_group ();
-static void usage ();
+static int change_file_group (char *file, int group);
+static int change_dir_group (char *dir, int group, struct stat *statp);
+static void describe_change (char *file, int changed);
+static void parse_group (char *name, int *g);
+static void usage (int status);
/* The name the program was run with. */
char *program_name;
};
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int group;
int errors = 0;
/* Set *G according to NAME. */
static void
-parse_group (name, g)
- char *name;
- int *g;
+parse_group (char *name, int *g)
{
struct group *grp;
Return 0 if successful, 1 if errors occurred. */
static int
-change_file_group (file, group)
- char *file;
- int group;
+change_file_group (char *file, int group)
{
struct stat file_stats;
int errors = 0;
Return 0 if successful, 1 if errors occurred. */
static int
-change_dir_group (dir, group, statp)
- char *dir;
- int group;
- struct stat *statp;
+change_dir_group (char *dir, int group, struct stat *statp)
{
char *name_space, *namep;
char *path; /* Full path of each entry to process. */
has been given; if CHANGED is zero, FILE was that group already. */
static void
-describe_change (file, changed)
- char *file;
- int changed;
+describe_change (char *file, int changed)
{
if (changed)
printf ("group of %s changed to %s\n", file, groupname);
}
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, "Try `%s --help' for more information.\n",
char *xmalloc ();
char *xrealloc ();
-static int change_file_mode ();
-static int change_dir_mode ();
-static void describe_change ();
-static void usage ();
+static int change_file_mode (char *file, struct mode_change *changes, int deref_symlink);
+static int change_dir_mode (char *dir, struct mode_change *changes, struct stat *statp);
+static void describe_change (char *file, short unsigned int mode, int changed);
+static void usage (int status);
/* The name the program was run with. */
char *program_name;
of `struct mode_change' and apply that to each file argument. */
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
struct mode_change *changes;
int errors = 0;
links. Return 0 if successful, 1 if errors occurred. */
static int
-change_file_mode (file, changes, deref_symlink)
- char *file;
- struct mode_change *changes;
- int deref_symlink;
+change_file_mode (char *file, struct mode_change *changes, int deref_symlink)
{
struct stat file_stats;
unsigned short newmode;
Return 0 if successful, 1 if errors occurred. */
static int
-change_dir_mode (dir, changes, statp)
- char *dir;
- struct mode_change *changes;
- struct stat *statp;
+change_dir_mode (char *dir, struct mode_change *changes, struct stat *statp)
{
char *name_space, *namep;
char *path; /* Full path of each entry to process. */
if CHANGED is zero, FILE had that mode already. */
static void
-describe_change (file, mode, changed)
- char *file;
- unsigned short mode;
- int changed;
+describe_change (char *file, short unsigned int mode, int changed)
{
char perms[11]; /* "-rwxrwxrwx" ls-style modes. */
}
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, "Try `%s --help' for more information.\n",
char *xmalloc ();
char *xrealloc ();
-static int change_file_owner ();
-static int change_dir_owner ();
-static void describe_change ();
-static void usage ();
+static int change_file_owner (char *file, uid_t user, gid_t group);
+static int change_dir_owner (char *dir, uid_t user, gid_t group, struct stat *statp);
+static void describe_change (char *file, int changed);
+static void usage (int status);
/* The name the program was run with. */
char *program_name;
};
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
uid_t user = (uid_t) -1; /* New uid; -1 if not to be changed. */
gid_t group = (uid_t) -1; /* New gid; -1 if not to be changed. */
Return 0 if successful, 1 if errors occurred. */
static int
-change_file_owner (file, user, group)
- char *file;
- uid_t user;
- gid_t group;
+change_file_owner (char *file, uid_t user, gid_t group)
{
struct stat file_stats;
uid_t newuser;
Return 0 if successful, 1 if errors occurred. */
static int
-change_dir_owner (dir, user, group, statp)
- char *dir;
- uid_t user;
- gid_t group;
- struct stat *statp;
+change_dir_owner (char *dir, uid_t user, gid_t group, struct stat *statp)
{
char *name_space, *namep;
char *path; /* Full path of each entry to process. */
has been given; if CHANGED is zero, FILE had those owners already. */
static void
-describe_change (file, changed)
- char *file;
- int changed;
+describe_change (char *file, int changed)
{
if (changed)
printf ("owner of %s changed to ", file);
}
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, "Try `%s --help' for more information.\n",
struct dir_attr *next;
};
-int stat ();
-int lstat ();
+int stat (const char *, struct stat *);
+int lstat (const char *, struct stat *);
-char *dirname ();
+char *dirname (char *);
char *xstrdup ();
enum backup_type get_version ();
int euidaccess ();
int full_write ();
-static int do_copy ();
-static int copy ();
-static int copy_dir ();
-static int make_path_private ();
-static int copy_reg ();
-static int re_protect ();
+static int do_copy (int argc, char **argv);
+static int copy (char *src_path, char *dst_path, int new_dst, dev_t device, struct dir_list *ancestors);
+static int copy_dir (char *src_path_in, char *dst_path_in, int new_dst, struct stat *src_sb, struct dir_list *ancestors);
+static int make_path_private (char *const_dirpath, int src_offset, int mode, char *verbose_fmt_string, struct dir_attr **attr_list, int *new_dst);
+static int copy_reg (char *src_path, char *dst_path);
+static int re_protect (char *const_dst_path, int src_offset, struct dir_attr *attr_list);
/* Initial number of entries in each hash table entry's table of inodes. */
#define INITIAL_HASH_MODULE 100
};
\f
void
-main (argc, argv)
- int argc;
- char *argv[];
+main (int argc, char **argv)
{
int c;
int make_backups = 0;
Return 0 if successful, 1 if any errors occur. */
static int
-do_copy (argc, argv)
- int argc;
- char *argv[];
+do_copy (int argc, char **argv)
{
char *dest;
struct stat sb;
Return 0 if successful, 1 if an error occurs. */
static int
-copy (src_path, dst_path, new_dst, device, ancestors)
- char *src_path;
- char *dst_path;
- int new_dst;
- dev_t device;
- struct dir_list *ancestors;
+copy (char *src_path, char *dst_path, int new_dst, dev_t device, struct dir_list *ancestors)
{
struct stat src_sb;
struct stat dst_sb;
permissions when done, otherwise 1. */
static int
-make_path_private (const_dirpath, src_offset, mode, verbose_fmt_string,
- attr_list, new_dst)
- char *const_dirpath;
- int src_offset;
- int mode;
- char *verbose_fmt_string;
- struct dir_attr **attr_list;
- int *new_dst;
+make_path_private (char *const_dirpath, int src_offset, int mode, char *verbose_fmt_string, struct dir_attr **attr_list, int *new_dst)
{
struct stat stats;
char *dirpath; /* A copy of CONST_DIRPATH we can change. */
when done, otherwise 1. */
static int
-re_protect (const_dst_path, src_offset, attr_list)
- char *const_dst_path;
- int src_offset;
- struct dir_attr *attr_list;
+re_protect (char *const_dst_path, int src_offset, struct dir_attr *attr_list)
{
struct dir_attr *p;
char *dst_path; /* A copy of CONST_DST_PATH we can change. */
Return 0 if successful, -1 if an error occurs. */
static int
-copy_dir (src_path_in, dst_path_in, new_dst, src_sb, ancestors)
- char *src_path_in;
- char *dst_path_in;
- int new_dst;
- struct stat *src_sb;
- struct dir_list *ancestors;
+copy_dir (char *src_path_in, char *dst_path_in, int new_dst, struct stat *src_sb, struct dir_list *ancestors)
{
char *name_space;
char *namep;
Return 0 if successful, -1 if an error occurred. */
static int
-copy_reg (src_path, dst_path)
- char *src_path;
- char *dst_path;
+copy_reg (char *src_path, char *dst_path)
{
char *buf;
int buf_size;
int safe_read ();
int full_write ();
-static RETSIGTYPE interrupt_handler ();
-static int bit_count ();
-static int parse_integer ();
-static void apply_translations ();
-static void copy ();
-static void copy_simple ();
-static void copy_with_block ();
-static void copy_with_unblock ();
-static void parse_conversion ();
-static void print_stats ();
-static void translate_charset ();
-static void quit ();
-static void scanargs ();
-static void skip ();
-static void usage ();
-static void write_output ();
+static RETSIGTYPE interrupt_handler (void);
+static int bit_count (register unsigned int i);
+static int parse_integer (char *str);
+static void apply_translations (void);
+static void copy (void);
+static void copy_simple (unsigned char *buf, int nread);
+static void copy_with_block (unsigned char *buf, int nread);
+static void copy_with_unblock (unsigned char *buf, int nread);
+static void parse_conversion (char *str);
+static void print_stats (void);
+static void translate_charset (unsigned char *new_trans);
+static void quit (int code);
+static void scanargs (int argc, char **argv);
+static void skip (int fdesc, char *file, long int records, long int blocksize, char *buf);
+static void usage (int status);
+static void write_output (void);
/* The name this program was run with. */
char *program_name;
};
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
#ifdef _POSIX_VERSION
struct sigaction sigact;
bytes of the data at a time in BUF, if necessary. */
static void
-skip (fdesc, file, records, blocksize, buf)
- int fdesc;
- char *file;
- long records;
- long blocksize;
- char *buf;
+skip (int fdesc, char *file, long int records, long int blocksize, char *buf)
{
struct stat stats;
to the NREAD bytes in BUF. */
static void
-translate_buffer (buf, nread)
- unsigned char *buf;
- int nread;
+translate_buffer (unsigned char *buf, int nread)
{
register unsigned char *cp;
register int i;
next call. Return the new start of the BUF buffer. */
static unsigned char *
-swab_buffer (buf, nread)
- unsigned char *buf;
- int *nread;
+swab_buffer (unsigned char *buf, int *nread)
{
unsigned char *bufstart = buf;
register unsigned char *cp;
/* The main loop. */
static void
-copy ()
+copy (void)
{
unsigned char *ibuf, *bufstart; /* Input buffer. */
int nread; /* Bytes read in the current block. */
/* Copy NREAD bytes of BUF, with no conversions. */
static void
-copy_simple (buf, nread)
- unsigned char *buf;
- int nread;
+copy_simple (unsigned char *buf, int nread)
{
int nfree; /* Number of unused bytes in `obuf'. */
unsigned char *start = buf; /* First uncopied char in BUF. */
replacing the newline with trailing spaces). */
static void
-copy_with_block (buf, nread)
- unsigned char *buf;
- int nread;
+copy_with_block (unsigned char *buf, int nread)
{
register int i;
with a newline). */
static void
-copy_with_unblock (buf, nread)
- unsigned char *buf;
- int nread;
+copy_with_unblock (unsigned char *buf, int nread)
{
register int i;
register unsigned char c;
/* Write, then empty, the output buffer `obuf'. */
static void
-write_output ()
+write_output (void)
{
int nwritten = full_write (output_fd, obuf, output_blocksize);
if (nwritten != output_blocksize)
}
static void
-scanargs (argc, argv)
- int argc;
- char **argv;
+scanargs (int argc, char **argv)
{
int i, n;
int c;
/* FIXME: use xstrtou?l */
static int
-parse_integer (str)
- char *str;
+parse_integer (char *str)
{
register int n = 0;
register int temp;
/* Interpret one "conv=..." option. */
static void
-parse_conversion (str)
- char *str;
+parse_conversion (char *str)
{
char *new;
int i;
/* Fix up translation table. */
static void
-apply_translations ()
+apply_translations (void)
{
int i;
}
static void
-translate_charset (new_trans)
- unsigned char *new_trans;
+translate_charset (unsigned char *new_trans)
{
int i;
/* Return the number of 1 bits in `i'. */
static int
-bit_count (i)
- register unsigned int i;
+bit_count (register unsigned int i)
{
register int set_bits;
}
static void
-print_stats ()
+print_stats (void)
{
fprintf (stderr, "%u+%u records in\n", r_full, r_partial);
fprintf (stderr, "%u+%u records out\n", w_full, w_partial);
}
static void
-quit (code)
- int code;
+quit (int code)
{
int errcode = code ? code : 1;
print_stats ();
}
static RETSIGTYPE
-interrupt_handler ()
+interrupt_handler (void)
{
quit (1);
}
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, "Try `%s --help' for more information.\n",
char *xmalloc ();
char *xstrdup ();
-static int selected_fstype ();
-static int excluded_fstype ();
-static void add_excluded_fs_type ();
-static void add_fs_type ();
-static void print_header ();
-static void show_entry ();
-static void show_all_entries ();
-static void show_dev ();
-static void show_disk ();
-static void show_point ();
-static void usage ();
+static int selected_fstype (char *fstype);
+static int excluded_fstype (char *fstype);
+static void add_excluded_fs_type (char *fstype);
+static void add_fs_type (char *fstype);
+static void print_header (void);
+static void show_entry (char *path, struct stat *statp);
+static void show_all_entries (void);
+static void show_dev (char *disk, char *mount_point, char *fstype);
+static void show_disk (char *disk);
+static void show_point (char *point, struct stat *statp);
+static void usage (int status);
/* Name this program was run with. */
char *program_name;
};
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int i;
struct stat *stats;
}
\f
static void
-print_header ()
+print_header (void)
{
printf ("Filesystem ");
an unselected type or are empty. */
static void
-show_all_entries ()
+show_all_entries (void)
{
struct mount_entry *me;
for it. STATP is the results of `stat' on PATH. */
static void
-show_entry (path, statp)
- char *path;
- struct stat *statp;
+show_entry (char *path, struct stat *statp)
{
if (S_ISBLK (statp->st_mode) || S_ISCHR (statp->st_mode))
show_disk (path);
DISK is mounted on, and show its disk usage. */
static void
-show_disk (disk)
- char *disk;
+show_disk (char *disk)
{
struct mount_entry *me;
STATP is the results of `stat' on POINT. */
static void
-show_point (point, statp)
- char *point;
- struct stat *statp;
+show_point (char *point, struct stat *statp)
{
struct stat disk_stats;
struct mount_entry *me;
If FSTYPE is non-NULL, it is the type of the filesystem on DISK. */
static void
-show_dev (disk, mount_point, fstype)
- char *disk;
- char *mount_point;
- char *fstype;
+show_dev (char *disk, char *mount_point, char *fstype)
{
struct fs_usage fsu;
long blocks_used;
/* Add FSTYPE to the list of filesystem types to display. */
static void
-add_fs_type (fstype)
- char *fstype;
+add_fs_type (char *fstype)
{
struct fs_type_list *fsp;
/* Add FSTYPE to the list of filesystem types to be omitted. */
static void
-add_excluded_fs_type (fstype)
- char *fstype;
+add_excluded_fs_type (char *fstype)
{
struct fs_type_list *fsp;
return nonzero, else zero. */
static int
-selected_fstype (fstype)
- char *fstype;
+selected_fstype (char *fstype)
{
struct fs_type_list *fsp;
return nonzero, else zero. */
static int
-excluded_fstype (fstype)
- char *fstype;
+excluded_fstype (char *fstype)
{
struct fs_type_list *fsp;
}
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, "Try `%s --help' for more information.\n",
char *text; /* Pointer to the text. */
} *string, stringstruct;
-int stat ();
-int lstat ();
+int stat (const char *, struct stat *);
+int lstat (const char *, struct stat *);
char *savedir ();
char *xmalloc ();
char *xrealloc ();
-static int hash_insert ();
-static int hash_insert2 ();
-static long count_entry ();
-static void du_files ();
-static void hash_init ();
-static void hash_reset ();
-static void str_concatc ();
-static void str_copyc ();
-static void str_init ();
-static void str_trunc ();
+static int hash_insert (ino_t ino, dev_t dev);
+static int hash_insert2 (struct htab *htab, ino_t ino, dev_t dev);
+static long count_entry (char *ent, int top, dev_t last_dev);
+static void du_files (char **files);
+static void hash_init (unsigned int modulus, unsigned int entry_tab_size);
+static void hash_reset (void);
+static void str_concatc (string s1, char *cstr);
+static void str_copyc (string s1, char *cstr);
+static void str_init (string *s1, unsigned int size);
+static void str_trunc (string s1, unsigned int length);
/* Name under which this program was invoked. */
char *program_name;
};
static void
-usage (status, reason)
- int status;
- char *reason;
+usage (int status, char *reason)
{
if (reason != NULL)
fprintf (status == 0 ? stdout : stderr, "%s: %s\n",
}
\f
void
-main (argc, argv)
- int argc;
- char *argv[];
+main (int argc, char **argv)
{
int c;
char *cwd_only[2];
named in FILES, the last entry of which is NULL. */
static void
-du_files (files)
- char **files;
+du_files (char **files)
{
struct saved_cwd cwd;
ino_t initial_ino; /* Initial directory's inode. */
LAST_DEV is the device that the parent directory of ENT is on. */
static long
-count_entry (ent, top, last_dev)
- char *ent;
- int top;
- dev_t last_dev;
+count_entry (char *ent, int top, dev_t last_dev)
{
long size;
doubled.) */
static void
-hash_init (modulus, entry_tab_size)
- unsigned modulus;
- unsigned entry_tab_size;
+hash_init (unsigned int modulus, unsigned int entry_tab_size)
{
struct htab *htab_r;
contain no entries. */
static void
-hash_reset ()
+hash_reset (void)
{
int i;
struct entry **p;
if it wasn't. */
static int
-hash_insert (ino, dev)
- ino_t ino;
- dev_t dev;
+hash_insert (ino_t ino, dev_t dev)
{
struct htab *htab_r = htab; /* Initially a copy of the global `htab'. */
already existed. */
static int
-hash_insert2 (htab, ino, dev)
- struct htab *htab;
- ino_t ino;
- dev_t dev;
+hash_insert2 (struct htab *htab, ino_t ino, dev_t dev)
{
struct entry **hp, *ep2, *ep;
hp = &htab->hash[ino % htab->modulus];
/* Initialize the struct string S1 for holding SIZE characters. */
static void
-str_init (s1, size)
- string *s1;
- unsigned size;
+str_init (string *s1, unsigned int size)
{
string s;
}
static void
-ensure_space (s, size)
- string s;
- unsigned size;
+ensure_space (string s, unsigned int size)
{
if (s->alloc < size)
{
/* Assign the null-terminated C-string CSTR to S1. */
static void
-str_copyc (s1, cstr)
- string s1;
- char *cstr;
+str_copyc (string s1, char *cstr)
{
unsigned l = strlen (cstr);
ensure_space (s1, l);
}
static void
-str_concatc (s1, cstr)
- string s1;
- char *cstr;
+str_concatc (string s1, char *cstr)
{
unsigned l1 = s1->length;
unsigned l2 = strlen (cstr);
/* Truncate the string S1 to have length LENGTH. */
static void
-str_trunc (s1, length)
- string s1;
- unsigned length;
+str_trunc (string s1, unsigned int length)
{
if (s1->length > length)
{
#include <sys/wait.h>
#endif
-struct passwd *getpwnam ();
-struct group *getgrnam ();
+struct passwd *getpwnam (const char *);
+struct group *getgrnam (const char *);
#ifndef _POSIX_VERSION
uid_t getuid ();
/* Number of bytes of a file to copy at a time. */
#define READ_SIZE (32 * 1024)
-char *basename ();
+char *basename (char *);
char *stpcpy ();
char *xmalloc ();
int safe_read ();
int full_write ();
int isdir ();
-static int change_attributes ();
-static int copy_file ();
-static int install_file_in_dir ();
-static int install_file_in_file ();
-static void get_ids ();
-static void strip ();
-static void usage ();
+static int change_attributes (char *path, int no_need_to_chown);
+static int copy_file (char *from, char *to, int *to_created);
+static int install_file_in_dir (char *from, char *to_dir);
+static int install_file_in_file (char *from, char *to);
+static void get_ids (void);
+static void strip (char *path);
+static void usage (int status);
/* The name this program was run with, for error messages. */
char *program_name;
};
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int optc;
int errors = 0;
Return 0 if successful, 1 if an error occurs. */
static int
-install_file_in_file (from, to)
- char *from;
- char *to;
+install_file_in_file (char *from, char *to)
{
int to_created;
int no_need_to_chown;
Return 0 if successful, 1 if not. */
static int
-install_file_in_dir (from, to_dir)
- char *from;
- char *to_dir;
+install_file_in_dir (char *from, char *to_dir)
{
char *from_base;
char *to;
copy fails, don't modify *TO_CREATED. */
static int
-copy_file (from, to, to_created)
- char *from;
- char *to;
- int *to_created;
+copy_file (char *from, char *to, int *to_created)
{
int fromfd, tofd;
int bytes;
Return 0 if successful, 1 if not. */
static int
-change_attributes (path, no_need_to_chown)
- char *path;
- int no_need_to_chown;
+change_attributes (char *path, int no_need_to_chown)
{
int err = 0;
it portable would be very difficult. Not worth the effort. */
static void
-strip (path)
- char *path;
+strip (char *path)
{
int pid, status;
decimal integer, zero if not. */
static int
-is_number (str)
- char *str;
+is_number (char *str)
{
if (*str == 0)
return 0;
/* Initialize the user and group ownership of the files to install. */
static void
-get_ids ()
+get_ids (void)
{
struct passwd *pw;
struct group *gr;
}
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, "Try `%s --help' for more information.\n",
#include "version.h"
#include "error.h"
-int link (); /* Some systems don't declare this anywhere. */
+int link (const char *, const char *); /* Some systems don't declare this anywhere. */
#ifdef S_ISLNK
-int symlink ();
+int symlink (const char *, const char *);
#endif
/* Construct a string NEW_DEST by concatenating DEST, a slash, and
} \
while (0)
-char *basename ();
+char *basename (char *);
enum backup_type get_version ();
int isdir ();
int yesno ();
void strip_trailing_slashes ();
char *stpcpy ();
-static void usage ();
-static int do_link ();
+static void usage (int status);
+static int do_link (char *source, char *dest);
/* The name by which the program was run, for error messages. */
char *program_name;
};
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int c;
int errors;
Return 1 if there is an error, otherwise 0. */
static int
-do_link (source, dest)
- char *source;
- char *dest;
+do_link (char *source, char *dest)
{
struct stat dest_stats;
char *dest_backup = NULL;
}
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, "Try `%s --help' for more information.\n",
int argmatch ();
void invalid_arg ();
-static char *make_link_path ();
-static int compare_atime ();
-static int rev_cmp_atime ();
-static int compare_ctime ();
-static int rev_cmp_ctime ();
-static int compare_mtime ();
-static int rev_cmp_mtime ();
-static int compare_size ();
-static int rev_cmp_size ();
-static int compare_name ();
-static int rev_cmp_name ();
-static int compare_extension ();
-static int rev_cmp_extension ();
-static int decode_switches ();
-static void parse_ls_color ();
-static int file_interesting ();
-static int gobble_file ();
-static int is_not_dot_or_dotdot ();
-static int length_of_file_name_and_frills ();
-static void add_ignore_pattern ();
-static void attach ();
-static void clear_files ();
-static void extract_dirs_from_files ();
-static void get_link_name ();
-static void indent ();
-static void print_current_files ();
-static void print_dir ();
-static void print_file_name_and_frills ();
-static void print_horizontal ();
-static void print_long_format ();
-static void print_many_per_line ();
-static void print_name_with_quoting ();
-static void print_type_indicator ();
-static void print_color_indicator ();
-static void put_indicator ();
-static void print_with_commas ();
-static void queue_directory ();
-static void sort_files ();
-static void usage ();
+static char *make_link_path (char *path, char *linkname);
+static int compare_atime (struct fileinfo *file1, struct fileinfo *file2);
+static int rev_cmp_atime (struct fileinfo *file2, struct fileinfo *file1);
+static int compare_ctime (struct fileinfo *file1, struct fileinfo *file2);
+static int rev_cmp_ctime (struct fileinfo *file2, struct fileinfo *file1);
+static int compare_mtime (struct fileinfo *file1, struct fileinfo *file2);
+static int rev_cmp_mtime (struct fileinfo *file2, struct fileinfo *file1);
+static int compare_size (struct fileinfo *file1, struct fileinfo *file2);
+static int rev_cmp_size (struct fileinfo *file2, struct fileinfo *file1);
+static int compare_name (struct fileinfo *file1, struct fileinfo *file2);
+static int rev_cmp_name (struct fileinfo *file2, struct fileinfo *file1);
+static int compare_extension (struct fileinfo *file1, struct fileinfo *file2);
+static int rev_cmp_extension (struct fileinfo *file2, struct fileinfo *file1);
+static int decode_switches (int argc, char **argv);
+static void parse_ls_color (void);
+static int file_interesting (register struct dirent *next);
+static int gobble_file (char *name, int explicit_arg, char *dirname);
+static int is_not_dot_or_dotdot (char *name);
+static int length_of_file_name_and_frills (struct fileinfo *f);
+static void add_ignore_pattern (char *pattern);
+static void attach (char *dest, char *dirname, char *name);
+static void clear_files (void);
+static void extract_dirs_from_files (char *dirname, int recursive);
+static void get_link_name (char *filename, struct fileinfo *f);
+static void indent (int from, int to);
+static void print_current_files (void);
+static void print_dir (const char *name, const char *realname);
+static void print_file_name_and_frills (struct fileinfo *f);
+static void print_horizontal (void);
+static void print_long_format (struct fileinfo *f);
+static void print_many_per_line (void);
+static void print_name_with_quoting (register char *p);
+static void print_type_indicator (unsigned int mode);
+static void print_color_indicator (unsigned int mode);
+static void put_indicator (int n);
+static void print_with_commas (void);
+static void queue_directory (char *name, char *realname);
+static void sort_files (void);
+static void usage (int status);
\f
/* The name the program was run with, stripped of any leading path. */
char *program_name;
list of the integers stored in OS all on one line. */
static void
-dired_dump_obstack (prefix, os)
- const char *prefix;
- struct obstack *os;
+dired_dump_obstack (const char *prefix, struct obstack *os)
{
int n_pos;
}
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
register int i;
register struct pending *thispend;
Return the index of the first non-option argument. */
static int
-decode_switches (argc, argv)
- int argc;
- char **argv;
+decode_switches (int argc, char **argv)
{
register char *p;
int c;
/* Parse the LS_COLORS/LS_COLOURS variable */
static void
-parse_ls_color ()
+parse_ls_color (void)
{
register char *p; /* Pointer to character being parsed */
char *whichvar; /* LS_COLORS or LS_COLOURS? */
real names. */
static void
-queue_directory (name, realname)
- char *name;
- char *realname;
+queue_directory (char *name, char *realname)
{
struct pending *new;
this is used for symbolic links to directories. */
static void
-print_dir (name, realname)
- const char *name;
- const char *realname;
+print_dir (const char *name, const char *realname)
{
register DIR *reading;
register struct dirent *next;
not listed. */
static void
-add_ignore_pattern (pattern)
- char *pattern;
+add_ignore_pattern (char *pattern)
{
register struct ignore_pattern *ignore;
/* Return nonzero if the file in `next' should be listed. */
static int
-file_interesting (next)
- register struct dirent *next;
+file_interesting (register struct dirent *next)
{
register struct ignore_pattern *ignore;
/* Empty the table of files. */
static void
-clear_files ()
+clear_files (void)
{
register int i;
Return the number of blocks that the file occupies. */
static int
-gobble_file (name, explicit_arg, dirname)
- char *name;
- int explicit_arg;
- char *dirname;
+gobble_file (char *name, int explicit_arg, char *dirname)
{
register int blocks;
register int val;
into the `linkname' field of `f'. */
static void
-get_link_name (filename, f)
- char *filename;
- struct fileinfo *f;
+get_link_name (char *filename, struct fileinfo *f)
{
char *linkbuf;
register int linksize;
If `linkname' is zero, return zero. */
static char *
-make_link_path (path, linkname)
- char *path;
- char *linkname;
+make_link_path (char *path, char *linkname)
{
char *linkbuf;
int bufsiz;
This is desirable when processing directories recursively. */
static void
-extract_dirs_from_files (dirname, recursive)
- char *dirname;
- int recursive;
+extract_dirs_from_files (char *dirname, int recursive)
{
register int i, j;
register char *path;
This is so we don't try to recurse on `././././. ...' */
static int
-is_not_dot_or_dotdot (name)
- char *name;
+is_not_dot_or_dotdot (char *name)
{
char *t;
/* Sort the files now in the table. */
static void
-sort_files ()
+sort_files (void)
{
int (*func) ();
/* Comparison routines for sorting the files. */
static int
-compare_ctime (file1, file2)
- struct fileinfo *file1, *file2;
+compare_ctime (struct fileinfo *file1, struct fileinfo *file2)
{
return longdiff (file2->stat.st_ctime, file1->stat.st_ctime);
}
static int
-rev_cmp_ctime (file2, file1)
- struct fileinfo *file1, *file2;
+rev_cmp_ctime (struct fileinfo *file2, struct fileinfo *file1)
{
return longdiff (file2->stat.st_ctime, file1->stat.st_ctime);
}
static int
-compare_mtime (file1, file2)
- struct fileinfo *file1, *file2;
+compare_mtime (struct fileinfo *file1, struct fileinfo *file2)
{
return longdiff (file2->stat.st_mtime, file1->stat.st_mtime);
}
static int
-rev_cmp_mtime (file2, file1)
- struct fileinfo *file1, *file2;
+rev_cmp_mtime (struct fileinfo *file2, struct fileinfo *file1)
{
return longdiff (file2->stat.st_mtime, file1->stat.st_mtime);
}
static int
-compare_atime (file1, file2)
- struct fileinfo *file1, *file2;
+compare_atime (struct fileinfo *file1, struct fileinfo *file2)
{
return longdiff (file2->stat.st_atime, file1->stat.st_atime);
}
static int
-rev_cmp_atime (file2, file1)
- struct fileinfo *file1, *file2;
+rev_cmp_atime (struct fileinfo *file2, struct fileinfo *file1)
{
return longdiff (file2->stat.st_atime, file1->stat.st_atime);
}
static int
-compare_size (file1, file2)
- struct fileinfo *file1, *file2;
+compare_size (struct fileinfo *file1, struct fileinfo *file2)
{
return longdiff (file2->stat.st_size, file1->stat.st_size);
}
static int
-rev_cmp_size (file2, file1)
- struct fileinfo *file1, *file2;
+rev_cmp_size (struct fileinfo *file2, struct fileinfo *file1)
{
return longdiff (file2->stat.st_size, file1->stat.st_size);
}
static int
-compare_name (file1, file2)
- struct fileinfo *file1, *file2;
+compare_name (struct fileinfo *file1, struct fileinfo *file2)
{
return strcmp (file1->name, file2->name);
}
static int
-rev_cmp_name (file2, file1)
- struct fileinfo *file1, *file2;
+rev_cmp_name (struct fileinfo *file2, struct fileinfo *file1)
{
return strcmp (file1->name, file2->name);
}
If extensions are the same, compare by filenames instead. */
static int
-compare_extension (file1, file2)
- struct fileinfo *file1, *file2;
+compare_extension (struct fileinfo *file1, struct fileinfo *file2)
{
register char *base1, *base2;
register int cmp;
}
static int
-rev_cmp_extension (file2, file1)
- struct fileinfo *file1, *file2;
+rev_cmp_extension (struct fileinfo *file2, struct fileinfo *file1)
{
register char *base1, *base2;
register int cmp;
/* List all the files now in the table. */
static void
-print_current_files ()
+print_current_files (void)
{
register int i;
}
static void
-print_long_format (f)
- struct fileinfo *f;
+print_long_format (struct fileinfo *f)
{
char modebuf[20];
char timebuf[40];
of P and set QUOTED_LENGTH to the length of the quoted P. */
static char *
-quote_filename (p, quoted_length)
- register const char *p;
- size_t *quoted_length;
+quote_filename (register const char *p, size_t *quoted_length)
{
register unsigned char c;
const char *p0 = p;
}
static void
-print_name_with_quoting (p)
- register char *p;
+print_name_with_quoting (register char *p)
{
char *quoted;
size_t quoted_length;
as requested by switches. */
static void
-print_file_name_and_frills (f)
- struct fileinfo *f;
+print_file_name_and_frills (struct fileinfo *f)
{
if (print_inode)
printf ("%*lu ", INODE_DIGITS, (unsigned long) f->stat.st_ino);
}
static void
-print_type_indicator (mode)
- unsigned int mode;
+print_type_indicator (unsigned int mode)
{
if (S_ISDIR (mode))
PUTCHAR ('/');
}
static void
-print_color_indicator (mode)
- unsigned int mode;
+print_color_indicator (unsigned int mode)
{
int type = C_FILE;
/* Output a color indicator (which may contain nulls) */
static void
-put_indicator (n)
- int n;
+put_indicator (int n)
{
register int i;
register char *p;
}
static int
-length_of_file_name_and_frills (f)
- struct fileinfo *f;
+length_of_file_name_and_frills (struct fileinfo *f)
{
register char *p = f->name;
register unsigned char c;
}
\f
static void
-print_many_per_line ()
+print_many_per_line (void)
{
int filesno; /* Index into files. */
int row; /* Current row. */
}
\f
static void
-print_horizontal ()
+print_horizontal (void)
{
int filesno;
int max_name_length;
}
\f
static void
-print_with_commas ()
+print_with_commas (void)
{
int filesno;
int pos, old_pos;
Use a TAB character instead of two or more spaces whenever possible. */
static void
-indent (from, to)
- int from, to;
+indent (int from, int to)
{
while (from < to)
{
/* Put DIRNAME/NAME into DEST, handling `.' and `/' properly. */
static void
-attach (dest, dirname, name)
- char *dest, *dirname, *name;
+attach (char *dest, char *dirname, char *name)
{
char *dirnamep = dirname;
}
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, "Try `%s --help' for more information.\n",
#include "version.h"
#include "error.h"
-static void usage ();
+static void usage (int status);
/* The name this program was run with. */
char *program_name;
};
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
unsigned int newmode;
unsigned int parent_mode;
}
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, "Try `%s --help' for more information.\n",
#include "version.h"
#include "error.h"
-static void usage ();
+static void usage (int status);
/* The name this program was run with. */
char *program_name;
};
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
unsigned short newmode;
struct mode_change *change;
#ifdef S_ISFIFO
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, "Try `%s --help' for more information.\n",
#include "error.h"
#include "xstrtol.h"
-static void usage ();
+static void usage (int status);
/* The name this program was run with. */
char *program_name;
};
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
unsigned short newmode;
struct mode_change *change;
}
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, "Try `%s --help' for more information.\n",
uid_t geteuid ();
#endif
-char *basename ();
+char *basename (char *);
enum backup_type get_version ();
int isdir ();
int yesno ();
int euidaccess ();
char *stpcpy ();
-static int copy_reg ();
-static int do_move ();
-static int movefile ();
-static void usage ();
+static int copy_reg (char *source, char *dest);
+static int do_move (char *source, char *dest);
+static int movefile (char *source, char *dest);
+static void usage (int status);
/* The name this program was run with. */
char *program_name;
};
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int c;
int errors;
/* If PATH is an existing directory, return nonzero, else 0. */
static int
-is_real_dir (path)
- char *path;
+is_real_dir (char *path)
{
struct stat stats;
Return 0 if successful, 1 if an error occurred. */
static int
-movefile (source, dest)
- char *source;
- char *dest;
+movefile (char *source, char *dest)
{
strip_trailing_slashes (source);
Return 0 if successful, 1 if an error occurred. */
static int
-do_move (source, dest)
- char *source;
- char *dest;
+do_move (char *source, char *dest)
{
char *dest_backup = NULL;
Return 1 if an error occurred, 0 if successful. */
static int
-copy_reg (source, dest)
- char *source, *dest;
+copy_reg (char *source, char *dest)
{
int ifd;
int ofd;
}
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, "Try `%s --help' for more information.\n",
# define D_INO(dp) 1
#endif
-char *basename ();
+char *basename (char *);
char *stpcpy ();
char *xmalloc ();
char *xrealloc ();
int yesno ();
void strip_trailing_slashes ();
-static int clear_directory ();
-static int duplicate_entry ();
-static int remove_dir ();
-static int remove_file ();
-static int rm ();
-static void usage ();
+static int clear_directory (struct stat *statp);
+static int duplicate_entry (struct pathstack *stack, ino_t inum);
+static int remove_dir (struct stat *statp);
+static int remove_file (struct stat *statp);
+static int rm (void);
+static void usage (int status);
/* Name this program was run with. */
char *program_name;
};
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int err = 0;
int c;
Return 0 if `pathname' is removed, 1 if not. */
static int
-rm ()
+rm (void)
{
struct stat path_stats;
char *base = basename (pathname);
Return 0 if `pathname' is removed, 1 if not. */
static int
-remove_file (statp)
- struct stat *statp;
+remove_file (struct stat *statp)
{
if (!ignore_missing_files && (interactive || stdin_tty)
&& euidaccess (pathname, W_OK)
Return 0 if `pathname' is removed, 1 if not. */
static int
-remove_dir (statp)
- struct stat *statp;
+remove_dir (struct stat *statp)
{
int err;
be larger, as well. */
static int
-clear_directory (statp)
- struct stat *statp;
+clear_directory (struct stat *statp)
{
DIR *dirp;
struct dirent *dp;
a corrupted file system. */
static int
-duplicate_entry (stack, inum)
- struct pathstack *stack;
- ino_t inum;
+duplicate_entry (struct pathstack *stack, ino_t inum)
{
#ifdef D_INO_IN_DIRENT
struct pathstack *p;
}
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, "Try `%s --help' for more information.\n",
void strip_trailing_slashes ();
-static void remove_parents ();
-static void usage ();
+static void remove_parents (char *path);
+static void usage (int status);
/* The name this program was run with. */
char *program_name;
};
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int errors = 0;
int optc;
Replaces '/' characters in `path' with NULs. */
static void
-remove_parents (path)
- char *path;
+remove_parents (char *path)
{
char *slash;
}
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, "Try `%s --help' for more information.\n",
char *program_name;
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, "Try `%s --help' for more information.\n",
}
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
program_name = argv[0];
int full_write ();
void invalid_arg ();
-static int touch ();
-static void usage ();
+static int touch (char *file);
+static void usage (int status);
#ifndef HAVE_UTIME_NULL
static int utime_now ();
#endif
};
void
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int c, i;
int date_set = 0;
Return 0 if successful, 1 if an error occurs. */
static int
-touch (file)
- char *file;
+touch (char *file)
{
int status;
struct stat sbuf;
#endif
static void
-usage (status)
- int status;
+usage (int status)
{
if (status != 0)
fprintf (stderr, "Try `%s --help' for more information.\n",