* 9 Sep 91. Changed user interface. cwr.
* 21 Jan 93. Revised error messages. cwr.
* 29 Mar 95. Added -o, NARROW define. cwr.
+ * 16 Nov 2013. Changed the functions to ANSI style.
+ * Author: Alexandre Beletti (rhiguita@gmail.com)
*/
#include <sys/types.h>
extern int errno;
extern char **environ;
-int main(int argc, char **argv);
+int main(int argc, char *argv[]);
void maketarget(char *dir2);
int make_dir(char *dir);
int stat_all(char *dir1, int n);
void usage(void);
void error(int type, char *s1, char *s2, char *s3);
-int main(argc, argv)
-int argc;
-char *argv[];
+int main(int argc, char *argv[])
{
int n, m;
char *dir1, *dir2, *cp, c;
}
-void maketarget(dir2)
-char *dir2;
+void maketarget(char *dir2)
{
/* The target directory is created if it does not already exist. */
}
}
-int make_dir(dir)
-char *dir;
+int make_dir(char *dir)
{
/* Create a directory. */
int pid, status;
}
-int stat_all(dir1, n)
-char *dir1;
-int n;
+int stat_all(char *dir1, int n)
{
/* Stat all the directory entries. By doing this all at once, the disk
* head can stay in the inode area.
}
-void sort_dir(m)
-int m;
+void sort_dir(int m)
{
/* Sort the directory using bubble sort. */
}
-void process(m, dir1, dir2)
-int m;
-char *dir1, *dir2;
+void process(int m, char *dir1, char *dir2)
{
/* Process each entry in sorted[]. If it is a regular file, stat the target
* file. The the source is newer, copy it. If the entry is a directory,
-void swap(sp1, sp2)
-struct sorted *sp1, *sp2;
+void swap(struct sorted *sp1, struct sorted *sp2)
{
/* Swap two directory entries. */
}
-int copy(dir1, sp, cbuf2)
-struct sorted *sp;
-char *dir1, *cbuf2;
+int copy(char *dir1, struct sorted *sp, char *cbuf2)
{
/* Copy a regular file. */
}
-int zcopy(src, targ)
-char *src, *targ;
+int zcopy(char *src, char *targ)
{
int pid, status, res, s;
}
-void copydir(dir1, dir2, namep)
-char *dir1, *dir2, *namep;
+void copydir(char *dir1, char *dir2, char *namep)
{
/* Copy a directory. */
}
}
-void newdisk(dir)
-char *dir;
+void newdisk(char *dir)
{
/* Ask for a new diskette. A big problem is that this program does not
* know which device is being used and where it is mounted on. As an
}
-void error(type, s1, s2, s3)
-int type;
-char *s1, *s2, *s3;
+void error(int type, char *s1, char *s2, char *s3)
{
fprintf(stderr, "%s: %s%s%s\n", pname, s1, s2, s3);