gdsl
1.8
|
00001 /* 00002 * This file is part of the Generic Data Structures Library (GDSL). 00003 * Copyright (C) 1998-2015 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.h,v $ 00021 * $Revision: 1.28 $ 00022 * $Date: 2015/02/17 12:22:56 $ 00023 */ 00024 00029 #ifndef __GDSL_LIST_H_ 00030 #define __GDSL_LIST_H_ 00031 00032 00033 #include <stdio.h> 00034 00035 00036 #include "_gdsl_node.h" 00037 #include "gdsl_types.h" 00038 00039 00040 #ifdef __cplusplus 00041 extern "C" 00042 { 00043 #endif /* __cplusplus */ 00044 00045 00057 typedef _gdsl_node_t _gdsl_list_t; 00058 00059 /******************************************************************************/ 00060 /* Management functions of low-level doubly-linked lists */ 00061 /******************************************************************************/ 00062 00076 extern _gdsl_list_t 00077 _gdsl_list_alloc (const gdsl_element_t E 00078 ); 00079 00093 extern void 00094 _gdsl_list_free (_gdsl_list_t L, 00095 const gdsl_free_func_t FREE_F 00096 ); 00097 00098 /******************************************************************************/ 00099 /* Consultation functions of low-level doubly-linked lists */ 00100 /******************************************************************************/ 00101 00111 extern bool 00112 _gdsl_list_is_empty (const _gdsl_list_t L 00113 ); 00114 00122 extern ulong 00123 _gdsl_list_get_size (const _gdsl_list_t L 00124 ); 00125 00126 /******************************************************************************/ 00127 /* Modification functions of low-level doubly-linked lists */ 00128 /******************************************************************************/ 00129 00141 extern void 00142 _gdsl_list_link (_gdsl_list_t L1, 00143 _gdsl_list_t L2 00144 ); 00145 00158 extern void 00159 _gdsl_list_insert_after (_gdsl_list_t L, 00160 _gdsl_list_t PREV 00161 ); 00162 00175 extern void 00176 _gdsl_list_insert_before (_gdsl_list_t L, 00177 _gdsl_list_t SUCC 00178 ); 00179 00192 extern void 00193 _gdsl_list_remove (_gdsl_node_t NODE 00194 ); 00195 00196 /******************************************************************************/ 00197 /* Search functions of low-level doubly-linked lists */ 00198 /******************************************************************************/ 00199 00215 extern _gdsl_list_t 00216 _gdsl_list_search (_gdsl_list_t L, 00217 const gdsl_compare_func_t COMP_F, 00218 void* VALUE 00219 ); 00220 00221 /******************************************************************************/ 00222 /* Parse functions of low-level doubly-linked lists */ 00223 /******************************************************************************/ 00224 00242 extern _gdsl_list_t 00243 _gdsl_list_map_forward (const _gdsl_list_t L, 00244 const _gdsl_node_map_func_t MAP_F, 00245 void* USER_DATA 00246 ); 00247 00265 extern _gdsl_list_t 00266 _gdsl_list_map_backward (const _gdsl_list_t L, 00267 const _gdsl_node_map_func_t MAP_F, 00268 void* USER_DATA 00269 ); 00270 00271 /******************************************************************************/ 00272 /* Input/output functions of low-level doubly-linked lists */ 00273 /******************************************************************************/ 00274 00291 extern void 00292 _gdsl_list_write (const _gdsl_list_t L, 00293 const _gdsl_node_write_func_t WRITE_F, 00294 FILE* OUTPUT_FILE, 00295 void* USER_DATA 00296 ); 00297 00316 extern void 00317 _gdsl_list_write_xml (const _gdsl_list_t L, 00318 const _gdsl_node_write_func_t WRITE_F, 00319 FILE* OUTPUT_FILE, 00320 void* USER_DATA 00321 ); 00322 00340 extern void 00341 _gdsl_list_dump (const _gdsl_list_t L, 00342 const _gdsl_node_write_func_t WRITE_F, 00343 FILE* OUTPUT_FILE, 00344 void* USER_DATA 00345 ); 00346 00347 /* 00348 * @} 00349 */ 00350 00351 00352 #ifdef __cplusplus 00353 } 00354 #endif /* __cplusplus */ 00355 00356 00357 #endif /* __GDSL_LIST_H_ */ 00358 00359