The mi_fparam_get_current() function

The mi_fparam_get_current() function obtains the MI_FPARAM structure for the currently running user-defined routine (UDR).

Syntax

MI_FPARAM *mi_fparam_get_current(void)
Valid in client LIBMI application? Valid in user-defined routine?
No Yes
Important: This advanced function can adversely affect your UDR if you use the function incorrectly. Use it only when no regular DataBlade® API function can perform the task you need done.

Usage

The mi_fparam_get_current() function obtains the MI_FPARAM structure for the current UDR. When the routine manager invokes a UDR, it passes this MI_FPARAM structure as that last argument to the UDR. This function is valid only within a UDR call. It returns the NULL-valued pointer if called from a callback (such as an end-of-statement callback) that is not strictly called from a UDR.

The database server's routine manager allocates an MI_FPARAM structure for every UDR, regardless of whether the UDR explicitly declares one or not. If a UDR does not declare an MI_FPARAM structure but dynamically determines that it requires MI_FPARAM information, the UDR can use the mi_fparam_get_current() function to obtain a pointer to its MI_FPARAM structure. This function is useful when the C function that implements a UDR needs to determine how many arguments the UDR was registered with (or called with).
Important: If you know that a UDR needs information in the MI_FPARAM structure, declare an MI_FPARAM structure as the final argument for the UDR. Restrict use of mi_fparam_get_current() to UDRs that must dynamically determine that they need MI_FPARAM information.

For more information about how to declare an MI_FPARAM argument or how to obtain routine information for a UDR, see the Informix® DataBlade® API Programmer's Guide.

Return values

An MI_FPARAM pointer
A pointer that references the MI_FPARAM structure for the current UDR.
NULL
The function was not successful or that it was called from a callback that was not strictly called from a UDR.