2 * Copyright (C) 2007 Wayne Davison
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 3 as
6 * published by the Free Software Foundation.
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.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, visit the http://fsf.org website.
17 extern int protocol_version;
22 if (protocol_version < 30)
24 return read_varint(f);
28 read_varlong30(int f, uchar min_bytes)
30 if (protocol_version < 30)
31 return read_longint(f);
32 return read_varlong(f, min_bytes);
36 write_varint30(int f, int32 x)
38 if (protocol_version < 30)
45 write_varlong30(int f, int64 x, uchar min_bytes)
47 if (protocol_version < 30)
50 write_varlong(f, x, min_bytes);