Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

xlist.h

00001 /*****************************************************************************
00002  * xlist.h : a simple doubly linked list in C (header file)
00003  *****************************************************************************
00004  * Copyright (C) 2003-2004 Commonwealth Scientific and Industrial Research
00005  *                         Organisation (CSIRO) Australia
00006  * Copyright (C) 2000-2004 the VideoLAN team
00007  *
00008  * $Id: xlist.h 11664 2005-07-09 06:17:09Z courmisch $
00009  *
00010  * Authors: Conrad Parker <[email protected]>
00011  *          Andre Pang <[email protected]>
00012  *
00013  * This program is free software; you can redistribute it and/or modify
00014  * it under the terms of the GNU General Public License as published by
00015  * the Free Software Foundation; either version 2 of the License, or
00016  * (at your option) any later version.
00017  *
00018  * This program is distributed in the hope that it will be useful,
00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  * GNU General Public License for more details.
00022  *
00023  * You should have received a copy of the GNU General Public License
00024  * along with this program; if not, write to the Free Software
00025  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
00026  *****************************************************************************/
00027 
00028 
00029 #ifndef __XLIST__
00030 #define __XLIST__
00031 
00035 typedef struct _XList XList;
00036 
00037 struct _XList {
00038   XList * prev;
00039   XList * next;
00040   void * data;
00041 };
00042 
00046 typedef void * (*XCloneFunc) (void * data);
00047 
00051 typedef void * (*XFreeFunc) (void * data);
00052 
00056 XList * xlist_new (void);
00057 
00063 XList * xlist_clone (XList * list);
00064 
00071 XList * xlist_clone_with (XList * list, XCloneFunc clone);
00072 
00078 XList * xlist_tail (XList * list);
00079 
00086 XList * xlist_prepend (XList * list, void * data);
00087 
00094 XList * xlist_append (XList * list, void * data);
00095 
00103 XList * xlist_add_before (XList * list, void * data, XList * node);
00104 
00112 XList * xlist_add_after (XList * list, void * data, XList * node);
00113 
00120 XList * xlist_find (XList * list, void * data);
00121 
00128 XList * xlist_remove (XList * list, XList * node);
00129 
00135 int xlist_length (XList * list);
00136 
00142 int xlist_is_empty (XList * list);
00143 
00149 int xlist_is_singleton (XList * list);
00150 
00157 XList * xlist_free_with (XList * list, XFreeFunc free_func);
00158 
00164 XList * xlist_free (XList * list);
00165 
00166 #endif /* __XLIST__ */
00167 
00168 

Generated on Tue Dec 20 10:14:28 2005 for vlc-0.8.4a by  doxygen 1.4.2