isc_blob_info()

From InterBase

Go Up to API Function Reference


Returns information about an open Blob.

Syntax

 ISC_STATUS isc_blob_info(
 ISC_STATUS *status_vector,
 isc_blob_handle *blob_handle,
 short item_list_buffer_length,
 char *item_list_buffer,
 short result_buffer_length,
 char *result_buffer);
Parameter Type Description

status_vector

ISC_STATUS *

Pointer to the error status vector

blob_handle

isc_blob_handle *

Pointer to the Blob

item_list_buffer_length

short

Length of the item-list buffer in which you specify the items for which you want ­information.

item_list_buffer

char *

Pointer to the item-list buffer

result_buffer_length

short

Length of the result buffer into which InterBase returns the requested information.

result_buffer

char *

Pointer to the result buffer

Description

isc_blob_info() returns information about an existing Blob specified by ­blob_handle. The item-list buffer is an unstructured byte vector. An application lists the items about which it wants information in the item-list buffer.

InterBase returns the requested information to the result buffer as a series of clusters of information, one per item requested. Each cluster consists of three parts:

  1. A one-byte item type. Each is the same as one of the item types in the item-list buffer.
  2. A 2-byte number specifying the number of bytes that follow in the remainder of the cluster.
  3. A value, stored in a variable number of bytes, whose interpretation depends on the item type.

A calling program is responsible for interpreting the contents of the result buffer and for deciphering each cluster as appropriate.

For a list of items that can be requested and returned, see Working with Blob Data.

Example

The following example retrieves information about the current open Blob:

static char blob_items[] = {
isc_info_blob_max_segment,
isc_info_blob_num_segments,
isc_info_blob_type};

CHAR blob_info[32];

isc_open_blob2(status_vector, &db, &tr_handle, &blob_handle,
 &blob_id, blength, baddr)
if (status_vector[0] == 1 && status_vector[1]){
isc_print_status(status_vector);
return(1);
}
isc_blob_info(status_vector, &blob_handle, sizeof(blob_items),
blob_items, sizeof(blob_info), blob_info));

Return value

isc_blob_info() returns the second element of the status vector. Zero indicates success. A nonzero value indicates an error. For InterBase errors, the first element of the status vector is set to 1, and the second element is set to an InterBase error code.

To check for an InterBase error, examine the first two elements of the status vector directly.

For more information about examining the status vector, see Handling Error Conditions.

See Also

Advance To: