00001 /* 00002 * slist.h 00003 * 00004 * Copyright (C) 2003 Bastian Blank <waldi@debian.org> 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program 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 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 00019 * 00020 * $Id$ 00021 */ 00022 00023 #ifndef DEBIAN_INSTALLER__SLIST_H 00024 #define DEBIAN_INSTALLER__SLIST_H 00025 00026 #include <debian-installer/mem_chunk.h> 00027 00028 typedef struct di_slist di_slist; 00029 typedef struct di_slist_node di_slist_node; 00030 00039 struct di_slist 00040 { 00041 di_slist_node *head; 00042 di_slist_node *bottom; 00043 }; 00044 00048 struct di_slist_node 00049 { 00050 di_slist_node *next; 00051 void *data; 00052 }; 00053 00059 di_slist *di_slist_alloc (void); 00060 00068 void di_slist_destroy (di_slist *slist, di_destroy_notify destroy_func) __attribute__ ((nonnull(1))); 00069 00075 void di_slist_free (di_slist *slist); 00076 00085 void di_slist_append (di_slist *slist, void *data) __attribute__ ((nonnull(1))); 00086 00098 void di_slist_append_chunk (di_slist *slist, void *data, di_mem_chunk *mem_chunk) __attribute__ ((nonnull(1,3))); 00099 00108 void di_slist_prepend (di_slist *slist, void *data) __attribute__ ((nonnull(1))); 00109 00121 void di_slist_prepend_chunk (di_slist *slist, void *data, di_mem_chunk *mem_chunk) __attribute__ ((nonnull(1,3))); 00122 00124 #endif