The mi_fp_rettype() function

The mi_fp_rettype() accessor function obtains the type identifier for the data type of a return value of a user-defined function from its associated MI_FPARAM structure.

Syntax

MI_TYPEID *mi_fp_rettype(fparam_ptr, ret_pos)
   MI_FPARAM *fparam_ptr;
   mi_integer ret_pos;
fparam_ptr
A pointer to the associated MI_FPARAM structure.
ret_pos
The index position into the return-type array for the return value whose type identifier you want. For user-defined functions, the only valid value is 0.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_fp_rettype() function obtains the type identifier of the routine return value at position ret_pos from the MI_FPARAM structure that fparam_ptr references. The type identifier is an integer value that indicates a particular data type. The MI_FPARAM structure stores information about the type identifiers of function return values in the zero-based return-type array. To obtain information about the nth return value, use a ret_pos value of n-1. For example, the following call to mi_fp_rettype() sets the type identifier for the first return value of the my_func() user-defined function, with which fparam1 is associated:
mi_integer my_func(..., fparam1)
   ...
   MI_FPARAM *fparam1;
{
   MI_TYPEID *ret_type;
   ...
   ret_type = mi_fp_rettype(fparam1, 0);
Important: C user-defined functions always have only one return value.

For more information about return-value information in an MI_FPARAM structure, see the Informix® DataBlade® API Programmer's Guide.

Return values

An MI_TYPEID pointer
A pointer to the type identifier of the return value at position ret_pos.
NULL
The function was not successful.