graphicscomposition/openwfcompositionengine/common/src/owflinkedlist.c
branchRCL_3
changeset 164 25ffed67c7ef
parent 163 bbf46f59e123
equal deleted inserted replaced
163:bbf46f59e123 164:25ffed67c7ef
     1 /* Copyright (c) 2009 The Khronos Group Inc.
     1 /* Copyright (c) 2009 The Khronos Group Inc.
     2  * Portions copyright (c) 2009-2010  Nokia Corporation and/or its subsidiary(-ies)
       
     3  *
     2  *
     4  * Permission is hereby granted, free of charge, to any person obtaining a
     3  * Permission is hereby granted, free of charge, to any person obtaining a
     5  * copy of this software and/or associated documentation files (the
     4  * copy of this software and/or associated documentation files (the
     6  * "Materials"), to deal in the Materials without restriction, including
     5  * "Materials"), to deal in the Materials without restriction, including
     7  * without limitation the rights to use, copy, modify, merge, publish,
     6  * without limitation the rights to use, copy, modify, merge, publish,
   164         root = next;
   163         root = next;
   165     }
   164     }
   166     return root;
   165     return root;
   167 }
   166 }
   168 
   167 
       
   168 OWF_API_CALL void
       
   169 OWF_List_ForEach(OWF_NODE* root, NODEITERFUNC func, void* data)
       
   170 {
       
   171     while (root) {
       
   172         if (!func(root->data, data)) {
       
   173             return;
       
   174         }
       
   175         root = root->next;
       
   176     }
       
   177 }
       
   178 
       
   179 OWF_API_CALL OWF_NODE*
       
   180 OWF_List_Find(OWF_NODE* root, NODECMPFUNC func, void* data)
       
   181 {
       
   182     while (root) {
       
   183         if (func(root->data, data)) {
       
   184             break;
       
   185         }
       
   186         root = root->next;
       
   187     }
       
   188     return root;
       
   189 }
       
   190 
       
   191 
   169 #ifdef __cplusplus
   192 #ifdef __cplusplus
   170 }
   193 }
   171 #endif
   194 #endif