The mi_put_integer() function
The mi_put_integer() function copies an mi_integer (INTEGER) value, converting any difference in alignment or byte order on the server computer to that of the client computer.
Syntax
mi_unsigned_char1 *mi_put_integer (data_ptr, int_val)
mi_unsigned_char1 *data_ptr;
mi_integer int_val;
- data_ptr
- A pointer to the buffer to which to copy the mi_integer value.
- int_val
- A pointer to the buffer from which to copy the mi_integer value.
Valid in client LIBMI application? | Valid in user-defined routine? |
---|---|
No | Yes |
Usage
The mi_put_integer() function copies the mi_integer value from the buffer that int_val references into the user-defined buffer that data_ptr references. Upon completion, mi_put_integer() returns the address of the next position to which data can be copied in the data_ptr buffer. The function returns the data_ptr address advanced by nbytes bytes, ready for copying in the next value. In other words, if n is the length of the value that int_val identifies, the returned address is n bytes advanced from the original buffer address in data_ptr.
The mi_put_integer() function is useful in a send support function of an opaque data type that contains an mi_integer value. Use this function to send an mi_integer field of an opaque-type internal structure to a client application (which possibly has unaligned data buffers).
For more information about the use of mi_put_integer() in a send support function, see the HCL OneDB™ DataBlade® API Programmer's Guide.
Return values
- An mi_unsigned_char1 pointer
- The new address in the data_ptr data buffer.
- NULL
- The function was not successful.