The mi_get_vardata() function
The mi_get_vardata() accessor function returns a pointer to the data contained in a varying-length structure (such as mi_lvarchar).
Syntax
char *mi_get_vardata(varlen_ptr)
mi_lvarchar *varlen_ptr;
- varlen_ptr
- A pointer to a varying-length structure from which to retrieve the data.
Valid in client LIBMI application? | Valid in user-defined routine? |
---|---|
Yes | Yes |
Usage
The data in a varying-length structure is not null terminated. Do not use null termination to determine end of the data that the mi_get_vardata() returns. Instead, use the mi_get_varlen() function to obtain the actual data length, which you can then use to access the varying-length data.
Although the varlen_ptr argument is declared as a pointer to an mi_lvarchar structure, you can also use the mi_get_vardata() function to obtain data from other varying-length data types, such as mi_sendrecv.
Return values
- A char pointer
- A pointer to the data in the varying-length structure.
- NULL
- The function was not successful.