From: Jim Meyering Date: Thu, 22 Nov 2001 10:52:40 +0000 (+0000) Subject: Include hash.h. X-Git-Tag: TEXTUTILS-2_0_17~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6b5ddbc2c92858d37f4d8c18e7b5da6c32ecde06;p=thirdparty%2Fcoreutils.git Include hash.h. (struct cp_options) [dest_info]: New member. --- diff --git a/src/copy.h b/src/copy.h index 6b949d048b..0c88f7e7e7 100644 --- a/src/copy.h +++ b/src/copy.h @@ -1,6 +1,8 @@ #ifndef COPY_H # define COPY_H +# include "hash.h" + /* Control creation of sparse files (files with holes). */ enum Sparse_type { @@ -153,6 +155,17 @@ struct cp_options /* If nonzero, stdin is a tty. */ int stdin_tty; + + /* This is a set of destination name/inode/dev triples. Each such triple + represents a file we have created corresponding to a source file name + that was specified on the command line. Use it to avoid clobbering + source files in commands like this: + rm -rf a b c; mkdir a b c; touch a/f b/f; mv a/f b/f c + For now, it protects only regular files when copying (i.e. not renaming). + When renaming, it protects all non-directories. + Use dest_info_init to initialize it, or set it to NULL to disable + this feature. */ + struct hash_table *dest_info; }; int stat (); @@ -184,6 +197,6 @@ copy PARAMS ((const char *src_path, const char *dst_path, int *copy_into_self, int *rename_succeeded)); void -dest_info_init PARAMS ((void)); +dest_info_init PARAMS ((struct cp_options *)); #endif