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, see <http://www.gnu.org/licenses/>. 00018 */ 00019 00020 #ifndef DEBIAN_INSTALLER__SLIST_H 00021 #define DEBIAN_INSTALLER__SLIST_H 00022 00023 #include <debian-installer/mem_chunk.h> 00024 00025 typedef struct di_slist di_slist; 00026 typedef struct di_slist_node di_slist_node; 00027 00036 struct di_slist 00037 { 00038 di_slist_node *head; 00039 di_slist_node *bottom; 00040 }; 00041 00045 struct di_slist_node 00046 { 00047 di_slist_node *next; 00048 void *data; 00049 }; 00050 00056 di_slist *di_slist_alloc (void); 00057 00065 void di_slist_destroy (di_slist *slist, di_destroy_notify destroy_func) __attribute__ ((nonnull(1))); 00066 00072 void di_slist_free (di_slist *slist); 00073 00082 void di_slist_append (di_slist *slist, void *data) __attribute__ ((nonnull(1))); 00083 00095 void di_slist_append_chunk (di_slist *slist, void *data, di_mem_chunk *mem_chunk) __attribute__ ((nonnull(1,3))); 00096 00105 void di_slist_prepend (di_slist *slist, void *data) __attribute__ ((nonnull(1))); 00106 00118 void di_slist_prepend_chunk (di_slist *slist, void *data, di_mem_chunk *mem_chunk) __attribute__ ((nonnull(1,3))); 00119 00121 #endif