00001 /* 00002 * list.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: list.h 29603 2005-07-31 16:10:46Z cjwatson $ 00021 */ 00022 00023 #ifndef DEBIAN_INSTALLER__LIST_H 00024 #define DEBIAN_INSTALLER__LIST_H 00025 00026 #include <debian-installer/mem_chunk.h> 00027 00028 typedef struct di_list di_list; 00029 typedef struct di_list_node di_list_node; 00030 00039 struct di_list 00040 { 00041 di_list_node *head; 00042 di_list_node *bottom; 00043 }; 00044 00048 struct di_list_node 00049 { 00050 di_list_node *next; 00051 di_list_node *prev; 00052 void *data; 00053 }; 00054 00060 di_list *di_list_alloc (void); 00061 00069 void di_list_destroy (di_list *list, di_destroy_notify destroy_func) __attribute__ ((nonnull(1))); 00070 00076 void di_list_free (di_list *list); 00077 00086 void di_list_append (di_list *list, void *data) __attribute__ ((nonnull(1))); 00087 00096 void di_list_append_chunk (di_list *list, void *data, di_mem_chunk *mem_chunk) __attribute__ ((nonnull(1,3))); 00097 00106 void di_list_prepend (di_list *list, void *data) __attribute__ ((nonnull(1))); 00107 00119 void di_list_prepend_chunk (di_list *list, void *data, di_mem_chunk *mem_chunk) __attribute__ ((nonnull(1,3))); 00120 00122 #endif