- Changed the {read,write}_longint() functions into separate
[rsync/rsync.git] / io.h
CommitLineData
6d4e718f
WD
1/*
2 * Copyright (C) 2007 Wayne Davison
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
16 */
17
18extern int protocol_version;
19
20static inline int32
f31514ad 21read_varint30(int f)
6d4e718f
WD
22{
23 if (protocol_version < 30)
24 return read_int(f);
f31514ad 25 return read_varint(f);
6d4e718f
WD
26}
27
28static inline void
f31514ad 29write_varint30(int f, int32 x)
6d4e718f
WD
30{
31 if (protocol_version < 30)
32 write_int(f, x);
33 else
f31514ad 34 write_varint(f, x);
6d4e718f 35}