Make compression-level handling generic.
[rsync.git] / rsync.h
diff --git a/rsync.h b/rsync.h
index 2a558e43072c79ddb836e77905e586ba3c9077d2..210cef4084dc071b17ed0c6c3ab62fbb272bcd85 100644 (file)
--- a/rsync.h
+++ b/rsync.h
@@ -52,6 +52,7 @@
 #define XMIT_SAME_NAME (1<<5)
 #define XMIT_LONG_NAME (1<<6)
 #define XMIT_SAME_TIME (1<<7)
+
 #define XMIT_SAME_RDEV_MAJOR (1<<8)    /* protocols 28 - now (devices only) */
 #define XMIT_NO_CONTENT_DIR (1<<8)     /* protocols 30 - now (dirs only) */
 #define XMIT_HLINKED (1<<9)            /* protocols 28 - now (non-dirs) */
 #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) (also protocol 30 w/'f' compat flag) */
 #define XMIT_MOD_NSEC (1<<13)          /* protocols 31 - now */
-#define XMIT_SAME_ATIME (1<<14)        /* protocols ?? - now */
+#define XMIT_SAME_ATIME (1<<14)        /* any protocol - restricted by command-line option */
+#define XMIT_UNUSED_15 (1<<15)         /* unused flag bit */
+
+/* The following XMIT flags require an rsync that uses a varint for the flag values */
+
+#define XMIT_RESERVED_16 (1<<16)       /* reserved for future fileflags use */
+#define XMIT_RESERVED_17 (1<<17)       /* reserved for future crtimes use */
 
 /* These flags are used in the live flist data. */
 
@@ -1054,7 +1061,32 @@ typedef struct {
 #define ACL_READY(sx) ((sx).acc_acl != NULL)
 #define XATTR_READY(sx) ((sx).xattr != NULL)
 
+#define CLVL_NOT_SPECIFIED INT_MIN
+
+#define CPRES_AUTO (-1)
+#define CPRES_NONE 0
+#define CPRES_ZLIB 1
+#define CPRES_ZLIBX 2
+#define CPRES_LZ4 3
+#define CPRES_ZSTD 4
+
+struct name_num_item {
+       int num;
+       const char *name, *main_name;
+};
+
+struct name_num_obj {
+       const char *type;
+       const char *negotiated_name;
+       uchar *saw;
+       int saw_len;
+       int negotiated_num;
+       struct name_num_item list[];
+};
+
+#ifndef __cplusplus
 #include "proto.h"
+#endif
 
 #ifndef SUPPORT_XATTRS
 #define x_stat(fn,fst,xst) do_stat(fn,fst)
@@ -1081,7 +1113,6 @@ int vsnprintf(char *str, size_t count, const char *fmt, va_list args);
 int snprintf(char *str, size_t count, const char *fmt,...);
 #endif
 
-
 #ifndef HAVE_STRERROR
 extern char *sys_errlist[];
 #define strerror(i) sys_errlist[i]
@@ -1320,7 +1351,8 @@ extern short info_levels[], debug_levels[];
 #define DEBUG_HLINK (DEBUG_HASH+1)
 #define DEBUG_ICONV (DEBUG_HLINK+1)
 #define DEBUG_IO (DEBUG_ICONV+1)
-#define DEBUG_OWN (DEBUG_IO+1)
+#define DEBUG_NSTR (DEBUG_IO+1)
+#define DEBUG_OWN (DEBUG_NSTR+1)
 #define DEBUG_PROTO (DEBUG_OWN+1)
 #define DEBUG_RECV (DEBUG_PROTO+1)
 #define DEBUG_SEND (DEBUG_RECV+1)