MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / MVOL_read_block

Function MVOL_read_block

src/burp/mvol.cpp:976–999  ·  view source on GitHub ↗

____________________________________________________________ Read a chunk of data from the IO buffer. Return a pointer to the first position NOT read into.

Source from the content-addressed store, hash-verified

974// Return a pointer to the first position NOT read into.
975//
976UCHAR* MVOL_read_block(BurpGlobals* tdgbl, UCHAR* ptr, ULONG count)
977{
978 while (count)
979 {
980 // If buffer empty, reload it
981 if (tdgbl->gbl_io_cnt <= 0)
982 MVOL_read(tdgbl);
983
984 const ULONG n = MIN(count, (ULONG) tdgbl->gbl_io_cnt);
985
986 // Copy data from the IO buffer
987
988 memcpy(ptr, tdgbl->gbl_io_ptr, n);
989 ptr += n;
990
991 // Skip ahead in current buffer
992
993 count -= n;
994 tdgbl->gbl_io_cnt -= n;
995 tdgbl->gbl_io_ptr += n;
996 }
997
998 return ptr;
999}
1000
1001
1002//____________________________________________________________

Callers

nothing calls this directly

Calls 1

MVOL_readFunction · 0.85

Tested by

no test coverage detected