这个函数看不明白,能解释一下这个函数的功能以及每个指针代表的含义吗?

关注【相关推荐】

//入队(尾部追加)
bool queue_push(struct queue *pq, int data)
{
//判断队列是否已满
if(is_full(*pq))
{
printf("入队失败,队列已满!\n");
return false;
}
//正确入队操作
struct node *pnew = NULL;
pnew = (struct node*)malloc(sizeof(struct node));
assert(pnew!=NULL);
pnew->data = data;
pnew->next = NULL;
if(pq->first == NULL) //pnew 是队列的第一个节点
{
pq->first = pnew;
pq->tail = pnew;
}
else //队列是一个非空的队列
{
pq->tail->next = pnew;
pq->tail = pnew;
}
pq->count ++;
return true;
}