-
Notifications
You must be signed in to change notification settings - Fork 116
/
list.h
48 lines (39 loc) · 1.04 KB
/
list.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
**==============================================================================
**
** Copyright (c) Microsoft Corporation. All rights reserved. See file LICENSE
** for license information.
**
**==============================================================================
*/
#ifndef _omi_list_h
#define _omi_list_h
#include "config.h"
#include <common.h>
BEGIN_EXTERNC
/* Serves as a base type for any structure that may be placed on a list
* (provided that the first two fields are 'next' and 'prev'.
*/
typedef struct _ListElem
{
struct _ListElem* next;
struct _ListElem* prev;
}
ListElem;
/* Insert 'elem' at the front of the doubly-linked list */
void List_Prepend(
ListElem** head_,
ListElem** tail_,
ListElem* elem);
/* Insert 'elem' at the end of the doubly-linked list */
void List_Append(
ListElem** head_,
ListElem** tail_,
ListElem* elem);
/* Remove 'elem' for the doubly-linked list */
void List_Remove(
ListElem** head_,
ListElem** tail_,
ListElem* elem);
END_EXTERNC
#endif /* _omi_list_h */