Main Page | Directories | File List | File Members

ll.h

Go to the documentation of this file.
00001 /*
00002     $Id: ll.h,v 1.1 2005/05/29 08:24:04 airborne Exp $
00003 
00004     Copyright (C) 2005 Kris Verbeeck <airborne@advalvas.be>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public
00017     License along with this library; if not, write to the
00018     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00019     Boston, MA  02111-1307, USA.
00020 */
00021 
00022 #ifndef LL_H
00023 #define LL_H 1
00024 
00025 #ifdef __cplusplus
00026     extern "C" {
00027 #endif
00028 
00029 
00030 /* --- type definitions */
00031 
00032 
00036 typedef struct elem_s elem_t;
00037 
00041 typedef struct list_s list_t;
00042 
00046 typedef void elem_destroy_cb(void *data);
00047 
00048 
00049 /* --- construction / destruction */
00050 
00051 
00059 list_t *list_new(elem_destroy_cb *cb);
00060 
00068 void list_destroy(list_t *list);
00069 
00077 void list_flush(list_t *list);
00078 
00079 
00080 /* --- list elements --- */
00081 
00089 void *element_data(elem_t *elem);
00090 
00091 
00092 /* --- getters & setters --- */
00093 
00094 
00103 elem_t *list_append(list_t *list, void *data);
00104 
00111 int list_size(list_t *list);
00112 
00121 elem_t *list_get(list_t *list, int idx);
00122 
00129 elem_t *list_first(list_t *list);
00130 
00138 elem_t *list_next(list_t *list);
00139 
00140 
00141 /* --- iteration */
00142 
00143 
00144 #ifdef __cplusplus
00145     }
00146 #endif
00147 
00148 #endif /* LL_H */

Generated on Sat Jul 9 11:18:30 2005 for libcddb by  doxygen 1.3.9.1