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

Method BLB_lseek

src/jrd/blb.cpp:963–996  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

961
962
963SLONG blb::BLB_lseek(USHORT mode, SLONG offset)
964{
965/**************************************
966 *
967 * b l b : : l s e e k
968 *
969 **************************************
970 *
971 * Functional description
972 * Position a blob for direct access. Seek is only defined for stream
973 * type blobs.
974 *
975 **************************************/
976
977 if (!(blb_flags & BLB_stream))
978 ERR_post(Arg::Gds(isc_bad_segstr_type));
979
980 if (mode == 1)
981 offset += blb_seek;
982 else if (mode == 2)
983 offset = blb_length + offset;
984
985 if (offset < 0)
986 offset = 0;
987
988 if (offset > (SLONG) blb_length)
989 offset = blb_length;
990
991 blb_seek = offset;
992 blb_flags |= BLB_seek;
993 blb_flags &= ~BLB_eof;
994
995 return offset;
996}
997
998
999// This function can't take from_desc as const because it may call store_array,

Callers 4

seekFunctionMethod · 0.80
seekMethod · 0.80
get_sliceMethod · 0.80
scalarMethod · 0.80

Calls 2

GdsClass · 0.85
ERR_postFunction · 0.70

Tested by

no test coverage detected