mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-03-06 07:29:41 -05:00
Added {read,write}_varlong30() inline functions to use the
right long-int function based on protocol version.
This commit is contained in:
17
io.h
17
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user