MCPcopy Create free account
hub / github.com/bailey27/cppcryptfs / adjust_file_offset_up

Function adjust_file_offset_up

libcppcryptfs/util/fileutil.cpp:90–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90bool
91adjust_file_offset_up(LARGE_INTEGER& l)
92{
93 long long offset = l.QuadPart;
94
95 if (offset < 0)
96 return false;
97
98 if (offset == 0)
99 return true;
100
101 long long blocks = (offset + PLAIN_BS - 1) / PLAIN_BS;
102 offset += (blocks*CIPHER_BLOCK_OVERHEAD + CIPHER_FILE_OVERHEAD);
103
104 l.QuadPart = offset;
105
106 return true;
107}
108
109bool adjust_file_size_down(LARGE_INTEGER& l)
110{

Callers 1

adjust_file_size_upFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected