os/graphics/graphicscomposition/openwfcompositionengine/common/src/owflinkedlist.c
Update contrib.
1 /* Copyright (c) 2009 The Khronos Group Inc.
2 * Portions copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies)
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and/or associated documentation files (the
6 * "Materials"), to deal in the Materials without restriction, including
7 * without limitation the rights to use, copy, modify, merge, publish,
8 * distribute, sublicense, and/or sell copies of the Materials, and to
9 * permit persons to whom the Materials are furnished to do so, subject to
10 * the following conditions:
12 * The above copyright notice and this permission notice shall be included
13 * in all copies or substantial portions of the Materials.
15 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
34 #include "owfmemory.h"
35 #include "owflinkedlist.h"
42 OWF_API_CALL OWF_NODE*
43 OWF_Node_Create(OWF_POOL* pool, void* data)
47 node = (OWF_NODE*)OWF_Pool_GetObject(pool);
56 OWF_Node_Destroy(OWF_NODE* node)
58 OWF_Pool_PutObject(node);
61 OWF_API_CALL OWF_NODE*
62 OWF_List_Tail(OWF_NODE* root)
74 OWF_API_CALL OWF_NODE*
75 OWF_List_Append(OWF_NODE* root, OWF_NODE* node)
79 tail = OWF_List_Tail(root);
91 OWF_API_CALL OWF_NODE*
92 OWF_List_Insert(OWF_NODE* root, OWF_NODE* node)
103 OWF_List_InsertAfter(OWF_NODE* pred, OWF_NODE* succ)
107 succ->next = pred->next;
112 OWF_API_CALL OWF_NODE*
113 OWF_List_Contains(OWF_NODE* root, void* data)
117 if (root->data == data)
127 OWF_API_CALL OWF_NODE*
128 OWF_List_Remove(OWF_NODE* root, OWF_NODE* node)
130 OWF_NODE* iter = NULL;
139 if (iter->next == node)
141 iter->next = node->next;
156 OWF_API_CALL OWF_NODE*
157 OWF_List_Clear(OWF_NODE* root)
159 OWF_NODE* next = NULL;
163 OWF_Node_Destroy(root);