19 5 4 C Skeleton Program

LANSA Application Design

19.5.4 C Skeleton Program

 

/* ================================================================= */
/* ========== USER DEFINED BUILTIN FUNCTION DEFINITION ============= */
/* ================================================================= */
/*                                                                   */
/* This is a sample of how a user defined builtin function may be    */
/* defined. It is provided as an example only. No warranty of any    */
/* kind is expressed or implied. The programmer copying this code    */
/* is responsible for the implementation and maintenance of this     */
/* function, both initially and at all times in the future.          */
/*                                                                   */
/* User defined builtin functions are a powefull facility. However,  */
/* you should note that YOU are responsible for any impact the       */
/* use of a user defined builtin function has on the performance,    */
/* security, integrity, portability and maintainability of your      */
/* applications.                                                     */
/*                                                                   */
/* ================================================================= */
/*                                                                   */
/* Source File               : U_BIFnnn.C                            */
/* Entry Point Name          : U_Builtin_nnn                         */
/* Linked DLL Name           : U_BIFnnn.DLL                          */
/* Shared Object Name (Linux): u_bifnnn.O                            */
/* OS/Dependencies           : Yes/No                                */
/*                                                                   */
/* Amendment History   :                                             */
/*                                                                   */
/* Task Id  Date    Description                                      */
/* =======  ====    ===========                                      */
/*                                                                   */
/* ================================================================= */

#define U_BIF_FUNCTION       U_BuiltIn_nnn
#define U_BIF_FUNCTION_NAME "U_BuiltIn_nnn"
#define U_BIF_DESCRIPTION   "This is a description of this builtin"

#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>

#include "x_glodef.h"
#include "x_glousr.h"

#ifdef X_OPERATING_SYSTEM_WIN
#include <windows.h>
#endif

#include "x_funstr.h"
#include "x_funpro.h"
#include "x_bif000.h"

/*===================================================================*/
/*                                                                   */
/* Arguments    : pX_Ids       - Standard X_IDS system definition    */
/*                pX_Pro       - Standard X_PRO process definition   */
/*                pX_Fun       - Standard X_FUN function definition  */
/*                pX_Bif       - Standard X_BIF builtin definition   */
/*                X_Fld[]      - Standard X_FLD field definitions    */
/*                X_List[]     - Standard X_LIST list definitions    */
/*                sInCount     - Number of arguments passed in       */
/*                sInVec[]     - Vectors of arguments                */
/*                sRetCount    - Number of return values             */
/*                sRetVec[]    - Vectors of return values            */
/*                                                                   */
/*===================================================================*/

X_VOID_FUNCTION U_BIF_FUNCTION ( U_BIF_STANDARD_PARAMETERS )
{

   /* ------------------------------------------------------------- */
   /* Handle a shutdown request (usually no activity is required)   */
   /* ------------------------------------------------------------- */

   if (U_BIF_SHUTDOWN_REQUEST)
   {
      U_BIF_SET_GOOD_RETURN
   }

   /* ------------------------------------------------------------- */
   /* Else perform the requested activity                           */
   /* ------------------------------------------------------------- */

   else
   {
   
      /* ------------------------------------- */
      /* Set a "good" return (Operating Level) */
      /* ------------------------------------- */

      U_BIF_SET_GOOD_RETURN;
   }

   /* ------------------------------------------------------------- */
   /* Return control to caller                                      */
   /* ------------------------------------------------------------- */

   U_BIF_RETURN;
}

X_HEAPDLLMAIN( U_BIF_FUNCTION_NAME, 1)