Added {read,write}_varlong30() inline functions to use the
[rsync/rsync.git] / io.h
diff --git a/io.h b/io.h
index dc43683..ef72bcb 100644 (file)
--- a/io.h
+++ b/io.h
@@ -25,6 +25,14 @@ read_varint30(int f)
        return read_varint(f);
 }
 
+static inline int64
+read_varlong30(int f, uchar min_bytes)
+{
+       if (protocol_version < 30)
+               return read_longint(f);
+       return read_varlong(f, min_bytes);
+}
+
 static inline void
 write_varint30(int f, int32 x)
 {
@@ -33,3 +41,12 @@ write_varint30(int f, int32 x)
        else
                write_varint(f, x);
 }
+
+static inline void
+write_varlong30(int f, int64 x, uchar min_bytes)
+{
+       if (protocol_version < 30)
+               write_longint(f, x);
+       else
+               write_varlong(f, x, min_bytes);
+}