-extern char *backup_suffix;
-
-static struct delete_list {
- DEV64_T dev;
- INO64_T inode;
-} *delete_list;
-static int dlist_len, dlist_alloc_len;
-
-/* yuck! This function wouldn't have been necessary if I had the sorting
- algorithm right. Unfortunately fixing the sorting algorithm would introduce
- a backward incompatibility as file list indexes are sent over the link.
-*/
-static int delete_already_done(struct file_list *flist,int j)
-{
- int i;
- STRUCT_STAT st;
-
- if (link_stat(f_name(flist->files[j]), &st)) return 1;
-
- for (i=0;i<dlist_len;i++) {
- if (st.st_ino == delete_list[i].inode &&
- st.st_dev == delete_list[i].dev)
- return 1;
- }
-
- return 0;
-}
-
-static void add_delete_entry(struct file_struct *file)
-{
- if (dlist_len == dlist_alloc_len) {
- dlist_alloc_len += 1024;
- delete_list = (struct delete_list *)Realloc(delete_list, sizeof(delete_list[0])*dlist_alloc_len);
- if (!delete_list) out_of_memory("add_delete_entry");
- }
-
- delete_list[dlist_len].dev = file->dev;
- delete_list[dlist_len].inode = file->inode;
- dlist_len++;
-
- if (verbose > 3)
- rprintf(FINFO,"added %s to delete list\n", f_name(file));
-}
-
-static void delete_one(struct file_struct *f)
-{
- if (!S_ISDIR(f->mode)) {
- if (robust_unlink(f_name(f)) != 0) {
- rprintf(FERROR,"delete_one: unlink %s: %s\n",f_name(f),strerror(errno));
- } else if (verbose) {
- rprintf(FINFO,"deleting %s\n",f_name(f));
- }
- } else {
- if (do_rmdir(f_name(f)) != 0) {
- if (errno != ENOTEMPTY && errno != EEXIST)
- rprintf(FERROR,"delete_one: rmdir %s: %s\n",
- f_name(f), strerror(errno));
- } else if (verbose) {
- rprintf(FINFO,"deleting directory %s\n",f_name(f));
- }
- }
-}
-
-
-
-
-/* this deletes any files on the receiving side that are not present
- on the sending side. For version 1.6.4 I have changed the behaviour
- to match more closely what most people seem to expect of this option */
-void delete_files(struct file_list *flist)
-{
- struct file_list *local_file_list;
- int i, j;
- char *name;
- extern int module_id;
- extern int ignore_errors;
- extern int max_delete;
- static int deletion_count;
-
- if (cvs_exclude)
- add_cvs_excludes();
-
- if (io_error && !(lp_ignore_errors(module_id) || ignore_errors)) {
- rprintf(FINFO,"IO error encountered - skipping file deletion\n");
- return;
- }
-
- for (j=0;j<flist->count;j++) {
- if (!S_ISDIR(flist->files[j]->mode) ||
- !(flist->files[j]->flags & FLAG_DELETE)) continue;
-
- if (remote_version < 19 &&
- delete_already_done(flist, j)) continue;
-
- name = strdup(f_name(flist->files[j]));
+extern int cleanup_got_literal;
+extern int remove_sent_files;
+extern int append_mode;
+extern int sparse_files;
+extern int keep_partial;
+extern int checksum_seed;
+extern int inplace;
+extern int delay_updates;
+extern struct stats stats;
+extern char *stdout_format;
+extern char *tmpdir;
+extern char *partial_dir;
+extern char *basis_dir[];
+extern struct file_list *the_file_list;
+extern struct filter_list_struct server_filter_list;