SV_JY.H
上传用户:bjghjy
上传日期:2007-01-07
资源大小:379k
文件大小:10k
- // define udp pack head
- #define JY_CHKUSR_HEAD (LPSTR)"JYCHKUSR"
- #define JY_CHGPWD_HEAD (LPSTR)"JYCHGPWD"
- #define JY_BUYSELL_HEAD (LPSTR)"JYBUYSELL"
- #define JY_SELL_HEAD (LPSTR)"JYSELL"
- #define JY_CANCEL_HEAD (LPSTR)"JYCANCEL"
- #define JY_YECX_HEAD (LPSTR)"JYYECX"
- #define JY_CJCX_HEAD (LPSTR)"JYCJCX"
- #define JY_WTCX_HEAD (LPSTR)"JYWTCX"
- #define JY_CXEND_HEAD (LPSTR)"JYCXEND"
- #define JY_TIMEOUT_HEAD (LPSTR)"JYTIMEOUT"
- #define JY_ZQSXX_HEAD (LPSTR)"PKRSA"
- #define MAX_GDDM_SIZE 10
- #define MAX_JYMM_SIZE 6
- #define MAX_RQ_SIZE 8
- #define MAX_GPDM_SIZE 6
- #define MAX_HTHM_SIZE 6
- #define MAX_TIME_SIZE 8
- #define MAX_CANCEL_SENDCOUNT 2
- #define MAX_CX_SENDCOUNT 20
- #define MAX_ZQS_COUNT 32
- #ifdef _MSDOS
- #ifndef BYTE
- #define BYTE char
- #endif
- #ifndef BOOL
- #define BOOL char
- #endif
- #ifdef FAR
- #define FAR far
- #endif
- #endif
- #ifdef _WIN16
- typedef struct tag_zqsxx
- {
- int zqsid[MAX_ZQS_COUNT+1];
- char zqsjc[MAX_ZQS_COUNT +1][12+1];
- }ZQSXX, FAR * LPZQSXX;
- typedef struct tag_PACK_ASK_CHKUSR
- {
- char jys;
- int zqsid;
- long userId;
- char gddm[MAX_GDDM_SIZE+1];
- char jymm[MAX_JYMM_SIZE+1];
- int sdHq;
- }JY_ASK_CHKUSR, FAR *LPJY_ASK_CHKUSR;
- typedef struct tag_PACK_ANS_CHKUSR
- {
- char flag;
- char jys;
- long userId;
- char gddm[MAX_GDDM_SIZE+1];
- }JY_ANS_CHKUSR, FAR *LPJY_ANS_CHKUSR;
- typedef struct tag_PACK_ASK_CHGPWD
- {
- char jys;
- long userId;
- char gddm[MAX_GDDM_SIZE+1];
- char xmm[MAX_JYMM_SIZE+1];
- }JY_ASK_CHGPWD, FAR *LPJY_ASK_CHGPWD;
- typedef struct tag_PACK_ANS_CHGPWD
- {
- char flag;
- char jys;
- char gddm[MAX_GDDM_SIZE+1];
- }JY_ANS_CHGPWD, FAR *LPJY_ANS_CHGPWD;
- typedef struct tag_PACK_ASK_BUYSELL
- {
- char jys;
- long userId;
- char gddm[MAX_GDDM_SIZE+1];
- char gpdm[MAX_GPDM_SIZE+1];
- char bs;
- long wtgs;
- long wtjg;
- }JY_ASK_BUYSELL, FAR *LPJY_ASK_BUYSELL;
- typedef struct tag_PACK_ANS_BUYSELL
- {
- char flag;
- char jys;
- char gddm[MAX_GDDM_SIZE+1];
- char hthm[MAX_HTHM_SIZE+1];
- char bs;
- }JY_ANS_BUYSELL, FAR *LPJY_ANS_BUYSELL;
- typedef struct tag_CANCEL
- {
- char hthm[MAX_HTHM_SIZE+1];
- }CANCEL, FAR *LPCANCEL;
- typedef struct tag_PACK_ASK_CANCEL
- {
- char jys;
- long userId;
- char gddm[MAX_GDDM_SIZE+1];
- int cancelCount;
- CANCEL Cancel[MAX_CANCEL_SENDCOUNT];
- }JY_ASK_CANCEL, FAR *LPJY_ASK_CANCEL;
- typedef struct tag_PACK_ANS_CANCEL
- {
- char flag[MAX_CANCEL_SENDCOUNT];
- char jys;
- char gddm[MAX_GDDM_SIZE+1];
- }JY_ANS_CANCEL, FAR *LPJY_ANS_CANCEL;
- typedef struct tag_PACK_ASK_YECX
- {
- char jys;
- long userId;
- char gddm[MAX_GDDM_SIZE+1];
- char gpdm[MAX_GPDM_SIZE+1];
- }JY_ASK_YECX, FAR *LPJY_ASK_YECX;
- typedef struct tag_GPTG
- {
- char gpdm[MAX_GPDM_SIZE+1];
- char kys[12+1],gpye[12+1];
- char ghrq[MAX_RQ_SIZE+1];
- }JY_GPTG, FAR *LPJY_GPTG;
- typedef struct tag_PACK_ANS_YECX
- {
- char flag;
- char jys;
- char gddm[MAX_GDDM_SIZE+1];
- int recnum;
- double kys,zjye;
- LPJY_GPTG lpGptg;
- }JY_ANS_YECX, FAR *LPJY_ANS_YECX;
- typedef struct tag_PACK_ASK_CJCX
- {
- char jys;
- long userId;
- char gddm[MAX_GDDM_SIZE+1];
- char cjrq[MAX_RQ_SIZE+1]; //YYMMDD
- char hthm[MAX_HTHM_SIZE+1]; // IF HTHM IS EMPTY,THEN RUQER ALL CJ
- }JY_ASK_CJCX, FAR *LPJY_ASK_CJCX;
- typedef struct tag_CJ
- {
- char hthm[MAX_HTHM_SIZE+1];
- char cjsj[MAX_TIME_SIZE+1]; //HH:MI:SS
- char mmbz; //B,S
- char gpdm[MAX_GPDM_SIZE+1];
- char cjgs[12+1];
- char cjjg[12+1];
- }JY_CJ, FAR *LPJY_CJ;
- typedef struct tag_PACK_ANS_CJCX
- {
- char flag;
- char jys;
- char gddm[MAX_GDDM_SIZE+1];
- int recnum;
- char cjrq[MAX_RQ_SIZE+1]; //YYMMDD
- LPJY_CJ lpCj;
- }JY_ANS_CJCX, FAR *LPJY_ANS_CJCX;
- typedef struct tag_PACK_ASK_WTCX
- {
- char jys;
- long userId;
- char gddm[MAX_GDDM_SIZE+1];
- char wtrq[MAX_RQ_SIZE+1]; //YYMMDD
- char hthm[MAX_HTHM_SIZE+1]; // IF HTHM IS EMPTY,THEN RUQER ALL WT
- char cdcx;
- }JY_ASK_WTCX, FAR *LPJY_ASK_WTCX;
- typedef struct tag_WT
- {
- char hthm[MAX_HTHM_SIZE+1];
- char wtsj[MAX_TIME_SIZE+1]; //HH:MI:SS
- char mmbz; //B,S
- char gpdm[MAX_GPDM_SIZE+1];
- char wtgs[12+1]; //if wtgs<0 then is cancel
- char wtjg[12+1];
- }JY_WT, FAR *LPJY_WT;
- typedef struct tag_PACK_ANS_WTCX
- {
- char flag;
- char jys;
- char gddm[MAX_GDDM_SIZE+1];
- int recnum;
- char wtrq[MAX_RQ_SIZE+1]; //YYMMDD
- LPJY_WT lpWt;
- }JY_ANS_WTCX, FAR *LPJY_ANS_WTCX;
- #else
- typedef struct tag_zqsxx
- {
- short zqsid[MAX_ZQS_COUNT+1];
- char zqsjc[MAX_ZQS_COUNT +1][12+1];
- }ZQSXX, FAR * LPZQSXX;
- typedef struct tag_PACK_ASK_CHKUSR
- {
- char jys;
- short zqsid;
- int userId;
- char gddm[MAX_GDDM_SIZE+1];
- char jymm[MAX_JYMM_SIZE+1];
- short sdHq;
- }JY_ASK_CHKUSR, FAR *LPJY_ASK_CHKUSR;
- typedef struct tag_PACK_ANS_CHKUSR
- {
- char flag; //if 0,right,if -1 ,then user invalid
- char jys;
- int userId;
- char gddm[MAX_GDDM_SIZE+1];
- }JY_ANS_CHKUSR, FAR *LPJY_ANS_CHKUSR;
- typedef struct tag_PACK_ASK_CHGPWD
- {
- char jys;
- int userId;
- char gddm[MAX_GDDM_SIZE+1];
- char xmm[MAX_JYMM_SIZE+1];
- }JY_ASK_CHGPWD, FAR *LPJY_ASK_CHGPWD;
- typedef struct tag_PACK_ANS_CHGPWD
- {
- char flag; // if 0 succeed,if -1 then failed
- char jys;
- char gddm[MAX_GDDM_SIZE+1];
- }JY_ANS_CHGPWD, FAR *LPJY_ANS_CHGPWD;
-
- typedef struct tag_PACK_ASK_BUYSELL
- {
- char jys;
- int userId;
- char gddm[MAX_GDDM_SIZE+1];
- char gpdm[MAX_GPDM_SIZE+1];
- char bs; // 'B', 'S'
- int wtgs;
- int wtjg;
- }JY_ASK_BUYSELL, FAR *LPJY_ASK_BUYSELL;
- typedef struct tag_PACK_ANS_BUYSELL
- {
- char flag; //0 succeed,-1 no money,-2 no stock
- char jys;
- char gddm[MAX_GDDM_SIZE+1];
- char hthm[MAX_HTHM_SIZE+1];
- char bs;
- }JY_ANS_BUYSELL, FAR *LPJY_ANS_BUYSELL;
- typedef struct tag_CANCEL
- {
- char hthm[MAX_HTHM_SIZE+1];
- }CANCEL, FAR *LPCANCEL;
- typedef struct tag_PACK_ASK_CANCEL
- {
- char jys;
- int userId;
- char gddm[MAX_GDDM_SIZE+1];
- short cancelCount;
- CANCEL Cancel[MAX_CANCEL_SENDCOUNT];
- }JY_ASK_CANCEL, FAR *LPJY_ASK_CANCEL;
- typedef struct tag_PACK_ANS_CANCEL
- {
- char flag[MAX_CANCEL_SENDCOUNT];
- char jys;
- char gddm[MAX_GDDM_SIZE+1];
- }JY_ANS_CANCEL, FAR *LPJY_ANS_CANCEL;
- typedef struct tag_PACK_ASK_YECX
- {
- char jys;
- int userId;
- char gddm[MAX_GDDM_SIZE+1];
- char gpdm[MAX_GPDM_SIZE+1];
- }JY_ASK_YECX, FAR *LPJY_ASK_YECX;
- typedef struct tag_GPTG
- {
- char gpdm[MAX_GPDM_SIZE+1];
- char kys[12+1],gpye[12+1];
- char ghrq[MAX_RQ_SIZE+1];
- }JY_GPTG, FAR *LPJY_GPTG;
- typedef struct tag_PACK_ANS_YECX
- {
- char flag;
- char jys;
- char gddm[MAX_GDDM_SIZE+1];
- short recnum;
- double kys,zjye;
- LPJY_GPTG lpGptg;
- }JY_ANS_YECX, FAR *LPJY_ANS_YECX;
- typedef struct tag_PACK_ASK_CJCX
- {
- char jys;
- int userId;
- char gddm[MAX_GDDM_SIZE+1];
- char cjrq[MAX_RQ_SIZE+1]; //YYMMDD
- char hthm[MAX_HTHM_SIZE+1]; // IF HTHM IS EMPTY,THEN RUQER ALL CJ
- }JY_ASK_CJCX, FAR *LPJY_ASK_CJCX;
- typedef struct tag_CJ
- {
- char hthm[MAX_HTHM_SIZE+1];
- char cjsj[MAX_TIME_SIZE+1]; //HH:MI:SS
- char mmbz; //B,S
- char gpdm[MAX_GPDM_SIZE+1];
- char cjgs[12+1];
- char cjjg[12+1];
- }JY_CJ, FAR *LPJY_CJ;
- typedef struct tag_PACK_ANS_CJCX
- {
- char flag;
- char jys;
- char gddm[MAX_GDDM_SIZE+1];
- short recnum;
- char cjrq[MAX_RQ_SIZE+1]; //YYMMDD
- LPJY_CJ lpCj;
- }JY_ANS_CJCX, FAR *LPJY_ANS_CJCX;
- typedef struct tag_PACK_ASK_WTCX
- {
- char jys;
- int userId;
- char gddm[MAX_GDDM_SIZE+1];
- char wtrq[MAX_RQ_SIZE+1]; //YYMMDD
- char hthm[MAX_HTHM_SIZE+1]; // IF HTHM IS EMPTY,THEN RUQER ALL WT
- char cdcx;
- }JY_ASK_WTCX, FAR *LPJY_ASK_WTCX;
- typedef struct tag_WT
- {
- char hthm[MAX_HTHM_SIZE+1];
- char wtsj[MAX_TIME_SIZE+1]; //HH:MI:SS
- char mmbz; //B,S
- char gpdm[MAX_GPDM_SIZE+1];
- char wtgs[12+1]; //if wtgs<0 then is cancel
- char wtjg[12+1];
- }JY_WT, FAR *LPJY_WT;
- typedef struct tag_PACK_ANS_WTCX
- {
- char flag;
- char jys;
- char gddm[MAX_GDDM_SIZE+1];
- short recnum;
- char wtrq[MAX_RQ_SIZE+1]; //YYMMDD
- LPJY_WT lpWt;
- }JY_ANS_WTCX, FAR *LPJY_ANS_WTCX;
- #endif
-
- #define JY_CHKUSR 0
- #define JY_CHGPWD 1
- #define JY_BUYSELL 2
- #define JY_CANCEL 3
- #define JY_YECX 4
- #define JY_CJCX 5
- #define JY_WTCX 6
- // defeine comm dbf file
- #define fld_ASKNO 0
- #define fld_ANSNO 1
- #define fld_STKNO 2
- #define fld_GDDM 3
- #define fld_JYMM 4
- #define fld_GPDM 5
- #define fld_WTGS 6
- #define fld_WTJG 7
- #define fld_HTHM 8
- #define fld_DATE 9
- #define fld_STAT 10
- #define fld_ADDR 11
- #define fld_SERI 12
- #define REQ_NULL '0'
- #define REQ_CHKUSR '1'
- #define REQ_CHGPWD '2'
- #define REQ_BUY '3'
- #define REQ_SELL '4'
- #define REQ_BUYSEL '3'
- #define REQ_CANCEL '5'
- #define REQ_YECX '6'
- #define REQ_CJCX '7'
- #define REQ_WTCX '8'
- #define REQ_EXIT '9'
- #define ANS_SUCC '0'
- #define ANS_TIME_OUT 'A'
- #define ANS_SYS_ERR 'B'
- #define ANS_NO_PRIV 'C'
- #define ANS_NO_GDDM 'D'
- #define ANS_NO_CANCEL 'E'
- #define ANS_NO_DATA_FOUND 'F'
- #define ANS_GDDM_USE 'I'
- #define ANS_SUSP_REQ 'J'
- #define MAX_WAIT_TIME 60
- int JyInit(void);
- int JyExit(void);
- int Jy_ChkUsr(int sd, int, LPJY_ASK_CHKUSR);
- int Jy_ChgPwd(int sd, int, LPJY_ASK_CHGPWD);
- int Jy_BuySell(int sd, int, LPJY_ASK_BUYSELL);
- int Jy_Cancel(int sd, int, LPJY_ASK_CANCEL);
- int Jy_Yecx(int sd, int, LPJY_ASK_YECX);
- int Jy_Cjcx(int sd, int, LPJY_ASK_CJCX);
- int Jy_Wtcx(int sd, int, LPJY_ASK_WTCX);
- int Jy_Zqsxx(int sd);