The Result Buffer (API Guide)

From InterBase

Go Up to Requesting Information About an Attachment (API Guide)


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

  1. A one-byte item return type. There are compile-time constants defined for all the item return types in ibase.h.
  2. A two-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 (for example, as a number or as a string of characters) depends on the item return type.

A calling program is responsible for interpreting the contents of the result buffer and for deciphering each cluster as appropriate. In many cases, the value simply contains a number or a string (sequence of characters). But in other cases, the value is a number of bytes whose interpretation depends on the item return type.

The clusters returned to the result buffer are not aligned. Furthermore, all numbers are represented in a generic format, with the least significant byte first, and the most significant byte last. Signed numbers have the sign in the last byte. Convert the numbers to a data type native to your system, if necessary, before interpreting them. The API call, isc_portable_integer(), can be used to perform the conversion.

Advance To: