IntToTempCast.c routine

/* {{FUNCTION(75fa3956-0d42-11d3-98b2-000000000000) (MergeSection) */

/*******************************************************************************
**
** Function name:
**
**  IntToTempCast
**
** Description:
**
** Special Comments:
**
**  Entrypoint for the SQL routine IntToTempCast (integer) returns temperature.
**
**      A stack size of 32,767 bytes  has  been  requested  for
**      the routine.  Normally, this is sufficient memory for most
**      invocations of your UDR.  If you intend, however, to  call
**      this routine recursively or other routines that use  large
**      or unknown stack sizes, you should use mi_call().  mi_call
**      checks to insure that sufficient stack space is available.
**      For  more  details  regarding  this   function,  look  in:
**      The  DataBlade  API Programmer's  Manual  (see Stack Space
**      Allocation in Chapter 11).
**
** Parameters:
**
**  None
**
** Return value:
**
**  mi_double_precision
**
** History:
**
**  05/18/1999 - Generated by BladeSmith Version 4.00.517.
**
** Identification:
**
** NOTE:
**
**  BladeSmith will add and remove parameters from the function
**  prototype, and will generate tracing calls.  Only edit code
**  in blocks marked  Your_<section>.  Any other  modifications
**  will require manual merging.
**
********************************************************************************
*/
UDREXPORT mi_double_precision *IntToTempCast
(

mi_integer                   Argument1,
MI_FPARAM *                  Gen_fparam       /* Standard info - see DBDK docs.*/
)
{
    mi_double_precision *     Gen_RetVal;   /* The return value. */
    MI_CONNECTION *      Gen_Con;     /* The connection handle.  */
    /* ------ {{Your_Declarations (PreserveSection) BEGIN ------ */
    /* ------ }}Your_Declarations (#0000) END ------             */

    /* Use the NULL connection. */
    Gen_Con = NULL;


    /* ------ {{Your_Code (PreserveSection) BEGIN ------ */
    /*
    

    /*
    ** Allocate the return value.  It must be
    ** allocated if it is a UDT or type whose
    ** size is greater than 4 bytes.
    */
    Gen_RetVal = (mi_double_precision *)mi_alloc( sizeof( mi_double_precision ));
    if( Gen_RetVal == 0)
    {
        /*
        ** Memory allocation has failed so issue
        ** the following message and quit.
        **
        **  "Memory allocation has failed in IntToTempCast."
        */
        DBDK_TRACE_ERROR( "IntToTempCast", ERRORMESG2, 10 );

        /* not reached */
    }

    /* TO DO: Compute and store your value into Gen_RetVal. */
    
    *Gen_RetVal = (double)Argument1;
    /* ------ }}Your_Code (#5TCE) END ------ */
    /* Return the function's return value. */
    return Gen_RetVal;
}
/* }}FUNCTION (#1P45HOFR) */