From: Wayne Davison Date: Fri, 20 Apr 2007 08:16:56 +0000 (+0000) Subject: Added {read,write}_varlong30() inline functions to use the X-Git-Tag: v3.0.0pre1~323 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=473feecff3c3b695afc43b0fee4b84c6dcfeeedc;p=thirdparty%2Frsync.git Added {read,write}_varlong30() inline functions to use the right long-int function based on protocol version. --- diff --git a/io.h b/io.h index dc43683e..ef72bcb9 100644 --- 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); +}