当前位置: 首页 > wzjs >正文

wordpress调用分类目录文章越秀seo搜索引擎优化

wordpress调用分类目录文章,越秀seo搜索引擎优化,曲靖市建设局网站,汕头地区做网站的背景 代码中经常会出现双向链表,对于双向链表的插入和删除有对应的API函数接口,但直观的图表更容易理解,所以本文会对rt-thread内核代码中提供的双向链表的一些API函数操作进行绘图,方便后续随时查看。 代码块 rt-thread中提供…

背景

代码中经常会出现双向链表,对于双向链表的插入和删除有对应的API函数接口,但直观的图表更容易理解,所以本文会对rt-thread内核代码中提供的双向链表的一些API函数操作进行绘图,方便后续随时查看。

代码块

rt-thread中提供的代码段包括:
链表定义rtdef.h

/*** Double List structure*/
struct rt_list_node
{struct rt_list_node *next;                          /**< point to next node. */struct rt_list_node *prev;                          /**< point to prev node. */
};
typedef struct rt_list_node rt_list_t;                  /**< Type for lists. */

API操作定义rtserver.h

/*** @addtogroup KernelService*//**@{*//*** rt_container_of - return the start address of struct type, while ptr is the* member of struct type.*/
#define rt_container_of(ptr, type, member) \((type *)((char *)(ptr) - (unsigned long)(&((type *)0)->member)))/*** @brief initialize a list object*/
#define RT_LIST_OBJECT_INIT(object) { &(object), &(object) }/*** @brief initialize a list** @param l list to be initialized*/
rt_inline void rt_list_init(rt_list_t *l)
{l->next = l->prev = l;
}/*** @brief insert a node after a list** @param l list to insert it* @param n new node to be inserted*/
rt_inline void rt_list_insert_after(rt_list_t *l, rt_list_t *n)
{l->next->prev = n;n->next = l->next;l->next = n;n->prev = l;
}/*** @brief insert a node before a list** @param n new node to be inserted* @param l list to insert it*/
rt_inline void rt_list_insert_before(rt_list_t *l, rt_list_t *n)
{l->prev->next = n;n->prev = l->prev;l->prev = n;n->next = l;
}/*** @brief remove node from list.* @param n the node to remove from the list.*/
rt_inline void rt_list_remove(rt_list_t *n)
{n->next->prev = n->prev;n->prev->next = n->next;n->next = n->prev = n;
}/*** @brief tests whether a list is empty* @param l the list to test.*/
rt_inline int rt_list_isempty(const rt_list_t *l)
{return l->next == l;
}/*** @brief get the list length* @param l the list to get.*/
rt_inline unsigned int rt_list_len(const rt_list_t *l)
{unsigned int len = 0;const rt_list_t *p = l;while (p->next != l){p = p->next;len ++;}return len;
}/*** @brief get the struct for this entry* @param node the entry point* @param type the type of structure* @param member the name of list in structure*/
#define rt_list_entry(node, type, member) \rt_container_of(node, type, member)/*** rt_list_for_each - iterate over a list* @pos:    the rt_list_t * to use as a loop cursor.* @head:   the head for your list.*/
#define rt_list_for_each(pos, head) \for (pos = (head)->next; pos != (head); pos = pos->next)/*** rt_list_for_each_safe - iterate over a list safe against removal of list entry* @pos:    the rt_list_t * to use as a loop cursor.* @n:      another rt_list_t * to use as temporary storage* @head:   the head for your list.*/
#define rt_list_for_each_safe(pos, n, head) \for (pos = (head)->next, n = pos->next; pos != (head); \pos = n, n = pos->next)/*** rt_list_for_each_entry  -   iterate over list of given type* @pos:    the type * to use as a loop cursor.* @head:   the head for your list.* @member: the name of the list_struct within the struct.*/
#define rt_list_for_each_entry(pos, head, member) \for (pos = rt_list_entry((head)->next, typeof(*pos), member); \&pos->member != (head); \pos = rt_list_entry(pos->member.next, typeof(*pos), member))/*** rt_list_for_each_entry_safe - iterate over list of given type safe against removal of list entry* @pos:    the type * to use as a loop cursor.* @n:      another type * to use as temporary storage* @head:   the head for your list.* @member: the name of the list_struct within the struct.*/
#define rt_list_for_each_entry_safe(pos, n, head, member) \for (pos = rt_list_entry((head)->next, typeof(*pos), member), \n = rt_list_entry(pos->member.next, typeof(*pos), member); \&pos->member != (head); \pos = n, n = rt_list_entry(n->member.next, typeof(*n), member))/*** rt_list_first_entry - get the first element from a list* @ptr:    the list head to take the element from.* @type:   the type of the struct this is embedded in.* @member: the name of the list_struct within the struct.** Note, that list is expected to be not empty.*/
#define rt_list_first_entry(ptr, type, member) \rt_list_entry((ptr)->next, type, member)

重点函数

rt_list_init()
rt_list_insert_after()
rt_list_insert_before()
rt_list_remove()

重点函数理解

rt_list_init(rt_list_t *l)

rt_inline void rt_list_init(rt_list_t *l)
{l->next = l->prev = l;
}

初始化当前链表l,即当前链表l的pre和next都是指向自己。
在这里插入图片描述

rt_list_insert_after(rt_list_t *l, rt_list_t *n)

rt_inline void rt_list_insert_after(rt_list_t *l, rt_list_t *n)
{l->next->prev = n;n->next = l->next;l->next = n;n->prev = l;
}

将新链表n1插入到l之后
在这里插入图片描述
将新链表n2插入到l之后
在这里插入图片描述
将新链表n3插入到l之后
在这里插入图片描述

rt_list_insert_before(rt_list_t *l, rt_list_t *n)

rt_inline void rt_list_insert_before(rt_list_t *l, rt_list_t *n)
{l->prev->next = n;n->prev = l->prev;l->prev = n;n->next = l;
}

将新链表n1插入到l之前
在这里插入图片描述
将新链表n2插入到l之前
在这里插入图片描述

rt_list_remove(rt_list_t *n)

rt_inline void rt_list_remove(rt_list_t *n)
{n->next->prev = n->prev;n->prev->next = n->next;n->next = n->prev = n;
}

从已有链表中移除当前链表,如原链表
在这里插入图片描述
从此链表中移除n2,则
在这里插入图片描述

http://www.dtcms.com/wzjs/196498.html

相关文章:

  • h5网站免费建设佛山百度关键词seo外包
  • 河南网站网站制作百度网站首页网址
  • 自己做网站好做么百度关键字
  • wordpress 仿微信主题湘潭seo优化
  • linux网站建设技术指南 百度网盘网站之家查询
  • 网站建设免费的海口做网站的公司
  • 淄博网站建设优化seo腾讯域名注册官网
  • 做淘客的网站都有哪几个百度推广登录官网
  • 桂林疫情最新消息解封哈尔滨seo推广
  • 北京城乡建设和住房门户网站百度竞价推广登录入口
  • 在线网站制作平台小程序开发平台官网
  • 中山 网站制作大连百度网站排名优化
  • wordpress抓取文章插件网站优化教程
  • 宝安做网站公司网站推广费用
  • 网站怎么吸引用户游戏推广
  • oa系统网站建设方案东莞seo广告宣传
  • wordpress主题透明天津seo数据监控
  • 昆山建设网站网站优化工具
  • 日照网站建设doingseo成都网站建设技术外包
  • 海南营销网站建设网站备案查询官网
  • 在网站做专题seo项目经理
  • 个人网站logo生成南宁网站运营优化平台
  • php开发微信小程序seo网站介绍
  • 青岛做网站多少钱windows优化大师是什么
  • 什么是网络广告策划seo课程培训机构
  • 如何自己创建论坛网站网站建设哪个公司好
  • 现在网站建设的技术百度站长收录提交入口
  • 杭州建设信息网莱芜seo
  • 贵阳网站开发zu97跨境电商哪个平台比较好
  • 半岛建设公司网站什么是百度权重