XMMS2
xmms_list.h
Go to the documentation of this file.
1 /* GLIB - Library of useful routines for C programming
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19 
20 /*
21  * Modified by the GLib Team and others 1997-2000. See the AUTHORS
22  * file for a list of people on the GLib Team. See the ChangeLog
23  * files for a list of changes. These files are distributed with
24  * GLib at ftp://ftp.gtk.org/pub/gtk/.
25  */
26 
27 #ifndef __X_LIST_H__
28 #define __X_LIST_H__
29 
30 #include "xmmsclientpriv/xmmsclient_util.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 typedef struct _x_list_t x_list_t;
37 
38 struct _x_list_t
39 {
40  void * data;
43 };
44 
45 /* Doubly linked lists
46  */
47 x_list_t* x_list_alloc (void);
48 void x_list_free (x_list_t *list);
49 void x_list_free_1 (x_list_t *list);
51  void * data);
53  void * data);
55  void * data,
56  int position);
58  void * data,
59  XCompareFunc func);
61  x_list_t *sibling,
62  void * data);
64  x_list_t *list2);
66  const void * data);
68  const void * data);
70  x_list_t *llink);
72  x_list_t *link_);
76  unsigned int n);
78  unsigned int n);
80  const void * data);
82  const void * data,
83  XCompareFunc func);
84 int x_list_position (x_list_t *list,
85  x_list_t *llink);
86 int x_list_index (x_list_t *list,
87  const void * data);
90 unsigned int x_list_length (x_list_t *list);
91 void x_list_foreach (x_list_t *list,
92  XFunc func,
93  void * user_data);
94 void * x_list_nth_data (x_list_t *list,
95  unsigned int n);
96 
97 #define x_list_previous(list) ((list) ? (((x_list_t *)(list))->prev) : NULL)
98 #define x_list_next(list) ((list) ? (((x_list_t *)(list))->next) : NULL)
99 
100 #ifdef __cplusplus
101 }
102 #endif
103 
104 #endif /* __X_LIST_H__ */
105 
unsigned int x_list_length(x_list_t *list)
Definition: xlist.c:432
x_list_t * x_list_nth(x_list_t *list, unsigned int n)
Definition: xlist.c:324
x_list_t * x_list_insert_before(x_list_t *list, x_list_t *sibling, void *data)
Definition: xlist.c:138
x_list_t * x_list_insert(x_list_t *list, void *data, int position)
Definition: xlist.c:105
x_list_t * x_list_remove_all(x_list_t *list, const void *data)
Definition: xlist.c:223
x_list_t * x_list_remove(x_list_t *list, const void *data)
Definition: xlist.c:197
x_list_t * next
Definition: xmms_list.h:41
void x_list_free(x_list_t *list)
Definition: xlist.c:45
void * data
Definition: xmms_list.h:40
void x_list_foreach(x_list_t *list, XFunc func, void *user_data)
Definition: xlist.c:446
x_list_t * x_list_nth_prev(x_list_t *list, unsigned int n)
Definition: xlist.c:333
int x_list_index(x_list_t *list, const void *data)
Definition: xlist.c:394
x_list_t * x_list_find(x_list_t *list, const void *data)
Definition: xlist.c:351
int x_list_position(x_list_t *list, x_list_t *llink)
Definition: xlist.c:378
void x_list_free_1(x_list_t *list)
Definition: xlist.c:58
x_list_t * prev
Definition: xmms_list.h:42
x_list_t * x_list_remove_link(x_list_t *list, x_list_t *llink)
Definition: xlist.c:269
x_list_t * x_list_append(x_list_t *list, void *data)
Definition: xlist.c:64
x_list_t * x_list_last(x_list_t *list)
Definition: xlist.c:410
x_list_t * x_list_delete_link(x_list_t *list, x_list_t *link_)
Definition: xlist.c:275
x_list_t * x_list_first(x_list_t *list)
Definition: xlist.c:421
x_list_t * x_list_copy(x_list_t *list)
Definition: xlist.c:284
x_list_t * x_list_prepend(x_list_t *list, void *data)
Definition: xlist.c:85
x_list_t * x_list_insert_sorted(x_list_t *list, void *data, XCompareFunc func)
Definition: xlist.c:457
x_list_t * x_list_concat(x_list_t *list1, x_list_t *list2)
Definition: xlist.c:179
void * x_list_nth_data(x_list_t *list, unsigned int n)
Definition: xlist.c:342
x_list_t * x_list_reverse(x_list_t *list)
Definition: xlist.c:308
x_list_t * x_list_alloc(void)
Definition: xlist.c:35
x_list_t * x_list_find_custom(x_list_t *list, const void *data, XCompareFunc func)
Definition: xlist.c:363