LINUX C 链表封装
main.c
//初始化队列
void InitQueue(LiQueue *q)
{
q=(LiQueue*)malloc(sizeof(LiQueue));
q->front=q->rear=NULL;
}
//判断是否为空
int QueueEmpty(LiQueue *q)
{
if(q->rear==NULL)
{
return 1;
}
else
{
return 0;
}
}
//释放
void ClearQueue(LiQueue *q)
{
QNode *p=q->front,*r;
if(p!=NULL)
{
r=p->next;
while(r!=NULL)
{
free(p);
p=r;
r=p->next;
}
}
free(q);
}
//实现队列的入队
void enQueue(LiQueue *q,struct TCPMASSAGE stTcpSendBuff)
{
//封装结点
QNode *s;
s=(QNode*)malloc(sizeof(QNode));
memcpy(&s->data , &stTcpSendBuff , sizeof(stTcpSendBuff));
//s->data =e;
s->next=NULL;
if(q->rear==NULL)
{
q->front =s;
q->rear =s;
}
else
{
q->rear->next =s;
q->rear =s;
}
}
//出队函数
int deQueue(LiQueue *q,struct TCPMASSAGE stTcpSendBuff)
{
QNode *t;
if(q->rear ==NULL)
{
return 0;
}
if(q->front ==q->rear )//只有一个结点
{
t=q->front;
q->front =NULL;
q->rear =NULL;
}
else
{
t=q->front;
q->front=q->front->next;
}
memcpy(stTcpSendBuff.cTcpBuff,t->data.cTcpBuff,t->data.len);
stTcpSendBuff.len = t->data.len;
free(t);
return 1;
}
/*
//出队函数
int deQueue(LiQueue *q,char *pstbuff,int *lenth)
{
QNode *t;
if(q->rear ==NULL)
{
return 0;
}
if(q->front ==q->rear )//只有一个结点
{
t=q->front;
q->front =NULL;
q->r
相关文档:
The Linux USB input subsystem is a single, harmonized way to manage all input devices. This is a relatively new approach for Linux, with the system being partly incorporated in kernel version 2.4 and fully integrated in the 2.5 development series.
This article covers four basic areas: a descripti ......
一、下载安装程序
1、 下载内核源码(linux-2.6.33.tar.bz2),位置:https://www.kernel.org
2、 下载最新版的module-init-tools(module-init-tools-3.8.tar.bz2)和modutils(modutils-2.4.26-1.src.rpm)的源码
位置:http://www.kernel.org/pub/linux/kernel/people/rusty/modules/
位置:http://www. ......
学校服务器的一个windows虚拟机开启了Desktop共享,这样可以在配置不高的终端使用高性能的机器,除了windows客户端访问外,在Ubuntu里可以通过自带的 rdesktop访问,该程序为命令行形式。参数较多,比较有用的是提供远程与本地交互的-r参数。
如:
rdesktop -r disk:floppy=/home/xiajing/t 192.168.111.111 ......
一、什么是init
init是Linux系统操作中不可缺少的程序之一。 是一个由内核启动的用户级进程。
内核启动(已经被载入内存,开始运行,并已初始化所有的设备驱动程序和数据结构等)之后,就通过启动一个用户级程序init的方式来启动其他用户级的进程或服务。所以,init始终是第一个进程(其PID始终为1)。
内核 ......
DBA:Linux
在 Linux x86 上安装 Oracle RAC 10g
作者:John Smiley
了解在 Red Hat Enterprise Linux 或 Novell SUSE Enterprise Linux 上从头安装 Oracle RAC 10g 的基础知识(仅用于评估)
目录
概述
背景
第 1 部分: 安装 Linux
第 2 部分: 为 Oracle 配置 Linux
第 3 部分: 准备共享磁盘
第 4 部分: ......