X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/b32d425451798d514b958a978f5f78903ed3327b..1a2e41af941573e69c02370329afe0192b61f213:/rsync.h diff --git a/rsync.h b/rsync.h index baf2f023..b0ac7a9f 100644 --- a/rsync.h +++ b/rsync.h @@ -61,6 +61,7 @@ #define XMIT_GROUP_NAME_FOLLOWS (1<<11) /* protocols 30 - now */ #define XMIT_HLINK_FIRST (1<<12) /* protocols 30 - now (HLINKED files only) */ #define XMIT_IO_ERROR_ENDLIST (1<<12) /* protocols 31 - now (w/XMIT_EXTENDED_FLAGS) */ +#define XMIT_MOD_NSEC (1<<13) /* protocols 31 - now */ /* These flags are used in the live flist data. */ @@ -80,6 +81,7 @@ #define FLAG_LENGTH64 (1<<9) /* sender/receiver/generator */ #define FLAG_SKIP_GROUP (1<<10) /* receiver/generator */ #define FLAG_TIME_FAILED (1<<11)/* generator */ +#define FLAG_MOD_NSEC (1<<12) /* sender/receiver/generator */ /* These flags are passed to functions but not stored. */ @@ -96,7 +98,7 @@ /* This is used when working on a new protocol version in CVS, and should * be a new non-zero value for each CVS change that affects the protocol. * It must ALWAYS be 0 when the protocol goes final (and NEVER before)! */ -#define SUBPROTOCOL_VERSION 6 +#define SUBPROTOCOL_VERSION 7 /* We refuse to interoperate with versions that are not in this range. * Note that we assume we'll work with later versions: the onus is on @@ -119,7 +121,8 @@ #define OLD_PROTOCOL_VERSION 25 #define MAX_PROTOCOL_VERSION 40 -#define FILECNT_LOOKAHEAD 1000 +#define MIN_FILECNT_LOOKAHEAD 1000 +#define MAX_FILECNT_LOOKAHEAD 10000 #define RSYNC_PORT 873 @@ -358,6 +361,10 @@ enum delret { #include #endif +#if defined HAVE_UTIMENSAT || defined HAVE_LUTIMES +#define CAN_SET_SYMLINK_TIMES 1 +#endif + #ifdef HAVE_SYS_SELECT_H #include #endif @@ -669,7 +676,9 @@ extern int xattrs_ndx; #define REQ_EXTRA(f,ndx) ((union file_extras*)(f) - (ndx)) #define OPT_EXTRA(f,bump) ((union file_extras*)(f) - file_extra_cnt - 1 - (bump)) +#define NSEC_BUMP(f) ((f)->flags & FLAG_MOD_NSEC ? 1 : 0) #define LEN64_BUMP(f) ((f)->flags & FLAG_LENGTH64 ? 1 : 0) +#define START_BUMP(f) (NSEC_BUMP(f) + LEN64_BUMP(f)) #define HLINK_BUMP(f) ((f)->flags & (FLAG_HLINKED|FLAG_HLINK_DONE) ? inc_recurse+1 : 0) #define ACL_BUMP(f) (acls_ndx ? 1 : 0) @@ -681,6 +690,8 @@ extern int xattrs_ndx; ? (int64)OPT_EXTRA(f, 0)->unum << 32 : 0)) #endif +#define F_MOD_NSEC(f) ((f)->flags & FLAG_MOD_NSEC ? OPT_EXTRA(f, LEN64_BUMP(f))->unum : 0) + /* If there is a symlink string, it is always right after the basename */ #define F_SYMLINK(f) ((f)->basename + strlen((f)->basename) + 1) @@ -698,22 +709,21 @@ extern int xattrs_ndx; #define F_NDX(f) REQ_EXTRA(f, unsort_ndx)->num /* These items are per-entry optional: */ -#define F_HL_GNUM(f) OPT_EXTRA(f, LEN64_BUMP(f))->num /* non-dirs */ -#define F_HL_PREV(f) OPT_EXTRA(f, LEN64_BUMP(f)+inc_recurse)->num /* non-dirs */ -#define F_DIR_NODE_P(f) (&OPT_EXTRA(f, LEN64_BUMP(f) \ +#define F_HL_GNUM(f) OPT_EXTRA(f, START_BUMP(f))->num /* non-dirs */ +#define F_HL_PREV(f) OPT_EXTRA(f, START_BUMP(f)+inc_recurse)->num /* non-dirs */ +#define F_DIR_NODE_P(f) (&OPT_EXTRA(f, START_BUMP(f) \ + DIRNODE_EXTRA_CNT - 1)->num) /* sender dirs */ -#define F_DIR_RELNAMES_P(f) (&OPT_EXTRA(f, LEN64_BUMP(f) + DIRNODE_EXTRA_CNT \ +#define F_DIR_RELNAMES_P(f) (&OPT_EXTRA(f, START_BUMP(f) + DIRNODE_EXTRA_CNT \ + PTR_EXTRA_CNT - 1)->num) /* sender dirs */ -#define F_DIR_DEFACL(f) OPT_EXTRA(f, LEN64_BUMP(f))->unum /* receiver dirs */ -#define F_DIR_DEV_P(f) (&OPT_EXTRA(f, LEN64_BUMP(f) + ACL_BUMP(f) \ +#define F_DIR_DEFACL(f) OPT_EXTRA(f, START_BUMP(f))->unum /* receiver dirs */ +#define F_DIR_DEV_P(f) (&OPT_EXTRA(f, START_BUMP(f) + ACL_BUMP(f) \ + DEV_EXTRA_CNT - 1)->unum) /* receiver dirs */ -/* This optional item might follow an F_HL_*() item. - * (Note: a device doesn't need to check LEN64_BUMP(f).) */ -#define F_RDEV_P(f) (&OPT_EXTRA(f, HLINK_BUMP(f) + DEV_EXTRA_CNT - 1)->unum) +/* This optional item might follow an F_HL_*() item. */ +#define F_RDEV_P(f) (&OPT_EXTRA(f, START_BUMP(f) + HLINK_BUMP(f) + DEV_EXTRA_CNT - 1)->unum) /* The sum is only present on regular files. */ -#define F_SUM(f) ((char*)OPT_EXTRA(f, LEN64_BUMP(f) + HLINK_BUMP(f) \ +#define F_SUM(f) ((char*)OPT_EXTRA(f, START_BUMP(f) + HLINK_BUMP(f) \ + SUM_EXTRA_CNT - 1)) /* Some utility defines: */ @@ -819,12 +829,9 @@ struct map_struct { #define FILTRULE_CLEAR_LIST (1<<18)/* this item is the "!" token */ #define FILTRULE_PERISHABLE (1<<19)/* perishable if parent dir goes away */ -#define FILTRULES_FROM_CONTAINER (FILTRULE_ABS_PATH | FILTRULE_INCLUDE \ - | FILTRULE_DIRECTORY | FILTRULE_SENDER_SIDE \ - | FILTRULE_NEGATE | FILTRULE_RECEIVER_SIDE \ - | FILTRULE_PERISHABLE) +#define FILTRULES_SIDES (FILTRULE_SENDER_SIDE | FILTRULE_RECEIVER_SIDE) -struct filter_struct { +typedef struct filter_struct { struct filter_struct *next; char *pattern; uint32 rflags; @@ -832,14 +839,14 @@ struct filter_struct { int slash_cnt; struct filter_list_struct *mergelist; } u; -}; +} filter_rule; -struct filter_list_struct { - struct filter_struct *head; - struct filter_struct *tail; - struct filter_struct *parent_dirscan_head; +typedef struct filter_list_struct { + filter_rule *head; + filter_rule *tail; + filter_rule *parent_dirscan_head; char *debug_type; -}; +} filter_rule_list; struct stats { int64 total_size; @@ -983,6 +990,9 @@ extern int errno; #ifdef HAVE_READLINK #define SUPPORT_LINKS 1 +#ifndef NO_SYMLINK_XATTRS +#define do_readlink(path, buf, bufsiz) readlink(path, buf, bufsiz) +#endif #endif #ifdef HAVE_LINK #define SUPPORT_HARD_LINKS 1