diff options
| author | Bernard Xiong <[email protected]> | 2018-03-03 16:34:01 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2018-03-03 16:34:01 +0800 |
| commit | 8b36b57a11223812c6b6e6bcc3be75783be1635e (patch) | |
| tree | 8263c848a9bc4634b931c4603ac4976566cea7c9 /components/gui/include/rtgui/list.h | |
| parent | fa693c51fde4727513f3feb56af87dc379c796f3 (diff) | |
[UIEngine] move UI engine as a package
Diffstat (limited to 'components/gui/include/rtgui/list.h')
| -rw-r--r-- | components/gui/include/rtgui/list.h | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/components/gui/include/rtgui/list.h b/components/gui/include/rtgui/list.h deleted file mode 100644 index 6eb77ccf8b..0000000000 --- a/components/gui/include/rtgui/list.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * File : list.h - * This file is part of RT-Thread GUI Engine - * COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Change Logs: - * Date Author Notes - * 2009-10-16 Bernard first version - */ -#ifndef __RTGUI_LIST_H__ -#define __RTGUI_LIST_H__ - -#include <rtgui/rtgui.h> - -struct rtgui_list_node -{ - struct rtgui_list_node *next; -}; -typedef struct rtgui_list_node rtgui_list_t; - -rt_inline void rtgui_list_init(rtgui_list_t *l) -{ - l->next = (struct rtgui_list_node *)0; -} - -rt_inline void rtgui_list_append(rtgui_list_t *l, rtgui_list_t *n) -{ - struct rtgui_list_node *node; - - node = l; - while (node->next) node = node->next; - - /* append the node to the tail */ - node->next = n; - n->next = (struct rtgui_list_node *) 0; -} - -rt_inline void rtgui_list_insert(rtgui_list_t *l, rtgui_list_t *n) -{ - n->next = l->next; - l->next = n; -} - -rt_inline rtgui_list_t *rtgui_list_remove(rtgui_list_t *l, rtgui_list_t *n) -{ - /* remove slist head */ - struct rtgui_list_node *node = l; - while (node->next && node->next != n) node = node->next; - - /* remove node */ - if (node->next != (rtgui_list_t *)0) node->next = node->next->next; - - return l; -} - -#define rtgui_list_entry(node, type, member) \ - ((type *)((char*)(node)-(unsigned long)(&((type *)0)->member))) - -#define rtgui_list_foreach(node, list) \ - for ((node) = (list)->next; (node) != RT_NULL; (node) = (node)->next) - -#endif |
