summaryrefslogtreecommitdiff
path: root/apps/plugins/mpegplayer/mpeg_linkedlist.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/mpegplayer/mpeg_linkedlist.h')
-rw-r--r--apps/plugins/mpegplayer/mpeg_linkedlist.h71
1 files changed, 0 insertions, 71 deletions
diff --git a/apps/plugins/mpegplayer/mpeg_linkedlist.h b/apps/plugins/mpegplayer/mpeg_linkedlist.h
deleted file mode 100644
index d4f8305d7d..0000000000
--- a/apps/plugins/mpegplayer/mpeg_linkedlist.h
+++ /dev/null
@@ -1,71 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Linked list API declarations
11 *
12 * Copyright (c) 2007 Michael Sevakis
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
18 *
19 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 * KIND, either express or implied.
21 *
22 ****************************************************************************/
23#ifndef MPEG_LINKEDLIST_H
24#define MPEG_LINKEDLIST_H
25
26struct list_item
27{
28 struct list_item *prev; /* previous item in list */
29 struct list_item *next; /* next item in list */
30};
31
32/* Utility macros to help get the actual structure pointer back */
33#define OFFSETOF(type, membername) ((off_t)&((type *)0)->membername)
34#define TYPE_FROM_MEMBER(type, memberptr, membername) \
35 ((type *)((intptr_t)(memberptr) - OFFSETOF(type, membername)))
36
37/* Initialize a master list head */
38void list_initialize(struct list_item *master_list_head);
39
40/* Are there items after the head item? */
41bool list_is_empty(struct list_item *head_item);
42
43/* Does the item belong to a list? */
44bool list_is_item_listed(struct list_item *item);
45
46/* Is the item a member in a particular list? */
47bool list_is_member(struct list_item *master_list_head,
48 struct list_item *item);
49
50/* Remove an item from a list - no head item needed */
51void list_remove_item(struct list_item *item);
52
53/* Add a list item after the base item */
54void list_add_item(struct list_item *head_item,
55 struct list_item *item);
56
57/* Clear list items after the head item */
58void list_clear_all(struct list_item *head_item);
59
60/* Enumerate all items after the head item - passing each item in turn
61 * to the callback as well as the data value. The current item may be
62 * safely removed. Items added after the current position will be enumated
63 * but not ones added before it. The callback may return false to stop
64 * the enumeration. */
65typedef bool (*list_enum_callback_t)(struct list_item *item, intptr_t data);
66
67void list_enum_items(struct list_item *head_item,
68 list_enum_callback_t callback,
69 intptr_t data);
70
71#endif /* MPEG_LINKEDLIST_H */