Community articleIFSObject_AllocateObject
Added by IBM contributorIBM on May 2, 2012
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

No abstract provided.



Description

This function creates a generic IFSObject and which is then cast to a FunctionCall structure. This enables you to call functions from the extension.

Function

IFSObject* IFSObject_AllocateObject(
   r_charP theInterfaceName,
   r_u_long theInterfaceVersion,
   r_short theFinalFlag,
   r_long theExtraDataSize);


Parameters

Table 1. allocate object parameters
ExpressionTypeDescription
theInterfaceNamer_charPName of the Function Call Interface. Set to FUNCTIONCALL_INTERFACE_NAME.
theInterfaceVersionr_u_longThe version of the Function Call Interface. Set to FUNCTIONCALL_INTERFACE_VERSION.
theFinalFlagr_shortFlag which determines if the object can be modified. Always set to NOTOK.
theExtraDataSizer_longAlways 0.


Returns

A pointer to a generic IFSObject. Normally, this will be cast to a FunctionCall pointer in an extension.

Notes

  • IFSObject_AllocateObject creates a generic IFSObject that provides very few services. To customize the object you must define its behavior by making a call to IFSObject_SetObjectProc.

Example

C_ExtensionInit(Extension *theExtension, IFX *theIFXManager)
{
/*    Additional Code Removed */
      if ((theFunctionCall = (FunctionCall*)
         IFSObject_AllocateObject(FUNCTIONCALL_INTERFACE_NAME,
         FUNCTIONCALL_CURRENT_VERSION, NOTOK, 0)) == NULL)
      {
         return NOTOK;
      }
/* Additional Code Removed */
}