gdsl
1.6
|
00001 /* 00002 * This file is part of the Generic Data Structures Library (GDSL). 00003 * Copyright (C) 1998-2006 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__node_8h_source.html,v $ 00021 * $Revision: 1.2 $ 00022 * $Date: 2012/08/21 14:01:03 $ 00023 */ 00024 00025 00026 #ifndef __GDSL_NODE_H_ 00027 #define __GDSL_NODE_H_ 00028 00029 00030 #include <stdio.h> 00031 00032 00033 #include "gdsl_types.h" 00034 00035 00036 #ifdef __cplusplus 00037 extern "C" 00038 { 00039 #endif /* __cplusplus */ 00040 00041 00053 typedef struct _gdsl_node* _gdsl_node_t; 00054 00062 typedef int (* _gdsl_node_map_func_t) (const _gdsl_node_t NODE, 00063 void* USER_DATA 00064 ); 00065 00072 typedef void (* _gdsl_node_write_func_t) (const _gdsl_node_t NODE, 00073 FILE* OUTPUT_FILE, 00074 void* USER_DATA 00075 ); 00076 00077 /******************************************************************************/ 00078 /* Management functions of low-level doubly linked nodes */ 00079 /******************************************************************************/ 00080 00092 extern _gdsl_node_t 00093 _gdsl_node_alloc (void); 00094 00105 extern gdsl_element_t 00106 _gdsl_node_free (_gdsl_node_t NODE 00107 ); 00108 00109 /******************************************************************************/ 00110 /* Consultation functions of low-level doubly linked nodes */ 00111 /******************************************************************************/ 00112 00124 extern _gdsl_node_t 00125 _gdsl_node_get_succ (const _gdsl_node_t NODE 00126 ); 00127 00139 extern _gdsl_node_t 00140 _gdsl_node_get_pred (const _gdsl_node_t NODE 00141 ); 00142 00152 extern gdsl_element_t 00153 _gdsl_node_get_content (const _gdsl_node_t NODE 00154 ); 00155 00156 /******************************************************************************/ 00157 /* Modification functions of low-level doubly linked nodes */ 00158 /******************************************************************************/ 00159 00171 extern void 00172 _gdsl_node_set_succ (_gdsl_node_t NODE, 00173 const _gdsl_node_t SUCC 00174 ); 00175 00187 extern void 00188 _gdsl_node_set_pred (_gdsl_node_t NODE, 00189 const _gdsl_node_t PRED 00190 ); 00191 00203 extern void 00204 _gdsl_node_set_content (_gdsl_node_t NODE, 00205 const gdsl_element_t CONTENT 00206 ); 00207 00220 extern void 00221 _gdsl_node_link (_gdsl_node_t NODE1, 00222 _gdsl_node_t NODE2 00223 ); 00224 00237 extern void 00238 _gdsl_node_unlink (_gdsl_node_t NODE1, 00239 _gdsl_node_t NODE2 00240 ); 00241 00242 /******************************************************************************/ 00243 /* Input/output functions of low-level doubly linked nodes */ 00244 /******************************************************************************/ 00245 00261 extern void 00262 _gdsl_node_write (const _gdsl_node_t NODE, 00263 const _gdsl_node_write_func_t WRITE_F, 00264 FILE* OUTPUT_FILE, 00265 void* USER_DATA 00266 ); 00267 00284 extern void 00285 _gdsl_node_write_xml (const _gdsl_node_t NODE, 00286 const _gdsl_node_write_func_t WRITE_F, 00287 FILE* OUTPUT_FILE, 00288 void* USER_DATA 00289 ); 00290 00307 extern void 00308 _gdsl_node_dump (const _gdsl_node_t NODE, 00309 const _gdsl_node_write_func_t WRITE_F, 00310 FILE* OUTPUT_FILE, 00311 void* USER_DATA 00312 ); 00313 00314 00315 /* 00316 * @} 00317 */ 00318 00319 00320 #ifdef __cplusplus 00321 } 00322 #endif /* __cplusplus */ 00323 00324 00325 #endif /* __GDSL_NODE_H_ */ 00326 00327