libUPnP
1.6.17
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
threadutil
inc
LinkedList.h
Go to the documentation of this file.
1
/*******************************************************************************
2
*
3
* Copyright (c) 2000-2003 Intel Corporation
4
* All rights reserved.
5
*
6
* Redistribution and use in source and binary forms, with or without
7
* modification, are permitted provided that the following conditions are met:
8
*
9
* * Redistributions of source code must retain the above copyright notice,
10
* this list of conditions and the following disclaimer.
11
* * Redistributions in binary form must reproduce the above copyright notice,
12
* this list of conditions and the following disclaimer in the documentation
13
* and/or other materials provided with the distribution.
14
* * Neither name of Intel Corporation nor the names of its contributors
15
* may be used to endorse or promote products derived from this software
16
* without specific prior written permission.
17
*
18
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
22
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
26
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
*
30
******************************************************************************/
31
32
#ifndef LINKED_LIST_H
33
#define LINKED_LIST_H
34
39
#include "
FreeList.h
"
40
41
#ifdef __cplusplus
42
extern
"C"
{
43
#endif
44
45
#define EOUTOFMEM (-7 & 1<<29)
46
47
#define FREELISTSIZE 100
48
#define LIST_SUCCESS 1
49
#define LIST_FAIL 0
50
52
typedef
void (*
free_function
)(
void
*arg);
53
55
typedef
int (*
cmp_routine
)(
void
*itemA,
void
*itemB);
56
60
typedef
struct
LISTNODE
61
{
62
struct
LISTNODE
*prev;
63
struct
LISTNODE
*next;
64
void
*item;
65
}
ListNode
;
66
83
typedef
struct
LINKEDLIST
84
{
86
ListNode
head
;
88
ListNode
tail
;
90
long
size
;
92
FreeList
freeNodeList
;
94
free_function
free_func
;
96
cmp_routine
cmp_func
;
97
}
LinkedList
;
98
106
int
ListInit
(
108
LinkedList
*list,
110
cmp_routine
cmp_func,
112
free_function
free_func);
113
123
ListNode
*
ListAddHead
(
125
LinkedList
*list,
127
void
*item);
128
137
ListNode
*
ListAddTail
(
139
LinkedList
*list,
141
void
*item);
142
151
ListNode
*
ListAddAfter
(
153
LinkedList
*list,
155
void
*item,
157
ListNode
*bnode);
158
167
ListNode
*
ListAddBefore
(
169
LinkedList
*list,
171
void
*item,
173
ListNode
*anode);
174
183
void
*
ListDelNode
(
185
LinkedList
*list,
187
ListNode
*dnode,
190
int
freeItem);
191
200
int
ListDestroy
(
202
LinkedList
*list,
205
int
freeItem);
206
214
ListNode
*
ListHead
(
216
LinkedList
*list);
217
225
ListNode
*
ListTail
(
227
LinkedList
*list);
228
236
ListNode
*
ListNext
(
238
LinkedList
*list,
240
ListNode
*node);
241
249
ListNode
*
ListPrev
(
251
LinkedList
*list,
253
ListNode
*node);
254
265
ListNode
*
ListFind
(
267
LinkedList
*list,
269
ListNode
*start,
271
void
*item);
272
280
long
ListSize
(
282
LinkedList
* list);
283
284
#ifdef __cplusplus
285
}
286
#endif
287
288
#endif
/* LINKED_LIST_H */
289
Generated on Tue Mar 1 2016 23:42:35 for libUPnP by
1.8.4