kservice.h.svn-base

来自「RT-Thread是发展中的下一代微内核嵌入式实时操作系统」· SVN-BASE 代码 · 共 95 行

SVN-BASE
95
字号
#ifndef __RT_SERVICE_H__#define __RT_SERVICE_H__#include <rtthread.h>#ifdef __cplusplusextern "C" {#endif/** * rt_list_init - initialize a list * * @l: list to be initialized */rt_inline void rt_list_init(rt_list_t *l){	l->next = l->prev = l;}/** * rt_list_insert_after - insert a node after a list * * @n: new node to be inserted * @l: list to insert it */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;}/** * rt_list_insert_before - insert a node before a list  * * @n: new node to be inserted * @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;}/** * rt_list_remove - remove node from list. * @l: 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 = 0;	n->prev = 0;}/** * rt_list_isempty - tests whether a list is empty * @l: the list to test. */rt_inline int rt_list_isempty(const rt_list_t *l){	return l->next == l;}/** * rt_list_entry - get the struct for this entry * @node: the entry point * @type: the type of structure * @member: the name of list in structure */#define rt_list_entry(node, type, member) \    ((type *)((char *)(node) - (unsigned long)(&((type *)0)->member)))/* * memory & string copy & move */void*     rt_memset(void *src, int c, rt_uint16 n);void*     rt_memcpy(void *dest, const void *src, rt_uint16 n);rt_uint16 rt_strncmp(const char * cs, const char * ct, rt_uint16 count);rt_uint16 rt_strlen (const char *src);#ifdef __cplusplus}#endif#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?