Main Page | Modules | File List | Globals

_gdsl_list.h

Go to the documentation of this file.
00001 /*
00002  * This file is part of the Generic Data Structures Library (GDSL).
00003  * Copyright (C) 1998-2004 Nicolas Darnis <ndarnis@free.fr>.
00004  *
00005  * The GDSL library is free software; you can redistribute it and/or 
00006  * modify it under the terms of the GNU General Public License as 
00007  * published by the Free Software Foundation; either version 2 of
00008  * the License, or (at your option) any later version.
00009  *
00010  * The GDSL library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with the GDSL library; see the file COPYING.
00017  * If not, write to the Free Software Foundation, Inc., 
00018  * 59 Temple Place, Suite 330, Boston, MA  02111-1307, USA.
00019  *
00020  * $RCSfile: __gdsl__list_8h-source.html,v $
00021  * $Revision: 1.4 $
00022  * $Date: 2004/10/03 14:35:37 $
00023  */
00024 
00025 #ifndef __GDSL_LIST_H_
00026 #define __GDSL_LIST_H_
00027 
00028 
00029 #include <stdio.h>
00030 
00031 
00032 #include "_gdsl_node.h"
00033 #include "gdsl_types.h"
00034 
00035 
00036 #ifdef __cplusplus
00037 extern "C" 
00038 {
00039 #endif /* __cplusplus */
00040 
00041 
00053 typedef _gdsl_node_t _gdsl_list_t;
00054 
00061 typedef int (* _gdsl_list_map_func_t) (_gdsl_node_t NODE,
00062                        void* USER_DATA
00063                        );
00064 
00065 /******************************************************************************/
00066 /* Management functions of low-level doubly-linked lists                      */
00067 /******************************************************************************/
00068 
00082 extern _gdsl_list_t
00083 _gdsl_list_alloc (const gdsl_element_t E
00084           );
00085 
00099 extern void 
00100 _gdsl_list_free (_gdsl_list_t L,
00101          const gdsl_free_func_t FREE_F
00102          );
00103 
00104 /******************************************************************************/
00105 /* Consultation functions of low-level doubly-linked lists                    */
00106 /******************************************************************************/
00107 
00117 extern bool
00118 _gdsl_list_is_empty (const _gdsl_list_t L
00119              );
00120 
00128 extern ulong
00129 _gdsl_list_get_size (const _gdsl_list_t L
00130              );
00131 
00132 /******************************************************************************/
00133 /* Modification functions of low-level doubly-linked lists                    */
00134 /******************************************************************************/
00135 
00147 extern void
00148 _gdsl_list_link (_gdsl_list_t L1,
00149          _gdsl_list_t L2
00150          );
00151 
00164 extern void 
00165 _gdsl_list_insert_after (_gdsl_list_t L,
00166              _gdsl_list_t PREV
00167              );
00168 
00181 extern void
00182 _gdsl_list_insert_before (_gdsl_list_t L,
00183               _gdsl_list_t SUCC
00184               );
00185 
00198 extern void
00199 _gdsl_list_remove (_gdsl_node_t NODE
00200            );
00201 
00202 /******************************************************************************/
00203 /* Search functions of low-level doubly-linked lists                          */
00204 /******************************************************************************/
00205 
00221 extern _gdsl_list_t
00222 _gdsl_list_search (_gdsl_list_t L,
00223            const gdsl_compare_func_t COMP_F,
00224            void* VALUE
00225            );
00226 
00227 /******************************************************************************/
00228 /* Parse functions of low-level doubly-linked lists                           */
00229 /******************************************************************************/
00230 
00248 extern _gdsl_list_t
00249 _gdsl_list_map_forward (const _gdsl_list_t L,
00250             const _gdsl_list_map_func_t MAP_F,
00251             void* USER_DATA
00252             );
00253         
00271 extern _gdsl_list_t
00272 _gdsl_list_map_backward (const _gdsl_list_t L,
00273              const _gdsl_list_map_func_t MAP_F,
00274              void* USER_DATA
00275              );
00276 
00277 /******************************************************************************/
00278 /* Input/output functions of low-level doubly-linked lists                    */
00279 /******************************************************************************/
00280 
00297 extern void
00298 _gdsl_list_write (const _gdsl_list_t L,
00299           const gdsl_write_func_t WRITE_F,
00300           FILE* OUTPUT_FILE,
00301           void* USER_DATA
00302           );
00303 
00323 extern void
00324 _gdsl_list_write_xml (const _gdsl_list_t L,
00325               const gdsl_write_func_t WRITE_F,
00326               FILE* OUTPUT_FILE,
00327               void* USER_DATA
00328               );
00329              
00347 extern void
00348 _gdsl_list_dump (const _gdsl_list_t L,
00349          const gdsl_write_func_t WRITE_F,
00350          FILE* OUTPUT_FILE,
00351          void* USER_DATA
00352          );
00353 
00354 /*
00355  * @}
00356  */
00357 
00358 
00359 #ifdef __cplusplus
00360 }
00361 #endif /* __cplusplus */
00362 
00363 
00364 #endif /* __GDSL_LIST_H_ */
00365 

Generated on Sun Oct 3 16:15:50 2004 for GDSL by doxygen 1.3.5