69,381
社区成员
发帖
与我相关
我的任务
分享
typedef unsigned long DWORD; //4Bytes
typedef unsigned short WORD; //2Bytes
typedef unsigned int UINT; //通常4Bytes
typedef signed char CHAR; // 1Bytes
typedef unsigned char BYTE; //1Bytes
typedef struct TS_Node{
BYTE acDate[250];
UINT uTS_Length;
struct TS_Node*next;
}TS_Node_S;
/*
用于存储pid相同的TS包,bContain标志位用于判断当前链表中是否存储过带有效净荷的TS
*/
typedef struct TS_Store{
UINT uPid;
UINT uContain;
struct TS_Node_S*psHead;
struct TS_Node_S*psTail;
}TS_Store_S;
/*
将TS_Store_S链接起来
*/
typedef struct TS_Store_All{
TS_Store_S sTS_Store;
struct TS_Store_All *psNext;
}TS_Store_All_S;
/////////////////////////////////////////////////////////////////////////////////
if (0 == (temp->sTS_Store). uContain) {
TS_Node_S *psTS_Node = (TS_Node_S*)malloc(sizeof(TS_Node_S));
memcpy(psTS_Node->acDate,pTS_Buffer,uTS_Buffer_Length);
psTS_Node->uTS_Length = uTS_Buffer_Length;
if(NULL == (temp->sTS_Store).psHead)
{
(temp->sTS_Store).psHead = psTS_Node; //warning: assignment from incompatible pointer type
(temp->sTS_Store).psTail = psTS_Node; //warning: assignment from incompatible pointer type
(temp->sTS_Store).uContain = 1;
return 0;
}
else
{
TS_Node_S *psTS_Node_Insert = (temp->sTS_Store).psTail;
psTS_Node_Insert->next=psTS_Node;
(temp->sTS_Store).psTail = psTS_Node_Insert->next;
(temp->sTS_Store).uContain = 1;
return 0;
}
}