⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 change_0214.ec

📁 证券交易系统
💻 EC
字号:
/* * 证券交易系统 城综网帐户信息校验 打包解包模块(与代理集中点) * 时间: 2001.2.21*/#include "../incl/bank.h"$include sqlca;extern   SEND_NET_0214   send_net_0214;extern   RECV_NET_0214   recv_net_0214;/* 按长度读取字段模块(来自代理集中点) */#define GET_REGION(region,recv_data)                                   \        for ( ; strncmp (tmp,"=",1) != 0; )   *tmp ++;                 \        *tmp++;                                                        \        tmpa = tmp;                                                    \        for ( lena = 0; strncmp (tmpa,"|",1) != 0; lena++)  *tmpa++;   \        memset( recv_data.region, 0x00, sizeof(recv_data.region) );    \        memcpy( recv_data.region, tmp, lena );                         \        for ( i=0; i<(lena+1); i++)  *tmp ++;                          \        recv_data.region[ lena ] = '\0';                               \        WriteLog(LOGFILE,"region=%s",recv_data.region);                   \/* 解包模块(来自代理集中点) */int   unpknet_stock_0214( rcv_data)char  *rcv_data;{        int   i,lena;        char  *tmp,*tmpa;        char  tmp1[256];        tmp = rcv_data;         GET_REGION ( trans_type, recv_net_0214 )        WriteLog(LOGFILE,"拆包处理结束(来自代理集中点)!");        return ( 0 );}pktonet_stock_0214( snd_data )char    *snd_data;{        int    lenb,len;        int    i;        char   tmp[1024],lenstr[2];        char   *temp,*snd_temp;    printf("FileName = [%s]\n",send_net_0214.FileName);              memset ( tmp,0,1024 );        temp = tmp;        len = 0;                 lenb = strlen(send_net_0214.retcode);        memcpy ( temp,"RETCODE=",8 );        for ( i=0; i<8; i++ ) *temp ++;        memcpy ( temp,send_net_0214.retcode,lenb);        for ( i=0; i<lenb; i++ ) *temp ++;        memcpy ( temp,"|",1 );        *temp++;        len=len+lenb+9;        if(strcmp(send_net_0214.retcode,"0000"))        {            lenb = strlen(send_net_0214.errmsg);            memcpy ( temp,"ERRMSG=",7 );            for ( i=0; i<7; i++ ) *temp ++;            memcpy ( temp,send_net_0214.errmsg,lenb);            for ( i=0; i<lenb; i++ ) *temp ++;            memcpy ( temp,"|",1 );            *temp ++;            len=len+lenb+8;	}        lenb = strlen(send_net_0214.FileName);        if ( lenb != 0 )        {           memcpy ( temp,"FILENAME=",9 );           for ( i=0; i<9; i++ ) *temp ++;           memcpy ( temp,send_net_0214.FileName,lenb);           for ( i=0; i<lenb; i++ ) *temp ++;           memcpy ( temp,"|",1 );           *temp ++;           len=len+lenb+10;        }        lenb = strlen(send_net_0214.mac);        if ( lenb != 0 )        {           memcpy ( temp,"MAC=",4 );           for ( i=0; i<4; i++ ) *temp ++;           memcpy ( temp,send_net_0214.mac,lenb);           for ( i=0; i<lenb; i++ ) *temp ++;           memcpy ( temp,"|",1 );           *temp ++;           len=len+lenb+5;        }        temp[len] = '\0';        snd_temp = snd_data;        memcpy  ( snd_temp, "03" , 2 );        for ( i=0; i<2; i++ ) *snd_temp ++;        sprintf(lenstr,"%2d",len);        memcpy  ( snd_temp,lenstr , 2 );        for ( i=0; i<2; i++ ) *snd_temp ++;        memcpy  ( snd_temp,tmp , len );        return ( 0 );}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -