//---------------------------------------------------------------------------
#pragma hdrstop
#include "fmt_wl.h"
//---------------------------------------------------------------------------
#pragma argsused
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{  return 1;  }
//---------------------------------------------------------------------------
extern "C" __declspec(dllexport) DWORD QupfInfo( PLG_FMT_INF* info)
{
   info->uType           = PLG_FMT;
   info->sName           = strdup( "Wealth-Lab");
   info->sFilter         = strdup( "*.wl");
   info->bConfig         = false;

   return PLG_FMT_OK;
}
//---------------------------------------------------------------------------
extern "C" __declspec(dllexport) void* QupfHandle( DWORD cmd, void* data)
{
  void* ret = NULL;


	switch( cmd )
	{
	  case FMT_CONFIG    : break;
	  case FMT_RENAME    : TikerRename( (PLG_FMT_DATA*)data);             break;
	  case FMT_DELETE    : TikerDelete( (PLG_FMT_DATA*)data);             break;
	  case FMT_PERIOD    : DatePeriod( (PLG_FMT_DATA*)data);              break;
	  case FMT_TICKERS   : ret = (void*)Tikers( (char*)data);             break;
	  case FMT_SER_ADD   : SeriesAdd( (PLG_FMT_DATA*)data);               break;
	  case FMT_SER_SET   : SeriesSet( (PLG_FMT_DATA*)data);               break;
	  case FMT_SER_GET   : ret = (void*)SeriesGet( (PLG_FMT_DATA*)data);  break;
      //------------------------------------------------------------------------
	  case FMT_SER_GETex : ret = (void*)SeriesGetEx( (char*)data);        break;
	  case FMT_SER_SETex : SeriesSetEx( (SERIES*)data);                   break;
	}

  return ret;
}
//---------------------------------------------------------------------------

