1 mike 1.1 /*
2 **==============================================================================
3 **
4 ** Open Management Infrastructure (OMI)
5 **
6 ** Copyright (c) Microsoft Corporation
7 **
8 ** Licensed under the Apache License, Version 2.0 (the "License"); you may not
9 ** use this file except in compliance with the License. You may obtain a copy
10 ** of the License at
11 **
12 ** http://www.apache.org/licenses/LICENSE-2.0
13 **
14 ** THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 ** KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
16 ** WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
17 ** MERCHANTABLITY OR NON-INFRINGEMENT.
18 **
19 ** See the Apache 2 License for the specific language governing permissions
20 ** and limitations under the License.
21 **
22 mike 1.1 **==============================================================================
23 */
24
25 #ifndef _omi_list_h
26 #define _omi_list_h
27
28 #include "config.h"
29 #include <common.h>
30
31 BEGIN_EXTERNC
32
33 /* Serves as a base type for any structure that may be placed on a list
34 * (provided that the first two fields are 'next' and 'prev'.
35 */
36 typedef struct _ListElem
37 {
38 struct _ListElem* next;
39 struct _ListElem* prev;
40 }
41 ListElem;
42
43 mike 1.1 /* Insert 'elem' at the front of the doubly-linked list */
44 void List_Prepend(
45 ListElem** head_,
46 ListElem** tail_,
47 ListElem* elem);
48
49 /* Insert 'elem' at the end of the doubly-linked list */
50 void List_Append(
51 ListElem** head_,
52 ListElem** tail_,
53 ListElem* elem);
54
55 /* Remove 'elem' for the doubly-linked list */
56 void List_Remove(
57 ListElem** head_,
58 ListElem** tail_,
59 ListElem* elem);
60
61 END_EXTERNC
62
63 #endif /* _omi_list_h */
|