HQ.H
上传用户:bjghjy
上传日期:2007-01-07
资源大小:379k
文件大小:7k
- #define MAX_HQ_SEND_COUNT 25
- #define MAX_ZQXX_SEND_COUNT 10
- #define MAX_GRA_SEND_COUNT 20
- #define MAX_HQFLDS_COUNT 15
- #define MAX_HQSEL_COUNT 5
- #define MAX_HQSEL_REC_COUNT 100
- #define MAX_HQ_REC_COUNT 600
- #define MAX_GMIN_REC_COUNT 500
- #define MAX_ZS_COUNT 15
- #define MAX_ZQDM_SIZE 7
- #define MAX_ZQMC_SIZE 13
- #define MAX_ZS_NAME_SIZE 15
- #define MAX_ZS_SIZE 12
- #define MAX_JG_SIZE 8
- #define MAX_CJSS_SIZE 12
- #define MAX_SL_SIZE 15
- #define MAX_CJJE_SIZE 18
- #define MAX_CJZJ_SIZE 15
- #define MAX_CJZJE_SIZE 18
- #define MAX_FLD_SIZE MAX_CJZJE_SIZE
- #define MAX_FILE_NAME_SIZE 13
- #define MSG_HEAD (LPSTR)"MSG"
- #define ERROR_HEAD (LPSTR)"ERROR"
- #define NOTRUN_HEAD (LPSTR)"NOTRUN"
- #define ECHO_HEAD (LPSTR)"ECHO"
- #define HQ00_HEAD (LPSTR)"HQ00"
- #define XHQ00_HEAD (LPSTR)"XHQ00"
- #define HQ01_HEAD (LPSTR)"HQ01"
- #define ZQXX_HEAD (LPSTR)"PKRSA"
- #define DP_HEAD (LPSTR)"DP"
- #define MMP_HEAD (LPSTR)"MMP"
- #define HQ10_HEAD (LPSTR)"HQ10"
- #define GRA00_HEAD (LPSTR)"GRA00"
- #define XGRA00_HEAD (LPSTR)"XGRA00"
- #define GRA01_HEAD (LPSTR)"GRA01"
- #define GRA10_HEAD (LPSTR)"GRA10"
- #define MAXMIN10_HEAD (LPSTR)"MAXMIN10"
- #define ZX_HEAD (LPSTR)"ZX"
- #define HQREF_HEAD (LPSTR)"HQREF"
- #define CLNT_EXIT (LPSTR)"CEXIT"
- #define CLNT_ALIVE (LPSTR)"ALIVE"
- #define JY_EXIT (LPSTR)"JYEXIT"
- #define GETZQMC_HEAD (LPSTR)"GETZQMC"
- #define HQ_CHKUSR_HEAD (LPSTR)"CHKUSR"
- #define DATA_DAY_HEAD (LPSTR)"DATADAY"
- #define DAY_DATA_HEAD (LPSTR)"DAYDATA"
- #define SEND_FILE_HEAD (LPSTR)"RECVFILE"
- typedef struct tag_SEND_FILE_FRAME
- {
- char filename[12];
- char sign; // bit4 is file begin sign ,bit3 is file EOF sign,
- short filelen; // bit2 is file compress sign
- }SEND_FILE_FRAME;
- #define STOCK_INFO_HEAD (LPSTR)"STOCKINFO"
- typedef struct tag_STOCK_INFO_FRAME
- {
- short type;
- char gpdm[MAX_FILE_NAME_SIZE];
- }STOCK_INFO_FRAME,FILE_INFO_FRAME;
- #define GZ_SZ 0
- #define GZ_SH 1
- #define MAX_SEND_BUF_SIZE 2048
- #define MAX_RECV_BUF_SIZE 2048
- #define MAX_JUNK_PACK 50
- #define MAX_JUNK_PACK_COUNT 10
- #define MAX_JUNK_VALID_TIME 5
- #define HQ_FLDS_COUNT 14
- #define HQ10_FLDS_COUNT 11
- #define SZZS_CF_REC_NUM 0 //深圳成分指数记录号
- #define SSUB_INT 0
- #define SSUB_LONG 1
- #define SSUB_FLOAT 2
- #define SSUB_FLOAT100 3
- #define SORT_UP 0
- #define SORT_DOWN 1
- typedef struct tag_GPZT
- {
- BOOL tpbz;
- BOOL fnew;
- BYTE type;
- }GPZT, *LPGPZT;
- typedef struct tag_GPZT_DATA
- {
- short recCount;
- LPGPZT lpGpzt;
- }GPZT_DATA, *LPGPZT_DATA;
- #define FLD_TYPE_STRING 0
- #define FLD_TYPE_FLOAT 1
- #define FLD_TYPE_LONG 2
- typedef struct tag_HQ_REF_DATA
- {
- float zgjg;
- float zdjg;
- float zgjm;
- float zdjm;
- float zjcj;
- float zdf;
- int cjss;
- int lc;
- int npzl;
- float wb;
- int cjje;
- }HQ_REF_DATA, *LPHQ_REF_DATA;
- #define HQ_REF_ITEM_COUNT 11
- typedef struct tag_HQ_PRE_DATA
- {
- char zqmc[MAX_ZQMC_SIZE];
- char zqdm[MAX_ZQDM_SIZE];
- float zrsp;
- float jrkp;
- }HQ_PRE_DATA, *LPHQ_PRE_DATA;
- typedef struct tag_HQ_DATA
- {
- short jys;
- short recCount;
- LPHQ_PRE_DATA lpPreData; //unrefresh datas
- LPHQ_REF_DATA lpRefData; //refresh datas
- BYTE *lpbChanged; //???
- }HQ_DATA, *LPHQ_DATA;
- typedef struct tag_HQ_TIME
- {
- short am_min_start, am_min_end;
- short pm_min_start, pm_min_end;
- BOOL fRunning;
- }HQ_TIME, *LPHQ_TIME;
- typedef struct tag_ZS
- {
- char szName[MAX_ZS_NAME_SIZE+1];
- float sp;
- float kp;
- float zg;
- float zd;
- float zj;
- float sd;
- }ZS, *LPZS;
- typedef struct tag_ZS_DATA
- {
- short zsCount;
- LPZS lpZs;
- }ZS_DATA, *LPZS_DATA;
- typedef struct tag_MMP
- {
- float jwBuy[3];
- int slBuy[3];
- float jwSell[3];
- int slSell[3];
- }MMP, *LPMMP;
- typedef struct tag_MMP_DATA
- {
- short recCount;
- LPMMP lpMmp;
- BYTE *lpChanged;
- }MMP_DATA, *LPMMP_DATA;
- typedef struct tag_DP_DATA
- {
- short zsCount;
- float zs[15]; //主要指数:深圳成分指数,上海综合指数
- float sp[15];
- float zd[15]; //升跌
- int cjzje; //上海成交总金额
- float npbl; //内盘比例
- int cjss; //成交手数
- short upCount, downCount, equalCount;
- }DP_DATA, *LPDP_DATA;
- typedef struct tag_HQSEL_DATA
- {
- short jys;
- short recCount;
- short recNum[MAX_HQSEL_REC_COUNT+1];
- }HQSEL_DATA, *LPHQSEL_DATA;
- typedef struct tag_MAXMIN
- {
- float zjcj;
- float zdf;
- int cjss;
- }MAXMIN, *LPMAXMIN;
- #define ZDF 0
- #define ZD 1
- #define CJSS 2
- #define CJJE 3
- typedef struct tag_MAXMIN_DATA
- {
- short recNum[4][10];
- MAXMIN MaxMin[4][10];
- }MAXMIN_DATA, *LPMAXMIN_DATA;
- typedef struct tag_ZX_DATA
- {
- short curMin;
- short len;
- LPSTR lpText;
- }ZX_DATA, *LPZX_DATA;
- typedef struct tag_GRA_DATA
- {
- short tim;
- float cjjg;
- int lc, zl;
- BYTE BS;
- }GRA_DATA, *LPGRA_DATA;
- typedef struct tag_GRA_HEAD
- {
- short dateNum;
- short recCount;
- float zgjg, zdjg;
- int zglc, zdlc;
- float zrsp;
- int npzl, wpzl;
- }GRA_HEAD, *LPGRA_HEAD;
- typedef struct tag_GRAPH_DATA
- {
- char szGraPath[128];
- LPGRA_HEAD lpGraHead;
- LPGRA_DATA lpGraData;
- }GRAPH_DATA, *LPGRAPH_DATA,GRA_ALL, *LPGRA_ALL;
- typedef struct tag_G5M_HEAD
- {
- short dateCount;
- short firstDate, lastDate;
- short dataCount;
- float maxjg, minjg;
- int maxlc;
- }G5M_HEAD, *LPG5M_HEAD;
- typedef struct tag_G5M_DATE_HEAD
- {
- short dateNum;
- short dataCount;
- }G5M_DATE_HEAD, *LPG5M_DATE_HEADd;
- typedef struct tag_G5M_DATE_REC
- {
- short min;
- float zg, zd, jg;
- int lc, zl;
- }G5M_DATE_REC, *LPG5M_DATE_REC;
- typedef struct tag_G5M_DATE_DATA
- {
- G5M_DATE_HEAD DateHead;
- G5M_DATE_REC DateRec;
- }G5M_DATE_DATA, *LPG5M_DATE_DATA;
- typedef struct tag_G5M_DATA
- {
- G5M_HEAD G5MHead;
- G5M_DATE_HEAD DateHead;
- G5M_DATE_REC DateRec;
- }G5M_DATA, *LPG5M_DATA;
- typedef struct tag_G5M_GP_DATA
- {
- LPG5M_DATA lpG5M;
- }G5M_GP_DATA, *LPG5M_GP_DATA;
- typedef struct tag_DAY_DATA
- {
- int day;
- float kpjg, spjg, zgjg, zdjg;
- int cjss;
- double cjje;
- }DAY_DATA, *LPDAY_DATA;
- typedef struct tag_DAY_DATAS
- {
- int *lpRecCount;
- }DAY_DATAS, *LPDAY_DATAS;
- typedef struct tag_JUNK_PACK
- {
- int sd;
- short len;
- time_t ltime;
- char junk[MAX_JUNK_PACK];
- }JUNK_PACK;
- #define DEALED 0
- #define NO_DEAL 1
- #define DEALING 2
- #define MAX_CMD_SIZE 50
- #define MAX_CMD_VALID_TIME 6
- #define MAX_CMD_BUFF_COUNT 100
- typedef struct tag_CLT_CMD
- {
- int sd,bz;
- struct sockaddr_in dest;
- int len;
- time_t ltime;
- char cmd[MAX_CMD_SIZE];
- }CLT_CMD;
- extern HQ_DATA HqData[2];
- extern MMP_DATA MmpData[2];
- extern DP_DATA DpData[2];
- extern HQSEL_DATA HqSelData;
- extern HQ_TIME HqTime[2];
- extern GRAPH_DATA GraphData[2];
- extern GPZT_DATA GpztData[2];
- extern MAXMIN_DATA MaxMinData[2][2]; //jys, 0:max, 1:min
- extern ZX_DATA ZxData;
- int CheckZqdm(LPSTR);
- typedef struct tag_HISTORY_DATA
- {
- char date[10]; //yymmddhhmi
- float ks;
- float zg;
- float zd;
- float ss;
- int cj;
- }HISTORY_DATA, *LPHISTORY_DATA;
- // To send HQ data fastly,We design the struct to decreace data amount
- typedef struct tag_HQ_REF_DATA_V202
- {
- char zqmc[MAX_ZQMC_SIZE]; //名称
- char zqdm[MAX_ZQDM_SIZE]; //代码
- int zrsp; //昨收盘 0
- int jrkp; //今开盘 1
- int zgjg; //最高 2
- int zdjg; //最低 3
- int zgjm; //叫卖 4
- int zdjm; //叫买 5
- int zjjg; //成交 6
- int cjss; //成交手数 8
- int npzl; //内盘总量 10
- int cjje; //成交金额 12
- int wb;
- }HQ_REF_DATA_V202,*LPHQ_REF_DATA_V202;
- typedef struct tag_DATA_V202
- {
- short *recCount;
- HQ_REF_DATA_V202 *lpData202;
- }LZW_DATA_202,*LPLZW_DATA_202;