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

Function filter_blr

src/jrd/filters.cpp:249–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247
248
249ISC_STATUS filter_blr(USHORT action, BlobControl* control)
250{
251/**************************************
252 *
253 * f i l t e r _ b l r
254 *
255 **************************************
256 *
257 * Functional description
258 * Get next segment from a blr blob.
259 * Doctor up Rdb BLR blobs that omit
260 * the BLR eoc so the pretty printer
261 * doesn't complain.
262 *
263 **************************************/
264 if (action != isc_blob_filter_open)
265 return string_filter(action, control);
266
267 // Initialize for retrieval
268 UCHAR buffer[BUFFER_MEDIUM];
269 const SLONG l = 1 + control->ctl_handle->ctl_total_length;
270 UCHAR* const temp = (l <= (SLONG) sizeof(buffer)) ? buffer : (UCHAR*) gds__alloc((SLONG) l);
271 // FREE: at procedure exit
272 if (!temp) // NOMEM:
273 return isc_virmemexh;
274
275 USHORT length;
276 const ISC_STATUS status = caller(isc_blob_filter_get_segment, control, (USHORT) l, temp, &length);
277
278 if (!status)
279 {
280 if (l > length && temp[length - 1] != blr_eoc)
281 temp[length] = blr_eoc;
282 fb_print_blr(temp, length, dump_blr, control, 0);
283 }
284
285 control->ctl_data[1] = control->ctl_data[0];
286
287 if (temp != buffer)
288 gds__free(temp);
289
290 return FB_SUCCESS;
291}
292
293
294ISC_STATUS filter_format(USHORT action, BlobControl* control)

Callers

nothing calls this directly

Calls 2

string_filterFunction · 0.85
callerFunction · 0.70

Tested by

no test coverage detected