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

Function filter_text

src/jrd/filters.cpp:582–766  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

580
581
582ISC_STATUS filter_text(USHORT action, BlobControl* control)
583{
584/**************************************
585 *
586 * f i l t e r _ t e x t
587 *
588 **************************************
589 *
590 * Functional description
591 * Get next segment from a text blob. Handle embedded
592 * carriage returns as separate segments.
593 *
594 * The usage of the variable ctl_data slots:
595 *
596 * ctl_data [0] residual bytes
597 * ctl_data [1] address of temp space
598 * ctl_data [2] flag indicating residual bytes was segment
599 * ctl_data [3] length of temp space
600 *
601 **************************************/
602 BlobControl* source;
603
604 switch (action)
605 {
606 case isc_blob_filter_open:
607 source = control->ctl_handle;
608 control->ctl_total_length = source->ctl_total_length;
609 control->ctl_max_segment = source->ctl_max_segment;
610 control->ctl_number_segments = source->ctl_number_segments;
611 control->ctl_data[0] = control->ctl_data[1] = control->ctl_data[2] = control->ctl_data[3] = 0;
612 return FB_SUCCESS;
613
614 case isc_blob_filter_close:
615 if (control->ctl_data[1])
616 {
617 gds__free((void*) control->ctl_data[1]);
618 control->ctl_data[1] = 0;
619 }
620 return FB_SUCCESS;
621
622 case isc_blob_filter_get_segment:
623 break;
624
625 case isc_blob_filter_put_segment:
626 case isc_blob_filter_create:
627 case isc_blob_filter_seek:
628 return isc_uns_ext;
629
630 case isc_blob_filter_alloc:
631 case isc_blob_filter_free:
632 return FB_SUCCESS;
633
634 default:
635 BUGCHECK(289); // Unknown blob filter ACTION
636 return isc_uns_ext;
637 }
638
639 // Drop thru for isc_blob_filter_get_segment.

Callers

nothing calls this directly

Calls 1

callerFunction · 0.70

Tested by

no test coverage detected