LIST_ENTRY是个什么东东?双向链表?怎么用?

cxf1976 2003-11-10 05:49:27
多谢
...全文
672 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
cxf1976 2003-12-29
  • 打赏
  • 举报
回复
good
Zark 2003-12-27
  • 打赏
  • 举报
回复
你是在哪里看到的LIST_ENTRY?总得有个上下文才好展开说.

通常LIST_ENTRY是一个结构体,是在c中用来构成链表的一个基本方法,是单向还是双向取决于它的定义.
typedef struct _LIST_ENTRY {
struct _LIST_ENTRY *Flink;
struct _LIST_ENTRY *Blink;
} LIST_ENTRY, *LPLIST_ENTRY;
这用以建立双向链表
typedef struct _LIST_ENTRY {
struct _LIST_ENTRY *Flink;
} LIST_ENTRY, *LPLIST_ENTRY;
这就可以建立单向链表.

在使用通常使用:
typedef struct _NODE {
LIST_ENTRY entry;
int nData;
} NODE, *LPNODE;
这种形式构成链表的结点.

与其他所用已经写好的链表类相比较,它具用速度最快,空间最省的特点,但其使用的方便程序最差,出错可能性最大.
cxf1976 2003-12-26
  • 打赏
  • 举报
回复
实在不满意这些答复
leon_z 2003-11-30
  • 打赏
  • 举报
回复
LIST_ENTRY and SINGLE_LIST_ENTRY Two list structures are used in layered, a doubly linked list defined in LLIST.H and a singly linked list defined in the NTDEF.H from the Platform SDK:
typedef struct _LIST_ENTRY {
struct _LIST_ENTRY *Flink;
struct _LIST_ENTRY *Blink;
} LIST_ENTRY, *PLIST_ENTRY,
*RESTRICTED_POINTER PRLIST_ENTRY;

typedef struct _SINGLE_LIST_ENTRY {
struct _SINGLE_LIST_ENTRY *Next;
} SINGLE_LIST_ENTRY, *PSINGLE_LIST_ENTRY;

LIST_ENTRY is used to store all protocol catalog items, all outstanding I/O on a particular socket, and all outstanding sockets. SINGLE_LIST_ENTRY is used to store a list of preallocated INTERNALOVERLAPPEDSTRUCT structures.
To allow a structure to be linked by LIST_ENTRY, the structure has to have the following form:

// typedef struct _FOO
// {
// LIST_ENTRY FooListEntry;



//
// } FOO, * PFOO;

Given a pointer to a member FooListEntry, the CONTAINING_RECORD macro gives you back the pointer to the hosting FOO structure.

#define CONTAINING_RECORD(address, type, field)
((type FAR *)( \
(PCHAR)(address) - \
(PCHAR)(&((type *)0)->field)))

Once you understand the CONTAINING_RECORD macro, you should have no problem understanding the rest in LLIST.H.
cxf1976 2003-11-30
  • 打赏
  • 举报
回复
up
cxf1976 2003-11-11
  • 打赏
  • 举报
回复
呵呵,这个链表不知道和和mfc里面的指针链表相比,那个更优。我在很多程序里面(包括linux)看到它,肯定有它的好处,不知哪位高手能指教一下。
cxf1976 2003-11-11
  • 打赏
  • 举报
回复
up
arvid_gs 2003-11-11
  • 打赏
  • 举报
回复
不了解!
lovenoend 2003-11-11
  • 打赏
  • 举报
回复
LIST_ENTRY ??具体点
cxf1976 2003-11-11
  • 打赏
  • 举报
回复
up
cxf1976 2003-11-10
  • 打赏
  • 举报
回复
做过驱动开发的朋友多多指教

16,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧