Home | Previous Page | Next Page   Function Descriptions >

mi_get_smallint( )

The mi_get_smallint( ) function copies an mi_smallint (SMALLINT) value, converting any difference in alignment or byte order on the client computer to that of the server computer.

Syntax

mi_unsigned_char1 *mi_get_smallint (data_ptr, smallint_ptr)
   mi_unsigned_char1 *data_ptr;
   mi_smallint *smallint_ptr;
data_ptr
is the address of the buffer from which to copy the promoted mi_smallint value.
smallint_ptr
is a pointer to the buffer to which to copy the mi_smallint value.
Valid in Client LIBMI Application? Valid in User-Defined Routine?
No Yes

Usage

The mi_get_smallint( ) function copies a value from the user-defined buffer that data_ptr references into the buffer that smallint_ptr references. Upon completion, mi_get_smallint( ) returns the address of the next position from which data can be copied from the data_ptr buffer. The function returns the data_ptr address advanced by n bytes, ready for a subsequent copy. In other words, if n is the length of the value that smallint_ptr identifies, the returned address is n bytes advanced from the original buffer address in data_ptr.

For maximum portability, this function accepts a fully promoted mi_integer value instead of an mi_smallint value. This argument might therefore require casting.

The mi_get_smallint( ) function is useful in a receive support function of an opaque data type that contains an mi_smallint value. Use this function to obtain an mi_smallint field of an opaque-type internal structure from a client application (which possibly has unaligned data buffers).

Return Values

An mi_unsigned_char1 pointer
is the new address in the data_ptr data buffer.
NULL
indicates that the function was not successful.

Related Topics

See also the descriptions of mi_fix_smallint( ), mi_get_bytes( ), mi_get_date( ), mi_get_datetime( ), mi_get_decimal( ), mi_get_double_precision( ), mi_get_int8( ), mi_get_integer( ), mi_get_interval( ), mi_get_lo_handle( ), mi_get_money( ), mi_get_real( ), mi_get_string( ), and mi_put_smallint( ).

For more information on the use of mi_get_smallint( ) in a receive support function, see the IBM Informix: DataBlade API Programmer's Guide.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]