libIEC61850  0.8.2
Open-source IEC 61850 MMS/GOOSE server and client library
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
linked_list.h
Go to the documentation of this file.
1 /*
2  * linked_list.h
3  *
4  * Copyright 2013 Michael Zillgith
5  *
6  * This file is part of libIEC61850.
7  *
8  * libIEC61850 is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * libIEC61850 is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with libIEC61850. If not, see <http://www.gnu.org/licenses/>.
20  *
21  * See COPYING file for the complete license text.
22  */
23 
24 #ifndef LINKED_LIST_H_
25 #define LINKED_LIST_H_
26 
27 #include "libiec61850_common_api.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
44 struct sLinkedList {
45  void* data;
46  struct sLinkedList* next;
47 };
48 
52 typedef struct sLinkedList* LinkedList;
53 
59 LinkedList
60 LinkedList_create(void);
61 
71 void
72 LinkedList_destroy(LinkedList self);
73 
74 
75 typedef void (*LinkedListValueDeleteFunction) (void*);
76 
88 void
89 LinkedList_destroyDeep(LinkedList self, LinkedListValueDeleteFunction valueDeleteFunction);
90 
99 void
100 LinkedList_destroyStatic(LinkedList self);
101 
111 void
112 LinkedList_add(LinkedList self, void* data);
113 
120 bool
121 LinkedList_remove(LinkedList self, void* data);
122 
129 LinkedList
130 LinkedList_get(LinkedList self, int index);
131 
137 LinkedList
138 LinkedList_getNext(LinkedList listElement);
139 
145 LinkedList
146 LinkedList_getLastElement(LinkedList self);
147 
153 LinkedList
154 LinkedList_insertAfter(LinkedList listElement, void* data);
155 
163 int
164 LinkedList_size(LinkedList self);
165 
166 void*
167 LinkedList_getData(LinkedList self);
168 
169 void
170 LinkedList_printStringList(LinkedList self);
171 
176 #ifdef __cplusplus
177 }
178 #endif
179 
180 #endif /* LINKED_LIST_H_ */