#include <WinTen.h>
#include <Windows.h>
#include <ClipApi.h>

typedef struct
{
   FARPROC farProc;
   BYTE bType;
   BYTE bReturn;
   BYTE bParams;
   BYTE bParam[ 15 ];
} STRFUNC;

//----------------------------------------------------------------------------//

CLIPPER GETPROCADD()
{
   STRFUNC strFunc;
   BYTE b = 0;
   BYTE bFunc[ 4 ];

   strFunc.bParams = PCOUNT() - 4;

   if( ISNUM( 2 ) )
   {
      bFunc[ 0 ]      = _parni( 2 );
      bFunc[ 1 ]      = 0;
      strFunc.farProc = GetProcAddress( _parni( 1 ), ( LPSTR ) bFunc );
   }
   else
      strFunc.farProc = GetProcAddress( _parni( 1 ), _parc( 2 ) );

   strFunc.bType      = _parl( 3 );
   strFunc.bReturn    = _parni( 4 );

   while( b < strFunc.bParams )
      strFunc.bParam[ b ] = _parni( 5 + b++ );

   _retclen( ( BYTE * ) &strFunc, 7 + strFunc.bParams );   // 4 + 1 + 1 + 1
}

//----------------------------------------------------------------------------//
