//---------------------------------------------------------------------------
#include "src_finam.h"
#pragma hdrstop
//---------------------------------------------------------------------------
#pragma argsused
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{  return 1;  }
//---------------------------------------------------------------------------
extern "C" __declspec(dllexport) DWORD QupsInfo( PLG_SRC_INF* info)
{
   info->uType           = PLG_SRC;
   info->sName           = strdup( "FINAM.RU");
   info->uSecCount       = 24;
   info->uTfCount        = 11;
   info->bConfig         = 1;
   info->bTickers        = 1;

   info->sSections       = new char*[24];
   info->sSections[0]    = strdup( sFINAM_MICEX        );
   info->sSections[1]    = strdup( sFINAM_MICEX_PIF    );
   info->sSections[2]    = strdup( sFINAM_MICEX_OBL    );
   info->sSections[3]    = strdup( sFINAM_MICEX_OBL_V  );
   info->sSections[4]    = strdup( sFINAM_RTS          );
   info->sSections[5]    = strdup( sFINAM_RTS_GAZ      );
   info->sSections[6]    = strdup( sFINAM_RTS_GTS      );
   info->sSections[7]    = strdup( sFINAM_RTS_BOARD    );
   info->sSections[8]    = strdup( sFINAM_RTS_Standard );
   info->sSections[9]    = strdup( sFINAM_FUTURES_FORTS);
   info->sSections[10]   = strdup( sFINAM_CURR         );
   info->sSections[11]   = strdup( sFINAM_INDEX        );
   info->sSections[12]   = strdup( sFINAM_FUTURES      );
   info->sSections[13]   = strdup( sFINAM_ADR          );
   info->sSections[14]   = strdup( sFINAM_MATERIAL     );
   info->sSections[15]   = strdup( sFINAM_SPFR         );
   info->sSections[16]   = strdup( sFINAM_ARC_FORTS    );
   info->sSections[17]   = strdup( sFINAM_ARC_MICEX    );
   info->sSections[18]   = strdup( sFINAM_ARC_RTS      );
   info->sSections[19]   = strdup( sFINAM_USA_STOCK    );
   info->sSections[20]   = strdup( sFINAM_US_BOND      );
   info->sSections[21]   = strdup( sFINAM_USA_INDUSTRY );
   info->sSections[22]   = strdup( sFINAM_ETF          );
   info->sSections[23]   = strdup( sFINAM_INDEX_IND    );

   info->pTimeFrames     = new uchar[11];
   info->pTimeFrames[0]  = TF_TIKS;
   info->pTimeFrames[1]  = TF_MIN1;
   info->pTimeFrames[2]  = TF_MIN5;
   info->pTimeFrames[3]  = TF_MIN10;
   info->pTimeFrames[4]  = TF_MIN15;
   info->pTimeFrames[5]  = TF_MIN30;
   info->pTimeFrames[6]  = TF_MIN60;
   info->pTimeFrames[7]  = TF_HOUR;
   info->pTimeFrames[8]  = TF_DAY;
   info->pTimeFrames[9]  = TF_WEEK;
   info->pTimeFrames[10] = TF_MONTH;

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


	switch( cmd )
	{
	  case SRC_CHKT     : ret = (void*)ChkTicker( (PLG_SRC_DATA*)data);  break;
	  case SRC_DOWN     : ret = (void*)Down( (PLG_SRC_DATA*)data);       break;
	  case SRC_CONFIG   : Config( (HWND)data);                           break;
	  case SRC_TICKERS  : ret = (void*)LstTickers( (char*)data);         break;
	}

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

