informix
Informix DataBlade API Programmer's Manual
DataBlade API Function Descriptions

mi_put_smallint()

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

Syntax

Usage

The mi_put_smallint() function copies the mi_smallint value that smllint_val references into the user-defined buffer that data_ptr references. Upon completion, mi_put_smallint() returns the address of the next buffer to which data can be copied. The function advances the returned address by n bytes, ready for copying in the next value. In other words, if n is the length of the value that smllint_val 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_put_smallint() function is useful in a send support function of an opaque data type that contains mi_smallint values. Use this function to send an aligned 2-byte integer (SMALLINT) value to a client application, which possibly has unaligned data buffers.

Return Values

mi_unsigned_char1 * The new address in the data_ptr data buffer.
NULL The function was not successful.

Related Topics

See the description of the following functions: mi_fix_smallint(), mi_get_smallint(), mi_put_bytes(), mi_put_date(), mi_put_datetime(), mi_put_decimal(), mi_put_double_precision(), mi_put_int8(), mi_put_integer(), mi_put_interval(), mi_put_lo_handle(), mi_put_money(), mi_put_real(), and mi_put_string().

For more information on the use of mi_put_smallint() in a send support function, see Converting Opaque-Type Data With Machine-Specific Data Types.


Informix DataBlade API Programmer's Manual, Version 9.2
Copyright © 1999, Informix Software, Inc. All rights reserved