/*****************************************************
   AREA.C using Borland 4.0 16-bit Compiler
   Sample 16-bit DLL for S-PLUS for Windows 3.2
*****************************************************/
#include <windows.h>
#define PI 3.1415926

/* standard DLL start-up function */

int FAR PASCAL LibMain (HANDLE hInstance, WORD wDataSeg,
                        WORD wHeapSize, LPSTR lpszCmdLine)
{
    /* if local (moveable) heap was allocated, unlock it */
    if (wHeapSize > 0)
        UnlockData (0);
    return (1);
}

/* traditional DLL exit function */

int FAR PASCAL _export 
WEP (int nParam)
{
    return (1);
}

/* simple function to calculate the area of a circle */

void FAR PASCAL _export 
area (double FAR lpArea, double FAR *lpRadius)
{
     /* calculate area */
     *lpArea = PI * (*lpRadius) * (*lpRadius);
}
