1 /*
2  * Copyright (C) 2010 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef __COM_ANDROID_NFC_LIST_H__
18 #define __COM_ANDROID_NFC_LIST_H__
19 
20 #include <pthread.h>
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 struct listNode
27 {
28    void* pData;
29    struct listNode* pNext;
30 };
31 
32 struct listHead
33 {
34     listNode* pFirst;
35     pthread_mutex_t mutex;
36 };
37 
38 bool listInit(listHead* pList);
39 bool listDestroy(listHead* pList);
40 bool listAdd(listHead* pList, void* pData);
41 bool listRemove(listHead* pList, void* pData);
42 bool listGetAndRemoveNext(listHead* pList, void** ppData);
43 void listDump(listHead* pList);
44 
45 #ifdef __cplusplus
46 }
47 #endif
48 
49 #endif /* __COM_ANDROID_NFC_LIST_H__ */
50