Add conditional support for excluding types of files from xattr ops.
[rsync/rsync.git] / io.h
CommitLineData
6d4e718f 1/*
d3d07a5e 2 * Copyright (C) 2007-2008 Wayne Davison
6d4e718f
WD
3 *
4 * This program is free software; you can redistribute it and/or modify
8e41b68e
WD
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
6d4e718f
WD
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
4fd842f9 15 * with this program; if not, visit the http://fsf.org website.
6d4e718f
WD
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
473feecf
WD
28static inline int64
29read_varlong30(int f, uchar min_bytes)
30{
31 if (protocol_version < 30)
32 return read_longint(f);
33 return read_varlong(f, min_bytes);
34}
35
6d4e718f 36static inline void
f31514ad 37write_varint30(int f, int32 x)
6d4e718f
WD
38{
39 if (protocol_version < 30)
40 write_int(f, x);
41 else
f31514ad 42 write_varint(f, x);
6d4e718f 43}
473feecf
WD
44
45static inline void
46write_varlong30(int f, int64 x, uchar min_bytes)
47{
48 if (protocol_version < 30)
49 write_longint(f, x);
50 else
51 write_varlong(f, x, min_bytes);
52}