[ Pobierz całość w formacie PDF ]
.Because the buffer contains information passed into the filter function, it is called an INfield.The filter function should include instructions in the case statement under theisc_blob_filter_put_segment case for performing the filtering and then passing the dataon for writing to the database.This can be done by calling the *ctl_source internalInterBase Blob access routine.For more information about ctl_source, see theProgrammer s Guide.On the other hand, when an application calls the isc_get_segment() API function, the bufferpointed to by ctl_buffer in the control structure passed to a filter function is empty.Inthis situation, InterBase passes an isc_blob_filter_get_segment action to the filterfunction.The filter function isc_blob_filter_get_segment action handling should includeinstructions for filling ctl_buffer with segment data from the database to return to theapplication.This can be done by calling the *ctl_source internal InterBase Blob accessroutine.In this case, because the buffer is used for filter function output, it is called anOUT field.136 INTERBASE 5 FILTERING BLOB DATAThe following table describes each of the fields in the isc_blob_ctl Blob control structure,and whether they are used for filter function input (IN), or output (OUT).Field name Description(*ctl_source)() Pointer to the internal InterBase Blob access routine (IN)*ctl_source_handle Pointer to an instance of isc_blob_ctl to be passed to the internal InterBase Blobaccess routine (IN)ctl_to_sub_type Target subtype: information field provided to support multi-purpose filters thatcan perform more than one kind of translation; this field and the next oneenable such a filter to decide which translation to perform (IN)ctl_from_sub_type Source subtype: information field provided to support multi-purpose filters thatcan perform more than one kind of translation; this field and the previous oneenable such a filter to decide which translation to perform (IN)ctl_buffer_length For isc_blob_filter_put_segment, field is an IN field that contains the length ofthe segment data contained in ctl_bufferFor isc_blob_filter_get_segment, field is an IN field set to the size of the bufferpointed at by ctl_buffer, which is used to store the retrieved Blob datactl_segment_length Length of current segment.For isc_blob_filter_put_segment, field is not usedFor isc_blob_filter_get_segment, field is an OUT field set to the size of theretrieved segment (or partial segment, in the case when the buffer lengthctl_buffer_length is less than the actual segment length)ctl_bpb_length Length of the Blob parameter buffer*ctl_bpb Pointer to the Blob parameter buffer*ctl_buffer Pointer to segment buffer.For isc_blob_filter_put_segment, field is an IN fieldthat contains the segment dataFor isc_blob_filter_get_segment, field is an OUT field the filter function fills withsegment data for return to the applicationTABLE 7.4 isc_blob_ctl structure field descriptionsAPI GUIDE 137 CHAPTER 7 WORKING WITH BLOB DATAField name Descriptionctl_max_segment Length, in bytes, of the longest segment in the Blob.Initial value is 0.The filterfunction sets this field.This field is information only.ctl_number_segments Total number of segments in the Blob.Initial value is 0.The filter function setsthis field.This field is information only.ctl_total_length Total length, in bytes, of the Blob.Initial value is 0.The filter function sets thisfield.This field is information only.*ctl_status Pointer to InterBase status vector.(OUT)ctl_data [8] 8-element array of application-specific data.Use this field to store resourcepointers, such as memory pointers and file handles created by theisc_blob_filter_open handler, for example.Then, the next time the filterfunction is called, the resource pointers will be available for use.(IN/OUT)TABLE 7.4 isc_blob_ctl structure field descriptions (continued)Programming filter function actionsWhen an application invokes a Blob API function on a Blob to be filtered, InterBasepasses a corresponding action message to the filter function by way of the actionparameter.There are eight possible actions.The following action macro definitions aredeclared in the ibase [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • funlifepok.htw.pl
  •