diff options
author | Wayne Davison <wayned@samba.org> | 2007-04-20 08:16:56 +0000 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2007-04-20 08:16:56 +0000 |
commit | 473feecff3c3b695afc43b0fee4b84c6dcfeeedc (patch) | |
tree | 565694f62df9c88d6ae4f44a0aaa091ea906d57d /io.h | |
parent | 351e23ad8e1b2b077bec77d6250d1c82fb04dd1f (diff) | |
download | rsync-473feecff3c3b695afc43b0fee4b84c6dcfeeedc.tar.gz rsync-473feecff3c3b695afc43b0fee4b84c6dcfeeedc.tar.bz2 rsync-473feecff3c3b695afc43b0fee4b84c6dcfeeedc.zip |
Added {read,write}_varlong30() inline functions to use the
right long-int function based on protocol version.
Diffstat (limited to 'io.h')
-rw-r--r-- | io.h | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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); +} |