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

Method BLB_get_data

src/jrd/blb.cpp:627–660  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

625
626
627ULONG blb::BLB_get_data(thread_db* tdbb, UCHAR* buffer, SLONG length, bool close)
628{
629/**************************************
630 *
631 * b l b : : g e t _ d a t a
632 *
633 **************************************
634 *
635 * Functional description
636 * Get a large hunk of data from a blob, which can then be
637 * closed (if close == true). Return total number of bytes read.
638 * Don't worry about segment boundaries.
639 *
640 **************************************/
641 SET_TDBB(tdbb);
642 BLOB_PTR* p = buffer;
643
644 while (length > 0)
645 {
646 // I have no idea why this limit is 32768 instead of 32767
647 // 1994-August-12 David Schnepper
648 USHORT n = (USHORT) MIN(length, (SLONG) 32768);
649 n = BLB_get_segment(tdbb, p, n);
650 p += n;
651 length -= n;
652 if (blb_flags & BLB_eof)
653 break;
654 }
655
656 if (close)
657 BLB_close(tdbb);
658
659 return (ULONG)(p - buffer);
660}
661
662
663USHORT blb::BLB_get_segment(thread_db* tdbb, void* segment, USHORT buffer_length)

Callers 15

executeMethod · 0.80
performMethod · 0.80
stringBooleanMethod · 0.80
readDataFunctionMethod · 0.80
appendFromBlobFunction · 0.80
DataPipeMethod · 0.80
nextMethod · 0.80
DscValueMethod · 0.80
evlEncodeDecode64Function · 0.80
evlEncodeDecodeHexFunction · 0.80
evlHashFunction · 0.80
evlOverlayFunction · 0.80

Calls 1

SET_TDBBFunction · 0.85

Tested by

no test coverage detected