libdebian-installer
list.h
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, see <http://www.gnu.org/licenses/>.
00018  */
00019 
00020 #ifndef DEBIAN_INSTALLER__LIST_H
00021 #define DEBIAN_INSTALLER__LIST_H
00022 
00023 #include <debian-installer/mem_chunk.h>
00024 
00025 typedef struct di_list di_list;
00026 typedef struct di_list_node di_list_node;
00027 
00036 struct di_list
00037 {
00038   di_list_node *head;                                   
00039   di_list_node *bottom;                                 
00040 };
00041 
00045 struct di_list_node
00046 {
00047   di_list_node *next;                                   
00048   di_list_node *prev;                                   
00049   void *data;                                           
00050 };
00051 
00057 di_list *di_list_alloc (void);
00058 
00066 void di_list_destroy (di_list *list, di_destroy_notify destroy_func) __attribute__ ((nonnull(1)));
00067 
00073 void di_list_free (di_list *list);
00074 
00083 void di_list_append (di_list *list, void *data) __attribute__ ((nonnull(1)));
00084 
00093 void di_list_append_chunk (di_list *list, void *data, di_mem_chunk *mem_chunk) __attribute__ ((nonnull(1,3)));
00094 
00103 void di_list_prepend (di_list *list, void *data) __attribute__ ((nonnull(1)));
00104 
00116 void di_list_prepend_chunk (di_list *list, void *data, di_mem_chunk *mem_chunk) __attribute__ ((nonnull(1,3)));
00117 
00119 #endif