MCPcopy Index your code
hub / github.com/RsyncProject/rsync / write_varint

Function write_varint

io.c:2164–2184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2162}
2163
2164void write_varint(int f, int32 x)
2165{
2166 char b[5];
2167 uchar bit;
2168 int cnt;
2169
2170 SIVAL(b, 1, x);
2171
2172 for (cnt = 4; cnt > 1 && b[cnt] == 0; cnt--) {}
2173 bit = ((uchar)1<<(7-cnt+1));
2174
2175 if (CVAL(b, cnt) >= bit) {
2176 cnt++;
2177 *b = ~(bit-1);
2178 } else if (cnt > 1)
2179 *b = b[cnt] | ~(bit*2-1);
2180 else
2181 *b = b[1];
2182
2183 write_buf(f, b, cnt);
2184}
2185
2186void write_varlong(int f, int64 x, uchar min_bytes)
2187{

Callers 10

write_varint30Function · 0.85
send_ida_entriesFunction · 0.85
send_rsync_aclFunction · 0.85
start_write_batchFunction · 0.85
send_file_entryFunction · 0.85
write_end_of_flistFunction · 0.85
setup_protocolFunction · 0.85
write_del_statsFunction · 0.85
send_xattrFunction · 0.85
send_xattr_requestFunction · 0.85

Calls 2

SIVALFunction · 0.85
write_bufFunction · 0.85

Tested by

no test coverage detected